In response to the poor detection performance of grapes in orchards caused by issues such as leaf occlusion and fruit overlap, this study proposes an improved grape detection method named YOLOv7-MCSF based on the You Only Look Once v7 (YOLOv7) framework. Firstly, the original backbone network is replaced with MobileOne to achieve a lightweight improvement of the model, thereby reducing the number of parameters. In addition, a Channel Attention (CA) module was added to the neck network to reduce interference from the orchard background and to accelerate the inference speed. Secondly, the SPPFCSPC pyramid pooling is embedded to enhance the speed of image feature fusion while maintaining a consistent receptive field. Finally, the Focal-EIoU loss function is employed to optimize the regression prediction boxes, accelerating their convergence and improving regression accuracy. The experimental results indicate that, compared to the original YOLOv7 model, the YOLOv7-MCSF model achieves a 26.9% reduction in weight, an increase in frame rate of 21.57 f/s, and improvements in precision, recall, and mAP of 2.4%, 1.8%, and 3.5%, respectively. The improved model can efficiently and in real-time identify grape clusters, providing technical support for the deployment of mobile devices and embedded grape detection systems in orchard environments.
To tackle the difficulties of detecting small targets, uneven target scale distribution, and occlusion in complex backgrounds of drone-captured images, we propose an adaptive multi-scale and occlusion-aware object detection algorithm for aerial scenes. First, we create a feature fusion module called ATPC-C2f, which incorporates partial convolution (PConv) along with triplet attention (TA) mechanisms. This module improves the spatial perception awareness of deep networks by fusing channel and spatial dimension information. Next, we introduce the Adaptively Scaled Dual Feature Network (ASDFN), which reduces the loss of small target information during network propagation, thus balancing the importance of features at different scales. Additionally, we incorporate a Haar wavelet downsampling (HWD) module, which utilizes lossless feature encoding and feature learning blocks to preserve small target feature information while filtering redundant data. Finally, we propose the UBHead detection head, which employs multi-scale spatial propagation to fully exploit contextual information, enhancing the model’s global perception of feature maps and improving detection performance in partially occluded scenarios. Experimental results on the VisDrone2019-DET drone image detection benchmark dataset show that the YOLO-AAHU algorithm outperforms the YOLOv8n algorithm, achieving enhancements of 1.2% in mAP50 and 2.1% in mAP50:95. This comes with a minimal increase in both parameter count, which rises by 7 × 105, and computational complexity rises by 1.1G. This demonstrates a favorable balance between detection performance and resource consumption, providing a reliable solution for drone-based visual detection in complex scenes.
In order to solve the problems of a high mismatching rate and being easily affected by noise and gray transformation, an improved product defect detection method combining centroid distance and textural information is proposed in this paper. Based on image preprocessing, the improved fuzzy C-means clustering method is used to extract the closed contour features. Then, the contour center distance description operator is used for bidirectional matching, and a robust coarse matching contour pair is obtained. After the coarse matching contour pair is screened, the refined matching result is obtained by using the improved local binary pattern operator. Finally, by comparing whether the number of fine matching pairs is consistent with the number of template outlines, the detection of good and bad industrial products is realized, and the closed contour extraction experiment, the anti-rotation matching experiment, the anti-gray difference matching experiment, and the defect detection experiment of three different products are designed. The experimental results show that the improved product defect detection method has good performance in relation to anti-rotation transformation and anti-gray difference, the detection accuracy can reach more than 90%, and the detection time is up to 362.6 ms, which can meet the requirements of industrial real-time detection.