A target detection method and system with inter-class ordered constraints

By combining the ResNet-18 backbone network and Hinge loss module with the RT-DETR-R18, the problem of classifying agricultural product maturity is solved, the classification accuracy and robustness are improved, and it is suitable for real-time agricultural detection.

CN122115834APending Publication Date: 2026-05-29HUIZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUIZHOU UNIV
Filing Date
2026-03-11
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing target detection methods struggle to accurately distinguish between adjacent maturity categories in agricultural product maturity grading, and fail to effectively utilize the ordered relationships between categories, resulting in limited classification accuracy and further complicating the problem of sample imbalance.

Method used

The RT-DETR-R18-based detection framework is adopted, combined with the ResNet-18 backbone network. The dimensionality is reduced to scalar projection values ​​through one-dimensional projection, the category feature centers are calculated, and the inter-class ordered loss module in Hinge form is used to penalize the feature centers of adjacent maturity categories. A multi-branch loss structure is constructed for training.

Benefits of technology

It significantly improves the classification accuracy of ordered categories, enhances robustness to samples with blurred boundaries, alleviates the sample imbalance problem, and maintains real-time detection capabilities, making it suitable for agricultural automation scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122115834A_ABST
    Figure CN122115834A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of target detection, and discloses a target detection method and system with inter-class ordered constraint, which comprises the following steps: taking an RT-DETR-R18 as a basic detection framework, adopting a ResNet-18 as a backbone network to extract image features, and constructing a basic detection frame; performing one-dimensional projection dimension reduction on high-dimensional features to obtain scalar projection values, and calculating corresponding class feature centers based on projection values of each maturity class sample; constructing an inter-class ordered constraint loss module, adopting a Hinge form to punish and constrain the difference value of adjacent maturity class feature centers, ensuring that the inter-class feature distance meets a preset interval threshold, and generating an inter-class ordered loss; building a multi-branch loss structure; fusing a conventional detection loss and the inter-class ordered loss to obtain a total loss, completing model training, realizing ordered detection of litchi maturity, and improving the performance and reliability of the model in actual application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, specifically to a target detection method and system with inter-class ordered constraints. Background Technology

[0002] In agricultural target detection tasks such as grading the maturity of agricultural products, detection models need to accurately distinguish between categories with sequential relationships, such as "unripe, semi-ripe, ripe, and overripe." Mainstream target detection methods, such as RT-DETR, the YOLO series, and Faster R-CNN, are typically trained using a combination of classification loss (e.g., cross-entropy loss) and bounding box regression loss (e.g., L1, GIoU loss). RT-DETR, as a Transformer-based real-time detection model, achieves classification and bounding box regression by leveraging multiple sets of query features from the decoder, striking a good balance between accuracy and real-time performance, thus meeting the real-time requirements of agricultural detection. Meanwhile, the inter-class loss function based on sample pair similarity optimization proposed by Sun et al. in 2020 strengthens the modeling of category differences by constraining intra-class and inter-class distances. It is commonly used in metric learning and fine-grained classification, and can provide an improvement approach for fine-grained, ordered category detection tasks such as agricultural products.

[0003] In the task of detecting the maturity of litchi, current methods suffer from three main technical shortcomings: First, the visual differences between adjacent maturity categories are small and the boundaries are blurred, making it difficult for the model to distinguish them accurately; second, the distribution of sample numbers at different maturity stages is uneven, with some stages having fewer samples, causing training bias in the model; and third, existing detection models treat maturity categories as independent labels, failing to effectively utilize their natural sequential relationships, resulting in limited classification accuracy. The root cause is that traditional cross-entropy loss only focuses on classification correctness and cannot model the ordered relationships between categories, and it lacks explicit constraints on the feature distance between classes, resulting in insufficient class discrimination in the feature space. At the same time, the imbalanced sample problem further increases the difficulty of classification, while existing inter-class loss methods, although able to optimize inter-class relationships, do not consider the ordered nature of categories and cannot directly adapt to the ordered classification scenario of litchi maturity grading. Summary of the Invention

[0004] Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a target detection method and system with inter-class ordered constraints. While maintaining the real-time detection advantages of RT-DETR, it systematically solves core problems such as boundary ambiguity and sample imbalance in ordered category classification through a lightweight inter-class ordered module, significantly improving the model's performance and reliability in practical applications.

