Real-time detection of green citrus fruit is crucial for accurate fruit localization and early yield prediction in the citrus growing process. This detection involves three imaging steps: acquisition, transmission, and detection. Image quality during acquisition and transmission also impacts detection accuracy. To enhance accuracy, we propose a lightweight method for detecting green citrus fruit in practical environments. The method applies a random sequence of four operations (blurred kernel, noise, size reduction, and compression) to preprocess original citrus fruit images, simulating real-world blurring and constructing a new dataset. A knowledge model is trained to reconstruct blurry citrus fruit images and address accuracy issues caused by blurring in practical environments. The YOLOv5 backbone network combines a convolutional neural network (CNN) for local information and a transformer for global background features. This fusion encodes both local and global information, learning representations efficiently and improving the detection model. In the YOLOv5 neck network, feature weighting optimizes representation of citrus fruit in space and channels, enhancing accuracy by reducing background weight. The proposed method, evaluated using a constructed dataset, outperforms mainstream lightweight detection models with 93.6% accuracy, 6.3 M parameters, and a 12.4 M model size. Compared to YOLOv5-MobileNetv3-small and YOLOv5-ShuffleNetv2, accuracy improves by 8.5% and 10.98%, respectively. Compared to YOLOv5s, parameters decrease by 9.6%, model size decreases by 8.82%, and accuracy improves by 1.5%. The proposed method demonstrates robust and effective detection of green citrus fruit in natural environments, providing guidance for accurate localization and early yield prediction. Data and methods used in this paper can be found at: https://github.com/PingfuChen/Citrus_detection.git.
Read full abstract