A method for detecting a target in a cotton field at a key growth stage

By constructing the RepAgri-YOLO lightweight detection network and combining specific modules and loss functions, the detection challenges in complex cotton field environments are solved, improving the accuracy and efficiency of cotton growth stage target detection. It is suitable for cotton field monitoring using lightweight equipment.

CN123160930APending Publication Date: 2026-11-24INST OF AGRI RESOURCES & REGIONAL PLANNING CHINESE ACADEMY OF AGRI SCI +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611082479.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing target detection methods in cotton fields are easily affected by changes in lighting, foliage occlusion, background obfuscation, target adhesion, and scale changes in complex environments, leading to missed detections and false detections. Furthermore, the computational load and number of parameters in the models are large, making it difficult to meet the requirements of lightweight equipment.

Method used

A lightweight detection network, RepAgri-YOLO, is adopted, which combines the RepC2f reparameterized convolution module, the CAGU content-aware gated upsampling module, and the DLWC dynamically learnable weighted stitching module to construct the recall enhancement joint loss function REJLoss, thereby improving the detection capability of low-contrast, partially occluded, and densely clustered targets.

Benefits of technology

Without significantly increasing computational load and parameter count, it improves the detection accuracy of cotton flowers, unopened bolls, and open bolls, is suitable for edge devices, and supports cotton growth status monitoring and defoliant application timing decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160930A_ABST
    Figure CN123160930A_ABST
Patent Text Reader

Abstract

The application is a kind of cotton field key growth period target detection method, which is based on light single-stage target detection network, and constructs RepAgri-YOLO detection network: through RepC2f reparameterization convolution module, the directional structural feature extraction is strengthened, and there is no additional calculation overhead in the inference stage; through CAGU content perception gating up-sampling module, the spatial detail recovery and background suppression are improved; through DLWC dynamic learnable weighted splicing module, the contribution of high and low layer features is adaptively adjusted; at the same time, REJLoss recall enhancement joint loss function is adopted, the training weight of difficult positive samples is improved, and the missed detection of low contrast, shielding and dense target is reduced. The application can detect cotton flower, unopened cotton boll and opened cotton boll, reduce the calculation amount, improve the recall rate and detection accuracy under the premise of slight increase of parameter amount, adapt to resource limited equipment such as field robot and edge computing terminal, and provide support for cotton growth monitoring, boll opening rate statistics and defoliant application decision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of smart agriculture, agricultural machine vision, and computer vision target detection technology, specifically to a lightweight target detection method for uniformly identifying, locating, and counting cotton flowers, unopened cotton bolls, and open cotton bolls in complex natural cotton field environments. Background Technology

[0002] Cotton is an important economic crop, and its flowering, boll-setting, and lint-opening stages reflect the plant's growth process, serving as crucial data for monitoring growth, assessing yield, and managing mechanical harvesting. In the later stages of cotton growth, the timing of defoliant application needs to consider both boll maturity and lint-opening rate. Applying too early may negatively impact the development of immature bolls, reducing boll weight and fiber quality; applying too late may delay concentrated lint-opening and mechanical harvesting.

[0003] Therefore, timely acquisition of information on the quantity and spatial distribution of cotton flowers, unopened cotton bolls, and open cotton bolls is of great significance for judging the growth status of cotton and determining the timing of defoliant application.

[0004] Currently, cotton growth target surveys mainly employ methods such as manual visual inspection, sampling counting, and image analysis. Traditional manual surveys are labor-intensive, inefficient, and the results are easily influenced by the surveyors' experience and subjective judgment, making it difficult to meet the needs of continuous, rapid, and standardized monitoring of large-scale cotton fields. By using agricultural robots or mobile inspection equipment equipped with visual sensors to collect cotton field images and automatically identifying different growth targets using target detection models, the efficiency of cotton field information acquisition can be improved.

[0005] Existing target detection methods mainly include two-stage detection methods, single-stage detection methods, and Transformer-based detection methods. Two-stage detection methods typically have high detection accuracy, but their model structure and inference process are relatively complex. Transformer-based detection methods have strong global relationship modeling capabilities, but their training and deployment resource requirements are high. YOLO-based single-stage detection methods can achieve a better balance between detection accuracy, model size, and inference speed, making them more suitable for field inspection equipment with limited computing resources.

[0006] However, the appearance characteristics and detection difficulty of different targets vary significantly in complex cotton fields: 1. The cotton flowers have bright colors and usually have a high contrast with the green leaves and branches, making them relatively easy to detect; 2. Unopened cotton bolls are similar in color and texture to leaves and branches, and can easily be confused with the background when they are covered by branches and leaves or affected by shadows. 3. There are a large number of open cotton bolls and they are densely distributed. Adjacent targets are prone to sticking together, and the boundaries between targets and individual plants are not clearly separated. 4. Natural lighting, local shadows, shooting angle, target scale, motion blur, and changes in background texture can cause instability in target features; 5. Conventional convolution has limited ability to describe the directional structures of cotton branches, leaf veins, and boll edges; 6. Traditional fixed upsampling methods cannot adjust the response at different spatial locations according to the target content; 7. The neck network directly splices high-level semantic features and shallow spatial features without considering the differences in contribution of different feature branches to the current detection task; 8. Conventional loss functions are insufficient for optimizing low-confidence, difficult positive samples, causing the model to tend to output higher precision but lower recall, and unopened cotton bolls and densely open cotton bolls are prone to missed detection.

[0007] Therefore, there is an urgent need for a lightweight detection method suitable for complex cotton field environments, which can improve the model's ability to detect targets with low contrast, local occlusion, dense adhesion, and scale changes without significantly increasing the number of model parameters and inference computation. Summary of the Invention

[0008] The purpose of this invention is to overcome the problems existing in the prior art and provide a method for detecting key growth stage targets in cotton fields. This method addresses the issue that cotton flowers, unopened bolls, and open bolls in complex cotton field environments are easily affected by changes in light intensity, foliage shading, background obfuscation, target adhesion, and scale changes, leading to missed detections and false detections. Without significantly increasing the number of model parameters and computational load, this method improves the model's ability to detect targets with low contrast, partial shading, dense adhesion, and scale changes. It is adaptable to the deployment requirements of edge devices and can be applied to field inspection robots, agricultural unmanned vehicles, fixed cotton field monitoring equipment, mobile terminals, or edge computing devices. It provides visual information for monitoring cotton growth status, calculating boll opening rates, evaluating boll maturity, and assisting in decision-making regarding the timing of defoliant application.