[0005] (II) Technical Solution To achieve the above objectives, the present invention provides the following technical solution: a target detection method with inter-class ordered constraints, comprising: Step 1: Based on the RT-DETR-R18 detection framework, ResNet-18 is used as the backbone network to extract image features and construct the basic detection box; Step 2: Reduce the dimensionality of the high-dimensional features output by the decoder to scalar projection values ​​using one-dimensional projection, and calculate the corresponding category feature centers based on the projection values ​​of samples from each maturity category. ; Step 3: Construct an inter-class ordered constraint loss module based on the class feature centers obtained in Step 2. A Hinge-like approach is used to penalize the difference in feature centers between adjacent maturity categories, ensuring that the feature distance between classes meets a preset interval threshold. Generate inter-class ordered loss ; Step 4: Construct a multi-branch loss structure. The detection branch calculates the conventional detection loss based on the original detection head. The ordered branching method calculates the inter-class ordered loss based on the ordered constraint loss module. ; Step 5: Perform routine inspections to assess the loss. Inter-class ordered loss The total loss is obtained by merging. The model was trained to achieve orderly detection of litchi maturity.

[0006] Preferably, step one includes: S1.1 Select RT-DETR-R18 as the basic detection framework; S1.2 Load and initialize the ResNet-18 backbone network, and extract the shallow and deep visual features of the lychee image; S1.3 Build the RT-DETR encoder structure and perform sequence encoding and global feature modeling on the visual features output by the backbone network; S1.4 Configure decoder parameters and set the query count. With feature dimension This makes the decoder output High-dimensional detection features.

[0007] Preferably, step two includes: S2.1, the decoder output High-dimensional detection features are subjected to one-dimensional linear projection, transforming single sample features Convert to scalar projection value ; S2.2. Based on the actual labels of lychee maturity, the scalar projection values ​​are grouped into categories. The formula expression is as follows: ; in, Represents maturity category The corresponding set of all scalar projection values, , This represents the total number of maturity categories; Represents the true label; S2.3, Traverse each maturity category Calculate the arithmetic mean of all scalar projection values ​​for this category; S2.4. Use the calculated arithmetic mean as the feature center of the corresponding category. Complete the initialization and updating of all category centers.

[0008] Preferably, in S2.1, the scalar projection value The formula expression is: ; in, Represents the projected weights; Represents bias.

[0009] Preferably, in S2.4, The formula expression is: ; in, Representative category The number of samples.

[0010] Preferably, step three includes: S3.1, Based on maturity category To determine the natural order of lychee maturity and clarify the correspondence between adjacent maturity categories, the formula expression is: ; S3.2 Select Hinge form as the calculation rule for inter-class ordering loss and set a preset interval threshold. , This represents a hyperparameter used to control the minimum distance between adjacent class feature centers; S3.3, Based on the feature centers of each category calculated in step two Iterate through all adjacent category pairs , Calculate the difference between the feature centers of adjacent categories. Determine whether the minimum interval requirement is met; S3.4. Penalize the difference of adjacent class centers that do not satisfy the margin constraint, and construct a Hinge-form inter-class ordered loss. The formula expression is: ; in, This represents the total number of categories representing the maturity level of lychees; Representing the Feature centers of each category; Representing the Feature centers for each category.

[0011] Preferably, in S3.3, the difference The calculation formula is: ; in, Representing the Feature centers for each maturity category; Representing the Feature centers for each maturity category; The rule for determining whether the minimum interval requirement is met is as follows: when When, it means the interval constraint is not satisfied; when When the interval constraint is satisfied, it means that the interval constraint is met.

[0012] Preferably, step four includes: S4.1, the decoder output from step one High-dimensional detection features are processed in parallel through two paths: a detection branch and an ordered branch. S4.2 The detection branch inputs the features into the RT-DETR-R18 original detection head to complete the litchi target classification and bounding box regression, and obtains the conventional detection loss. ; S4.3 The ordered branch inputs the features into the ordered constraint loss module, and sequentially performs one-dimensional projection, category feature center calculation and inter-class distance constraint; S4.4. Based on the Hinge loss form from step three, complete the inter-class ordered loss in the ordered branches. Calculation; S4.5, Output the conventional detection loss respectively. Inter-class ordered loss .

