Crop Row Line Detection for Rapeseed Seedlings in Complex Environments Based on Improved BiSeNetV2 and Dynamic Sliding Window Fitting
Abstract
1. Introduction
2. Materials and Methods
2.1. Data Acquisition
2.1.1. Image Data Acquisition
2.1.2. Dataset Construction
2.2. Algorithm Design
- (1)
- Improved BiSeNetV2-based rapeseed seedling segmentation. To address the problem of insufficient segmentation efficiency due to the complex field environment and high density of rapeseed planting, the model was improved based on the original BiSeNetV2 model to determine the optimal rapeseed seedling segmentation model.
- (2)
- Extraction of crop row areas based on the vertical projection crop row area extraction method. Vertical projection was used to count the information of rapeseed seedling pixel points, and Gaussian filtering and multi-dimensional threshold screening methods were used to extract the crop row area.
- (3)
- Detection of crop row lines based on a dynamic sliding window fitting algorithm for crop row lines. Dynamic adjustment of window parameters was achieved by constructing an adaptive model of window width, step length, and region width, combined with the lateral inertial drift strategy and the dynamic adjustment of longitudinal step length strategy. Finally, variable-order polynomial fitting was used to adaptively characterize changes in crop row curvature and detect crop row lines with high accuracy (Figure 2).
2.2.1. Rapeseed Seedling Extraction Method Based on Improved BiSeNetV2
2.2.2. Vertical Projection-Based Crop Row Area Extraction
2.2.3. Dynamic Sliding Window-Based Crop Row Lines Fitting
2.3. Test Platform
2.4. Evaluation Indicators
2.4.1. Evaluation Metrics for Semantic Segmentation
2.4.2. Evaluation Indicators for Crop Row Line Detection
3. Results
3.1. Analysis of Rapeseed Seedling Segmentation Results Based on Real-Time Semantic Segmentation Model
3.1.1. Analysis of Test Results Before and After Model Segmentation Improvements
3.1.2. Comparison of Performance Improvements in the BiSeNetV2 Model
3.1.3. Comparison of the Performance of Different Segmentation Models
3.2. Analysis of Rapeseed Seedling Crop Row Line Detection Algorithm
3.2.1. Analysis of the Results of Crop Row Area Detection Using the Vertical Projection Crop Row Area Extraction Method for Rapeseed Seedlings
3.2.2. Analysis of Dynamic Sliding Window Crop Row Line Fitting Detection Results
3.3. Analysis of Rapeseed Seedling Crop Row Line Detection Results
3.4. Performance Analysis of Crop Row Line Detection Algorithms in Different Environments
3.5. Parameter Sensitivity Analysis
3.5.1. Sensitivity Analysis of the Boundary Expansion Factor δ
3.5.2. Sensitivity Analysis of the Gaussian Smoothing Parameter σ
3.5.3. Sensitivity Analysis of the Attenuation Weight α
3.5.4. Sensitivity Analysis of the Confidence Adjustment Coefficient β
4. Conclusions
- (1)
- To determine the optimal rapeseed seedling segmentation model, the standard convolution in the Detail Branch was replaced with DS Conv based on the original BiSeNetV2 model. The model was further improved by integrating the ECA mechanism and ASPP decoding architecture. The results reveal that the improved BiSeNetV2 network outperforms the original BiSeNetV2 during testing. The F1 score increased from 81.54% to 87.99%, marking an improvement of 6.45%. Furthermore, mPA increased from 77.75% to 87.73%, indicating an improvement of 9.98%. The MIoU increased from 70.84% to 79.40%, suggesting an increase of 8.56%. Additionally, the accuracy increased from 90.46% to 92.91%, with an increase of 2.45%. The improved BiSeNetV2 can be effectively applied to rapeseed seedling segmentation.
- (2)
- To determine the rapeseed seedling crop row area, a vertical projection crop row area extraction method was employed. This method involved vertically projecting the rapeseed seedling pixels onto the x-axis. After Gaussian filtering, a multi-dimensional threshold screening strategy was used to identify local peaks, which allowed for the division of the target crop row area based on the width of these peaks.
- (3)
- By applying a dynamic sliding window fitting algorithm to the pixel points of rapeseed seedlings in the crop area, the window size was dynamically adjusted according to the width of the target area. The window was then slid via a lateral inertial drift strategy and by dynamically adjusting the longitudinal step length. Finally, a variable-order polynomial fitting was applied to the center point of the window to obtain the crop row curve. The overall crop row line CFC was 0.80, RMSE was 1.97, and MAE was 1.56, indicating a high level of detection accuracy. This method can effectively identify crop row lines and support crop row detection in navigation tasks.
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Conflicts of Interest
References
- Hu, Q.; Hua, W.; Yin, Y.; Zhang, X.; Liu, L.; Shi, J.; Zhao, Y.; Lu, Q.; Chen, C.; Wang, H. Rapeseed research and production in China. Crop J. 2017, 5, 127–135. [Google Scholar] [CrossRef]
- Gai, J.; Guo, Z.; Raj, A.; Tang, L. Robust crop row detection using discrete Fourier transform (DFT) for vision-based in-field navigation. Comput. Electron. Agric. 2025, 229, 109666. [Google Scholar] [CrossRef]
- Wang, T.; Chen, B.; Zhang, Z.; Li, H.; Zhang, M. Applications of machine vision in agricultural robot navigation: A review. Comput. Electron. Agric. 2022, 198, 107085. [Google Scholar] [CrossRef]
- Yu, F.; Cao, Y.; Xu, T.; Guo, Z.; Wang, D. Precision fertilization by UAV for rice at tillering stage in cold region based on hyperspectral remote sensing prescription map. Trans. CSAE 2020, 36, 103–110. [Google Scholar]
- Tellaeche, A.; BurgosArtizzu, X.P.; Pajares, G.; Ribeiro, A.; Fernández-Quintanilla, C. A new vision-based approach to differential spraying in precision agriculture. Comput. Electron. Agric. 2008, 60, 144–155. [Google Scholar] [CrossRef]
- Zeng, F.; Wang, R.; Jiang, Y.; Liu, Z.; Ding, Y.; Dong, W.; Xu, C.; Zhang, D.; Wang, J. Growth monitoring of rapeseed seedlings in multiple growth stages based on low-altitude remote sensing and semantic segmentation. Comput. Electron. Agric. 2025, 232, 110135. [Google Scholar] [CrossRef]
- Quan, L.; Feng, H.; Lv, Y.; Wang, Q.; Zhang, C.; Liu, J.; Yuan, Z. Maize seedling detection under different growth stages and complex field environments based on an improved Faster R–CNN. Biosyst. Eng. 2019, 184, 1–23. [Google Scholar] [CrossRef]
- Yu, G.; Wang, Y.; Gan, S.; Xu, H.; Chen, Y.; Wang, L. Extracting the navigation lines of crop-free ridges using improved deeplabv3+. Trans. Chin. Soc. Agric. Eng. 2024, 40, 168–175. [Google Scholar]
- Yang, Y.; Zhou, Y.; Yue, X.; Zhang, G.; Wen, X.; Ma, B.; Xu, L.; Chen, L. Real-time detection of crop rows in maize fields based on autonomous extraction of ROI. Expert Syst. Appl. 2023, 213, 118826. [Google Scholar] [CrossRef]
- Pin, J.; Guo, T.; Xv, M.; Zou, X.; Hu, W. Fast extraction of navigation line and crop position based on LiDAR for cabbage crops. Artif. Intell. Agric. 2025, 15, 686–695. [Google Scholar] [CrossRef]
- Zhang, S.; Liu, Y.; Xiong, K.; Tian, Y.; Du, Y.; Zhu, Z.; Du, M.; Zhai, Z. A review of vision-based crop row detection method: Focusing on field ground autonomous navigation operations. Comput. Electron. Agric. 2024, 222, 109086. [Google Scholar] [CrossRef]
- Montalvo, M.; Pajares, G.; Guerrero, J.M.; Romeo, J.; Guijarro, M.; Ribeiro, A.; Ruz, J.J.; Cruz, J.M. Automatic detection of crop rows in maize fields with high weeds pressure. Expert Syst. Appl. 2012, 39, 11889–11897. [Google Scholar] [CrossRef]
- Guerrero, J.M.; Guijarro, M.; Montalvo, M.; Romeo, J.; Emmi, L.; Ribeiro, A.; Pajares, G. Automatic expert system based on images for accuracy crop row detection in maize fields. Expert Syst. Appl. 2013, 40, 656–664. [Google Scholar] [CrossRef]
- García-Santillán, I.D.; Montalvo, M.; Guerrero, J.M.; Pajares, G. Automatic detection of curved and straight crop rows from images in maize fields. Biosyst. Eng. 2017, 156, 61–79. [Google Scholar] [CrossRef]
- Zhang, X.; Li, X.; Zhang, B.; Zhou, J.; Tian, G.; Xiong, Y.; Gu, B. Automated robust crop-row detection in maize fields based on position clustering algorithm and shortest path method. Comput. Electron. Agric. 2018, 154, 165–175. [Google Scholar] [CrossRef]
- Zhao, S.; Zhang, Z. A new recognition of crop row based on its structural parameter model. IFAC-Pap. 2016, 49, 431–438. [Google Scholar] [CrossRef]
- Zhang, X.; Wang, Q.; Wang, X.; Li, H.; He, J.; Lu, C.; Yang, Y.; Jiang, S. Automated detection of Crop-Row lines and measurement of maize width for boom spraying. Comput. Electron. Agric. 2023, 215, 108406. [Google Scholar] [CrossRef]
- Guo, Z.; Quan, L.; Sun, D.; Lou, Z.; Geng, Y.; Chen, T.; Xue, Y.; He, J.; Hou, P.; Wang, J. Efficient crop row detection using transformer-based parameter prediction. Biosyst. Eng. 2024, 246, 13–25. [Google Scholar] [CrossRef]
- Basso, M.; Pignaton de Freitas, E. A UAV guidance system using crop row detection and line follower algorithms. J. Intell. Robot. Syst. 2020, 97, 605–621. [Google Scholar] [CrossRef]
- Li, D.; Li, B.; Kang, S.; Feng, H.; Long, S.; Wang, J. E2CropDet: An efficient end-to-end solution to crop row detection. Expert Syst. Appl. 2023, 227, 120345. [Google Scholar] [CrossRef]
- Afzaal, H.; Rude, D.; Farooque, A.A.; Randhawa, G.S.; Schumann, A.W.; Krouglicof, N. Improved crop row detection by employing attention-based vision transformers and convolutional neural networks with integrated depth modeling for precise spatial accuracy. Smart Agric. Technol. 2025, 11, 100934. [Google Scholar] [CrossRef]
- Gong, H.; Zhuang, W.; Wang, X. Improving the maize crop row navigation line recognition method of YOLOX. Front. Plant Sci. 2024, 15, 1338228. [Google Scholar] [CrossRef]
- Zhang, W.; Chen, X.; Qi, J.; Zhou, J.; Li, N.; Wang, S. Deep learning and Gaussian process regression based path extraction for visual navigation under canopy. Trans. Chin. Soc. Agric. 2024, 55, 15–26. [Google Scholar]
- Padhiary, M.; Saha, D.; Kumar, R.; Sethi, L.N.; Kumar, A. Enhancing precision agriculture: A comprehensive review of machine learning and AI vision applications in all-terrain vehicle for farm automation. Smart Agric. Technol. 2024, 8, 100483. [Google Scholar] [CrossRef]
- Zhang, J.; Zhao, B.; Yang, C.; Shi, Y.; Liao, Q.; Zhou, G.; Xie, J. Rapeseed stand count estimation at leaf development stages with UAV imagery and convolutional neural networks. Front. Plant Sci. 2020, 11, 617. [Google Scholar] [CrossRef]
- Yu, C.; Gao, C.; Wang, J.; Yu, G.; Shen, C.; Sang, N. Bisenet v2, Bilateral network with guided aggregation for real-time semantic segmentation. Int. J. Comput. Vis. 2021, 129, 3051–3068. [Google Scholar] [CrossRef]
- Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. ECA-Net: Efficient channel attention for deep convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition 2020, Seattle, WA, USA, 13–19 June 2020; pp. 11534–11542. [Google Scholar]
- Shu, H.; Wang, K.; Guo, L.; Bindelle, J.; Wang, W. Automated collection of facial temperatures in dairy cows via improved UNet. Comput. Electron. Agric. 2024, 220, 108614. [Google Scholar] [CrossRef]
- Mehta, S.; Rastegari, M.; Caspi, A.; Shapiro, L.; Hajishirzi, H. Espnet: Efficient spatial pyramid of dilated convolutions for semantic segmentation. In Proceedings of the European Conference on Computer Vision (ECCV) 2018, Munich, Germany, 8–14 September 2018; pp. 552–568. [Google Scholar]
- Xu, L.; Ming, D.; Du, T.; Chen, Y.; Dong, D.; Zhou, C. Delineation of cultivated land parcels based on deep convolutional networks and geographical thematic scene division of remotely sensed images. Comput. Electron. Agric. 2022, 192, 106611. [Google Scholar] [CrossRef]
- Li, B.; Li, D.; Wei, Z.; Wang, J. Rethinking the crop row detection pipeline: An end-to-end method for crop row detection based on row-column attention. Comput. Electron. Agric. 2024, 225, 109264. [Google Scholar] [CrossRef]
- Ito, K.; Xiong, K. Gaussian filters for nonlinear filtering problems. IEEE Trans. Autom. Control 2002, 45, 910–927. [Google Scholar] [CrossRef]
- Illingworth, J.; Kittler, J. A survey of the Hough transform. Comput. Vis. Graph. Image Process. 1988, 44, 87–116. [Google Scholar] [CrossRef]
- Björck, Å. Least squares methods. Handb. Numer. Anal. 1990, 1, 465–652. [Google Scholar]
- Dinakaran, K.; Sagayaraj, A.S.; Kabilesh, S.K.; Mani, T.; Anandkumar, A.; Chandrasekaran, G. Advanced lane detection technique for structural highway based on computer vision algorithm. Mater. Today Proc. 2021, 45, 2073–2081. [Google Scholar] [CrossRef]