[0009] To achieve the above-mentioned technical objectives and effects, the present invention is implemented through the following technical solution: A method for detecting key growth stage targets in cotton fields, comprising the following steps: Step S1: Data Acquisition and Preprocessing: Acquire natural cotton field images, identify three types of detection targets: cotton flowers, unopened cotton bolls, and open cotton bolls, and perform bounding box annotation. After data cleaning, divide the dataset and perform data augmentation and image preprocessing on the training set. Step S2: Construct the RepAgri-YOLO lightweight detection network: Based on the lightweight single-stage object detection network architecture, set up the RepC2f reparameterized convolution module, the CAGU content-aware gated upsampling module, and the DLWC dynamically learnable weighted concatenation module in the network; Step S3: Construct the recall enhancement joint loss function REJLoss: Calculate the sample difficulty based on the class prediction probability of positive samples and the overlap between the predicted box and the ground truth box, generate positive sample enhancement weights based on the difficulty, and construct a joint loss function that includes weighted classification loss, weighted bounding box regression loss and distributed bounding box regression loss. Step S4: Model Training and Reparameterization: The RepAgri-YOLO lightweight detection network is trained based on the cotton field dataset and the joint loss function REJLoss for recall enhancement. After training, the multi-branch convolution in the RepC2f reparameterized convolution module is reparameterized and fused to obtain the detection model for inference. Step S5: Model Inference and Result Output: Input the cotton field image to be detected into the detection model for inference. After preprocessing, forward propagation and candidate box filtering, output the category, location, confidence and quantity information of the three types of targets, and calculate the cotton field boll opening rate based on the detection quantity of open and closed cotton bolls.

[0010] Furthermore, the specific steps in step S1 are as follows: Step S101: Cotton field image acquisition Images of natural cotton fields are acquired using RGB image sensors mounted on agricultural robots, mobile inspection platforms, handheld devices, or fixed monitoring equipment. The image acquisition range covers at least the cotton flowering, boll-forming, and lint-opening stages, and includes one or more of the following imaging conditions: Front lighting, side lighting, backlighting, partial shadows, and uneven lighting conditions; Frontal view, overhead view, oblique view, and different shooting distances; Single target, partially occluded target, and densely distributed target; Plant branches and leaves, soil, weeds and other natural field background; Cotton flowers of different sizes, unopened cotton bolls, and open cotton bolls; Among them, the acquired images are associated with the corresponding acquisition time, land parcel information or equipment information in order to conduct data traceability and model testing; Step S102: Target Category Determination The cotton growth targets to be tested are divided into the following three categories: Cotton flowers are denoted as CF; unopened cotton bolls are denoted as UCB; and open cotton bolls are denoted as OCB. Among them, unopened cotton bolls include cotton bolls that have not yet opened and whose outer shells are basically intact, while open cotton bolls include cotton bolls whose cotton fibers have been partially or completely exposed. Step S103: Target Labeling Rectangular bounding boxes were used to label cotton flowers, unopened cotton bolls, and open cotton bolls in the acquired images. Each labeled target should include at least: target category; bounding box center coordinates; bounding box width and height; and corresponding image label; For partially occluded targets, when the visible area can determine the target category and main location, they are labeled according to the visible outline or the estimated range of the complete target, and a unified labeling rule is used in all data. Step S104: Data Cleaning Delete or correct images or labels that fall under the following categories: severely out of focus, making the target unidentifiable; image damaged or abnormally exposed; target category incorrectly labeled; bounding box significantly deviating from the target; the same target being labeled repeatedly; the labeled target not belonging to one of the three preset target categories. Step S105: Dataset partitioning The cleaned images are divided into training set, validation set and test set; Furthermore, the same original image and its augmented image are assigned to the same subset of data, or online data augmentation is performed only on the training set, in order to avoid data leakage caused by the same image content entering both the training and test sets at the same time; Step S106: Image Enhancement and Preprocessing During the training phase, one or more data augmentation operations are performed on the image, including: horizontal flipping; random scaling and cropping; brightness, contrast, or color perturbation; shadow simulation; blurring; noise addition; image stitching or blending enhancement; In this process, the enhanced image is scaled to the input size required by the detection network and pixel normalized, while the label bounding box is updated synchronously according to the image geometric transformation.

