Work with decision trees

I know tl; dr;

I will try to explain my problem without bothering you with the subtlety of shitty code. I am working on a school assignment. We have smurfs photos and we need to find them with a background analysis background. I have a decision tree in java that contains all the data (HSV histograms) 1 one single node. Then it tries to find the best attribute (from the histogram data) to split the tree. It then splits and creates a left and right subtree with data split into both node-trees. All data is still stored in the main tree to be able to calculate the gini index.

So, after 26 minutes of smurfs analysis, my computer has a giant tree with a breakdown and other data. Now my question is: can someone give me a global idea on how to analyze a new picture and determine which pixels can be โ€œsmurf pixelsโ€. I know that I need to create a new array of data points with the HSV histograms of the new smurf, and then I need to use the generated tree to determine which pixels belong to smurf.

Can someone give me a pointer on how to do this?

Additional Information.
Each decision tree object has a Split object that has the best attribute for splitting, a value for splitting, and a gini index.

If I need to provide additional information that I would like to hear.

+8
image-processing machine-learning classification image-recognition decision-tree
source share
1 answer

OK Basically, in a non-optimized pseudo-code: for marking pixels in a new image:

For each pixel of a new image:

  • Calculate HSV pixel functions
  • Recursively starting at the root of the tree:
  • Is this a sheet? if so, give the pixel the dominant label node.
  • Otherwise, check the criterion for splitting into pixel functions and, accordingly, go to the right or left child

I hope this makes sense in your context.

+2
source share

All Articles