Changes in citrus volatile organic compounds (VOCs) induced by Bactrocera dorsalis (Hendel) infestation can serve as characteristic identifiers for non-destructive detection of infested citrus. This study proposed an innovative method combining colorimetric sensor array (CSA) technology with machine learning algorithms for the discrimination of B. dorsalis infestation in citrus. Gas chromatography-mass spectrometry (GC-MS) analysis identified key VOCs, including d-limonene, linalool, and decanal, as infestation markers. Subsequently, various porphyrin and metalloporphyrin dyes exhibiting sensitivity to these VOCs were selected to construct the CSA. To enhance detection accuracy, a hybrid feature selection method integrating ReliefF and Particle Swarm Optimization (PSO) was implemented. Subsequently, the optimized features subsets were utilized to develop classification models. Specifically, a binary classification model employing the K Nearest Neighbor (KNN) algorithm achieved a high accuracy of 93.89 % in distinguishing between healthy and infected citrus. Furthermore, a multi-class classification model using KNN was developed to differentiate among invasive, incubation, and infestation stages, attaining a remarkable accuracy of 97.78 %. This approach presents a promising solution for early detection of B. dorsalis infestation in citrus.