[0011] Furthermore, the specific steps in step S2 are as follows: Step S201: Construct the RepC2f reparameterized convolution module The RepC2f reparameterized convolutional module is obtained by replacing the regular Bottleneck inside the base network C2f module with RepAgriBottleneck. The input features are first processed by 1×1 convolution to adjust the channels, and then divided into the first feature branch and the second feature branch along the channel dimension. The first feature branch is retained and directly participates in subsequent fusion. The second feature branch passes through at least one RepAgriBottleneck in sequence. The output of each RepAgriBottleneck is concatenated with the first feature branch, and then channel fusion is completed through 1×1 convolution to obtain the RepC2f output features. RepAgriBottleneck includes a 1×1 convolution and an agricultural scene reparameterized convolution RepConv_Agri. When the number of input channels and output channels of RepAgriBottleneck are the same and shortcut connections are enabled, the input features are added to the convolution output as residuals. Step S202: Construct the RepConv_Agri training structure RepConv_Agri includes the following four parallel convolution-batch normalization branches during the training phase: 3×3 convolution branch, 1×3 convolution branch, 3×1 convolution branch, and 1×1 convolution branch; Among them, the 3×3 convolution branch is used to extract the local spatial features of the target; the 1×3 convolution branch is used to enhance the horizontal features; the 3×1 convolution branch is used to enhance the vertical features; and the 1×1 convolution branch is used to complete the channel information transformation. Let the input feature be X, and the output feature be Y. Then the output of Y during the training phase is: , In the formula, W k For the convolution kernel of the k-th branch, BN k For the batch normalization of the k-th branch, Φ represents the SiLU activation function; Step S203: Perform convolution and batch normalization fusion. No convolutional bias is set for each convolutional branch. For the k-th convolutional branch, the equivalent weights and equivalent biases after fusing the convolutional kernel with the batch normalized parameters are as follows: , , In the formula, μ k and These are the batch-normalized moving mean and variance, γ, respectively. k and β k Here, ϵ represents the scaling and translation parameters, and ϵ is the stability constant. Step S204: Construct equivalent convolution kernels for the inference stage Expand the 1×3, 3×1, and 1×1 convolutional kernels into 3×3 convolutional kernels by zero-padding, and sum the equivalent weights and biases of each branch to obtain: , , The output of the verification or inference phase is: ; Step S205: Construct the CAGU content-aware gating upsampling module Replace at least one fixed upsampling module in the neck of the basic network with a CAGU content-aware gated upsampling module; The CAGU content-aware gated upsampling module includes a bilinear upsampling branch and a spatial gated branch; For input features F in The spatially gated branch generates a single-channel spatial weight map by sequentially passing it through 3×3 convolution, batch normalization, SiLU activation, and 1×1 convolution: , In the formula, σ and Φ represent the Sigmoid and SiLU functions, respectively. The input features and the spatial gating map are bilinearly upsampled using the same target size, resulting in: , In the formula, UP(·) represents bilinear upsampling, and ⊙ represents element-wise multiplication; Step S206: Construct the DLWC dynamically learnable weighted splicing module Replace at least one direct channel stitching module in the neck of the basic network with a DLWC dynamically learnable weighted stitching module; Let the first input feature to be fused and the second input feature be F1 and F2, respectively, and the corresponding learnable scalar parameters be w1 and w2, respectively. First, nonnegativity constraints and normalization are applied to the learnable scalar: , In the formula, α i Let ε be the normalized fusion weight for the i-th feature branch, and ϵ be a stability constant. The two input features are weighted separately and then concatenated along the channel dimension. , The first input feature and the second input feature have the same spatial dimensions before splicing; Step S207: Construct a multi-scale detection head The detection head inputs features of different scales processed by RepC2f, CAGU, and DLWC, and outputs the following respectively: the class confidence and bounding box parameters of cotton flowers; the class confidence and bounding box parameters of unopened cotton bolls; and the class confidence and bounding box parameters of open cotton bolls. The output of the detection head includes at least the target category probability, the center position of the bounding box, the width of the bounding box, and the height of the bounding box.

[0012] Furthermore, the specific steps in step S3 are as follows: Step S301: Determine positive and negative samples Samples are assigned based on the positional relationship, class matching relationship, and degree of overlap between the predicted bounding boxes and the ground truth bounding boxes to obtain a positive sample set and a negative sample set. Positive samples that match the real target but have low prediction confidence, low overlap of prediction bounding boxes, or small visible target area are identified as difficult positive samples. Step S302: Calculate the difficulty of positive samples For the i-th positive sample, predict the probability p based on its target category. i and the overlap between the predicted bounding box and the ground truth bounding box u i Determine the level of difficulty d i ; The difficulty function satisfies: when p i Reduce or u i When d decreases i Increase; The difficulty level is calculated as follows: , In the formula, γ1, γ2 and k are adjustment parameters; Positive sample augmentation weights are determined based on the difficulty level. , In the formula, λ r The enhancement coefficient for difficult positive samples; Step S303: Calculate the recall enhancement classification loss The positive sample classification loss is multiplied by the positive sample enhancement weight, so that low-confidence difficult positive samples generate a larger gradient contribution during backpropagation. The enhanced classification loss for recall is expressed as: , In the formula, P represents the set of positive samples and N represents the set of negative samples; Step S304: Calculate the recall-weighted bounding box regression loss The bounding box regression loss is weighted according to the positive sample augmentation weights: , In the formula, B i To predict the bounding box, For the corresponding true bounding box, L RWIoU For bounding box regression loss based on intersection-union ratio, These are the normalized weights of the positive samples; Step S305: Construct the joint loss function The recall-enhanced joint loss function, REJLoss, includes the recall-enhanced classification loss, the recall-weighted bounding box regression loss, and the distributed bounding box regression loss: , In the formula, λ box , λ cls and λ dflThese are the weight coefficients for classification loss, bounding box loss, and distributed regression loss, respectively.

[0013] Furthermore, the specific steps in step S4 are as follows: Step S401: Model Initialization Load the network parameters of the basic lightweight object detection model, or initialize RepAgri-YOLO with random parameters; For the newly added RepC2f, CAGU and DLWC modules, the convolution weights are set according to the initialization method of convolutional networks, and the learnable scalars in DLWC are set to the same initial value so that each input branch has similar weights in the initial stage of training. Step S402: Forward Propagation The preprocessed cotton field image is input into RepAgri-YOLO, and then passes through the backbone feature extraction network, the neck multi-scale feature fusion network and the detection head in sequence to obtain the category prediction results and bounding box prediction results of the three types of targets. Step S403: Loss Calculation and Backpropagation The REJLoss is calculated based on the model prediction results and the real labels, and the parameters of RepC2f, CAGU, DLWC and the detection head are updated through backpropagation. Step S404: Model Validation After completing a predetermined number of training rounds, the precision, recall, mean precision, and loss value are calculated using the validation set, and the optimal model parameters are selected according to the preset indicators. Step S405: Model reparameterization After the model training is completed, the parameters of the four convolution-batch normalization branches of RepConv_Agri are fused to obtain an equivalent 3×3 convolution kernel and an equivalent bias. Save the reparameterized model for validation, deployment, or real-time inference.

[0014] Furthermore, the specific steps in step S5 are as follows: Step S501: Acquire the image to be detected Images of the cotton field to be inspected are acquired using an image acquisition terminal; Step S502: Image preprocessing Adjust the image to be detected to the model input size, and perform pixel normalization and channel arrangement in the manner used in the training phase; Step S503: Target Prediction The preprocessed image is input into the reparameterized RepAgri-YOLO to obtain multiple candidate bounding boxes, object class probabilities, and confidence scores. Step S504: Candidate box filtering Low-confidence predicted boxes are filtered out based on the confidence threshold, and overlapping predicted boxes are processed by non-maximum suppression or other candidate box deduplication methods. Step S505: Output of detection results Output for each target: target category, bounding box coordinates, target confidence score, number of targets in each category, and spatial distribution of the target in the image; The boll opening rate is calculated based on the number of open cotton bolls and the total number of cotton bolls: , In the formula, N OCB To determine the number of open cotton bolls, N UCB This represents the number of cotton bolls that have not yet been opened.

[0015] Furthermore, in step S404, recall rate and average precision are preferably used as the main indicators, while precision rate, number of parameters and computational load are monitored at the same time.

