I guess I have multiple remarks that can basically lead to errors in training:
- Use only natural occuring training images. Using the utility to apply translations, rotations, ... screws up the performance of your classifier model. So if you have 40 positives, stick to those 40 positives, don't make 2000 of them.
- You are making a model of 24x24 pixels while a banana has more a ratio of 24/48 pixels or so, just like a car.
- I have completely no idea why you are merging your negatives into the vector. Looking at the official tutorial, there isn't a single merge operation around there...
- Your number of positives is way larger than number of negatives... This is weird, since an object will never have as much variations as the possible backgrounds in most cases. It should be like 40 pos and 1000 neg.
- Your two cascade trainings contain different parameters. One goes to HAAR wavelets, other one to LBP. Please select one and stick to it.
- As your training is running out of memory, what is your system configuration? You are now using more than 2GB of RAM, which is a lot if you have only 3GB available for example. Please close down any unnecessary applications