[0013] Preferably, in step five, the total loss The formula expression is: ; in, Represents the balance factor.

[0014] A target detection system with inter-class ordered constraints is applied to a target detection method with inter-class ordered constraints, including a basic detection framework module, an inter-class ordered feature module, an inter-class ordered constraint module, a multi-branch parallel computing module, and a loss fusion optimization module. The basic detection framework module is used to use RT-DETR-R18 as the basic detection framework, extract image features using ResNet-18, and output high-dimensional detection features by the decoder after being processed by the encoder. The inter-class ordered feature module is used to receive the high-dimensional detection features output by the decoder, reduce the dimensionality to scalar projection values ​​through one-dimensional projection, and calculate the feature centers of each litchi maturity category. ; The inter-class ordering constraint module is used to calculate the penalty loss of adjacent class feature centers using Hinge form, and generate the inter-class ordering loss. ; The multi-branch parallel computing module is used to divide the features into two parallel processing paths. The loss fusion optimization module is used to incorporate the loss from conventional detection. Inter-class ordered loss The total loss is obtained by merging. Complete model training.

[0015] A target detection method and system with inter-class ordered constraints includes the following steps:

[0016] Compared with the prior art, the present invention provides a target detection method and system with inter-class ordered constraints, which has the following beneficial effects: 1. Significantly improves the accuracy of ordered category classification: For categories with natural sequential relationships, such as lychee ripeness, this invention explicitly constrains the distance between the feature centers of adjacent categories through an inter-class ordered module, thereby forcing the model to widen the distribution interval between adjacent categories in the feature space, which significantly improves the model's classification accuracy for ordered categories. 2. Enhance robustness to samples with blurred boundaries: For samples in the maturity transition stage, their visual feature differences are minimal. This invention uses global class center constraints to make the model focus more on the overall distribution of categories rather than individual details, thereby improving the robustness of distinguishing fuzzy samples. 3. Alleviate the problem of class imbalance in samples: In the litchi maturity dataset, some categories have fewer samples, which can easily lead to the model biasing towards the majority class. This invention provides a clear optimization objective for the minority classes through class center calculation and ordered loss, allowing their feature centers to be effectively adjusted, thereby improving the classification performance of the minority classes. 4. Maintain real-time detection capabilities: The inter-class ordered module consists of only a simple linear projection layer and mean calculation, with minimal computational overhead. It is executed in parallel with the original detection head and does not increase model inference latency, making it suitable for real-time scenarios such as agricultural automation. 5. To address the shortcomings of existing inter-class loss methods: Compared to general inter-class loss, this invention is specifically designed for ordered categories, directly modeling the geometric relationships between adjacent categories, which is more in line with the essential needs of tasks such as maturity grading. Attached Figure Description

[0017] Figure 1 This is a diagram illustrating the steps of the method of the present invention; Figure 2 This is a schematic diagram of the system flow of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It is worth noting that this application also relates to prior art. Since prior art is well known to those skilled in the art, it will not be described in detail in this application.