[0016] Furthermore, in step S505, the detection result or boll opening rate is sent to the cotton field management terminal to display the cotton growth status or as input information to assist in decision-making regarding the timing of defoliant application.

[0017] The beneficial effects of this invention are: (1) Enhance the ability to extract directional local features: RepConv_Agri extracts local spatial, horizontal, vertical and channel features through multi-branch convolution, effectively describing the directional structures of cotton branches, leaf veins, cotton boll edges and cotton lint outlines, and improving feature discriminability; (2) Reduce computational complexity in the inference stage: RepConv_Agri uses a multi-branch structure in the training stage and merges multiple branches into a single 3×3 convolution in the inference stage. It does not require repeated execution of four parallel convolution branches on the input features, thus balancing training representation ability and inference efficiency. (3) Improved upsampling detail recovery and background suppression: CAGU adaptively adjusts the response of different spatial locations through content-aware spatial gating, enhances the features of the target area, and suppresses background interference such as shadows, branches, and soil. Moreover, single-channel gating only adds very few parameters. (4) Adaptive adjustment of cross-layer feature contribution: DLWC automatically adjusts the fusion ratio of high-level semantic features and shallow spatial features through learnable weights, reducing the interference of shallow background features on semantic judgment, and the parameter cost is negligible. (5) Reduce missed detection of difficult targets: REJLoss increases the gradient contribution of positive samples with low confidence or low overlap, making the model pay more attention to unopened cotton bolls, partially occluded targets and densely open cotton bolls, and improves the recall ability in complex cotton field scenarios. (6) Balancing detection performance and computational efficiency: Compared with YOLOv8n, this invention improves recall and mAP50 while reducing computational load, making it suitable for field robots and edge computing devices with limitations in computing power, storage space or power consumption. (7) Support cotton growth monitoring and management decision-making: This invention can uniformly output information on the type, location and quantity of cotton flowers, unopened cotton bolls and open cotton bolls, and can further calculate the boll opening rate, providing a data basis for judging the cotton growth process, monitoring growth and assisting decision-making on the timing of defoliant application. Attached Figure Description

[0018] Figure 1 This is an overall flowchart of the lightweight detection method for key growth period targets in cotton fields according to the present invention; Figure 2 This is a schematic diagram of the overall network structure of RepAgri-YOLO in this invention; Figure 3 This is a schematic diagram of the RepC2f module structure of the present invention; Figure 4 This is a schematic diagram of the CAGU content-aware gating upsampling module structure of the present invention; Figure 5 This is a schematic diagram of the DLWC dynamic learnable weighted splicing module structure of the present invention; Figure 6 This is a schematic diagram illustrating the detection results of different cotton field targets according to the present invention. Detailed Implementation

[0019] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0020] like Figure 1 As shown, a method for detecting key growth stage targets in cotton fields includes the following steps: Step S1: Data Acquisition and Preprocessing: Acquire natural cotton field images, identify three types of detection targets: cotton flowers, unopened cotton bolls, and open cotton bolls, and perform bounding box annotation. After data cleaning, divide the dataset and perform data augmentation and image preprocessing on the training set. Step S2: As Figure 2 As shown, a lightweight detection network, RepAgri-YOLO, is constructed: based on a lightweight single-stage object detection network, a RepC2f reparameterized convolution module, a CAGU content-aware gated upsampling module, and a DLWC dynamically learnable weighted concatenation module are set in the network. Step S3: Construct the recall enhancement joint loss function REJLoss: Calculate the sample difficulty based on the class prediction probability of positive samples and the overlap between the predicted box and the ground truth box, generate positive sample enhancement weights based on the difficulty, and construct a joint loss function that includes weighted classification loss, weighted bounding box regression loss and distributed bounding box regression loss. Step S4: Model Training and Reparameterization: The RepAgri-YOLO lightweight detection network is trained based on the cotton field dataset and the joint loss function REJLoss for recall enhancement. After training, the multi-branch convolution in the RepC2f reparameterized convolution module is reparameterized and fused to obtain the detection model for inference. Step S5: Model Inference and Result Output: Input the cotton field image to be detected into the detection model for inference. After preprocessing, forward propagation and candidate box filtering, output the category, location, confidence and quantity information of the three types of targets, and calculate the cotton field boll opening rate based on the detection quantity of open and closed cotton bolls.

[0021] The specific steps in step S1 are as follows: Step S101: Cotton field image acquisition Images of natural cotton fields are acquired using RGB image sensors mounted on agricultural robots, mobile inspection platforms, handheld devices, or fixed monitoring equipment. The image acquisition range covers at least the cotton flowering, boll-forming, and lint-opening stages, and includes one or more of the following imaging conditions: Front lighting, side lighting, backlighting, partial shadows, and uneven lighting conditions; Frontal view, overhead view, oblique view, and different shooting distances; Single target, partially occluded target, and densely distributed target; Plant branches and leaves, soil, weeds and other natural field background; Cotton flowers of different sizes, unopened cotton bolls, and open cotton bolls; Among them, the acquired images are associated with the corresponding acquisition time, land parcel information or equipment information in order to conduct data traceability and model testing; Step S102: Target Category Determination The cotton growth targets to be tested are divided into the following three categories: Cotton flowers are denoted as CF; unopened cotton bolls are denoted as UCB; and open cotton bolls are denoted as OCB. Among them, unopened cotton bolls include cotton bolls that have not yet opened and whose outer shells are basically intact, while open cotton bolls include cotton bolls whose cotton fibers have been partially or completely exposed. Step S103: Target Labeling Rectangular bounding boxes were used to label cotton flowers, unopened cotton bolls, and open cotton bolls in the acquired images. Each labeled target should include at least: target category; bounding box center coordinates; bounding box width and height; and corresponding image label; For partially occluded targets, when the visible area can determine the target category and main location, they are labeled according to the visible outline or the estimated range of the complete target, and a unified labeling rule is used in all data. Step S104: Data Cleaning Delete or correct images or labels that fall under the following categories: severely out of focus, making the target unidentifiable; image damaged or abnormally exposed; target category incorrectly labeled; bounding box significantly deviating from the target; the same target being labeled repeatedly; the labeled target not belonging to one of the three preset target categories. Step S105: Dataset partitioning The cleaned images are divided into training set, validation set and test set; Furthermore, the same original image and its augmented image are assigned to the same subset of data, or online data augmentation is performed only on the training set, in order to avoid data leakage caused by the same image content entering both the training and test sets at the same time; Step S106: Image Enhancement and Preprocessing During the training phase, one or more data augmentation operations are performed on the image, including: horizontal flipping; random scaling and cropping; brightness, contrast, or color perturbation; shadow simulation; blurring; noise addition; image stitching or blending enhancement; In this process, the enhanced image is scaled to the input size required by the detection network and pixel normalized, while the label bounding box is updated synchronously according to the image geometric transformation.

