| In order to evaluate the quality of tobacco leaves produced and the detection accuracy of sorting personnel,this paper creatively proposes a purity index for tobacco leaf sorting quality,and combines clustering and deep learning methods to build a feature clustering model based on deep neural networks to address the problem of declining accuracy of tobacco leaf classification caused by the impact of environment and personal status during the tobacco leaf sorting process,Through the overall system design of software and hardware for the tobacco leaf sorting pipeline,real-time calculation of the sorting purity index of the input tobacco leaf image data is realized,thereby solving the problems existing in the above tobacco leaf sorting process.The main research contents are as follows:(1)Based on the actual tobacco leaf sorting process,a standardized tobacco leaf image acquisition system was designed and built,using hardware devices such as conveyor belts to simulate the actual production environment.In order to minimize the interference of the external environment on tobacco leaf image acquisition,hardware devices such as industrial cameras,light strips,and dark boxes were used to deploy the experimental environment,Reduce the impact of the surrounding environment on the image quality of tobacco leaves through industrial camera configuration interface programming and other methods.(2)The tobacco leaf image is collected in a standard laboratory environment,and the tobacco leaf image data is pre-processed.The background removal algorithm is used to remove the background of tobacco leaf images to reduce the impact of image background on image recognition results.At the same time,further analysis and optimization of the algorithm improves its background removal accuracy.(3)A deep clustering feature extraction backbone network combining dense connected convolutional neural network and mixed attention mechanism is proposed.This model improves the residual attention network,and uses dense connected convolutional modules to replace the main branch residual modules in the original network attention module and multiple residual modules in the network output stage,It enhances the learning performance of branch features and reduces the number of parameters to alleviate the problem of gradient disappearance;At the same time,two attention mechanism modules in the Reactive Attention Network are used,and spatial attention mechanisms(SAM)are added in front of the two attention mechanism modules to extract information from the tobacco leaf feature map with weight in space and channel dimensions,so as to obtain more comprehensive feature information.The network not only reduces the network depth,but also improves the speed and recognition accuracy.(4)By comparing various clustering algorithm ideas,a distance clustering algorithm based on actual tasks is proposed.On the basis of extracting image feature vectors from the feature extraction backbone network,a clustering algorithm is used to calculate the distance of the feature vectors,find the image data clustering center,define the image clustering center for clustering,calculate the loss based on the clustering distribution and the actual data distribution,and guide the convergence of the neural network.In the downstream task,the clustering center is calculated using the feature vectors predicted by deep clustering,and the purity index of the tobacco leaf is calculated.Experiments have shown that the depth clustering algorithm in this paper has higher accuracy and better unsupervised characteristics in multi object tobacco leaf images compared to classification networks.The tobacco leaf image purity detection system designed by the above methods in this paper can effectively identify differences in the quality of tobacco leaf sorting in the actual production process,demonstrating the stability,effectiveness,and practicality of the tobacco leaf image purity detection system. |