Abstract:
Abstract: Accurate and rapid acquisition of crop and weed category information has been one of the most important steps for automatic weeding operations. In this research, a weed recognition model was proposed using improved DenseNet, particularly for the efficient and accurate identification of weeds in crop fields under complex environments. Firstly, data augmentation was utilized to expand the number of images for the collected crop and weed pictures, thereby increasing the diversity of data, but avoiding network learning irrelevant features, and finally enhancing the recognition ability of the model. Secondly, Efficient Channel Attention (ECA) was introduced into the DenseNet-121 network after each convolutional layer. As such, the accuracy of weed recognition was improved to effectively focus the attention on the weeds in the main part of images, where the weight of important features increased further to strengthen the weed features, but to suppress the extraction of background features. At the same time, DropBlock regularization was also added after each DenseBlock block, further to randomly hide some feature maps and noise. Correspondingly, the generalization, robustness, and adaptability of the model were improved to identify different types of weeds. Finally, taking maize seedlings and six types of associated weeds in natural environments as samples, a comparison test was performed on the test set using VggNet-16, ResNet-50, and the unimproved DenseNet-121 model, where the batch size was 64, and the initial learning rate was 0.01. More importantly, an Stochastic Gradient Descent (SGD) optimizer was used to train the CNN model, and the batch size was set to 64, the initial learning rate was set to 0.01, and the VggNet-16, ResNet-50 and the unimproved DenseNet-121 model was compared and tested on the test set. The results show that the improved DenseNet model presented the best performance, where the model size was 26.55 MB, the single image took 0.23 s, and the average recognition accuracy reached 98.63%, increased by 2.09 percentage points before the improvement. It infers that the overall performance of improved DenseNet-121 was significantly higher than that of VggNet-16 and ResNet-50. Gradient-weighted Class Activation Mapping (Grad-CAM) was also used to visualize the heat map for the subsequent comparison. The improved DenseNet decision was obtained, where the important weight position of classification was more focused on the main part of weeds than before. Specifically, the category judgment probability was 0.99, significantly higher than that of the unimproved model, further verifying the effectiveness of the improved model. Consequently, the DenseNet network with ECA attention and DropBlock regularization can widely be expected to improve the recognition accuracy and the generalization of the model, further to ensure the efficient and accurate recognition of weeds in complex environments. The findings can provide a strong reference for the accurate identification of other crops and associated weeds. The versatility of the model in weed identification can also be improved for the technical development of intelligent weeding robots.