[0022] like Figure 2 As shown, the specific steps in step S2 are as follows: Step S201: Construct the RepC2f reparameterized convolution module like Figure 3 As shown, the RepC2f reparameterized convolutional module is obtained by replacing the regular Bottleneck inside the base network C2f module with RepAgriBottleneck. The input features are first processed by 1×1 convolution to adjust the channels, and then divided into the first feature branch and the second feature branch along the channel dimension. The first feature branch is retained and directly participates in subsequent fusion. The second feature branch passes through at least one RepAgriBottleneck in sequence. The output of each RepAgriBottleneck is concatenated with the first feature branch, and then channel fusion is completed through 1×1 convolution to obtain the RepC2f output features. RepAgriBottleneck includes a 1×1 convolution and an agricultural scene reparameterized convolution RepConv_Agri. When the number of input channels and output channels of RepAgriBottleneck are the same and shortcut connections are enabled, the input features are added to the convolution output as residuals. Step S202: Construct the RepConv_Agri training structure RepConv_Agri includes the following four parallel convolution-batch normalization branches during the training phase: 3×3 convolution branch, 1×3 convolution branch, 3×1 convolution branch, and 1×1 convolution branch; Among them, the 3×3 convolution branch is used to extract the local spatial features of the target; the 1×3 convolution branch is used to enhance the horizontal features; the 3×1 convolution branch is used to enhance the vertical features; and the 1×1 convolution branch is used to complete the channel information transformation. Let the input feature be X, and the output feature be Y. Then the output of Y during the training phase is: , In the formula, W k For the convolution kernel of the k-th branch, BN k For the batch normalization of the k-th branch, Φ represents the SiLU activation function; Step S203: Perform convolution and batch normalization fusion. No convolutional bias is set for each convolutional branch. For the k-th convolutional branch, the equivalent weights and equivalent biases after fusing the convolutional kernel with the batch normalized parameters are as follows: , , In the formula, μ k and These are the batch-normalized moving mean and variance, γ, respectively. k and β k Here, ϵ represents the scaling and translation parameters, and ϵ is the stability constant. Step S204: Construct equivalent convolution kernels for the inference stage Expand the 1×3, 3×1, and 1×1 convolutional kernels into 3×3 convolutional kernels by zero-padding, and sum the equivalent weights and biases of each branch to obtain: , , The output of the verification or inference phase is: ; Thus, the four parallel branches in the training phase are equivalent to a single 3×3 convolution operation, enabling the network to acquire multi-branch feature representation capabilities during the training phase, while avoiding the execution of four parallel feature calculation paths during the inference phase. Step S205: Construct the CAGU content-aware gating upsampling module like Figure 4 As shown, at least one fixed upsampling module in the neck of the basic network is replaced with a CAGU content-aware gated upsampling module; The CAGU content-aware gated upsampling module includes a bilinear upsampling branch and a spatial gated branch; For input features F in The spatially gated branch generates a single-channel spatial weight map by sequentially passing it through 3×3 convolution, batch normalization, SiLU activation, and 1×1 convolution: , In the formula, σ and Φ represent the Sigmoid and SiLU functions, respectively. The input features and the spatial gating map are bilinearly upsampled using the same target size, resulting in: , In the formula, UP(·) represents bilinear upsampling, and ⊙ represents element-wise multiplication; Spatial gating maps modulate upsampled features in spatial location, thereby enhancing the response of cotton corolla, boll edges and cotton lint areas, and reducing interference from branches, soil texture and shaded areas; The gated branch outputs a single-channel weight map, which is broadcast along the channel dimension to all channels of the input feature. Therefore, it is not necessary to generate weight features with the same number of input channels, reducing additional parameters and computation. Step S206: Construct the DLWC dynamically learnable weighted splicing module like Figure 5 As shown, at least one direct channel stitching module in the neck of the basic network is replaced with a DLWC dynamically learnable weighted stitching module; Let the first input feature to be fused and the second input feature be F1 and F2, respectively, and the corresponding learnable scalar parameters be w1 and w2, respectively. First, nonnegativity constraints and normalization are applied to the learnable scalar: , In the formula, α i Let ε be the normalized fusion weight for the i-th feature branch, and ϵ be a stability constant. The two input features are weighted separately and then concatenated along the channel dimension. , The first input feature and the second input feature have the same spatial dimensions before splicing; DLWC adds only two learnable scalar parameters without changing the spatial size of the input features or the number of output channels after concatenation. The model can automatically adjust the contribution of high-level semantic features and shallow spatial features during training, reducing the interference of shallow branches, shadows and soil textures on deep target semantic features. Step S207: Construct a multi-scale detection head The detection head inputs features of different scales processed by RepC2f, CAGU, and DLWC, and outputs the following respectively: the class confidence and bounding box parameters of cotton flowers; the class confidence and bounding box parameters of unopened cotton bolls; and the class confidence and bounding box parameters of open cotton bolls. The output of the detection head includes at least the target category probability, the center position of the bounding box, the width of the bounding box, and the height of the bounding box.

