基于随机森林外观特征筛选的大米品种识别研究
Rice Grain Variety Identification Using Random Forest-Based Selection of Appearance Features
摘要: 为筛选具有明确外观含义的大米品种识别指标,本文基于公开大米数据集开展随机森林特征筛选与分类对比研究。采用85%/15%的分层随机划分构建训练集与测试集,并在训练集内进行5折交叉验证。根据随机森林特征重要性构建不同规模的原始特征子集,比较径向基函数核支持向量机、随机森林和多层感知机等的分类表现,并与主成分分析降维方案、ANOVA F检验和L1正则化逻辑回归筛选方案进行对比。结果表明,随机森林筛选的13个原始特征包含5个形态特征、2个形状特征和6个颜色特征,结合多层感知机时,测试集宏平均F1为0.9981,接近全特征多层感知机的0.9986,输入特征数量减少87.7%。以逻辑回归开展的特征组对比显示,颜色特征组在三类单独特征组中表现最好,全部特征联合输入的分类性能最高。11项候选特征在5个训练折中均进入Top-13,表现出较高的跨折选择一致性。研究表明,随机森林筛选能够减少输入变量并保持较高分类性能,同时保留原始外观指标的名称和含义。
Abstract: To identify rice-variety indicators with clear appearance interpretations, this study conducted random-forest (RF)-based feature selection and comparative classification analysis using a publicly available rice dataset. An 85%/15% stratified random split was used to construct the training and test sets, and five-fold cross-validation was performed within the training set. Based on RF feature importance, subsets of original features with different sizes were constructed, and the classification performance of a support vector machine with a radial basis function kernel (RBF-SVM), RF, and a multilayer perceptron (MLP) was compared. The RF-based feature selection approach was also compared with dimensionality reduction using principal component analysis (PCA) and feature selection using the ANOVA F-test and L1-regularized logistic regression. The results showed that the 13 original features selected by RF comprised five morphological features, two shape features, and six color features. When combined with MLP, this RF-selected subset achieved a test-set macro-averaged F1 score of 0.9981, close to 0.9986 obtained by the full-feature MLP, while reducing the number of input features by 87.7%. Logistic-regression comparisons among feature groups showed that the color feature group performed best among the three individual groups, whereas combining all feature groups yielded the highest classification performance. Eleven candidate features were selected in the Top-13 subset in all five training folds, indicating high selection consistency across folds. These results demonstrate that RF-based feature selection can reduce the number of input variables while maintaining high classification performance and preserving the names and meanings of the original appearance indicators.
文章引用:郑馨怡, 张莎莎. 基于随机森林外观特征筛选的大米品种识别研究[J]. 计算机科学与应用, 2026, 16(11): 50-59. https://doi.org/10.12677/csa.2026.1611325

参考文献

[1] Aznan, A., Gonzalez Viejo, C., Pang, A. and Fuentes, S. (2021) Computer Vision and Machine Learning Analysis of Commercial Rice Grains: A Potential Digital Approach for Consumer Perception Studies. Sensors, 21, Article 6354.
https://doi.org/10.3390/s21196354
[2] Koklu, M., Cinar, I. and Taspinar, Y.S. (2021) Classification of Rice Varieties with Deep Learning Methods. Computers and Electronics in Agriculture, 187, Article ID: 106285.
https://doi.org/10.1016/j.compag.2021.106285
[3] Cinar, I. and Koklu, M. (2021) Determination of Effective and Specific Physical Features of Rice Varieties by Computer Vision in Exterior Quality Inspection. Selcuk Journal of Agricultural and Food Sciences, 35, 229-243.
https://doi.org/10.15316/sjafs.2021.252
[4] Çinar, İ. and Koklu, M. (2021) Identification of Rice Varieties Using Machine Learning Algorithms. Tarım Bilimleri Dergisi, 28, 307-325.
https://doi.org/10.15832/ankutbd.862482
[5] Coronel-Reyes, J., Haro-Sarango, A., Delgado-Vera, C. and Triviño-Sánchez, J. (2026) Comparative Evaluation of Machine Learning Algorithms for the Identification and Morphological Classification of Rice Grains. AgriEngineering, 8, Article 100.
https://doi.org/10.3390/agriengineering8030100
[6] Li, X., Wang, Y., Monday, H.N. and Nneji, G.U. (2025) A Novel Residual Learning of Multi-Scale Feature Extraction Model for the Classification of Rice Grain Varieties. Computers and Electronics in Agriculture, 237, Article ID: 110491.
https://doi.org/10.1016/j.compag.2025.110491
[7] Islam, M.M., Himel, G.M.S., Moazzam, M.G. and Uddin, M.S. (2025) Artificial Intelligence-Based Rice Variety Classification: A State-of-the-Art Review and Future Directions. Smart Agricultural Technology, 10, Article ID: 100788.
https://doi.org/10.1016/j.atech.2025.100788
[8] Sonnadara, D., Khuat, T.T., Musial-Gabrys, K. and Gabrys, B. (2026) Interpretable Automated Feature Engineering: A Comprehensive Review with a Focus on Dynamic and Stationary Environments. Artificial Intelligence Review, 59, Article No. 165.
https://doi.org/10.1007/s10462-026-11573-y
[9] Naik, N.K., Subbarao, M.V., Sethy, P.K., Behera, S.K. and Panigrahi, G.R. (2024) Machine Learning with Analysis-of-Variance-Based Method for Identifying Rice Varieties. Journal of Agriculture and Food Research, 18, Article ID: 101397.
https://doi.org/10.1016/j.jafr.2024.101397
[10] Phan, T. and Nguyen, L.H.B. (2025) Enhancing Rice Seed Purity Recognition Accuracy Based on Optimal Feature Selection. Ecological Informatics, 86, Article ID: 103044.
https://doi.org/10.1016/j.ecoinf.2025.103044
[11] Bhuiyan, A.H., Tinny, T.K. and Uddin, M.F. (2026) Assessing the Effectiveness of Feature Selection Methods in Machine Learning Using Statistical Metrics. Egyptian Informatics Journal, 34, Article ID: 100949.
https://doi.org/10.1016/j.eij.2026.100949
[12] Elmakias, I., Kolsky, D. and Vilenchik, D. (2026) Feature Stability as a Trust Layer for Feature Selection: Resampling-Based Recurrence Profiles beyond Predictive Performance. Mathematics, 14, Article 2372.
https://doi.org/10.3390/math14132372
[13] Breiman, L. (2001) Random Forests. Machine Learning, 45, 5-32.
https://doi.org/10.1023/a:1010933404324