A detection-attribute decoupling system for fruit ripeness recognition
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU UNIV
- Filing Date
- 2026-06-05
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]为了解决上述问题,本发明的目的是提供一种面向果实成熟度识别的检测-属性解耦系统,旨在解决现有成熟度识别方法中目标定位与成熟度属性判断耦合、转色阶段识别不稳定、两阶段crop分类部署开销较高以及端到端评价口径不一致的问题
本发明降低了定位与属性判断耦合,检测器只负责单类目标定位,成熟度估计分支独立处理实例属性,有助于减少成熟度类别对检测头定位学习的干扰。
Smart Images

Figure CN122531005A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, mainly to the fields of agricultural visual recognition, target detection, instance-level attribute classification and lightweight edge deployment technology, and specifically to a detection-attribute decoupling system for fruit maturity recognition. Background Technology
[0002] Currently, intelligent strawberry maturity recognition employs various technical solutions, including deep learning-integrated detection, spectral hardware detection, color feature-based hierarchical recognition, and single-class target detection. Most mainstream solutions couple fruit location with maturity determination, leading to mutual interference between location deviations and maturity recognition errors in field scenarios with fruit occlusion, color gradations, and complex lighting conditions, resulting in insufficient accuracy. Spectral detection solutions are costly in hardware and lack versatility; reliance on color and shape for judgment is susceptible to environmental interference; and conventional two-stage recognition methods involve high computational demands and are difficult to deploy.
[0003] Meanwhile, existing technologies have not achieved a purely visual, lightweight, and separate recognition architecture. They lack a complete process for independent localization of single-type targets, multi-scale feature alignment extraction, and exclusive maturity branch determination. They also lack supporting technologies such as annotation conversion, threshold optimization, and effect evaluation. As a result, they cannot balance low cost, high speed, and high recognition accuracy, making it difficult to meet the real-time and lightweight deployment requirements of field harvesting robots. Summary of the Invention
[0004] To address the aforementioned issues, the present invention aims to provide a detection-attribute decoupling system for fruit maturity identification, which addresses the problems of coupling target localization and maturity attribute judgment, unstable identification during the color change stage, high deployment overhead of two-stage crop classification, and inconsistent end-to-end evaluation criteria in existing maturity identification methods.
[0005] To achieve the above technical objectives, this application provides a detection-attribute decoupling system for fruit maturity identification, comprising: The label decoupling and training data construction module is used to parse the original annotations, convert polygons into bounding boxes, unify ripe, turning, and unripe into strawberry single-class detection labels, and retain the original maturity categories as attribute labels to construct the dataset; The single-class object detection module uses the YOLO26n detector and interacts with the label decoupling and training data construction module to obtain object candidate boxes using the detector. The multi-scale feature extraction and ROI alignment module is used to extract intermediate feature maps at least two scales from the forward process of the detector, and map the candidate box coordinates to the coordinate systems of the intermediate feature maps at the two scales respectively. ROI-Align is performed at the two scales respectively and the maps are concatenated by channel dimension to form the multi-scale instance features corresponding to each target instance. The maturity estimation branch module MEB uses a lightweight instance classification network CNN to obtain the probability that a target belongs to each maturity category based on multi-scale instance features. The threshold calibration and matching evaluation module is used to select the detection confidence threshold on the validation set and evaluate the end-to-end maturity recognition performance based on the matching relationship between the predicted box and the ground truth box. The results output module is used to output the location, maturity category, and corresponding probability of the target fruit based on the target candidate box, detection confidence, and maturity category probability.
[0006] Preferably, the label decoupling and training data construction module is used to parse the original labels. If the original label is a standard YOLObbox, the category number, center point, width, and height are read. If the original label is a polygon point set, the minimum and maximum values of the horizontal and vertical coordinates of all points are calculated to obtain the bounding rectangle, which is then converted into normalized center point and width and height. In this way, the detection label is uniformly written as a single-class target, and the original maturity category is written to the attribute label file.
[0007] Preferably, the single-class object detection module is used to merge all maturity categories into one object category during training, and output candidate boxes and detection confidence during inference, without directly outputting maturity categories, in order to obtain object candidate boxes.
[0008] Preferably, the multi-scale feature extraction and ROI alignment module is used to extract a shallower-scale feature map that retains high spatial resolution to capture fruit surface color, edges, and local textures, and to extract a deeper-scale feature map that contains strong semantic information to improve stability under occlusion, background interference, and scale changes.
[0009] Preferably, the multi-scale feature extraction and ROI alignment module is used to perform ROI-Align on two scales respectively to obtain ROI feature blocks of fixed size, and to splice the ROI features of the two scales according to the channel dimension to form multi-scale instance features. In this module, the internal features of the detector are directly reused.
[0010] Preferably, the maturity estimation branch module MEB includes a 1×1 convolutional dimensionality reduction unit, a 3×3 depthwise separable convolutional unit, an SE channel attention unit, a global average pooling unit, a Dropout unit, and a linear classification unit.
[0011] Preferably, a 1×1 convolutional dimensionality reduction unit is used to compress the number of feature channels of the ROI after P3 and P4 are concatenated; Depthwise separable convolutional units are used to extract local spatial features within an instance region; SE channel attention units are used to enhance channel responses related to maturity discrimination.
[0012] Preferably, the threshold calibration and matching evaluation module is used to select the optimal threshold for the end-to-end metric from multiple candidate detection confidences on the validation set, and fix the selected threshold for end-to-end maturity identification and evaluation on the test set.
[0013] Preferably, the threshold calibration and matching evaluation module is used to perform one-to-one matching between the predicted bounding box and the ground truth bounding box according to the IoU threshold; unmatched ground truth targets can be recorded as "missed" and included in the false negative of the corresponding ground truth category.
[0014] Preferably, the threshold calibration and matching evaluation module is also used to train the maturity estimation branch module MEB with the predicted box ROI after matching the detector predicted box with the real box; unmatched samples can be backed to the real box ROI, or the real box ROI and the predicted box ROI can be used at the same time and their outputs can be constrained to be consistent.
[0015] The present invention discloses the following technical effects: This invention reduces the coupling between localization and attribute judgment. The detector is only responsible for localizing a single type of target, and the maturity estimation branch independently processes instance attributes, which helps to reduce the interference of maturity category on the localization learning of the detection head.
[0016] The P3+P4 multi-scale ROI-Align designed in this invention utilizes both high-resolution details and strong semantic information, making it suitable for handling local color shifts, occlusions, and densely mixed scenes.
[0017] Compared to a single-class detector plus a ResNet-18crop classifier, this invention reuses intermediate features of the detector and adds only a lightweight maturity branch, which can significantly reduce the number of parameters and inference latency.
[0018] This invention explicitly converts polygon labels into bounding boxes while retaining the original maturity labels, thus avoiding misinterpretation of the label format that could lead to incorrect training boxes for the detector.
[0019] The evaluation and deployment closed loop of this invention is more complete, the validation set threshold calibration avoids test set parameter tuning, and the full-GTmissed inclusion mechanism evaluates both detection recall and maturity classification quality, which is more in line with actual picking or grading scenarios.
[0020] This invention demonstrates higher end-to-end maturity recognition stability compared to three YOLO baselines in scenarios involving occlusion, dense mixing, and color shift dominance. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a system structure diagram of the present invention.
[0023] Figure 2 This is a schematic diagram of the system processing flow described in this invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0025] like Figure 1 As shown, this invention provides a detection-attribute decoupling system for fruit maturity recognition. The system models target fruit detection as a class-independent single-class localization task and maturity judgment as an instance-level attribute classification task after detection, so that the detector, feature alignment, attribute branching and evaluation process form a closed loop.
[0026] For example, this invention is applicable to image-based fruit maturity recognition scenarios, with typical applications including visual recognition of agricultural products such as strawberries, tomatoes, and blueberries that exhibit visible differences in maturity stages. For ease of explanation, taking a three-category classification of target fruit maturity as an example, maturity categories can be denoted as Category A, Category B, and Category C, corresponding to stages such as ripe, color-changing, and immature, respectively; in practical applications, the number of categories and their semantics can be expanded according to business needs.
[0027] In one embodiment, the detection attribute decoupling system mentioned in this invention includes a label decoupling and training data construction module, a single-class target detection module, an intermediate feature extraction module, a multi-scale ROI-Align module, a maturity estimation branch module, a threshold calibration and matching evaluation module, and a result output module.
[0028] For example, the label decoupling and training data construction module of the detection attribute-decoupling system mentioned in this invention is used to parse the original labels. If the original labels are standard YOLObboxes, the category number, center point, width, and height are read; if the original labels are polygon point sets, the minimum and maximum values of the horizontal and vertical coordinates of all points are calculated to obtain the bounding rectangle, which is then converted into normalized center point and width and height. The detection labels are uniformly written as single-class targets, and the original maturity categories are written to the attribute label file.
[0029] For example, the role of the label decoupling and training data construction module is to separate localization supervision and maturity supervision at the data level, so that the detector only learns the target location during training, while the maturity category only participates in supervision in the attribute branch.
[0030] For example, the single-class target detection module of the detection attribute-decoupling system mentioned in this invention adopts a lightweight YOLO series detector or other single-stage target detector. During training, all maturity categories are merged into one target category, such as "target fruit". During inference, the module outputs candidate boxes and detection confidence scores, but does not directly output maturity categories.
[0031] For example, the lightweight YOLO series detector is the YOLO26n.
[0032] For example, the relationship between the single-class object detection module and the maturity estimation branch is an upstream localization relationship: the detector is responsible for generating object candidate boxes and providing intermediate feature maps; the maturity estimation branch determines attributes based on the candidate boxes and intermediate features.
[0033] For example, the intermediate feature extraction module of the multi-scale feature extraction and ROI alignment module of the detection attribute-decoupling system mentioned in this invention is used to extract intermediate feature maps at least two scales from the detector's forward process. A shallower scale feature map retains higher spatial resolution and is used to capture fruit surface color, edges, and local textures; a deeper scale feature map contains stronger semantic information and is used to improve stability under occlusion, background interference, and scale changes. In this embodiment, feature maps P3 and P4 are selected.
[0034] For example, the multi-scale ROI-Align module in the multi-scale feature extraction and ROI alignment module of the detection attribute-decoupling system mentioned in this invention is used to map the candidate box coordinates to the P3 and P4 feature map coordinate systems respectively, perform ROI-Align on the two scales respectively to obtain ROI feature blocks of fixed size; then the ROI features of the two scales are spliced according to the channel dimension to form the multi-scale instance features corresponding to each target instance.
[0035] For example, unlike ordinary crop classification, the multi-scale ROI-Align module does not require re-cropping the original image and running an additional large classifier. Instead, it directly reuses features from within the detector, thus reducing deployment overhead.
[0036] For example, the maturity estimation branch module of the detection attribute-decoupling system mentioned in this invention is a lightweight instance classification network CNN, which includes 1×1 convolutional dimensionality reduction and 3×3 depthwise separable convolutional units, wherein the depthwise separable convolutional units include channel-wise convolution and pointwise convolution, channel attention, global average pooling, Dropout and linear classifier; the input of this module is the ROI features concatenated by P3+P4, and the output is the probability that the target instance belongs to each maturity category.
[0037] In one embodiment, the present invention defines the three modules of detector + ROI-Align + MEB to form the SM-YOLO26 framework.
[0038] For example, as shown in Table 1, ablation analysis of SM-YOLO26 was performed in three aspects. First, the HSV baseline, ResNet-18crop baseline, and the full SM-YOLO26 were compared to analyze whether MEB could provide a more effective maturity representation than traditional color statistics, and compared with a strong two-stage crop classifier. Second, P3 / P4ROI-Align was replaced with simple ROI average pooling (roi_avg_pool) to verify whether spatially aligned multi-scale ROI features are key to improving model performance. Third, FocalLoss was replaced with ordinary Cross-EntropyLoss, and the maturity classification loss weight λ was further adjusted. mat This is used to analyze the impact of loss function design on the overall recognition performance and the ability to recognize turning classes.
[0039] Table 1 For example, this invention mainly analyzes the following four types of scenarios: heavily occluded scenarios, densely mixed scenarios, turning-dominant scenarios, and sparse single-fruit scenarios. Heavily occluded scenarios mainly include strawberry instances partially occluded by leaves, stems, or adjacent fruits; densely mixed scenarios typically include strawberries at multiple maturity stages with close proximity between targets, making interference from adjacent fruits likely; turning-dominant scenarios have a high proportion of strawberries in the color-changing stage, blurred category boundaries, and higher requirements for maturity judgment; sparse single-fruit scenarios have fewer targets and relatively low background interference, and can be used as a reference for relatively simple scenarios. Table 2 shows the end-to-end evaluation results of SM-YOLO26 under different scenario difficulties.
[0040] Table 2 For example, on the overall test set, SM-YOLO26 achieves an Accuracy of 0.8718 and a Macro-F1 score of 0.8667, indicating good overall maturity recognition capability under full-GT end-to-end evaluation. In heavily occluded scenarios, SM-YOLO26 still achieves an Accuracy of 0.8938 and a Macro-F1 score of 0.8636, demonstrating the robustness of the detection-attribute decoupling framework under occlusion conditions. This may be because the single-class detector is primarily responsible for locating strawberry instances as much as possible, while MEB further determines maturity attributes based on the P3 / P4ROI-Align features, making maturity classification less dependent on the class prediction in the detection head. In densely mixed scenarios, SM-YOLO26 achieves an Accuracy of 0.8661 and a Macro-F1 score of 0.8608, which are close to the results on the overall test set. Densely mixed scenes often contain ripe, turning, and unripe strawberries simultaneously, and overlapping bounding boxes, partial occlusion, and color interference are common between adjacent targets. In such cases, the model needs to handle instance localization and maturity differentiation simultaneously. This result demonstrates that ROI-Align instance features based on candidate bounding boxes can alleviate the interference caused by the mixing of adjacent fruits to some extent, allowing MEB to perform independent attribute determination for each candidate strawberry instance.
[0041] For example, compared to the three traditional YOLO detection paradigms, including "YOLOv8n", SM-YOLO26 performs more stably in full-GT end-to-end maturity recognition; compared to strong two-stage crop classifiers, it significantly reduces the number of parameters, computational cost and inference latency while maintaining similar recognition performance.
[0042] For example, the threshold calibration and matching evaluation module of the detection attribute decoupling system mentioned in this invention is used to select the optimal threshold for end-to-end metrics from multiple candidate detection confidences on the validation set, and fix the selected threshold for testing or deployment evaluation. The predicted box and the ground truth box can be matched one-to-one according to the IoU threshold. Unmatched ground truth targets can be recorded as missed and counted as false negatives of the corresponding ground truth category.
[0043] For example, the threshold calibration and matching evaluation module is also used for training the predicted bounding box ROI, wherein after matching the detector predicted bounding box with the ground truth bounding box, the maturity branch is trained with the predicted bounding box ROI; unmatched samples can be backed to the ground truth bounding box ROI, or the ground truth bounding box ROI and the predicted bounding box ROI can be used simultaneously and their outputs can be constrained to be consistent.
[0044] In one implementation, such as Figure 2As shown, the system process can be divided into four stages: data construction, model training, model inference, and end-to-end evaluation. First, the original image and annotations are read, the label format is determined, and polygon-to-boundary conversion is performed. Then, a single-class detector is trained or loaded to output only target candidate boxes. Next, P3 and P4 feature maps are extracted, and multi-scale ROI-Align is performed on the candidate boxes. Then, the concatenated instance features are fed into the maturity estimation branch to obtain the class probability. Finally, the detection confidence threshold is determined on the validation set, and the target boxes and maturity classes are output during the testing or deployment phase.
[0045] For example, the maturity estimation branch MEB is called the MaturityEstimationBranch.
[0046] For example, the present invention first uses a single-class detector to locate the target fruit, and then uses an independent maturity estimation branch to determine the maturity attribute of each candidate target.
[0047] This invention converts the original multi-class maturity labels into single-class detection bounding boxes, while retaining the original maturity categories as attribute labels, supporting both bounding box and polygon original labeling formats.
[0048] In one implementation, regarding the design of polygon annotation conversion and attribute label retention in this system process, let the polygon point set of a target instance be: P={(x_i,y_i)|i=1,2,...,n}, then the bounding rectangle is: x_min=min(x_i), x_max=max(x_i), y_min=min(y_i), y_max=max(y_i). The conversion to a YOLO normalized bounding box is: cx=(x_min+x_max) / 2, cy=(y_min+y_max) / 2, w=x_max-x_min, h=y_max-y_min. If the original annotation is already clscxcywh, then the bounding box is directly read. After conversion, the detection label is written as 0cxcywh, where 0 represents a single-class target; the original cls is written into the maturity attribute label for training the maturity estimation branch.
[0049] In one implementation, multi-scale ROI-Align instance feature extraction is performed for the system process.
[0050] For example, suppose the single-class detector outputs the k-th candidate box b_k=(cx_k,cy_k,w_k,h_k), and the intermediate feature maps of the detector include P3 and P4, with spatial dimensions of (H3,W3) and (H4,W4) respectively; map the candidate box coordinates to the feature map coordinate system: x1_s=(cx_k-w_k / 2)*W_s, y1_s=(cy_k-h_k / 2)*H_s, x2_s=(cx_k+w_k / 2)*W_s, y2_s =(cy_k+h_k / 2)*H_s, where s represents P3 or P4; Perform ROI-Align on P3 and P4 respectively to obtain feature blocks of fixed size such as 7×7: R3_k=ROIAlign(P3,b_k), R4_k=ROIAlign(P4,b_k); Then concatenate them according to the channel dimension: R_k=concat(R3_k,R4_k). This concatenated feature contains both local details and strong semantics, which are used for subsequent maturity attribute classification.
[0051] For example, the present invention maps candidate boxes to feature maps P3 and P4 respectively, performs ROI-Align, and then concatenates them by channel to form instance-level maturity features.
[0052] In one implementation, for the maturity estimation branch training of the system process, for each instance feature R_k, the maturity estimation branch first performs dimensionality reduction through 1×1 convolution, then extracts local spatial patterns through depthwise separable convolution, and then generates maturity-related channel weights through channel attention, and outputs category logits through global average pooling and a linear classifier.
[0053] For example, the present invention includes 1×1 dimensionality reduction, depthwise separable convolution, channel attention, pooling, Dropout, and a linear classifier for outputting maturity class probabilities on concatenated ROI features.
[0054] For example, the maturity training loss can be FocalLoss with class weights: L_mat=alpha_y*(1-p_y)^gamma*CE(logits,y), where y is the true maturity class, p_y is the true class probability, gamma is the focusing parameter, and alpha_y is the class weight.
[0055] For example, the present invention employs FocalLoss with category weights and controls attribute branch training through maturity loss weight lambda_mat.
[0056] For example, the total loss can be written as: L = lambda_mat * L_mat.
[0057] For example, in an embodiment where the detector is completely frozen, the maturity loss only updates the maturity estimation branch; in a partially unfrozen embodiment, the shallow layers of the detector can be frozen and subsequent neck or partial feature layers can be updated with a smaller learning rate to achieve feature shaping. To avoid compromising localization capabilities, the preferred approach is to freeze a single-class detector and train the maturity estimation branch.
[0058] In one implementation, the predicted box matching, backtracking, and consistency training are performed for the system process.
[0059] For example, during the training or validation phase, the frozen detector can first generate predicted bounding boxes, and then match the predicted bounding boxes with the ground truth bounding boxes according to the IoU threshold. If a ground truth bounding box has a matching predicted bounding box, the maturity estimation branch is trained using the predicted bounding box ROI and the corresponding maturity label; if there is no matching predicted bounding box, the ground truth bounding box ROI can be used back to avoid discarding hard samples.
[0060] In another implementation, both the ground truth bounding box ROI and the matched predicted bounding box ROI are extracted simultaneously, and both are trained using maturity classification. The logits of the two are then constrained to be close using KL divergence or other consistency loss methods. This approach reduces the deviation between the ground truth bounding box ROI during the training phase and the predicted bounding box ROI during the inference phase.
[0061] For example, the present invention uses the predicted bounding box to train the maturity branch after matching the predicted bounding box with the ground truth bounding box; unmatched samples can be backed up to ground truth bounding boxes; and the output of the ground truth bounding box ROI and the predicted bounding box ROI can be constrained to be consistent at the same time.
[0062] In one implementation, the confidence threshold for the validation set of the system process is calibrated.
[0063] For example, since the confidence distributions of single-class detectors and three-class detectors differ, the system can select the optimal end-to-end Macro-F1 detection confidence threshold from several candidate thresholds on the validation set, such as a candidate set {0.25, 0.10, 0.05, 0.001}. Once the threshold is selected, it is consistently used in the test set or actual deployment, without further parameter tuning based on the test set. During end-to-end evaluation, unmatched true targets are treated as "missed" items and counted as false negatives in the corresponding category. This evaluation method can simultaneously reflect the detection recall and maturity identification quality.
[0064] For example, the present invention selects a detection confidence threshold in the validation set and uses it consistently in testing or deployment; failure to match the real target is counted as a missed false negative in the corresponding category.
[0065] For example, to verify the detection effect of the present invention, the present invention achieved an Accuracy of 0.9181 and a Macro-F1 of 0.8994 under the predicted box matching maturity classification. After validation set confidence threshold calibration, under the full-GT end-to-end classification, the number of matched boxes was 572 / 593, the number of missed boxes was 21, the Full-GT Accuracy was 0.8718, the Full-GT Macro-F1 was 0.8667, and the Turning-F1 was 0.7661, all of which are better than the three YOLO baselines. Compared with the HSV statistical maturity classification, the FullGT Macro-F1 of the present invention is higher, indicating that it is not a simple color thresholding scheme. Compared to a single-class detector plus a ResNet-18crop classifier, this invention achieves slightly higher Macro-F1 and Turning-F1 scores while maintaining the same accuracy. The number of parameters is approximately 2.556M, significantly lower than the approximately 13.682M of the two-stage ResNet-18 scheme. On an RTX 3070 Ti Laptop GPU, the median latency is approximately 15.12ms, corresponding to approximately 66.16 FPS.
[0066] In summary, this invention first locates the target fruit using a single-class detector, then extracts instance-level ROI features for each candidate box on the detector's intermediate feature map, and finally outputs the maturity category via a lightweight maturity estimation branch. This process does not require the detector to distinguish maturity categories in the detection head, reducing the competition between localization and attribute determination.
[0067] This example uses strawberry maturity recognition. The original data includes several training, validation, and test images, with maturity categories including ripe, turning, and unripe. First, the original three-class labels are converted into single-class strawberry detection labels, and the original maturity labels are saved in a separate attribute label file. If some original labels are polygons, their bounding rectangles are used to generate normalized bounding boxes. Then, a single-class YOLO26n detector is trained to output only strawberry bounding boxes. During the maturity branch training phase, the single-class detector is loaded and its parameters are frozen. ROI-Align instance features are extracted from the P3 and P4 feature maps. The concatenated ROI features are input into the MEB branch, which outputs three maturity probabilities through 1×1 convolution, depthwise separable convolution, SE channel attention, and a classifier. The training loss uses FocalLoss with class weights of 1.0, 2.5, and 1.0, gamma is set to 2.0, and lambda_mat is preferably 1.0. During inference, the single-class detector first generates candidate boxes; the candidate boxes are mapped to the P3 and P4 feature maps and then processed by ROI-Align to obtain instance features; MEB outputs the maturity category of each candidate box. The system finally outputs the target box coordinates, detection confidence, maturity category, and maturity probability.
[0068] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0069] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0070] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A detection-attribute decoupling system for fruit maturity recognition, characterized in that, include: The label decoupling and training data construction module is used to parse the original annotations, convert polygons into bounding boxes, unify ripe, turning, and unripe into strawberry single-class detection labels, and retain the original maturity categories as attribute labels to construct the dataset; The single-class target detection module uses the YOLO26n detector and interacts with the label decoupling and training data construction module to obtain target candidate boxes using the detector. The multi-scale feature extraction and ROI alignment module is used to extract intermediate feature maps at least two scales from the forward process of the detector, and map the candidate box coordinates to the coordinate systems of the intermediate feature maps at the two scales respectively. ROI-Align is performed at the two scales respectively and the maps are concatenated by channel dimension to form the multi-scale instance features corresponding to each target instance. The maturity estimation branch module MEB uses a lightweight instance classification network CNN to obtain the probability that the target belongs to each maturity category based on the multi-scale instance features. The threshold calibration and matching evaluation module is used to select the detection confidence threshold on the validation set and evaluate the end-to-end maturity recognition performance based on the matching relationship between the predicted box and the ground truth box. The results output module is used to output the location, maturity category, and corresponding probability of the target fruit based on the target candidate box, detection confidence, and maturity category probability.
2. The detection-attribute decoupling system for fruit maturity recognition according to claim 1, characterized in that: The label decoupling and training data construction module is used to parse the original labels. If the original label is a standard YOLObbox, the class number, center point, width, and height are read. If the original label is a polygon point set, the minimum and maximum values of the horizontal and vertical coordinates of all points are calculated to obtain the bounding rectangle, which is then converted into normalized center point and width and height. The detection label is uniformly written as a single-class target, and the original maturity category is written to the attribute label file.
3. The detection-attribute decoupling system for fruit maturity recognition according to claim 1, characterized in that: The single-class object detection module is used to merge all maturity categories into one target category during training, and output candidate boxes and detection confidence scores during inference, without directly outputting maturity categories, in order to obtain the target candidate boxes.
4. The detection-attribute decoupling system for fruit maturity recognition according to claim 1, characterized in that: The multi-scale feature extraction and ROI alignment module is used to extract a shallower-scale feature map that retains high spatial resolution to capture fruit surface color, edges, and local textures, and to extract a deeper-scale feature map that contains strong semantic information to improve stability under occlusion, background interference, and scale changes.
5. The detection-attribute decoupling system for fruit maturity recognition according to claim 1, characterized in that: The multi-scale feature extraction and ROI alignment module is used to perform ROI-Align on two scales respectively to obtain ROI feature blocks of fixed size, and to splice the ROI features of the two scales according to the channel dimension to form the multi-scale instance features. In this module, the internal features of the detector are directly reused.
6. The detection-attribute decoupling system for fruit maturity recognition according to claim 1, characterized in that: The maturity estimation branch module MEB includes a 1×1 convolutional dimensionality reduction unit, a 3×3 depthwise separable convolutional unit, an SE channel attention unit, a global average pooling unit, a Dropout unit, and a linear classification unit.
7. The detection-attribute decoupling system for fruit maturity recognition according to claim 6, characterized in that: The 1×1 convolutional dimensionality reduction unit is used to compress the number of feature channels of the ROI after P3 and P4 are concatenated; The depthwise separable convolutional unit is used to extract local spatial features within the instance region; The SE channel attention unit is used to enhance the channel response related to maturity discrimination.
8. The detection-attribute decoupling system for fruit maturity recognition according to claim 1, characterized in that: The threshold calibration and matching evaluation module is used to select the optimal threshold for end-to-end metrics from multiple candidate detection confidences on the validation set, and fix the selected threshold for end-to-end maturity identification and evaluation on the test set.
9. The detection-attribute decoupling system for fruit maturity recognition according to claim 8, characterized in that: The threshold calibration and matching evaluation module is used to perform one-to-one matching between the predicted bounding box and the ground truth bounding box according to the IoU threshold; unmatched ground truth targets can be recorded as "missed" and included in the false negative of the corresponding ground truth category.
10. The detection-attribute decoupling system for fruit maturity recognition according to claim 9, characterized in that: The threshold calibration and matching evaluation module is also used to train the maturity estimation branch module MEB with the predicted box ROI after matching the detector predicted box with the real box; unmatched samples can be backed to the real box ROI, or the real box ROI and the predicted box ROI can be used at the same time and their outputs can be constrained to be consistent.