[0023] The specific steps in step S3 are as follows: Step S301: Determine positive and negative samples Samples are assigned based on the positional relationship, class matching relationship, and degree of overlap between the predicted bounding boxes and the ground truth bounding boxes to obtain a positive sample set and a negative sample set. Positive samples that match the real target but have low prediction confidence, low overlap of prediction bounding boxes, or small visible target area are identified as difficult positive samples. Step S302: Calculate the difficulty of positive samples For the i-th positive sample, predict the probability p based on its target category. i and the overlap between the predicted bounding box and the ground truth bounding box u i Determine the level of difficulty d i ; The difficulty function satisfies: when p i Reduce or u i When d decreases i Increase; The difficulty level is calculated as follows: , In the formula, γ1, γ2 and k are adjustment parameters; Positive sample augmentation weights are determined based on the difficulty level. , In the formula, λ r The enhancement coefficient for difficult positive samples; Step S303: Calculate the recall enhancement classification loss The positive sample classification loss is multiplied by the positive sample enhancement weight, so that low-confidence difficult positive samples generate a larger gradient contribution during backpropagation. The enhanced classification loss for recall is expressed as: , In the formula, P represents the set of positive samples and N represents the set of negative samples; Step S304: Calculate the recall-weighted bounding box regression loss The bounding box regression loss is weighted according to the positive sample augmentation weights: , In the formula, B i To predict the bounding box, For the corresponding true bounding box, L RWIoU For bounding box regression loss based on intersection-union ratio, These are the normalized weights of the positive samples; By normalizing the weights, difficult positive samples are given relatively high optimized weights, while avoiding the loss of the overall scale from changing significantly with the number of positive samples. Step S305: Construct the joint loss function The recall-enhanced joint loss function, REJLoss, includes the recall-enhanced classification loss, the recall-weighted bounding box regression loss, and the distributed bounding box regression loss: , In the formula, λ box , λ cls and λ dfl These are the weight coefficients for classification loss, bounding box loss, and distributed regression loss, respectively. By using the joint loss function described above, the contribution of low-confidence, low-overlap, and partially occluded positive samples in model training is increased, reducing the number of cases where the model misjudges real targets as background.

[0024] The specific steps in step S4 are as follows: Step S401: Model Initialization Load the network parameters of the basic lightweight object detection model, or initialize RepAgri-YOLO with random parameters; For the newly added RepC2f, CAGU and DLWC modules, the convolution weights are set according to the initialization method of convolutional networks, and the learnable scalars in DLWC are set to the same initial value so that each input branch has similar weights in the initial stage of training. Step S402: Forward Propagation The preprocessed cotton field image is input into RepAgri-YOLO, and then passes through the backbone feature extraction network, the neck multi-scale feature fusion network and the detection head in sequence to obtain the category prediction results and bounding box prediction results of the three types of targets. Step S403: Loss Calculation and Backpropagation The REJLoss is calculated based on the model prediction results and the real labels, and the parameters of RepC2f, CAGU, DLWC and the detection head are updated through backpropagation. Step S404: Model Validation After completing a predetermined number of training rounds, the precision, recall, mean precision, and loss value are calculated using the validation set, and the optimal model parameters are selected according to the preset indicators. Step S405: Model reparameterization After the model training is completed, the parameters of the four convolution-batch normalization branches of RepConv_Agri are fused to obtain an equivalent 3×3 convolution kernel and an equivalent bias. Save the reparameterized model for validation, deployment, or real-time inference.

[0025] The specific steps in step S5 are as follows: Step S501: Acquire the image to be detected Images of the cotton field to be inspected are acquired using an image acquisition terminal; Step S502: Image preprocessing Adjust the image to be detected to the model input size, and perform pixel normalization and channel arrangement in the manner used in the training phase; Step S503: Target Prediction The preprocessed image is input into the reparameterized RepAgri-YOLO to obtain multiple candidate bounding boxes, object class probabilities, and confidence scores. Step S504: Candidate box filtering Low-confidence predicted boxes are filtered out based on the confidence threshold, and overlapping predicted boxes are processed by non-maximum suppression or other candidate box deduplication methods. Step S505: Output of detection results Output for each target: target category, bounding box coordinates, target confidence score, number of targets in each category, and spatial distribution of the target in the image; The boll opening rate is calculated based on the number of open cotton bolls and the total number of cotton bolls: , In the formula, N OCB To determine the number of open cotton bolls, N UCB This represents the number of cotton bolls that have not yet been opened.

[0026] In step S404, recall rate and average precision are preferably used as the main indicators, while precision rate, number of parameters and computational load are monitored at the same time.

[0027] In step S505, the detection results or boll opening rate are sent to the cotton field management terminal to display the cotton growth status or as input information to assist in decision-making regarding the timing of defoliant application.

[0028] like Figure 6 As shown, applying the above method, this method provides the following embodiments: Example 1: Detection of three types of fertility targets in complex cotton fields RGB images containing cotton flowers, unopened cotton bolls, and open cotton bolls were collected in a natural cotton field environment, and bounding boxes were annotated.

[0029] Using YOLOv8n as the basic detection model, RepC2f modules are set at the C2f feature extraction positions of the backbone network and the neck network; the nearest neighbor upsampling module in the top-down path of the neck network is replaced with the CAGU module; the corresponding direct Concat feature concatenation module is replaced with the DLWC module; and REJLoss is used to optimize the model during the training phase.

[0030] After the model is trained, the 3×3, 1×3, 3×1 and 1×1 convolution branches in RepConv_Agri are fused into a single 3×3 convolution to obtain the RepAgri-YOLO model for inference.

[0031] Test results show that:

[0032] Compared to YOLOv8n, RepAgri-YOLO with REJLoss improved recall from 0.55 to 0.64, mAP50 from 0.72 to 0.76, and computational cost from 8.1 GFLOPs to 6.9 GFLOPs.

[0033] Example 2: Detection of unopened cotton bolls In the overall test set, unopened cotton bolls have a high degree of visual similarity to leaves, branches, and shaded areas, making them a target category that is more likely to be missed.

[0034] The detection results of different models for unopened cotton bolls are as follows:

[0035] RepAgri-YOLO improved the recall rate of unopened bolls from 0.46 in YOLOv8n to 0.61, indicating that the present invention can improve the problem of missed detection when unopened bolls have low contrast with the background and are partially occluded.

[0036] Example 3: Imaging Perturbation Adaptability Test Tests were conducted using original cotton field images and enhanced images that included variations in lighting, shadows, blur, and noise disturbances.

[0037] RepAgri-YOLO achieved a recall and mAP50 of 0.66 and 0.78 on the original image test set, respectively, and a recall and mAP50 of 0.63 and 0.76 on the enhanced image test set, respectively, with a precision of 0.84 for both sets.

[0038] The above results demonstrate that the present invention has a certain adaptability to common field imaging disturbances.