| Data Set | Dataset Usage | Influence Factors | Number of Images |
|---|---|---|---|
| Training set | Rapeseed Seedling Segmentation Model Training | None | 7200 |
| Validation set | Rapeseed Seedling Segmentation Model Validation | None | 1028 |
| Test set No. 1 | Rapeseed Seedling Segmentation Model Testing | None | 514 |
| Test set No. 2 | Crop Row Line Detection Algorithm Testing | None | 400 |
| Test set No. 3 | Crop Row Line Detection Algorithm Testing under Different Complex Environments | Sunny | 200 |
| Cloudy | 200 | ||
| Foggy | 200 | ||
| Evening | 200 |
| Model | MIoU/% | mPA/% | F1 Score/% | Accuracy/% | Model Size/MB |
|---|---|---|---|---|---|
| BiSeNetV2 | 70.84 | 77.75 | 81.54 | 90.46 | 20.01 |
| Improved BiSeNetV2 | 79.40 | 87.73 | 87.99 | 92.91 | 19.80 |
| Model | F1 Score/% | MIoU/% | Accuracy/% | mPA/% | Params (M) | GFLOPs | FPS |
|---|---|---|---|---|---|---|---|
| BiSeNetV2 | 81.54 ± 0.42 | 70.84 ± 0.38 | 90.46 ± 0.25 | 77.75 ± 0.45 | 3.3412 | 97.6285 | 36.12 |
| BiSeNetV2 + ECA | 85.85 ± 0.35 | 76.34 ± 0.32 | 91.76 ± 0.21 | 85.15 ± 0.38 | 3.3415 | 97.6520 | 35.85 |
| BiSeNetV2 + ASPP | 82.29 ± 0.39 | 71.76 ± 0.35 | 90.70 ± 0.28 | 78.77 ± 0.41 | 3.8520 | 112.4500 | 29.40 |
| Improved BiSeNetV2 | 87.99 ± 0.28 | 79.40 ± 0.31 | 92.91 ± 0.15 | 87.73 ± 0.22 | 3.2968 | 69.9333 | 40.55 |
| Model | F1 Score/% | MIoU/% | Accuracy/% | mPA/% | Model Size/MB |
|---|---|---|---|---|---|
| BiSeNetV1 | 76.45 | 63.64 | 83.45 | 82.00 | 51.32 |
| BiSeNetV2 | 81.54 | 70.84 | 90.46 | 77.75 | 20.01 |
| FastSeg | 80.12 | 69.15 | 90.00 | 75.92 | 1.52 |
| CGNet | 62.69 | 46.68 | 66.21 | 78.55 | 4.30 |
| Enet | 78.08 | 53.79 | 84.08 | 62.36 | 0.93 |
| Improved BiSeNetV2 | 87.99 | 79.40 | 92.91 | 87.73 | 19.80 |
| Algorithm | CFC | RMSE/Pixel | MAE/Pixel |
|---|---|---|---|
| Hoff transformation | 0.65 | 3.62 | 3.01 |
| Least squares method | 0.68 | 2.74 | 2.10 |
| Ordinary sliding window method | 0.72 | 2.25 | 1.82 |
| Our algorithm | 0.80 | 1.97 | 1.56 |
| Different Environments | Number of Images | Dacc (%) | CFC | RMSE/Pixel | MAE/Pixel |
|---|---|---|---|---|---|
| Sunny | 200 | 99.5 | 0.85 | 1.57 | 1.27 |
| Cloudy | 200 | 98.2 | 0.86 | 2.05 | 1.63 |
| Foggy | 200 | 96.5 | 0.74 | 2.89 | 2.22 |
| Evening | 200 | 97.8 | 0.76 | 1.38 | 1.11 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Dong, W.; Wang, R.; Zeng, F.; Jiang, Y.; Zhang, Y.; Shi, Q.; Liu, Z.; Xu, W. Crop Row Line Detection for Rapeseed Seedlings in Complex Environments Based on Improved BiSeNetV2 and Dynamic Sliding Window Fitting. Agriculture 2026, 16, 23. https://doi.org/10.3390/agriculture16010023
Dong W, Wang R, Zeng F, Jiang Y, Zhang Y, Shi Q, Liu Z, Xu W. Crop Row Line Detection for Rapeseed Seedlings in Complex Environments Based on Improved BiSeNetV2 and Dynamic Sliding Window Fitting. Agriculture. 2026; 16(1):23. https://doi.org/10.3390/agriculture16010023
Chicago/Turabian StyleDong, Wanjing, Rui Wang, Fanguo Zeng, Youming Jiang, Yang Zhang, Qingyang Shi, Zhendong Liu, and Wei Xu. 2026. "Crop Row Line Detection for Rapeseed Seedlings in Complex Environments Based on Improved BiSeNetV2 and Dynamic Sliding Window Fitting" Agriculture 16, no. 1: 23. https://doi.org/10.3390/agriculture16010023
APA StyleDong, W., Wang, R., Zeng, F., Jiang, Y., Zhang, Y., Shi, Q., Liu, Z., & Xu, W. (2026). Crop Row Line Detection for Rapeseed Seedlings in Complex Environments Based on Improved BiSeNetV2 and Dynamic Sliding Window Fitting. Agriculture, 16(1), 23. https://doi.org/10.3390/agriculture16010023