[0019] Please see Figures 1-2 A target detection method with inter-class order constraints, comprising: Step 1: Based on the RT-DETR-R18 detection framework, ResNet-18 is used as the backbone network to extract image features and construct the basic detection box, specifically including: S1.1 Select RT-DETR-R18 as the basic detection framework; S1.2 Load and initialize the ResNet-18 backbone network, and extract the shallow and deep visual features of the lychee image; S1.3 Build the RT-DETR encoder structure and perform sequence encoding and global feature modeling on the visual features output by the backbone network; S1.4 Configure decoder parameters and set the query count. With feature dimension This makes the decoder output High-dimensional detection features; Step one establishes a basic architecture for orderly detection of lychee maturity, providing high-quality, multi-dimensional visual feature support for the entire model. Specifically, it leverages the efficient detection capabilities of RT-DETR-R18 and the feature extraction advantages of ResNet-18 to accurately extract both shallow texture and deep semantic features from lychee images. Furthermore, through the collaborative work of the encoder and decoder, it outputs high-dimensional features that meet the requirements of subsequent processing, laying a solid foundation for subsequent orderly classification of maturity and constraint loss calculation. At the same time, it ensures the basic detection accuracy of the model and avoids detection errors caused by insufficient feature quality. Step 2: Reduce the dimensionality of the high-dimensional features output by the decoder to scalar projection values ​​using one-dimensional projection, and calculate the corresponding category feature centers based on the projection values ​​of samples from each maturity category. Specifically, it includes: S2.1, the decoder output High-dimensional detection features are subjected to one-dimensional linear projection, transforming single sample features Convert to scalar projection value The formula expression is: ; in, Represents the projected weights; Represents bias; S2.2. Based on the actual labels of lychee maturity, the scalar projection values ​​are grouped into categories. The formula expression is as follows: ; in, Represents maturity category The corresponding set of all scalar projection values, , This represents the total number of maturity categories; Represents the true label; S2.3, Traverse each maturity category Calculate the arithmetic mean of all scalar projection values ​​for this category; S2.4. Use the calculated arithmetic mean as the feature center of the corresponding category. Complete the initialization and updating of all category centers; the formula expression is: ; in, Representative category The number of samples; Step two establishes a correspondence between maturity categories and features by transforming high-dimensional detection features into measurable and groupable ordered feature representations. Specifically, this involves: simplifying feature dimensions through one-dimensional projection to reduce subsequent computational complexity; and grouping categories with feature centers. The calculation aggregates the scattered sample features into category-level features, clearly distinguishes the feature differences of different maturity categories, and provides a clear calculation carrier for the inter-class ordering constraints in step three, ensuring that the calculation of ordering loss is more targeted and reasonable. Step 3: Construct an inter-class ordered constraint loss module based on the class feature centers obtained in Step 2. A Hinge-like approach is used to penalize the difference in feature centers between adjacent maturity categories, ensuring that the feature distance between classes meets a preset interval threshold. Generate inter-class ordered loss Specifically, it includes: S3.1, Based on maturity category To determine the natural order of lychee maturity and clarify the correspondence between adjacent maturity categories, the formula expression is: ; S3.2 Select Hinge form as the calculation rule for inter-class ordering loss and set a preset interval threshold. , This represents a hyperparameter used to control the minimum distance between adjacent class feature centers; S3.3, Based on the feature centers of each category calculated in step two Iterate through all adjacent category pairs , Calculate the difference between the feature centers of adjacent categories. Determine whether the minimum interval requirement is met, and the difference. The calculation formula is: ; in, Representing the Feature centers for each maturity category; Representing the Feature centers for each maturity category; The rule for determining whether the minimum interval requirement is met is as follows: when When, it means the interval constraint is not satisfied; when When this occurs, it means the interval constraint is satisfied; S3.4. Penalize the difference of adjacent class centers that do not satisfy the margin constraint, and construct a Hinge-form inter-class ordered loss. The formula expression is: ; in, This represents the total number of categories representing the maturity level of lychees; Representing the Feature centers of each category; Representing the Feature centers of each category; Step three establishes an inter-class order constraint mechanism to standardize the feature distribution of different maturity categories. Specifically, it applies a spacing constraint to the feature centers of adjacent maturity categories using Hinge loss, forcing the model to learn feature patterns that conform to the natural order of lychee maturity. This effectively avoids confusion between maturity categories and significantly improves the model's ability to identify ordered relationships between maturity levels. Simultaneously, it uses a preset spacing threshold... This enhances the model's ability to distinguish between different maturity levels, further improving the accuracy and robustness of ordered detection; Step 4: Construct a multi-branch loss structure. The detection branch calculates the conventional detection loss based on the original detection head. The ordered branching method calculates the inter-class ordered loss based on the ordered constraint loss module. Specifically, it includes: S4.1, the decoder output from step one High-dimensional detection features are processed in parallel through two paths: a detection branch and an ordered branch. S4.2 The detection branch inputs the features into the RT-DETR-R18 original detection head to complete the litchi target classification and bounding box regression, and obtains the conventional detection loss. ; S4.3 The ordered branch inputs the features into the ordered constraint loss module, and sequentially performs one-dimensional projection, category feature center calculation and inter-class distance constraint; S4.4. Based on the Hinge loss form from step three, complete the inter-class ordered loss in the ordered branches. Calculation; S4.5, Output the conventional detection loss respectively. Inter-class ordered loss ; Step four achieves decoupled parallel optimization of the detection task and the ordered constraint task, taking into account both the detection accuracy and ordered performance of the model. Specifically, the dual-branch structure enables the detection branch and the ordered branch to work independently and without interference. The detection branch ensures the accurate localization and basic classification of the litchi target, while the ordered branch is dedicated to optimizing the ordered relationship of maturity. This avoids the drawback of a single loss function being unable to take into account both tasks, and allows the two tasks to be optimized independently, improving the overall performance of the model. At the same time, it provides an independent and reliable loss output for the subsequent total loss fusion. Step 5: Perform routine inspections to assess the loss. Inter-class ordered loss The total loss is obtained by merging. Complete model training to achieve orderly detection of litchi maturity, total loss The formula expression is: ; in, Represents the balance factor; Step five achieves end-to-end training and overall performance optimization of the model, completing the final goal of ordered detection of litchi maturity. Specifically, by flexibly adjusting the weights of detection loss and ordered constraint loss through the balancing factor λord, the model's target detection accuracy and maturity ordered reasoning ability are effectively balanced, avoiding excessive weighting of any one loss factor that could cause the model to deviate. By backpropagating the total loss to update all model parameters, the integrated optimization of basic detection and ordered constraints is achieved, ultimately enabling the model to accurately locate litchi targets, classify maturity, and determine order, meeting the detection needs of practical applications. The above-mentioned target detection method with inter-class ordered constraints, the application system includes: a basic detection framework module, an inter-class ordered feature module, an inter-class ordered constraint module, a multi-branch parallel computing module, and a loss fusion optimization module; The basic detection framework module is used to use RT-DETR-R18 as the basic detection framework, extracts image features using ResNet-18, and outputs high-dimensional detection features by the decoder after being processed by the encoder. The inter-class ordered feature module receives the high-dimensional detection features output by the decoder, reduces the dimensionality to scalar projection values ​​through one-dimensional projection, and calculates the feature centers for each litchi maturity category. ; The inter-class ordered constraint module is used to calculate the penalty loss of adjacent class feature centers using Hinge form, generating the inter-class ordered loss. ; The multi-branch parallel computing module is used to divide the features into two parallel processing paths; The loss fusion optimization module is used to integrate the losses from conventional detection. Inter-class ordered loss The total loss is obtained by merging. Complete model training.