[0039] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for detecting key growth stage targets in cotton fields, characterized in that, The method includes the following steps: Step S1: Data Acquisition and Preprocessing: Acquire natural cotton field images, identify three types of detection targets: cotton flowers, unopened cotton bolls, and open cotton bolls, and perform bounding box annotation. After data cleaning, divide the dataset and perform data augmentation and image preprocessing on the training set. Step S2: Construct the RepAgri-YOLO lightweight detection network: Based on the lightweight single-stage object detection network architecture, set up the RepC2f reparameterized convolution module, the CAGU content-aware gated upsampling module, and the DLWC dynamically learnable weighted concatenation module in the network; Step S3: Construct the recall enhancement joint loss function REJLoss: Calculate the sample difficulty based on the class prediction probability of positive samples and the overlap between the predicted box and the ground truth box, generate positive sample enhancement weights based on the difficulty, and construct a joint loss function that includes weighted classification loss, weighted bounding box regression loss and distributed bounding box regression loss. Step S4: Model Training and Reparameterization: The RepAgri-YOLO lightweight detection network is trained based on the cotton field dataset and the joint loss function REJLoss for recall enhancement. After training, the multi-branch convolution in the RepC2f reparameterized convolution module is reparameterized and fused to obtain the detection model for inference. Step S5: Model Inference and Result Output: Input the cotton field image to be detected into the detection model for inference. After preprocessing, forward propagation and candidate box filtering, output the category, location, confidence and quantity information of the three types of targets, and calculate the cotton field boll opening rate based on the detection quantity of open and closed cotton bolls.

2. The method for detecting key growth stage targets in cotton fields according to claim 1, characterized in that, The specific steps in step S1 are as follows: Step S101: Cotton field image acquisition Images of natural cotton fields are acquired using RGB image sensors mounted on agricultural robots, mobile inspection platforms, handheld devices, or fixed monitoring equipment. The image acquisition range covers at least the cotton flowering, boll-forming, and lint-opening stages, and includes one or more of the following imaging conditions: Front lighting, side lighting, backlighting, partial shadows, and uneven lighting conditions; Frontal view, overhead view, oblique view, and different shooting distances; Single target, partially occluded target, and densely distributed target; Plant branches and leaves, soil, weeds and other natural field background; Cotton flowers of different sizes, unopened cotton bolls, and open cotton bolls; Among them, the acquired images are associated with the corresponding acquisition time, land parcel information or equipment information in order to conduct data traceability and model testing; Step S102: Target Category Determination The cotton growth targets to be tested are divided into the following three categories: Cotton flowers are denoted as CF; unopened cotton bolls are denoted as UCB; and open cotton bolls are denoted as OCB. Among them, unopened cotton bolls include cotton bolls that have not yet opened and whose outer shells are basically intact, while open cotton bolls include cotton bolls whose cotton fibers have been partially or completely exposed. Step S103: Target Labeling Rectangular bounding boxes were used to label cotton flowers, unopened cotton bolls, and open cotton bolls in the acquired images. Each labeled target should include at least: target category; bounding box center coordinates; bounding box width and height; and corresponding image label; For partially occluded targets, when the visible area can determine the target category and main location, they are labeled according to the visible outline or the estimated range of the complete target, and a unified labeling rule is used in all data. Step S104: Data Cleaning Delete or correct images or labels that fall under the following categories: severely out of focus, making the target unidentifiable; image damaged or abnormally exposed; target category incorrectly labeled; bounding box significantly deviating from the target; the same target being labeled repeatedly; the labeled target not belonging to one of the three preset target categories. Step S105: Dataset partitioning The cleaned images are divided into training set, validation set and test set; Furthermore, the same original image and its augmented image are assigned to the same subset of data, or online data augmentation is performed only on the training set, in order to avoid data leakage caused by the same image content entering both the training and test sets at the same time; Step S106: Image Enhancement and Preprocessing During the training phase, one or more data augmentation operations are performed on the image, including: horizontal flipping; random scaling and cropping; brightness, contrast, or color perturbation; shadow simulation; blurring; noise addition; image stitching or blending enhancement; In this process, the enhanced image is scaled to the input size required by the detection network and pixel normalized, while the label bounding box is updated synchronously according to the image geometric transformation.

3. The method for detecting key growth stage targets in cotton fields according to claim 2, characterized in that, The specific steps in step S2 are as follows: Step S201: Construct the RepC2f reparameterized convolution module The RepC2f reparameterized convolutional module is obtained by replacing the regular Bottleneck inside the base network C2f module with RepAgriBottleneck. The input features are first processed by 1×1 convolution to adjust the channels, and then divided into the first feature branch and the second feature branch along the channel dimension. The first feature branch is retained and directly participates in subsequent fusion. The second feature branch passes through at least one RepAgriBottleneck in sequence. The output of each RepAgriBottleneck is concatenated with the first feature branch, and then channel fusion is completed through 1×1 convolution to obtain the RepC2f output features. RepAgriBottleneck includes a 1×1 convolution and an agricultural scene reparameterized convolution RepConv_Agri. When the number of input channels and output channels of RepAgriBottleneck are the same and shortcut connections are enabled, the input features are added to the convolution output as residuals. Step S202: Construct the RepConv_Agri training structure RepConv_Agri includes the following four parallel convolution-batch normalization branches during the training phase: 3×3 convolution branch, 1×3 convolution branch, 3×1 convolution branch, and 1×1 convolution branch; Among them, the 3×3 convolution branch is used to extract the local spatial features of the target; the 1×3 convolution branch is used to enhance the horizontal features; the 3×1 convolution branch is used to enhance the vertical features; and the 1×1 convolution branch is used to complete the channel information transformation. Let the input feature be X, and the output feature be Y. Then the output of Y during the training phase is: , In the formula, W k For the convolution kernel of the k-th branch, BN k For the batch normalization of the k-th branch, Φ represents the SiLU activation function; Step S203: Perform convolution and batch normalization fusion. No convolutional bias is set for each convolutional branch. For the k-th convolutional branch, the equivalent weights and equivalent biases after fusing the convolutional kernel with the batch normalized parameters are as follows: , , In the formula, μ k and These are the batch-normalized moving mean and variance, γ, respectively. k and β k Here, ϵ represents the scaling and translation parameters, and ϵ is the stability constant. Step S204: Construct equivalent convolution kernels for the inference stage Expand the 1×3, 3×1, and 1×1 convolutional kernels into 3×3 convolutional kernels by zero-padding, and sum the equivalent weights and biases of each branch to obtain: , , The output of the verification or inference phase is: ; Step S205: Construct the CAGU content-aware gating upsampling module Replace at least one fixed upsampling module in the neck of the basic network with a CAGU content-aware gated upsampling module; The CAGU content-aware gated upsampling module includes a bilinear upsampling branch and a spatial gated branch; For input features F in The spatially gated branch generates a single-channel spatial weight map by sequentially passing it through 3×3 convolution, batch normalization, SiLU activation, and 1×1 convolution: , In the formula, σ and Φ represent the Sigmoid and SiLU functions, respectively. The input features and the spatial gating map are bilinearly upsampled using the same target size, resulting in: , In the formula, UP(·) represents bilinear upsampling, and ⊙ represents element-wise multiplication; Step S206: Construct the DLWC dynamically learnable weighted splicing module Replace at least one direct channel stitching module in the neck of the basic network with a DLWC dynamically learnable weighted stitching module; Let the first input feature to be fused and the second input feature be F1 and F2, respectively, and the corresponding learnable scalar parameters be w1 and w2, respectively. First, nonnegativity constraints and normalization are applied to the learnable scalar: , In the formula, α i Let ε be the normalized fusion weight for the i-th feature branch, and ϵ be a stability constant. The two input features are weighted separately and then concatenated along the channel dimension. , The first input feature and the second input feature have the same spatial dimensions before splicing; Step S207: Construct a multi-scale detection head The detection head inputs features of different scales processed by RepC2f, CAGU, and DLWC, and outputs the following respectively: the class confidence and bounding box parameters of cotton flowers; the class confidence and bounding box parameters of unopened cotton bolls; and the class confidence and bounding box parameters of open cotton bolls. The output of the detection head includes at least the target category probability, the center position of the bounding box, the width of the bounding box, and the height of the bounding box.

