JOURNAL ARTICLE

An improved YOLOv7 model based on Swin Transformer and Trident Pyramid Networks for accurate tomato detection

Abstract

Accurate fruit detection is crucial for automated fruit picking. However, real-world scenarios, influenced by complex environmental factors such as illumination variations, occlusion, and overlap, pose significant challenges to accurate fruit detection. These challenges subsequently impact the commercialization of fruit harvesting robots. A tomato detection model named YOLO-SwinTF, based on YOLOv7, is proposed to address these challenges. Integrating Swin Transformer (ST) blocks into the backbone network enables the model to capture global information by modeling long-range visual dependencies. Trident Pyramid Networks (TPN) are introduced to overcome the limitations of PANet’s focus on communication-based processing. TPN incorporates multiple self-processing (SP) modules within existing top-down and bottom-up architectures, allowing feature maps to generate new findings for communication. In addition, Focaler-IoU is introduced to reconstruct the original intersection-over-union (IoU) loss to allow the loss function to adjust its focus based on the distribution of difficult and easy samples. The proposed model is evaluated on a tomato dataset, and the experimental results demonstrated that the proposed model’s detection recall, precision, F 1 score, and AP reach 96.27%, 96.17%, 96.22%, and 98.67%, respectively. These represent improvements of 1.64%, 0.92%, 1.28%, and 0.88% compared to the original YOLOv7 model. When compared to other state-of-the-art detection methods, this approach achieves superior performance in terms of accuracy while maintaining comparable detection speed. In addition, the proposed model exhibits strong robustness under various lighting and occlusion conditions, demonstrating its significant potential in tomato detection.

Keywords:
Computer science Robustness (evolution) Artificial intelligence Pattern recognition (psychology)

Metrics

5
Cited By
3.91
FWCI (Field Weighted Citation Impact)
76
Refs
0.93
Citation Normalized Percentile
Is in top 1%
Is in top 10%

Citation History

Topics

Smart Agriculture and AI
Life Sciences →  Agricultural and Biological Sciences →  Plant Science
Date Palm Research Studies
Life Sciences →  Agricultural and Biological Sciences →  Plant Science
Advanced Chemical Sensor Technologies
Physical Sciences →  Engineering →  Biomedical Engineering

Related Documents

JOURNAL ARTICLE

Accurate Tomato Leaf Disease Identification Method based on Improved Swin Transformer

Yue Cao

Journal:   Journal of Imaging Science and Technology Year: 2025 Vol: 69 (5)Pages: 1-11
JOURNAL ARTICLE

STA-YOLOv7: Swin-Transformer-Enabled YOLOv7 for Road Damage Detection

Dong Zhang

Journal:   Computer Science and Application Year: 2023 Vol: 13 (05)Pages: 1157-1165
JOURNAL ARTICLE

Swin transformer adaptation into YOLOv7 for road damage detection

Riyandi Banovbi Putera IrsalFitri UtaminingrumKohichi Ogata

Journal:   Bulletin of Electrical Engineering and Informatics Year: 2024 Vol: 13 (4)Pages: 2527-2536
© 2026 ScienceGate Book Chapters — All rights reserved.