Abstract:The level of mechanized harvesting of wheat in China has reached over 97%, and the impurity rate is one of the important indicators of mechanized wheat harvesting. In order to realize the online detection of the impurity rate in the wheat mechanized harvesting process, an online detection method of the wheat machine harvesting impurity rate was proposed based on the improved U-Net model combined with attention. Based on the wheat sample images collected by machine, the Labelme was used to manually label the images, and the images were enhanced by random rotation, scaling, shearing, and horizontal mirroring to construct a basic image dataset; an improved U-Net model combined with attention was designed. The model was classified and identified, and the offline training of the model was implemented under the torch 1.2.0 deep learning framework; the optimal offline model was transplanted to the Nvidia jetson tx2 development kit, and a quantification model of impurity rate was designed based on image information, so as to realize wheat on-line detection of impurity content in mechanized harvesting. The experimental results showed that the comprehensive evaluation index F1 of the improved U-Net model combined with attention was 76.64% and 85.70%, respectively, which were 10.33 percentage points and 2.86 percentage points higher than that of the standard U-Net, and 10.22 percentage points and 11.62 percentage points higher than that of DeepLabV3, which was 18.40 percentage points and 14.67 percentage points higher than that of PSPNet. Quantitative analysis of the detection results of impurity rate showed that in the bench test and field test, the average online detection of impurity rate of the device was 1.69% and 1.48%, respectively, which was higher than the manual detection by 0.26 percentage points and 0.13 percentage points. Qualitative analysis of the test results of impurity rate showed that whether it was a bench test or a field test, the test results of the device and the labor were all less than 2%. It was judged that the operation performance of the combine harvester during the test process met the national standards, and the test results were consistent. Therefore, the online detection method of wheat impurity rate proposed can provide technical support for the online quality control of wheat combined harvesting operations.