Source-linked AI summary
A fast accurate fine-grain object detection model based on YOLOv4 deep neural network
Arunabha M. Roy, Rikhi Bose, Jayabrata Bhaduri
TL;DR
Plant disease detection is difficult in complex scenes because diseases can be fine-grained, irregular, multi-scale, visually similar, and densely distributed. This paper develops a modified YOLOv4 model for real-time detection, using architectural changes that improve feature extraction, feature reuse, and fine-grain information preservation; the resulting model enhances accuracy, efficiency, and robustness in challenging detection tasks.
Problem
Real-time accurate tomato disease detection is challenging because infected areas vary in size, morphology, scale, texture, illumination, overlap, and occlusion, while original YOLOv4 can suffer missed detections, false predictions, and high computational cost.
Method
The paper modifies YOLOv4 with DenseNet-based feature reuse, new residual CSP blocks, and changes to the backbone and neck to improve feature extraction, reduce computation, and preserve fine-grain information.
Results
The modified model enhances detection accuracy, efficiency, and robustness in complex detection tasks and is easier to train than the original YOLO models.
Takeaways & Limitations
The proposed model provides an effective real-time approach for detecting plant diseases in complex, noisy environments.
Takeaways & Limitations
Further feature-extraction improvements are needed to minimize missed and false detections under challenging backgrounds, with future work targeting mobile on-field deployment.
Abstract
from arXiv · showhide
Early identification and prevention of various plant diseases in commercial farms and orchards is a key feature of precision agriculture technology. This paper presents a high-performance real-time fine-grain object detection framework that addresses several obstacles in plant disease detection that hinder the performance of traditional methods, such as, dense distribution, irregular morphology, multi-scale object classes, textural similarity, etc. The proposed model is built on an improved version of the You Only Look Once (YOLOv4) algorithm. The modified network architecture maximizes both detection accuracy and speed by including the DenseNet in the back-bone to optimize feature transfer and reuse, two new residual blocks in the backbone and neck enhance feature extraction and reduce computing cost; the Spatial Pyramid Pooling (SPP) enhances receptive field, and a modified Path Aggregation Network (PANet) preserves fine-grain localized information and improve feature fusion. Additionally, the use of the Hard-Swish function as the primary activation improved the model's accuracy due to better nonlinear feature extraction. The proposed model is tested in detecting four different diseases in tomato plants under various challenging environments. The model outperforms the existing state-of-the-art detection models in detection accuracy and speed. At a detection rate of 70.19 FPS, the proposed model obtained a precision value of $90.33 \%$, F1-score of $93.64 \%$, and a mean average precision ($mAP$) value of $96.29 \%$. Current work provides an effective and efficient method for detecting different plant diseases in complex scenarios that can be extended to different fruit and crop detection, generic disease detection, and various automated agricultural detection processes.
1 Introduction
Plant disease detection in complex agricultural environments requires real-time, fine-grained recognition despite dense distributions, occlusion, irregular lesions, and multi-scale visual similarity. The study therefore develops an improved YOLOv4 model to optimize detection speed and accuracy.
- Motivation: Early disease detection supports prevention, intelligent spraying, autonomous pesticide application, and crop health monitoring in commercial agriculture.The motivation links accurate detection with reduced pesticide use and improved production.
- Research gap: Existing crop-disease research emphasizes image classification, while region-based detectors are relatively few and often too slow for real-time complex-environment detection.The paper identifies limited real-time capability as a central gap in current approaches.
- Research gap: Two-stage detectors such as Faster R-CNN improve detection over traditional methods but cannot perform real-time detection with high-resolution images.Their region-proposal and classification structure reduces detection time but remains unsuitable for real-time high-resolution use.
- Background: YOLO increases detection speed by unifying classification and localization as regression without a region proposal network.The paper positions YOLOv4 as a faster one-stage alternative with improved precision and accuracy over YOLOv3 in real-time applications.
- Contribution: The study develops an improved YOLOv4 for real-time multi-scale disease detection and evaluates it in challenging environments.The proposed modifications target both detection speed and accuracy.
- Application challenge: Tomato disease detection is especially challenging because four diseases exhibit varying lesion size, color, density, morphology, texture, growth stage, and surrounding contrast.The targeted diseases are early blight, late blight, Septoria spot, and leaf mold.
2 YOLOv4 network structure
YOLOv4 is a single-stage regression detector organized around a backbone, neck, and prediction head. Although its architecture improves speed and accuracy, the original model remains vulnerable to fine-grain disease complexity and computational demands.
- YOLOv4 framework: YOLOv4 predicts bounding-box coordinates and class probabilities by transforming object detection into a regression problem.Its architecture is described as a high-precision single-stage detector.
- YOLOv4 architecture: The YOLOv4 network uses CSPDarknet53 for feature extraction, PANet for semantic representation, and a regular YOLOv3 head for prediction.The three components correspond to the backbone, neck, and head of the network.
- Backbone: CSPDarknet53 combines residual learning with cross-stage partial connections to reduce parameters while improving residual feature information and feature learning.Feature layers are progressively down-sampled to extract rich semantic information.
- Prediction: YOLOv4 predicts bounding boxes at three scales after feature fusion through convolution, up-sampling, and down-sampling operations.The input image is discretized into N × N grids before prediction.
- Limitations: Original YOLOv4 may produce missed detections and false predictions for dense, irregular, multi-scale, overlapping, occluded, and visually similar disease regions.The paper attributes this limitation to insufficient fine-grain feature extraction and also notes high computational cost and longer training time.
3 The proposed model network structure
The proposed network modifies YOLOv4 with new backbone and neck blocks, DenseNet connections, SPP, Hard-Swish activation, and training augmentations. These changes target feature extraction, feature reuse, receptive field, fine-grain localization, computational cost, and robustness.
- Backbone feature extraction: CSP1-n is introduced in the backbone to improve feature extraction while reducing computational memory requirements for high-resolution real-time detection.The block is added because the original residual design still leaves scope to reduce memory demands.
- Network architecture: The proposed architecture combines Dense-CSPDarknet53 with SPP, a modified PANet neck, and a regular YOLOv3 head.The design is illustrated alongside the CSP-n, CSP1-n, and CSP2-n blocks.
- Activation function: Hard-Swish is selected to improve nonlinear feature learning, robustness to noise, regularization, and computational efficiency relative to Swish.The paper links its non-monotonic, bounded-below, and unbounded properties to these effects.
- Dense feature transfer: DenseNet connections let each layer receive feature information from all preceding layers, enhancing feature propagation and reuse while reducing parameters.Dense-CSP1-4 and Dense-CSP1-2 replace selected down-sampling layers, while redundant operations are removed to increase calculation speed.
- Spatial pyramid pooling: The SPP block applies maximum pooling with 5 × 5, 9 × 9, and 13 × 13 kernels to enlarge the receptive field while retaining output spatial dimensions.It is integrated with the last residual block of the Dense-CSPDarknet53 backbone.
- Feature fusion: The modified PANet neck addresses increasingly complex interconnectivity by shortening high- and low-level fusion paths and preserving fine-grain localized information.PANet fuses information from all layers and uses bottom-up path augmentation to disseminate lower-level information.
- Training and augmentation: Dropout, CIoU loss, Cross mini Batch Normalization, cosine annealing, dropblock regularization, and image augmentation are used to improve performance and input variability.Augmentations include rotation, mirror projection, color balancing, brightness transformation, and blur processing.
4 Preliminaries of an object detection problem
This section formulates key object-detection components, including bounding-box regression, confidence and classification errors, loss functions, and evaluation metrics. It explains IoU-based localization losses and precision-based measures for assessing detection performance.
- 4.1 Bounding box regression: Bounding-box regression predicts localization boxes from input images, while IoU evaluates overlap between predicted and ground-truth boxes.IoU is scale-invariant and uses the intersection and union of the two boxes.
- 4.1 Bounding box regression: IoU loss ignores non-overlapping boxes and can suffer gradient disappearance, motivating GIoU, which incorporates box shape, area, and orientation.GIoU addresses limitations of overlap-only evaluation for separated boxes.
- 4.1 Bounding box regression: DIoU adds center-distance information, whereas CIoU jointly considers overlap, center distance, and aspect ratio for bounding-box regression.The normalized center-distance penalty is described as supporting faster convergence than GIoU; CIoU extends DIoU in YOLOv4.
- 4.2 Confidence score: YOLO assigns targets through grid cells, with each grid predicting bounding boxes, confidence scores, and class-conditional probabilities.The target is detected when its ground-truth center falls within a specified grid cell.
- 4.3 Loss function: The detection loss combines coordinate, IoU, and classification error components, with terms defined for localization, confidence, and class probabilities.The formulation includes weighted coordinate and IoU errors and classification errors across objects in each grid cell.
- 4.4 Evaluation metrics: Precision, recall, F1-score, AP, and mAP provide evaluation measures, with AP defined by the area under the precision-recall curve.AP50:95 averages precision across IoU thresholds from 0.50 to 0.95, while APS, APM, and APL describe small, medium, and large objects.
5 Results & Discussion
The proposed improved YOLOv4 is evaluated on tomato disease detection through ablations, comparisons with state-of-the-art detectors, and convergence analysis. It achieves strong accuracy and speed while addressing fine-grain, multi-scale, and visually similar disease patterns.
- Experimental setup: 1200 tomato-disease images were constructed from 300 images for each of four diseases in the PlantVillage dataset.The diseases were early blight, late blight, Septoria leaf spot, and leaf mold.
- Experimental setup: The evaluation tests activation functions, backbone-neck configurations, detection metrics, training behavior, and loss functions.Metrics include precision, recall, F1-score, mAP, IoU, detection speed, and detection time.
- Activation functions: H-swish improved nonlinear feature learning and increased detection speed by 14.7% compared with Leaky-ReLU activation.The H-swish configuration provided the strongest combined detection accuracy and speed on the disease dataset.
- Residual blocks: Adding CSP1-n and CSP2-n blocks increased AP, AP75, APS, APM, and APL by 2.1%, 14.8%, 9.7%, 14.7%, and 18.6%, respectively, while detection speed increased by 6.3%.CSP1-n enhances backbone feature extraction, while CSP2-n improves semantic-feature learning in the PANet.
- Overall performance: 70.19 FPS was achieved by the proposed model, which exceeded original YOLOv4 by 10.34% while improving precision, recall, F1-score, and mAP by 8.94%, 5.06%, 7.20%, and 3.45%, respectively.The model outperformed the compared detection models on the custom disease dataset.
- Overall performance: The proposed model reached an IoU of 0.935, an F1-score of 0.936, and an average detection time of 14.29 ms.These were the best values among the compared YOLOv3, YOLOv4, and proposed models.
- Convergence: The final training loss was 2.98, approximately 34.7% lower than original YOLOv4, while the validation loss decreased rapidly before later saturation.Training loss saturated after approximately 55,000 steps, and validation loss converged after about 65,000 steps.
- Loss functions: CIoU loss increased precision, recall, F1, and mAP by 2.78%, 3.81%, 2.73%, and 1.5%, respectively, versus GIoU loss, with a 1.03 ms detection-time increase.The paper reports that activation choice and residual or dense blocks had greater influence than loss-function selection.
6 Real-time detection results
The proposed model is evaluated on four tomato diseases across challenging visual conditions and compared with YOLOv3 and YOLOv4. It generally reduces missed detections and improves robustness for fine-grain, irregular, dense, and visually similar lesions.
- Detection of different plant disease classes: The proposed model is compared with YOLOv3 and YOLOv4 on early blight, late blight, Septoria leaf spot, and leaf mold.Each disease is evaluated on three distinct leaves using bounding-box predictions.
- Detection of different plant disease classes: Early blight detection improves because the proposed model misses fewer high-aspect-ratio spots, especially near leaf edges.YOLOv3 and YOLOv4 miss several spots, whereas the proposed model performs better in the illustrated cases.
- Detection of different plant disease classes: The proposed model performs better for late blight and leaf mold when lesion boundaries or colors resemble surrounding leaves.Late blight comparisons involve irregular, texture-similar lesions, while leaf mold is additionally tested under varying illumination.
- Detection of different plant disease classes: The proposed model reduces missed detections for densely distributed Septoria spots and produces higher-confidence bounding boxes in challenging cases.All three models perform reasonably on less dense spots, while the proposed model is stronger for dense distributions.
- Detection of different plant disease classes: The proposed model shows superior overall detection for densely populated, irregular, multi-scale, and texture-similar disease regions.The comparison specifically emphasizes challenging lesion distributions, morphology, backgrounds, and lighting conditions.
- Detection under greyscale and low-resolution images: The model remains accurate on greyscale and 100 × 100 pixelated images, although it misses one late-blight spot and two Septoria spots in greyscale cases.Its low-resolution performance is reported as higher than that of YOLOv3 and YOLOv4.
- Detection under different illumination intensities: Under reduced brightness, the model detects disease spots accurately at 80% and 60% brightness, with reasonable bounding-box predictions and confidence scores under dimming.The illumination comparison includes original RGB images and reduced brightness conditions.
7 Conclusion
The paper develops a real-time YOLOv4-based detector with architectural and activation-function modifications intended to improve speed, accuracy, feature extraction, and fine-grain information preservation. It reports strong detection performance across complex environments.
- Conclusion: The model is a modified YOLOv4 detector designed to optimize detection accuracy and speed.The evaluation covers complex detection tasks in noisy environments using standard object-detection measures.
- Conclusion: The CSP1-n backbone block improves feature extraction, while the CSP2-n neck module preserves fine-grain local information.A DenseNet block also improves feature transfer and reuse, and the modified design is reported as easier to train than the original YOLO models.
- Conclusion: 70.19 FPS, 90.33% precision, 93.64% F1-score, and 96.29% mAP are reported for the proposed model.These are the paper’s principal reported detection speed and accuracy results.
- Conclusion: The proposed model is reported to achieve the highest detection accuracy and speed among the compared state-of-the-art detection models.The conclusion positions the model as effective for the evaluated detection setting.