4. The method for detecting key growth stage targets in cotton fields according to claim 3, characterized in that, The specific steps in step S3 are as follows: Step S301: Determine positive and negative samples Samples are assigned based on the positional relationship, class matching relationship, and degree of overlap between the predicted bounding boxes and the ground truth bounding boxes to obtain a positive sample set and a negative sample set. Positive samples that match the real target but have low prediction confidence, low overlap of prediction bounding boxes, or small visible target area are identified as difficult positive samples. Step S302: Calculate the difficulty of positive samples For the i-th positive sample, predict the probability p based on its target category. i and the overlap between the predicted bounding box and the ground truth bounding box u i Determine the level of difficulty d i ; The difficulty function satisfies: when p i Reduce or u i When d decreases i Increase; The difficulty level is calculated as follows: , In the formula, γ1, γ2 and k are adjustment parameters; Positive sample augmentation weights are determined based on the difficulty level. , In the formula, λ r The enhancement coefficient for difficult positive samples; Step S303: Calculate the recall enhancement classification loss The positive sample classification loss is multiplied by the positive sample enhancement weight, so that low-confidence difficult positive samples generate a larger gradient contribution during backpropagation. The enhanced classification loss for recall is expressed as: , In the formula, P represents the set of positive samples and N represents the set of negative samples; Step S304: Calculate the recall-weighted bounding box regression loss The bounding box regression loss is weighted according to the positive sample augmentation weights: , In the formula, B i To predict the bounding box, For the corresponding true bounding box, L RWIoU For bounding box regression loss based on intersection-union ratio, These are the normalized weights of the positive samples; Step S305: Construct the joint loss function The recall-enhanced joint loss function, REJLoss, includes the recall-enhanced classification loss, the recall-weighted bounding box regression loss, and the distributed bounding box regression loss: , In the formula, λ box , λ cls and λ dfl These are the weight coefficients for classification loss, bounding box loss, and distributed regression loss, respectively.

5. The method for detecting key growth stage targets in cotton fields according to claim 4, characterized in that, The specific steps in step S4 are as follows: Step S401: Model Initialization Load the network parameters of the basic lightweight object detection model, or initialize RepAgri-YOLO with random parameters; For the newly added RepC2f, CAGU and DLWC modules, the convolution weights are set according to the initialization method of convolutional networks, and the learnable scalars in DLWC are set to the same initial value so that each input branch has similar weights in the initial stage of training. Step S402: Forward Propagation The preprocessed cotton field image is input into RepAgri-YOLO, and then passes through the backbone feature extraction network, the neck multi-scale feature fusion network and the detection head in sequence to obtain the category prediction results and bounding box prediction results of the three types of targets. Step S403: Loss Calculation and Backpropagation The REJLoss is calculated based on the model prediction results and the real labels, and the parameters of RepC2f, CAGU, DLWC and the detection head are updated through backpropagation. Step S404: Model Validation After completing a predetermined number of training rounds, the precision, recall, mean precision, and loss value are calculated using the validation set, and the optimal model parameters are selected according to the preset indicators. Step S405: Model reparameterization After the model training is completed, the parameters of the four convolution-batch normalization branches of RepConv_Agri are fused to obtain an equivalent 3×3 convolution kernel and an equivalent bias. Save the reparameterized model for validation, deployment, or real-time inference.

6. The method for detecting key growth stage targets in cotton fields according to claim 5, characterized in that, The specific steps in step S5 are as follows: Step S501: Acquire the image to be detected Images of the cotton field to be inspected are acquired using an image acquisition terminal; Step S502: Image preprocessing Adjust the image to be detected to the model input size, and perform pixel normalization and channel arrangement in the manner used in the training phase; Step S503: Target Prediction The preprocessed image is input into the reparameterized RepAgri-YOLO to obtain multiple candidate bounding boxes, object class probabilities, and confidence scores. Step S504: Candidate box filtering Low-confidence predicted boxes are filtered out based on the confidence threshold, and overlapping predicted boxes are processed by non-maximum suppression or other candidate box deduplication methods. Step S505: Output of detection results Output for each target: target category, bounding box coordinates, target confidence score, number of targets in each category, and spatial distribution of the target in the image; The boll opening rate is calculated based on the number of open cotton bolls and the total number of cotton bolls: , In the formula, N OCB To determine the number of open cotton bolls, N UCB This represents the number of cotton bolls that have not yet been opened.

7. The method for detecting key growth stage targets in cotton fields according to claim 6, characterized in that, In step S404, recall rate and average precision are preferably used as the main indicators, while precision rate, number of parameters and computational load are monitored at the same time.

8. The method for detecting key growth stage targets in cotton fields according to claim 6, characterized in that, In step S505, the detection results or boll opening rate are sent to the cotton field management terminal to display the cotton growth status or as input information to assist in decision-making regarding the timing of defoliant application.