
Different varieties and backgrounds
The YOLOv7 detector was shown on different apple varieties and could detect background apples once they became recognizable, including examples that were not labeled during the training annotation process.
A field-based study combining apple detection and ripeness classification. Follow the workflow from nighttime image capture and evolving annotation strategies to a YOLOv7 detector and a custom CNN classifier.
The image database was collected from Red Aroma apple trees in Gvarv, Telemark, Norway, across the 2021 growing season. The capture setup was designed to be simple and practical for orchard monitoring.
Night capture
Camera locationA Raspberry Pi HQ Camera with an Arducam 6 mm lens, manual focus, adjustable aperture, and LED illumination was positioned approximately five metres from the trees, at a height of two metres. Images were captured from two viewing angles during the day and at night. The night images were used because they provided better contrast and illumination.
Explore the paper's time-based ripeness labels and capture period.
Rather than modifying the YOLO architectures, the study created three sub-datasets with different labeling, augmentation, and temporal-sampling strategies.

In Sub-dataset 1, almost all visible apples were included in the labeling process.
Class counts: 37 unripe · 168 semi-ripe · 36 ripe. Temporal sampling was used to maintain the 15% / 70% / 15% class distribution.
YOLOv5, YOLOv7, and YOLOv8 were fine-tuned on each sub-dataset. The best reported detection result came from YOLOv7 trained with Sub-dataset 3.

The reported 0.120 s average detection time was measured for a 3,040 × 4,056-pixel image. The paper also reports that performance was less satisfactory for heavily clustered apples and fruit occluded by leaves.
Cropped apple images were classified into three temporal ripeness classes. The study compared fine-tuned CNNs, CNN feature extractors combined with ML classifiers, and a custom CNN.

Dataset 2 contained 500 selected images, expanded to approximately 3,100 through augmentation. Results shown are the best achieved over 25 training cycles using 5-fold cross-validation.
The paper tested the detector on different apple varieties and background fruit, and separately evaluated the classifier on FruitNet. It also documents cases where detection remains difficult.

The YOLOv7 detector was shown on different apple varieties and could detect background apples once they became recognizable, including examples that were not labeled during the training annotation process.

The paper notes that detection was less satisfactory when apples appeared in highly clustered groups or were covered by leaves. These cases are important constraints for practical orchard deployment.
On the FruitNet dataset, the custom CNN achieved 96.2% accuracy. Fine-tuned ResNet-50 followed with 94.6%. This is a separate evaluation from the Dataset 2 cross-validation results shown above.

The paper reports the confusion matrix for the custom CNN classifier alongside the classification accuracy comparisons.
Amin Mavaddat, Fabio A. A. Andrade, Karl Thomas Hjelmervik, Erik Andrew Johannessen, and Christian Hovden.