[0020] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A target detection method with inter-class order constraints, characterized in that, include: Step 1: Based on the RT-DETR-R18 detection framework, ResNet-18 is used as the backbone network to extract image features and construct the basic detection box; Step 2: Reduce the dimensionality of the high-dimensional features output by the decoder to scalar projection values ​​using one-dimensional projection, and calculate the corresponding category feature centers based on the projection values ​​of samples from each maturity category. ; Step 3: Construct an inter-class ordered constraint loss module based on the class feature centers obtained in Step 2. A Hinge-like approach is used to penalize the difference in feature centers between adjacent maturity categories, ensuring that the feature distance between classes meets a preset interval threshold. Generate inter-class ordered loss ; Step 4: Construct a multi-branch loss structure. The detection branch calculates the conventional detection loss based on the original detection head. The ordered branching method calculates the inter-class ordered loss based on the ordered constraint loss module. ; Step 5: Perform routine inspections to assess the loss. Inter-class ordered loss The total loss is obtained by merging. The model was trained to achieve orderly detection of litchi maturity.

2. The target detection method with inter-class ordered constraints according to claim 1, characterized in that, Step one includes: S1.1 Select RT-DETR-R18 as the basic detection framework; S1.2 Load and initialize the ResNet-18 backbone network, and extract the shallow and deep visual features of the lychee image; S1.3 Build the RT-DETR encoder structure and perform sequence encoding and global feature modeling on the visual features output by the backbone network; S1.4 Configure decoder parameters and set the query count. With feature dimension This makes the decoder output High-dimensional detection features.

