Early detection of allergies in the oral cavity remains challenging due to the subjective nature of visual assessment and limited access to diagnostic facilities. This study proposes a novel approach using the Random Forest algorithm to classify the severity of allergic symptoms based on gum color analysis from digital images. A total of 2,742 gum images were clinically categorized using the Modified Gingival Index (MGI) into mild, moderate, and severe conditions. Preprocessing included conversion to HSV color space and adaptive segmentation using red thresholds on the hue channel (0–10 and 160–180), saturation > 50, and value > 40. Statistical features, including mean, standard deviation, skewness, kurtosis, and entropy, were extracted and normalized using Z-Score. Six parameter combinations were tested with an 80:20 train-test split. The optimal configuration with n_estimators=80, max_depth=9, and min_samples_leaf=2 achieved an accuracy of 95.81%. The highest performance was achieved in the mild class with precision and recall of 98.91%, and stable results in the moderate (93.80%) and severe (94.74%) classes, with only a 0.94% difference. Cross-validation evaluation demonstrated excellent model stability, with an average accuracy of 95.30% and a standard deviation of 0.67%, indicating consistent performance across data subsets. Feature importance analysis showed the dominance of the hue and saturation channels, particularly kurtosis and mean saturation. This study demonstrates that a Random Forest-based allergy detection system using gum color is highly accurate and effective as a non-invasive screening tool in dental and oral health, especially in resource-limited settings, with the potential to improve early screening access in primary healthcare facilities.
Copyrights © 2025