Research Article

Content-Based Image Retrieval Using Colour, Gray, Advanced Texture, Shape Features, and Random Forest Classifier with Optimized Particle Swarm Optimization

Algorithm 2

Random forest training and classification for image database.
INPUT: number of classes of images with labels and number of extracted features
OUTPUT: Optimized images with extracted features
Step 1: Set = Number of classes, = Number of features
Step 2: Let: determines the number of features at a node of decision tree, ()
Step 3: For each decision tree do
Step 4: Select randomly: a subset (with replacement) of training data that represents the
    classes and uses the rest of data to measure the error of the tree
Step 5: For each node of this tree do
Step 6: Select randomly: features to determine the decision at this node and calculate
   the best split accordingly.
Step 7: end for
Step 8: end for