A semi-supervised dressing specification detection method for improving pseudo label quality
By constructing training and validation sets, using labeled data to fine-tune the teacher model to generate high-quality pseudo-label data, and combining data augmentation and instance feature consistency constraints to train the student model, the problem of low pseudo-label quality in existing technologies is solved, and detection accuracy and robustness are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU EMBEDDED MASCH TECH CO LTD
- Filing Date
- 2026-03-19
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, dress code detection algorithms require a large amount of labeled data to train the model, which leads to extended development time. Furthermore, using noisy pseudo-label data for distillation training cannot effectively improve the accuracy of student models.
By constructing training and validation sets, the teacher model is fine-tuned using labeled data for augmentation detection and deduplication filtering, generating high-quality pseudo-label data. The teacher model is then iteratively trained using both labeled and pseudo-label data, while the student model is trained using different data augmentation strategies and instance feature consistency constraints.
High-quality pseudo-label data was generated, which improved the detection accuracy of the teacher model and enhanced the robustness of the student model through distillation learning, thus alleviating the problem of ambiguous recognition in the dress code detection task.
Smart Images

Figure CN122135142A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of semi-supervised learning, and in particular to a semi-supervised method for detecting dress code errors to improve the quality of pseudo-labels. Background Technology
[0002] Various industries have certain requirements for employee dress codes. For example, kitchens, construction sites, factories, and laboratories have strict requirements for staff attire. Dress codes are essential for ensuring worker safety and product quality. Dress code detection uses object detection algorithms to detect and identify the clothing worn by pedestrians. Different application scenarios involve diverse clothing styles and wearing conditions, making it a non-standard, customized detection algorithm. Currently, most dress code detection algorithms employ deep learning methods, requiring a large amount of labeled data to train the model. However, data labeling requires professional personnel, which delays the training and optimization of the algorithm model, directly leading to extended project timelines.
[0003] For example, the technical solution of application number "CN202311408607.9", patent name "Method and System for Improving the Accuracy of YOLO Detection Model Based on Semi-Supervised Training", and patent applicant "Chengdu HeNeng ChuangYue Software Co., Ltd." is as follows: A teacher model is trained using labeled data. The trained teacher model generates pseudo-labels for unlabeled data. A student model is trained using labeled data. Based on the pre-training, the student model is trained again using pseudo-labels. The student and teacher models have the same structure. The teacher model parameters are updated using the exponential moving average method based on the trained student model. The previous steps are repeated to jointly optimize the student and teacher models. In this solution, the teacher model has the same structure as the student model and is also a small model. The pseudo-labels generated by the teacher model trained on a small amount of labeled data are of low quality. Furthermore, small models are sensitive to noisy data. Therefore, using noisy pseudo-label data for distillation training cannot effectively improve the accuracy of the student model.
[0004] For example, the technical solution of application number "CN202310142023.5", patent name "Semi-supervised Non-Independent Identically Distributed Federated Learning Distillation Method and Apparatus", and patent applicant "Anhui Kexun Financial Services Technology Co., Ltd." is as follows: A first subject-specific teacher model is trained using labeled data. This model generates soft labels for the labeled data and a first prediction result for unlabeled data. A second subject-specific teacher model on other terminals generates a second prediction result for the unlabeled data. Hard labels for the unlabeled data are generated by calculating the variance of the first and second prediction results. Simultaneously, the mean of the prediction results is used as the soft label for the unlabeled data. A student model is trained based on the soft and hard label distillation of labeled and unlabeled data. However, due to the non-standard customization characteristics of the dress code detection algorithm, the subject-specific teacher models on other terminals cannot generalize to the data in the current scenario. Directly using the untrained second subject-specific teacher model cannot effectively guide the generation of pseudo-labels for the unlabeled data.
[0005] For example, the technical solution of application number "CN202310223294.3", patent title "A Data Labeling Method and System Based on Semi-Supervised Learning", and patent applicant "Shanghai Xiding Intelligent Technology Co., Ltd." is as follows: A first number of sample data is selected from the data to be labeled, and a portion of this data is extracted for labeling to obtain a second number of labeled data; a first semi-supervised model is trained based on the sample data to obtain a trained first model; a second semi-supervised model is trained based on the labeled data to obtain a trained second model; then, the data to be labeled is detected using these two models, and the ground truth of the detection boxes and the detection boxes to be re-inspected are selected based on the detection results. For this solution, the model trained on unlabeled data has low detection accuracy, and the quality of pseudo-labels generated by comparing its inference results is not high. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings and deficiencies of the prior art and provide a semi-supervised dress code detection method to improve the quality of fake labels.
[0007] The objective of this invention is achieved through the following technical solution:
[0008] A semi-supervised method for detecting false labels to improve the quality of dress code detection includes the following steps:
[0009] S1. Construct a dataset for the dress code detection task scenario and divide it into a training set and a validation set. The training set includes labeled data and unlabeled data.
[0010] S2. Fine-tune the teacher model using labeled data, perform enhanced detection and deduplication filtering on the unlabeled data based on the fine-tuned teacher model to obtain pre-labeled data, and then deduplicate the pre-labeled data according to the category exclusion of the dress code detection task and the difficulty of the detection instance to obtain the first pseudo-label data.
[0011] S3. Fine-tune the teacher model by combining the labeled data and the first pseudo-label data, and verify the average accuracy of the teacher model through the validation set. When the improvement of the average accuracy of the fine-tuned teacher model is less than the preset threshold, the teacher model reaches accuracy saturation.
[0012] Conversely, step S2 is repeated using the fine-tuned teacher model to obtain the second pseudo-label data, and then the model is fine-tuned by combining the labeled data and the second pseudo-label data until the teacher model with saturated accuracy is obtained.
[0013] The unlabeled data is processed using a teacher model with saturated precision to obtain the third pseudo-label data;
[0014] S4. Use the labeled data and the third pseudo-label data as the training data for the student model. The training data is processed through two different data augmentation strategies to obtain two sets of preprocessed data.
[0015] S5. After constraining the consistency of instance features on the two sets of preprocessed data, calculate the loss function of the labeled data and pseudo-label data in the dress code detection task respectively; finally, obtain the trained student model and use the trained student model to perform dress code detection.
[0016] Step S1 involves constructing a dress code detection task scenario dataset and dividing it into a training set and a validation set. The training set consists of labeled and unlabeled data representing actual application scenarios of dress codes, while the validation set consists of labeled data representative of dress code scenarios. The labeled data contains at least N target instances for each category, and the label information for each target instance is as follows: ,in, Indicates the target category, and Let x and y represent the x and y coordinates of the center point of the smallest bounding rectangle of the target instance, respectively. and These represent the width and height of the minimum bounding rectangle of the target instance, respectively.
[0017] Step S2 is as follows:
[0018] S21. An open vocabulary target detection large model is adopted as the teacher model. During the training phase of the teacher model, the labeled data in the training set is used to fine-tune the teacher model: the text encoding features corresponding to the target categories in the labeled data are obtained through reasoning, the computational load of the teacher model in the fine-tuning phase is reduced, the parameters of the image encoding module in the teacher model are frozen, and the parameters of the text-image fusion module in the teacher model are updated through the learning rate.
[0019] S22. When testing unlabeled data based on the fine-tuned teacher model, augmentation detection is performed on the unlabeled data. After merging the augmentation detection results of different unlabeled data, duplicate bounding boxes of the same target category in the merged results are removed using non-maximum suppression. By setting a uniform confidence threshold for different target categories, low-confidence false detection targets are filtered out to obtain pre-labeled data. The augmentation detection methods include image flipping and scaling. The pre-labeled data is generated from... composition, This represents the confidence value of the target instance in the pre-labeled data;
[0020] S23. Based on the category exclusion of the dress code detection task and the difficulty of the detection instances, the pre-labeled data is further deduplicated and filtered to obtain the first pseudo-label data. This is achieved through the following steps:
[0021] Based on the mutual exclusion relationship between the categories of the dress code detection task, the pre-labeled data of mutually exclusive categories are merged. After deduplication and filtering of the merged pre-labeled data of mutually exclusive categories by non-maximum suppression, the confidence threshold of the target category is set according to the detection difficulty of the target category in the pre-labeled data to further filter out false detection targets with low confidence. The remaining data after filtering is the first pseudo-label data.
[0022] Step S3 involves fine-tuning the teacher model by combining the labeled data and the first pseudo-label data: the teacher model parameter update strategy is the same as in step S21. When calculating the loss function using the first pseudo-label data, the confidence value of the target instance is used as the weight coefficient, and the calculation method is as follows:
[0023] ;
[0024] in, This represents the confidence value of the target instance in the first pseudo-label data. and These represent the category and regression loss of the first pseudo-label data, respectively. and These represent the categories of the labeled data and the regression loss, respectively.
[0025] The accuracy of the teacher model is verified using a validation set. It is determined whether the average accuracy improvement of the teacher model in the current fine-tuning stage compared to the previous fine-tuning stage is less than a preset threshold. If it is less than the preset threshold, the teacher model has reached accuracy saturation. Otherwise, steps S22 and S23 are repeated to generate second pseudo-label data for the teacher model in the current fine-tuning stage, and fine-tuning continues until the teacher model's accuracy saturates. Steps S22 and S23 are then repeated on unlabeled data using the teacher model with saturated accuracy to obtain third pseudo-label data. , This indicates that the target category output branch has not been traversed. soft label vectors, Z represents the probability value of each target category. This represents the number of categories in the sample.
[0026] Step S4 involves using the labeled data and the third pseudo-label data as training data for the student model, and employing YOLOv8 as the student model. The loss function of the student model includes cross-entropy loss. Complete intersection and comparison loss and distribution focus loss During the student model training phase, two sets of preprocessed data were obtained by augmenting each batch of training data using two different data augmentation strategies. The two data augmentation strategies were mosaic augmentation and mixed data augmentation with the same coefficients, the difference being the use of different coefficients for image blurring, size scaling, and HSV color space enhancement.
[0027] Step S5 involves extracting instance features from the two sets of preprocessed data and applying instance feature consistency constraints, as detailed below:
[0028] Bilinear interpolation is performed on instance features that have been scaled in data augmentation to obtain instance features of the same size as those that have not been scaled.
[0029] Based on the coordinate information of the target instance label, the instance features obtained after bilinear interpolation of two sets of preprocessed data are extracted respectively;
[0030] The extracted instance features are processed using Min-max normalization to eliminate the magnitude differences caused by different data augmentations, and the mean squared error loss function is calculated. The specific calculation formula is as follows:
[0031] ;
[0032] in, Indicates the number of target instances. For Min-max normalization processing, For the interception operation, For bilinear interpolation, and Two sets of preprocessed data, For student models, For student model parameters;
[0033] Apart from In addition to the loss function, a loss function is calculated for the labeled data. The specific calculation formula is as follows:
[0034] ;
[0035] The third pseudo-label data uses logical distillation to transfer category knowledge, and uses confidence values as coefficients for the loss function. The loss function is calculated as follows:
[0036] ;
[0037] ;
[0038] ;
[0039] in, and Unprocessed of Vector elements are distinguished by their index numbers; Predict the probability that the current sample belongs to the i-th class for the teacher model; Predict the probability that the current sample belongs to the i-th class for the student model; Let C be the knowledge distillation loss function, and C be the number of categories. This is a temperature coefficient used to control the degree of softening in the output probability. This represents the confidence value of the third pseudo-label data.
[0040] Meanwhile, this invention provides:
[0041] A server includes a processor and a memory, the memory storing at least one program that is loaded and executed by the processor to implement the aforementioned semi-supervised dress code detection method for improving the quality of pseudo-labels.
[0042] A computer-readable storage medium storing at least one program that is loaded and executed by a processor to implement the above-described semi-supervised dress code detection method for improving the quality of pseudo-labels.
[0043] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0044] 1. This invention processes unlabeled data through exclusion category deduplication and confidence threshold filtering strategies, generating high-quality pseudo-label data for the dress code detection task. Iterative training combining labeled data and pseudo-label data further improves the detection accuracy of the teacher model, which is beneficial for the teacher model to generate higher-quality pseudo-label data and for the student model to perform distillation learning.
[0045] 2. The student model of this invention uses two different data augmentation strategies to preprocess the training data obtained by combining labeled data and pseudo-label data, and then applies instance feature consistency constraints to it. This constrains the student model to have spatial dimension consistency of instance features obtained by different preprocessing of the same input source, enabling the student model to learn more robust feature semantics and alleviating the ambiguous recognition of the same target in the dress code detection task. Attached Figure Description
[0046] Figure 1 This is a flowchart of the semi-supervised dress code detection method for improving the quality of fake labels as described in this invention.
[0047] Figure 2 This is a schematic diagram illustrating the iterative improvement of pseudo-labels.
[0048] Figure 3 This is a schematic diagram of instance feature consistency distillation training. Detailed Implementation
[0049] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0050] like Figure 1 A semi-supervised method for detecting false labels to improve the quality of dress code detection includes the following steps:
[0051] S1. Construct a dataset for the dress code detection task scenario and divide it into a training set and a validation set. The training set includes labeled data and unlabeled data.
[0052] S2. Fine-tune the teacher model using labeled data, perform enhanced detection and deduplication filtering on the unlabeled data based on the fine-tuned teacher model to obtain pre-labeled data, and then deduplicate the pre-labeled data according to the category exclusion of the dress code detection task and the difficulty of the detection instance to obtain the first pseudo-label data.
[0053] S3. Fine-tune the teacher model by combining the labeled data and the first pseudo-label data, and verify the average accuracy of the teacher model through the validation set. When the improvement of the average accuracy of the fine-tuned teacher model is less than the preset threshold, the teacher model reaches accuracy saturation.
[0054] Conversely, step S2 is repeated using the fine-tuned teacher model to obtain the second pseudo-label data, and then the model is fine-tuned by combining the labeled data and the second pseudo-label data until the teacher model with saturated accuracy is obtained.
[0055] The unlabeled data is processed using a teacher model with saturated precision to obtain the third pseudo-label data;
[0056] S4. Use the labeled data and the third pseudo-label data as the training data for the student model. The training data is processed through two different data augmentation strategies to obtain two sets of preprocessed data.
[0057] S5. After constraining the consistency of instance features on the two sets of preprocessed data, calculate the loss function of the labeled data and pseudo-label data in the dress code detection task respectively; finally, obtain the trained student model and use the trained student model to perform dress code detection.
[0058] Step S1 involves constructing a dress code detection task scenario dataset and dividing it into a training set and a validation set. The training set consists of a small amount of labeled data and a large amount of unlabeled data representing actual dress code application scenarios. The validation set consists of a small amount of labeled data representative of dress code scenarios, such as data selected from different viewpoints, lighting conditions, backgrounds, and occlusion scenarios. Each category in the small amount of labeled data contains at least N target instances, and the label information for each target instance is as follows: ,in, Indicates the target category, (x-axis) and (The vertical axis) represents the x and y coordinates of the center point of the smallest bounding rectangle of the target instance, respectively. (width) and (height) represents the width and height of the minimum bounding rectangle of the target instance, respectively.
[0059] Step S2 is as follows:
[0060] S21. Large-scale open-vocabulary object detection models (GLIP, GroundingDINO, YOLO-World) are used as teacher models. During the training phase of the teacher model, a small amount of labeled data in the training set is used to fine-tune the teacher model: the text encoding features corresponding to the target categories in the labeled data are obtained in advance through inference. The subsequent encoding features are treated as constants and are called every time the model infers, avoiding repeated calculations and reducing the computational load of the teacher model during the fine-tuning phase. The parameters of the image encoding module in the teacher model are frozen, and the parameters of the text-image fusion module in the teacher model are updated with a small learning rate. This preserves the generalization ability of the extracted image features and the scalability of detecting new categories, preventing overfitting during the model fine-tuning process. Since the large-scale open-vocabulary object detection models are trained using large-scale labeled data, they are not limited by categories, have good generalization ability, and have a certain zero-shot detection capability. Even with a small amount of labeled data, the model can achieve good accuracy during fine-tuning.
[0061] S22. When testing a large amount of unlabeled data based on a fine-tuned teacher model, augmentation detection is performed on the unlabeled data. After merging the augmentation detection results of different unlabeled data, duplicate bounding boxes of the same target category in the merged results are removed using non-maximum suppression. By setting a uniform confidence threshold for different target categories, low-confidence false detection targets are filtered out to obtain pre-labeled data. The augmentation detection methods include image flipping and scaling. The pre-labeling information for each target instance in the pre-labeled data is provided by... composition, This represents the confidence value of the target instance in the pre-labeled data;
[0062] S23. Based on the category exclusion of the dress code detection task and the difficulty of the detection instances, the pre-labeled data is further deduplicated and filtered to obtain the first pseudo-label data. The first pseudo-label data is low-noise data, which is achieved through the following steps:
[0063] (1) Based on the mutual exclusion relationship between categories, merge the pre-labeled data of mutually exclusive categories and use the non-maximum suppression deduplication method to filter out false detection targets. This is because the dress code detection algorithm will design mutually exclusive detection categories in the same position. For example, in the medical protective clothing code detection task, wearing a mask and not wearing a mask, wearing a head covering and not wearing a head covering, and protective clothing and casual clothing are two different categories that correspond one-to-one. Their detection positions are the same, but they cannot appear in the same position at the same time, and they have a mutual exclusion relationship.
[0064] (2) Set category-related confidence thresholds to filter out false detections with low confidence. Because different categories of detection targets have different amounts of labeled data, target size, and occlusion, easy-to-detect categories often have higher confidence and can be filtered with high thresholds, while challenging detection categories need to have lower confidence thresholds to retain a certain number of detection results; for example, large targets are easy to detect, while small targets are difficult to detect.
[0065] Step S3 is as follows: Figure 2 As shown, the pseudo-label data is iteratively improved to obtain high-quality pseudo-label data: the teacher model is fine-tuned by combining the labeled data and the first pseudo-label data: the teacher model parameter update strategy is consistent with step S21, and the confidence value of the target instance is used as the weight coefficient when calculating the loss function of the first pseudo-label data, and the calculation method is as follows:
[0066] ;
[0067] in, This represents the confidence value of the target instance in the first pseudo-label data. and These represent the category and regression loss of the first pseudo-label data, respectively. and These represent the categories of labeled data and the regression loss, respectively. Since the open vocabulary target detection model has been pre-trained on a large amount of data and the number of model parameters has reached a certain scale, it has a certain ability to tolerate noisy data. After the first pseudo-label data is processed in step S23, the label quality is further improved. Introducing the confidence of the first pseudo-label data as the loss weight during the training process enables the model to self-adjust and correct mislabeled data. Therefore, the teacher model after this fine-tuning step has higher detection accuracy.
[0068] The accuracy of the teacher model is verified using a validation set. It is determined whether the average accuracy improvement of the teacher model in the current fine-tuning stage compared to the previous fine-tuning stage is less than a preset threshold. If it is less than the preset threshold, the teacher model has reached accuracy saturation. Otherwise, steps S22 and S23 are repeated to generate second pseudo-label data for the teacher model in the current fine-tuning stage, and fine-tuning iterations are continued using the labeled data until the teacher model's accuracy saturates. Steps S22 and S23 are then repeated on the unlabeled data using the teacher model with saturated accuracy to obtain third pseudo-label data. , This indicates that the target category output branch has not been traversed. soft label vectors, Z represents the probability value of each target category. The number of categories for the sample, where the sample is a single individual in the training set.
[0069] Step S4 involves using the labeled data and the third pseudo-label data as training data for the student model, and employing YOLOv8 as the student model. The loss function of the student model includes cross-entropy loss. Complete intersection and comparison loss and distribution focus loss During the student model training phase, two sets of different data augmentation strategies were used to augment each batch of training data, resulting in two sets of preprocessed data. The two data augmentation strategies were mosaic augmentation with the same coefficient and mixed data augmentation, the difference being the use of different coefficients for image blurring, size scaling, and HSV color space enhancement.
[0070] For example, two different data augmentation strategies are Strategy A and Strategy B. Strategy A uses the same mosaic and blending coefficients, but the blur / scaling / HSV coefficients are α; Strategy B uses the same mosaic and blending coefficients, but the blur / scaling / HSV coefficients are β.
[0071] Step S5 is as follows: Figure 3 As shown, in terms of loss calculation, instance features of the PAN layer are extracted from the two sets of preprocessed data, and instance feature consistency constraints are applied, as follows:
[0072] Bilinear interpolation is performed on the PAN layer instance features that are scaled in the data augmentation process to obtain instance features of the same size as those that are not scaled.
[0073] Based on each target instance label The coordinate information is used to extract instance features from two sets of preprocessed data after bilinear interpolation.
[0074] The extracted instance features are processed using Min-max normalization to eliminate the magnitude differences caused by different data augmentations, and the mean squared error loss function is calculated. The specific calculation formula is as follows:
[0075] ;
[0076] in, Indicates the number of target instances. For Min-max normalization processing, For the interception operation, For bilinear interpolation, and Two sets of preprocessed data, For student models, For student model parameters;
[0077] Apart from In addition to the loss function, a loss function is calculated for the labeled data. The specific calculation formula is as follows:
[0078] ;
[0079] The third pseudo-label data uses logical distillation to transfer category knowledge, and uses confidence values as coefficients for the loss function. The loss function is calculated as follows:
[0080] ;
[0081] ;
[0082] ;
[0083] in, and Unprocessed of Vector elements are distinguished by their index numbers; Predict the probability that the current sample belongs to the i-th class for the teacher model; Predict the probability that the current sample belongs to the i-th class for the student model; The knowledge distillation loss function is defined as follows: the class probability distribution of the student model should mimic that of the teacher model; the closer the two distributions are, the smaller the loss function. C represents the number of classes. This is a temperature coefficient used to control the degree of softening in the output probability. This represents the confidence value of the third pseudo-label data; a higher confidence value for the pseudo-labels generated by the teacher model allows for larger gradient updates to be applied to the student model. The loss function guides model learning, improving model performance.
[0084] Meanwhile, this invention provides:
[0085] A server includes a processor and a memory, the memory storing at least one program that is loaded and executed by the processor to implement the aforementioned semi-supervised dress code detection method for improving the quality of pseudo-labels.
[0086] A computer-readable storage medium storing at least one program that is loaded and executed by a processor to implement the above-described semi-supervised dress code detection method for improving the quality of pseudo-labels.
[0087] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. A semi-supervised method for detecting dress code errors to improve the quality of false labels, characterized in that, Includes the following steps: S1. Construct a dataset for the dress code detection task scenario and divide it into a training set and a validation set. The training set includes labeled data and unlabeled data. S2. Fine-tune the teacher model using labeled data, perform enhanced detection and deduplication filtering on the unlabeled data based on the fine-tuned teacher model to obtain pre-labeled data, and then deduplicate the pre-labeled data according to the category exclusion of the dress code detection task and the difficulty of the detection instance to obtain the first pseudo-label data. S3. Fine-tune the teacher model by combining the labeled data and the first pseudo-label data, and verify the average accuracy of the teacher model through the validation set. When the improvement of the average accuracy of the fine-tuned teacher model is less than the preset threshold, the teacher model reaches accuracy saturation. Conversely, step S2 is repeated using the fine-tuned teacher model to obtain the second pseudo-label data, and then the model is fine-tuned by combining the labeled data and the second pseudo-label data until the teacher model with saturated accuracy is obtained. The unlabeled data is processed using a teacher model with saturated precision to obtain the third pseudo-label data; S4. Use the labeled data and the third pseudo-label data as the training data for the student model. The training data is processed through two different data augmentation strategies to obtain two sets of preprocessed data. S5. After constraining the consistency of instance features on the two sets of preprocessed data, calculate the loss function of the labeled data and pseudo-label data in the dress code detection task respectively; finally, obtain the trained student model and use the trained student model to perform dress code detection.
2. The semi-supervised dress code detection method for improving the quality of false labels according to claim 1, characterized in that, Step S1 involves constructing a dress code detection task scenario dataset and dividing it into a training set and a validation set. The training set consists of labeled and unlabeled data representing actual application scenarios of dress codes, while the validation set consists of labeled data representative of dress code scenarios. The labeled data contains at least N target instances for each category, and the label information for each target instance is as follows: ,in, Indicates the target category, and Let x and y represent the x and y coordinates of the center point of the smallest bounding rectangle of the target instance, respectively. and These represent the width and height of the minimum bounding rectangle of the target instance, respectively.
3. The semi-supervised dress code detection method for improving the quality of false labels according to claim 1, characterized in that, Step S2 is as follows: S21. An open vocabulary target detection large model is adopted as the teacher model. During the training phase of the teacher model, the labeled data in the training set is used to fine-tune the teacher model: the text encoding features corresponding to the target categories in the labeled data are obtained through reasoning, the computational load of the teacher model in the fine-tuning phase is reduced, the parameters of the image encoding module in the teacher model are frozen, and the parameters of the text-image fusion module in the teacher model are updated through the learning rate. S22. When testing unlabeled data based on the fine-tuned teacher model, augmentation detection is performed on the unlabeled data. After merging the augmentation detection results of different unlabeled data, duplicate bounding boxes of the same target category in the merged results are removed using non-maximum suppression. By setting a uniform confidence threshold for different target categories, low-confidence false detection targets are filtered out to obtain pre-labeled data. The augmentation detection methods include image flipping and scaling. The pre-labeled data is generated from... composition, This represents the confidence value of the target instance in the pre-labeled data; S23. Based on the category exclusion of the dress code detection task and the difficulty of the detection instances, the pre-labeled data is further deduplicated and filtered to obtain the first pseudo-label data. This is achieved through the following steps: Based on the mutual exclusion relationship between the categories of the dress code detection task, the pre-labeled data of mutually exclusive categories are merged. After deduplication and filtering of the merged pre-labeled data of mutually exclusive categories by non-maximum suppression, the confidence threshold of the target category is set according to the detection difficulty of the target category in the pre-labeled data to further filter out false detection targets with low confidence. The remaining data after filtering is the first pseudo-label data.
4. The semi-supervised dress code detection method for improving the quality of false labels according to claim 1, characterized in that, Step S3 involves fine-tuning the teacher model by combining the labeled data and the first pseudo-label data. The teacher model parameter update strategy is consistent with that in step S21. When calculating the loss function using the first pseudo-label data, the confidence value of the target instance is used as the weight coefficient, and the calculation method is as follows: ; in, This represents the confidence value of the target instance in the first pseudo-label data. and These represent the category and regression loss of the first pseudo-label data, respectively. and These represent the categories of the labeled data and the regression loss, respectively. The accuracy of the teacher model is verified using a validation set. It is determined whether the average accuracy improvement of the teacher model in the current fine-tuning stage compared to the previous fine-tuning stage is less than a preset threshold. If it is less than the preset threshold, the teacher model has reached accuracy saturation. Otherwise, steps S22 and S23 are repeated to generate second pseudo-label data for the teacher model in the current fine-tuning stage, and fine-tuning continues until the teacher model's accuracy saturates. Steps S22 and S23 are then repeated on unlabeled data using the teacher model with saturated accuracy to obtain third pseudo-label data. , This indicates that the target category output branch has not been traversed. soft label vectors, Z represents the probability value of each target category. This represents the number of categories in the sample.
5. The semi-supervised dress code detection method for improving the quality of false labels according to claim 1, characterized in that, Step S4 involves using the labeled data and the third pseudo-label data as training data for the student model, and employing YOLOv8 as the student model. The loss function of the student model includes cross-entropy loss. Complete intersection and comparison loss and distribution focus loss During the student model training phase, two sets of preprocessed data were obtained by augmenting each batch of training data using two different data augmentation strategies. The two data augmentation strategies were mosaic augmentation and mixed data augmentation with the same coefficients, the difference being the use of different coefficients for image blurring, size scaling, and HSV color space enhancement.
6. The semi-supervised dress code detection method for improving the quality of false labels according to claim 1, characterized in that, Step S5 involves extracting instance features from the two sets of preprocessed data and applying instance feature consistency constraints, as detailed below: Bilinear interpolation is performed on instance features that have been scaled in data augmentation to obtain instance features of the same size as those that have not been scaled. Based on the coordinate information of the target instance label, the instance features obtained after bilinear interpolation of two sets of preprocessed data are extracted respectively; The extracted instance features are processed using Min-max normalization to eliminate the magnitude differences caused by different data augmentations, and the mean squared error loss function is calculated. The specific calculation formula is as follows: ; in, Indicates the number of target instances. For Min-max normalization processing, For the interception operation, For bilinear interpolation, and Two sets of preprocessed data, For student models, For student model parameters; Apart from In addition to the loss function, a loss function is calculated for the labeled data. The specific calculation formula is as follows: ; The third pseudo-label data uses logical distillation to transfer category knowledge, and uses confidence values as coefficients for the loss function. The loss function is calculated as follows: ; ; ; in, and Unprocessed of Vector elements are distinguished by their index numbers; Predict the probability that the current sample belongs to the i-th class for the teacher model; Predict the probability that the current sample belongs to the i-th class for the student model; Let C be the knowledge distillation loss function, and C be the number of categories. This is a temperature coefficient used to control the degree of softening in the output probability. This represents the confidence value of the third pseudo-label data.
7. A server, characterized in that, The server includes a processor and a memory, the memory storing at least one program that is loaded and executed by the processor to implement the semi-supervised dress code detection method for improving the quality of false tags as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The storage medium stores at least one program, which is loaded and executed by a processor to implement the semi-supervised dress code detection method for improving the quality of false tags as described in any one of claims 1 to 6.