A Machine Vision-Based Intelligent Identification System for Quality Grading of Saw-Ginned Cotton
Quality inspection of imported saw-ginned cotton mainly involves the determination of color grade and impurity grade. Traditional manual grading and High Volume Instrument (HVI) testing are limited by subjectivity, insufficient accuracy, single-indicator measurement, and long inspection cycles. To address these limitations, this study developed a machine vision-based intelligent identification system for saw-ginned cotton quality grading. The system integrates a portable image acquisition box, a cloud-based intelligent recognition service, and a HarmonyOS-based mobile application. A total of 6363 saw-ginned cotton images were collected using the self-developed image acquisition device for model training and testing. Based on U-Net background segmentation, a dual-branch parallel recognition framework was established for cotton color grading and impurity grading. The CA-ResNet50 model, integrating ResNet50, the Efficient Channel Attention (ECA) mechanism, and the AdamW optimization strategy, was constructed for cotton color grade recognition. The AD-UNet model, incorporating Atrous Spatial Pyramid Pooling (ASPP)-based multi-scale contextual modeling and the DySample adaptive upsampling mechanism, was developed for impurity segmentation. In addition, the HarmonyOS-based mobile application supports information query, image acquisition, intelligent recognition, and data traceability. Experimental results showed that the CA-ResNet50 color grading model achieved an F1-Score of 94.8%. Based on the AD-UNet impurity segmentation results and the calculated impurity area ratio, the accuracy of impurity grade determination reached 97.3%. The average cloud-based inference time for a single image was approximately 0.8 s, and the complete workflow, including sample flattening, image acquisition, and recognition, required approximately 10 min. The proposed system improves the accuracy, efficiency, objectivity, and traceability of saw-ginned cotton quality identification, providing technical support for rapid inspection and quality supervision of imported cotton.