# Help: Random Forest optimization (image classification)

I'm having trouble classifying images using a random forest.

The images all have a very similar scale, but they may be rotated arbitrarily around a fixed point in the image.

The core problem is that the images of the test set vary somewhat from the training images. But in this case, it is crucial to train based on the given training set and to test it on the given test set(!).

It's thus easily concluded that, I "simply" need a very robust random forest.

The classes are:

• class 0: images that show an certain plane part (the inside of the engine)
• class 1: images that don't show that part

My learners (node functions) are simple intensity comparisons, that check if a pixel value is lower than another pixel value in the same image:

• I(u1,v1) < I(u2,v2) -> true/false

My current configuration is:

• supervised learning, all class lables available
• number of positive samples: 100 000
• number of negative samples: 100 000
• image size: 160x120
• tree depth = 6
• number of trees: 400

Do you have any suggestions for me?

• Perhaps try a covnet instead of a random forest: github.com/fchollet/keras/blob/master/examples/cifar10_cnn.py – Zach Jan 12 '16 at 15:27
• Since the RF is working good but not good enough, I think some tuning should do it. If possible I'd prefer not switching the classifier! – S.H Jan 12 '16 at 15:35
• Try more trees (e.g. 4,000), deeper tress, and tuning the mtry parameter (or number of variables considered per split). Test all these parameters out of sample. – Zach Jan 12 '16 at 15:36
• What means "Test all these parameters out of sample"? – S.H Jan 12 '16 at 15:45
• @also try different numbers of candidate features at each split. – Zach Jan 13 '16 at 16:25