3. The target detection method with inter-class ordered constraints according to claim 1, characterized in that, Step two includes: S2.1, the decoder output High-dimensional detection features are subjected to one-dimensional linear projection, transforming single sample features Convert to scalar projection value ; S2.

2. Based on the actual labels of lychee maturity, the scalar projection values ​​are grouped into categories. The formula expression is as follows: ; in, Represents maturity category The corresponding set of all scalar projection values, , This represents the total number of maturity categories; Represents the true label; S2.3, Traverse each maturity category Calculate the arithmetic mean of all scalar projection values ​​for this category; S2.

4. Use the calculated arithmetic mean as the feature center of the corresponding category. Complete the initialization and updating of all category centers.

4. The target detection method with inter-class ordered constraints according to claim 3, characterized in that, In S2.1, the scalar projection value The formula expression is: ; in, Represents the projected weights; Represents bias.

5. The target detection method with inter-class ordered constraints according to claim 3, characterized in that, In S2.4, The formula expression is: ; in, Representative category The number of samples.

6. The target detection method with inter-class ordered constraints according to claim 3, characterized in that, Step three includes: S3.1, Based on maturity category To determine the natural order of lychee maturity and clarify the correspondence between adjacent maturity categories, the formula expression is: ; S3.2 Select Hinge form as the calculation rule for inter-class ordering loss and set a preset interval threshold. , This represents a hyperparameter used to control the minimum distance between adjacent class feature centers; S3.3, Based on the feature centers of each category calculated in step two Iterate through all adjacent category pairs , Calculate the difference between the feature centers of adjacent categories. Determine whether the minimum interval requirement is met; S3.

4. Penalize the difference of adjacent class centers that do not satisfy the margin constraint, and construct a Hinge-form inter-class ordered loss. The formula expression is: ; in, This represents the total number of categories representing the maturity level of lychees; Representing the Feature centers of each category; Representing the Feature centers for each category.

7. The target detection method with inter-class ordered constraints according to claim 6, characterized in that, In S3.3, the difference The calculation formula is: ; in, Representing the Feature centers for each maturity category; Representing the Feature centers for each maturity category; The rule for determining whether the minimum interval requirement is met is as follows: when When, it means the interval constraint is not satisfied; when When the interval constraint is satisfied, it means that the interval constraint is met.

8. The target detection method with inter-class ordered constraints according to claim 1, characterized in that, Step four includes: S4.1, the decoder output from step one High-dimensional detection features are processed in parallel through two paths: a detection branch and an ordered branch. S4.2 The detection branch inputs the features into the RT-DETR-R18 original detection head to complete the litchi target classification and bounding box regression, and obtains the conventional detection loss. ; S4.3 The ordered branch inputs the features into the ordered constraint loss module, and sequentially performs one-dimensional projection, category feature center calculation and inter-class distance constraint; S4.

4. Based on the Hinge loss form from step three, complete the inter-class ordered loss in the ordered branches. Calculation; S4.5, Output the conventional detection loss respectively. Inter-class ordered loss .

9. The target detection method with inter-class ordered constraints according to claim 8, characterized in that, In step five, the total loss The formula expression is: ; in, Represents the balance factor.

10. A target detection system with inter-class ordered constraints, applied to the target detection method with inter-class ordered constraints as described in any one of claims 1 to 9, characterized in that, It includes a basic detection framework module, an inter-class ordered feature module, an inter-class ordered constraint module, a multi-branch parallel computing module, and a loss fusion optimization module; The basic detection framework module is used to use RT-DETR-R18 as the basic detection framework, extract image features using ResNet-18, and output high-dimensional detection features by the decoder after being processed by the encoder. The inter-class ordered feature module is used to receive the high-dimensional detection features output by the decoder, reduce the dimensionality to scalar projection values ​​through one-dimensional projection, and calculate the feature centers of each litchi maturity category. ; The inter-class ordering constraint module is used to calculate the penalty loss of adjacent class feature centers using Hinge form, and generate the inter-class ordering loss. ; The multi-branch parallel computing module is used to divide the features into two parallel processing paths. The loss fusion optimization module is used to incorporate the loss from conventional detection. Inter-class ordered loss The total loss is obtained by merging. Complete model training.