A semi-supervised learning method for directional object segmentation
By using SAM in the directional target segmentation task to build a segmentation mask candidate library and optimize the pseudo-label strategy, the pseudo-label noise and segmentation problems are solved, the model performance is improved, the labeling cost is reduced, and a more efficient directional target segmentation is achieved. .
Patent Information
- Application Number
- CN202410370335.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-03-29
AI Technical Summary
In the task of directional target segmentation, the pseudo-labels in existing semi-supervised learning methods have large noise, under-segmentation and over-segmentation problems, which affect the model performance, and there is a high demand for expensive pixel-level annotation, resulting in cost and time. challenge.
A semi-supervised learning method for directional target segmentation is adopted. By splitting the data into labeled and unlabeled data, SAM is used to build a segmentation mask candidate library, and the pseudo labels are optimized by combining IoU optimal matching and synthetic partial integration strategies. Combine exponential moving average and data augmentation techniques to improve pseudo-label quality and model performance.
It significantly improves the quality of pseudo labels, improves the utilization of unlabeled data, reduces labeling costs, improves the performance of the model on RefCOCO, RefCOCO+ and G-Ref data sets, and achieves more efficient directional target segmentation.
Smart Images

Figure CN117975241B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image recognition, and in particular to a semi-supervised learning method for directional target segmentation using SAM as a guide. Background Art
[0002] Referring Expression Segmentation (RES) has attracted extensive attention in the field of vision and language research. Different from common visual localization tasks such as phrase localization and referring object detection, RES requires accurate pixel-level object segmentation in images based on referring expressions, which goes beyond simple bounding box recognition.
[0003] Although the RES task has made good progress recently, the high demand for pixel-level segmentation labeled data has become a major obstacle in the deployment of RES, especially in areas with extremely high labeling costs, such as medical imaging and autonomous driving. For the time calculation of pixel-level mask annotation for COCO images, it takes about 79.1 seconds to annotate a single mask. For the three benchmark datasets of the RES task, RefCOCO, RefCOCO+, and G-Ref, they all contain tens of thousands of labeled instances, which requires a lot of manual time and cost, such as Figure 4 As shown in Figure 2, the impact of cost and time, coupled with the possible inaccuracy of manual labeling, poses significant challenges to the scalability and reliability of the RES model, highlighting the urgent need for more efficient methods.
[0004] In order to address the challenges mentioned above, a semi-supervised learning framework can be used, semi-supervised referring expression segmentation, which aims to solve the expensive and time-consuming pixel-level annotation problem in the fully supervised referring expression segmentation (RES) task. It uses a large number of unsegmented image and text pairs and a small number of segmented annotated image and text pairs for semi-supervised learning, which significantly reduces the need for annotation while maintaining model performance. Considering that in the mutual learning stage of the semi-supervised framework of the ordinary teacher-student network, the quality of the pseudo-labels generated by the teacher model greatly affects the learning of the student model. For example, the original pseudo-labels usually have noise and the segmentation edges are not fine or complete, which may cause the model performance to fall into a suboptimal state, such as Figure 3 As shown in Figure 2, how to improve the quality of pseudo labels becomes the core issue.
[0005] Currently, this problem is often solved by using a confidence-based pseudo-label filtering strategy or an auxiliary correction network. Although it seems intuitive, relying solely on confidence for filtering may lead to reduced utilization of unlabeled data and lack flexibility in dealing with various noises in pseudo-labels. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a semi-supervised learning method for directional target segmentation, which can solve the problems of large noise, under-segmentation, over-segmentation and other imprecise and incomplete pseudo-labels in the semi-supervised learning of directional target segmentation, improve the quality of pseudo-label masks, and at the same time improve the utilization rate of unlabeled data.
[0007] The present invention is implemented as follows: a semi-supervised learning method for directional target segmentation, the method comprising:
[0008] Step S1, in the data splitting stage: split the three mainstream data sets of RES into labeled data and unlabeled data respectively, wherein the labeled data includes image-text pairs and segmented true masks, and the unlabeled data only includes image-text pairs;
[0009] Step S2: construct a segmentation mask candidate library offline using SAM, wherein the segmentation mask candidate library includes multi-scale candidate segmentations of unlabeled images in unlabeled data;
[0010] Step S3, in the warm-up phase: use the labeled data to train the pre-trained model, save the model parameters after the training, and assign them to the teacher and student models to initialize the model;
[0011] Step S4, in the iterative mutual learning stage between teachers and students: input the unlabeled image into the teacher model to obtain the pseudo-label, obtain the segmentation mask that best matches the pseudo-label from the segmentation mask candidate library, replace the mask in the pseudo-label, and obtain the optimized pseudo-label to supervise the student's training, and input the unlabeled image into the student model to obtain the student's prediction; at the same time, the labeled data continues to be supervised learning, and the teacher and student models are trained simultaneously, learn from each other, and make progress together.
[0012] Furthermore, the step S1 is specifically as follows: In the data splitting stage: for the three RES benchmark datasets RefCOCO, RefCOCO+, and G-Ref, split them into labeled data and unlabeled data , where there is labeled data It contains the true labels of image-text pairs and segmentation, and unlabeled data Contains only image-text pairs, not annotations of real labels:
[0013]
[0014]
[0015] in, , is the i-th labeled image and the i-th unlabeled image, and is the corresponding description text, is the i-th labeled image The true mask label of and are the number of labeled and unlabeled data, respectively. Usually .
[0016] Furthermore, the step S2 is specifically as follows: a segmentation mask candidate library is constructed offline using the "Segment Everything" function of SAM, wherein the segmentation mask candidate library includes multi-scale candidate segmentations of unlabeled images of the RES dataset, and a run-length encoding (RLE) algorithm is used to store the segmentation mask candidate library.
[0017] Furthermore, the optimization goal of the model training process in the warm-up phase in step S3 is defined as follows:
[0018]
[0019] in, represents the model's predicted mask for the jth pixel of the i-th labeled image, represents the corresponding true mask value, represents the binary cross entropy loss, and Indicates the height and width of the i-th labeled image;
[0020] After completing the Burn-In phase, we assign the trained model parameters to the teacher and student models in the mutual learning phase to prepare for the subsequent training process, as shown below:
[0021]
[0022] in, Represent the parameters of the teacher, student and warm-up stage model (Burn-In model) respectively.
[0023] Furthermore, in the iterative mutual learning phase between teachers and students in step S4:
[0024] The teacher generates pseudo labels for unlabeled data to supervise the training of the student, which is defined as follows:
[0025]
[0026] in, and denote the predicted masks of the student model and the teacher model for the jth pixel of the i-th unlabeled image, respectively. and Represents the height and width of the i-th unlabeled image;
[0027] At the same time, the student continues to train on a small amount of labeled data, and the two loss functions are combined and jointly optimized, which is defined as follows:
[0028]
[0029] in, and Respectively represent the supervised loss and unsupervised loss The weight coefficient of .
[0030] Furthermore, the parameters of the teacher model are updated by the exponential moving average method, which is defined as follows:
[0031]
[0032] in, denote the parameters of the teacher and student models respectively, is the decay factor of the EMA, usually set in a small range between 0.9 and 0.999.
[0033] Furthermore, in step S4, before the unlabeled image is input into the teacher model, weak data enhancement is first performed, and before the unlabeled image is input into the student model, weak data enhancement is first performed and then strong data enhancement is performed.
[0034] Furthermore, the specific method of "obtaining the segmentation mask that best matches the pseudo label from the segmentation mask candidate library" in step S4 is as follows:
[0035] Pre-set the corresponding strategy for optimizing pseudo labels, and select appropriate candidate masks generated by SAM from the segmentation mask candidate library according to the original pseudo labels to optimize the pseudo labels; the strategy for optimizing pseudo labels includes the optimal matching strategy based on IoU and the synthetic partial integration strategy CPI;
[0036] When there is noise in the pseudo-label, the optimal matching strategy based on IoU is used to optimize the pseudo-label. When there is under-segmentation and over-segmentation in the pseudo-label, the synthetic partial integration strategy CPI is used.
[0037] Furthermore, the IoU-based optimal matching strategy performs pseudo-label optimization, specifically including: calculating the similarity between the pseudo-label and each segmentation generated by SAM, identifying the segmentation with the highest similarity score, ensuring that it is closely aligned with the overall target mask, and using the intersection over union (IoU) similarity metric to quantify the degree of overlap between two regions:
[0038] in, and denote the pseudo label and the value on the kth segmentation mask of the jth pixel of the i-th unlabeled image generated by SAM, respectively. Exceeding a certain threshold , the best matching mask will replace the pseudo-label.
[0039] Furthermore, the synthetic partial integration strategy CPI specifically includes:
[0040] When the pseudo-label has an under-segmentation problem, that is, the coverage of the target instance is incomplete and there are pixels in some areas that lack activation, a larger area is identified in the candidate library to correct the pseudo-label. At this time, the overlap ratio with the pseudo-label is selected, which is calculated as follows:
[0041]
[0042] in, is a smoothing factor to prevent the denominator from being zero. Exceeding a predefined threshold When , select the kth segmentation generated by SAM , and then the refined pseudo-labels constructed in the k-1 step are combined to replace the original pseudo-labels. This method is called CPI-U;
[0043] On the contrary, when the pseudo-label has an over-segmentation problem, that is, the wrong area is introduced into the segmentation mask, the segmentation function of SAM is used to filter out the extra noise. The selection is based on the overlap ratio with the candidate mask, which is calculated as follows:
[0044]
[0045] When the ratio Exceeding the set threshold When , select the kth segmentation generated by SAM , and integrate them to refine the pseudo-labels, an approach called CPI-O.
[0046] Furthermore, when the scores of the candidates calculated by the two strategies for optimizing pseudo-labels do not reach a certain threshold, indicating that the segmentation generated by SAM does not match the current pseudo-label, the original pseudo-label is used, and a pixel-wise adjustment strategy (PWA) is adopted to assign different weights according to the pixel confidence level to strengthen the model's attention to reliable pixel pairs in the original pseudo-label, ensuring that the focus remains on high-quality data points, as follows:
[0047] Mapping function that converts pixel confidence into weight is defined as follows:
[0048]
[0049] in, , and are hyperparameters, set to 1.3, 0.1, and 0.5, respectively. Therefore, the loss for the i-th unlabeled image is defined as follows:
[0050] .
[0051] The present invention has the following advantages:
[0052] 1. Set up the semi-supervised learning framework of this application by defining the warm-up phase strategy, data augmentation technology and exponential moving average method. This is a semi-supervised framework tailored for RES, which can efficiently train the model with a small amount of labeled data and a large amount of unlabeled data, thereby reducing the dependence on expensive pixel-level annotations;
[0053] 2. Considering that the quality of pseudo labels may affect the learning of the student model, we introduce IoU-based optimal matching (IOM) and synthetic partial integration (CPI) to generate high-quality pseudo labels using the powerful segmentation capability of SAM;
[0054] 3. A large number of experiments show that the SemiRES framework proposed in this paper achieves significant performance improvements on three benchmark datasets RefCOCO, RefCOCO+ and G-Ref, while reducing the labeling cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0056] Figure 1 The present invention is a schematic diagram of the execution flow of a semi-supervised learning method for directional target segmentation.
[0057] Figure 2 A schematic diagram of the principle of a semi-supervised learning method for directional target segmentation according to the present invention.
[0058] Figure 3 Schematic diagram of the comparison results between SemiRES proposed in this application and the semi-supervised baseline model on the selected examples.
[0059] Figure 4 The horizontal axis is the proportion of labeled data, and the vertical axis is the annotation cost.
[0060] Figure 5 Comparison of our method with the baseline model on the RefCOCO dataset. The horizontal axis is the proportion of labeled data, and the vertical axis is the evaluation index total intersection-over-union ratio.
[0061] Figure 6 Table showing the performance (overall IoU) comparison of SemiRES with other methods on the RES benchmark dataset.
[0062] Figure 7 The two matching strategies IOM and CPI designed for us solve several common problems in pseudo-labeling. The results of each row are text, original image, pseudo-label, SAM segmentation result, IOM prediction result, CPI prediction result, and true mask label.
[0063] Figure 8 These are the training curves of the two matching strategies and variants of SemiRES of the present invention and the semi-supervised baseline (the horizontal axis is the number of iterations of the training process, and the vertical axis is the overall intersection-union ratio).
[0064] Fig. 9 A classic example diagram of the SemiRES we built for visualization on the RefCOCO dataset. DETAILED DESCRIPTION
[0065] The technical solution in the embodiments of the present application has the following overall idea: a semi-supervised learning framework SemiRES tailored for RES is designed, and a small-scale image-text pair dataset, which contains segmentation mask annotations, and a large number of unlabeled image-text pairs without segmentation mask annotations, is used to train the model. First, we established a baseline model of semi-supervised RES, including a comprehensive training process, and used data enhancement and exponential moving average training mechanisms. However, this baseline model faces a major challenge: the pseudo-labels are incomplete and noisy for the target instances, which may cause the model performance to fall into a suboptimal state, such as Figure 3As shown, it is shown that SemiRES we constructed solves the problems of supervised and semi-supervised baseline models. The key to semi-supervised learning is to optimize these pseudo labels to improve their quality. The motivation of SemiRES in this application is to use the powerful segmentation ability of SAM (Segment Anything Model) to correct pseudo labels, especially to optimize the areas near the edges of instances. Specifically, we use SAM to extract multi-scale masks from the original image to build a mask candidate library. The core of SemiRES is to retrieve one or more candidate masks from this library to reconstruct high-quality pseudo labels. To achieve this, we propose two strategies: IoU-based optimal matching (IOM) and synthetic part integration (CPI). The first strategy assumes that the candidate mask library contains a mask that closely matches the target instance, so it uses IoU (Intersection over Union) to directly retrieve and replace the pseudo label with the best matching mask in the library. The second strategy gets rid of this assumption and instead uses different part-specific candidate masks selected from the library according to the pseudo label to assemble a complete mask. In the case that neither strategy can retrieve a suitable mask from the candidate library, we will default to using the original pseudo-label itself to optimize the student model. To enhance training in this case, we design a Pixel-Wise Adjustment (PWA) strategy to adjust the final loss pixel by pixel according to the confidence level on the pseudo-label.
[0066] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0067] Please refer to Figure 1 and Figure 2 The present application provides a semi-supervised learning method for directional target segmentation, the method comprising:
[0068] Step S1, in the data splitting stage: split the three mainstream data sets of RES into labeled data and unlabeled data respectively, wherein the labeled data includes image-text pairs and segmented true masks, and the unlabeled data only includes image-text pairs;
[0069] Step S2: construct a segmentation mask candidate library offline using SAM, wherein the segmentation mask candidate library includes multi-scale candidate segmentations of unlabeled images in unlabeled data;
[0070] Step S3, in the warm-up phase: use the labeled data to train the pre-trained model, save the model parameters after the training, and assign them to the teacher and student models to initialize the model;
[0071] Step S4, in the iterative mutual learning stage between teachers and students: input the unlabeled image into the teacher model to obtain the pseudo-label, obtain the segmentation mask that best matches the pseudo-label from the segmentation mask candidate library, replace the mask in the pseudo-label, and obtain the optimized pseudo-label to supervise the student's training, and input the unlabeled image into the student model to obtain the student's prediction; at the same time, the labeled data continues to be supervised learning, and the teacher and student models are trained simultaneously, learn from each other, and make progress together.
[0072] The step S1 is as follows: In the data splitting stage, for the three RES benchmark datasets RefCOCO, RefCOCO+, and G-Ref, they are split into labeled data and unlabeled data , where there is labeled data It contains the true labels of image-text pairs and segmentation, and unlabeled data Contains only image-text pairs, not annotations of real labels:
[0073]
[0074]
[0075] in, , is the i-th labeled image and the i-th unlabeled image, and is the corresponding description text, is the i-th labeled image The true mask label of and are the number of labeled and unlabeled data, respectively. Usually .
[0076] It is worth noting that in the unlabeled set There are no ground-truth mask labels in , and only description text is used as input. Our main goal is to leverage this small labeled set and a large unlabeled set , to achieve good performance in the RES task.
[0077] In a preferred embodiment, although the semi-supervised framework utilizes a large amount of unlabeled data, the pseudo-labels generated by the teacher model are usually noisy or have incomplete boundaries. The visual segmentation large model SAM has demonstrated powerful segmentation capabilities, but effectively utilizing this capability for pseudo-label refinement is an area worth exploring. In this application, we have developed two strategies for matching the segmentation candidates generated by SAM with the original pseudo-labels to improve their accuracy. Before using these strategies, we used SAM's "Segment Everything" function to build a segmentation mask candidate library offline, which contains our multi-scale candidate segmentations of unlabeled images of the RES dataset, eliminating the need for specific prompts. In order to optimize storage space, we use the run length encoding (RLE) algorithm for storage. Considering that SAM can generate hundreds to thousands of complex segmentations for each image, it is crucial to adopt an efficient storage solution. It is worth noting that although the RLE algorithm achieves a high compression rate, it also retains the accuracy of the candidate mask.
[0078] In a preferred embodiment, the optimization target of the model training process in the warm-up phase in step S3 is defined as follows:
[0079]
[0080] in, represents the model's predicted mask for the jth pixel of the i-th labeled image, represents the corresponding true mask value, represents the binary cross entropy loss, and Indicates the height and width of the i-th labeled image;
[0081] After completing the warm-up phase, we assign the trained model parameters to the teacher and student models in the mutual learning phase to prepare for the subsequent training process, as shown below:
[0082]
[0083] in, Represent the parameters of the teacher, student and warm-up phase models respectively.
[0084] In a preferred embodiment, in the iterative mutual learning phase between teacher and students in step S4:
[0085] The teacher generates pseudo labels for unlabeled data to supervise the training of the student, which is defined as follows:
[0086]
[0087] in, and denote the predicted masks of the student model and the teacher model for the jth pixel of the i-th unlabeled image, respectively. and Represents the height and width of the i-th unlabeled image;
[0088] At the same time, the student continues to train on a small amount of labeled data, and the two loss functions are combined and jointly optimized, which is defined as follows:
[0089]
[0090] in, and Respectively represent the supervised loss and unsupervised loss The weight coefficient of .
[0091] In a preferred embodiment, in order to maintain the stability of pseudo labels, we do not use gradient backpropagation to update the parameters of the teacher model. Instead, we use the exponential moving average (EMA) method to create an aggregate model that reflects the current and previous states. The effectiveness of EMA has been demonstrated in many studies. Using EMA not only improves the accuracy of the teacher model, but also enhances its stability, making it a useful tool in the mutual learning stage. The parameters of the teacher model are updated by the exponential moving average (EMA) method, which is defined as follows:
[0092]
[0093] in, is the decay factor of the EMA, usually set in a small range between 0.9 and 0.999.
[0094] In a preferred embodiment, in step S4, weak data enhancement is performed before the unlabeled image is input into the teacher model, and weak data enhancement and then strong data enhancement are performed before the unlabeled image is input into the student model.
[0095] Data augmentation plays a vital role in the generalization and robustness of the model. In our method, we designed strong and weak data augmentation strategies. For unlabeled images, we perform weak augmentation on them and input them into the teacher model. On the basis of weak augmentation, we add strong augmentation to them and input them into the student model. The weak augmentation we use here is RandomGaussianBlur, and the strong augmentation adds RandomColorJitter on this basis.
[0096] In a preferred embodiment, the specific method of "obtaining the segmentation mask that best matches the pseudo label from the segmentation mask candidate library" in step S4 is as follows:
[0097] Pre-set the corresponding strategy for optimizing pseudo labels, and select appropriate candidate masks generated by SAM from the segmentation mask candidate library according to the original pseudo labels to optimize the pseudo labels; the strategy for optimizing pseudo labels includes the optimal matching strategy based on IoU and the synthetic partial integration strategy CPI;
[0098] When there is noise in the pseudo-label, the optimal matching strategy based on IoU is used to optimize the pseudo-label. When there is under-segmentation and over-segmentation in the pseudo-label, the synthetic partial integration strategy CPI is used.
[0099] In a preferred embodiment, to achieve our goal, we initially considered a more direct approach based on the powerful multi-scale segmentation capabilities of SAM. We assume that among the constructed segmentation mask candidates, it is very likely to contain an approximation of the ideal target segmentation. Therefore, our task is reduced to designing a method to retrieve this optimal mask from the library. Our method involves an IoU-based selection process that calculates the similarity between the pseudo-label and each segmentation generated by SAM. Our goal is to identify the segmentation with the highest similarity score, ensuring that it is closely aligned with the overall target mask. The similarity metric uses the Intersection over Union (IoU) metric, which is a standard in object detection and segmentation tasks to quantify the degree of overlap between two regions. By selecting the segmentation with the highest IoU score from the candidate library, we are able to effectively align the output of our model with the most accurate representation of the expected segmentation. The IoU-based Optimal Matching (IOM) strategy performs pseudo-label optimization, specifically including:
[0100] in, and denote the pseudo label and the value on the kth segmentation mask of the jth pixel of the i-th unlabeled image generated by SAM, respectively. Exceeding a certain threshold , the best matching mask will replace the pseudo-label.
[0101] In a preferred embodiment, during our exploration of the semi-supervised pointed object segmentation task, we realized that although the IoU-based optimal matching (IOM) strategy is generally straightforward and effective, it may fail in some cases. One such case is when the proposal base lacks an ideal object segmentation, and even the most sophisticated matching algorithm cannot find an appropriate mask. Another case is when the difference between the pseudo-label and the desired segmentation is too large to make an effective correction. We note that the original pseudo-labels generated by the teacher model may be affected by the over-segmentation or under-segmentation of the target instance, such as Figure 7As shown in the figure, the pseudo labels, SAM, IOM, CPI, and real label examples obtained by processing the images in the text image pair. We found that the pseudo labels of different images may have noise problems (Noisy) or under-segmentation problems (Under-Segmentation) or over-segmentation problems (Over-Segmentation). These inaccuracies reduce the quality of pseudo labels, provide incorrect guidance for the student model, and hinder its learning. To solve this problem, we propose a composite parts integration strategy CPI (Composite Parts Integration), which specifically includes:
[0102] When the pseudo-label has an under-segmentation problem, that is, the coverage of the target instance is incomplete and there are some areas where pixels lack activation, our goal is to identify larger areas in the candidate library to correct the pseudo-label. At this time, the selection is based on the overlap ratio with the pseudo-label, which is calculated as follows:
[0103]
[0104] in, is a smoothing factor to prevent the denominator from being zero. Exceeding a predefined threshold When , select the kth segmentation generated by SAM , and then the refined pseudo-labels constructed in the k-1 step are combined to replace the original pseudo-labels. This method is called CPI-U;
[0105] On the contrary, when the pseudo-label has an over-segmentation problem, that is, the wrong area is introduced into the segmentation mask, in order to alleviate this problem, the segmentation function of SAM is used to filter out the additional noise. The selection is based on the overlap ratio with the candidate mask, which is calculated as follows:
[0106]
[0107] When the ratio Exceeding the set threshold When , select the kth segmentation generated by SAM , and integrate them to refine the pseudo-labels, an approach called CPI-O. When both conditions are met, we form the complete CPI strategy.
[0108] In a preferred embodiment, when the scores of the candidates calculated by the two strategies for optimizing pseudo-labels do not reach a certain threshold, indicating that the segmentation generated by SAM does not match the current pseudo-label, the original pseudo-label is used, and a pixel-wise adjustment strategy (PWA) is used to assign different weights according to the pixel confidence level to strengthen the model's attention to reliable pixel pairs in the original pseudo-label, ensuring that the focus remains on high-quality data points, as follows:
[0109] Mapping function that converts pixel confidence into weight is defined as follows:
[0110]
[0111] in, , and are hyperparameters, set to 1.3, 0.1, and 0.5, respectively. Therefore, the loss for the i-th unlabeled image is defined as follows:
[0112] .
[0113] Although our two strategies for optimizing pseudo-labels are very effective, in some cases, the scores of candidates calculated by both strategies do not reach a certain threshold, indicating that the segmentation generated by SAM does not match the current pseudo-label. In this case, we use the original pseudo-label based on the pixel-wise adjustment strategy (Pixel-Wise Adjustment, PWA). The core goal of PWA is to assign different weights to pixels according to their confidence levels. For those high-confidence pixels, scores close to 0 or 1, indicating that the pixels are very confident about the foreground or background, we give these pixels more attention weights. On the contrary, pixels with scores close to 0.5 are usually associated with noise or uncertainty, and they will be given lower weights to reduce their impact on training.
[0114] The present invention utilizes semi-supervised learning to solve the problem of expensive pixel-level labels in the directional target segmentation task. It uses the effectiveness of the Burn-In strategy, data enhancement technology and exponential moving average method. Meanwhile, considering that the quality of pseudo-labels may affect the learning of the student model, thereby affecting the process of mutual training between teachers and students and affecting the final performance of the model, we propose two pseudo-label refinement strategies IOM and CPI based on SAM, which can realize a semi-supervised directional target segmentation framework SemiRES, which uses a small amount of labeled data and a large amount of unlabeled data to efficiently train the model, thereby reducing the dependence on expensive pixel-level annotations and improving the processing efficiency of image segmentation tasks.
[0115] To further qualitatively verify the effectiveness of our proposed SemiRES, we conducted extensive experiments on three RES benchmark datasets: RefCOCO, RefCOCO+, and G-Ref. Our experiments show that SemiRES significantly outperforms supervised and semi-supervised baseline models in all different settings of labeled data ratios. For example, on RefCOCO with 1% labeled data, Figure 5 As shown in Figure 3, the performance of SemiRES is improved by +18.64% and +8.28% over the supervised and semi-supervised baseline models, respectively, highlighting its significant potential in practical applications.
[0116] The specific experimental results are as follows:
[0117] The invention is trained and tested on the directed object segmentation task (RES). We verify the effectiveness of our proposed method on three standard RES enchmark datasets, including RefCOCO, RefCOCO+ and G-Ref. The images of these datasets are from the MS-COCO dataset, and each image is accompanied by one or more short text captions.
[0118] RefCOCO and RefCOCO+ contain 19,994 and 19,992 images, with 50,000 and 49,856 annotated objects and 142,209 and 141,564 directional descriptions, respectively. RefCOCO and RefCOCO+ are divided into four parts, namely training set, validation set, test set A and test set B. The representation of RefCOCO mainly involves absolute position, while the representation of RefCOCO+ contains more attribute-related information.
[0119] G-Ref contains 26,711 images with 54,822 annotated objects and 104,560 directional descriptions. In contrast, G-Ref contains more complex expressions with an average length of 8.4 words, making the dataset more challenging. In addition, the G-Ref dataset is divided into a version split by UMD and another version split by Google, and we provide results on the UMD version.
[0120] exist Figure 6In the table, we conduct experiments on RefCOCO, RefCOCO+, and G-Ref in the settings of 0.5%, 1%, 2%, and 5% labeled data. From the results, we can see that the performance of the supervised models will drop significantly when there is a lack of sufficient labeled data. For example, with 0.5% labeled data, the overall IoU on the RefCOCO validation set is only 22.37%. We also compare with common semi-supervised baselines as described in Section 3.2. The baseline model outperforms the supervised methods in all settings, for example, it shows a +7.96% improvement on the RefCOCO validation set when trained with the setting of 0.5% labeled data. Most importantly, our proposed SemiRES achieves state-of-the-art performance relative to the baseline. Compared with the supervised models, SemiRES obtains +17.94%, +18.64%, +15.39%, and +11.91% improvements on the RefCOCO validation set in the cases of 0.5%, 1%, 2%, and 5% labeled data, respectively.
[0121] Figure 8 The training curves of two matching strategies and variants of SemiRES and the semi-supervised baseline are shown. It can be seen that both matching strategies improve the performance compared with the baseline model. Among them, CPI-U performs best.
[0122] We are Fig. 9 Typical qualitative results are shown in Figure 1, comparing the SemiRES of this application (Ours in the figure) with a supervised model (the supervised model in the figure is a model trained with only a fixed amount of labeled data but no unlabeled data), a semi-supervised baseline (i.e., Baseline), and the ground truth (i.e., the true label Ground Truth). Impressively, SemiRES corrects the errors of the supervised model and the semi-supervised baseline. For example, in the first example, the supervised model and the baseline model failed to correctly interpret "far right", resulting in the misidentification of the luggage, while SemiRES accurately located the target. In the second example, SemiRES effectively understood "smile" and accurately segmented the correct pizza. In the third, more complex example involving multiple elephants, SemiRES accurately identified that the described elephant was facing us, not with its back to us, demonstrating its excellent semantic understanding ability. In summary, the SemiRES method we proposed maintains good results in performance while saving annotation costs.
[0123] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A semi-supervised learning method for directional target segmentation, characterized by: The method comprises: Step S1, in the data splitting stage: split the three benchmark data sets of RES into labeled data and unlabeled data respectively, wherein the labeled data includes image-text pairs and segmented true masks, and the unlabeled data only includes image-text pairs; Step S2: construct a segmentation mask candidate library offline using SAM, wherein the segmentation mask candidate library includes multi-scale candidate segmentations of unlabeled images in unlabeled data; Step S3, in the warm-up phase: use the labeled data to train the pre-trained model, save the model parameters after the training, and assign them to the teacher model and the student model to initialize the model; Step S4, in the iterative mutual learning stage between the teacher model and the student model: input the unlabeled image into the teacher model to obtain a pseudo label, obtain the segmentation mask that best matches the pseudo label from the segmentation mask candidate library, replace the mask in the pseudo label with it, and obtain the optimized pseudo label to supervise the training of the student model, input the unlabeled image into the student model to obtain the student model prediction; at the same time, continue to perform supervised learning on the labeled data, and the teacher model and the student model are trained simultaneously, learn from each other, and make progress together; The optimization goal of the model training process in the warm-up phase in step S3 is defined as follows: in, represents the model's predicted mask for the jth pixel of the i-th labeled image, represents the corresponding true mask value, represents the binary cross entropy loss, H and W represent the height and width of the i-th labeled image; After the warm-up phase is completed, the trained model parameters are assigned to the teacher model and student model in the mutual learning phase to prepare for the subsequent training process, as shown below: i t ←θ,θ S ←θ Among them, θ t ,θ s , θ represent the parameters of the teacher model, student model and warm-up stage model respectively; The specific method of "obtaining the segmentation mask that best matches the pseudo label from the segmentation mask candidate library" in step S4 is as follows: Pre-set the corresponding strategy for optimizing pseudo labels, and select a suitable candidate mask generated by SAM from the segmentation mask candidate library according to the original pseudo labels to optimize the pseudo labels; the strategy for optimizing pseudo labels includes an optimal matching strategy based on IoU and a synthetic partial integration strategy CPI; When there is noise in the pseudo-label, the optimal matching strategy based on IoU is used to optimize the pseudo-label. When there is under-segmentation and over-segmentation in the pseudo-label, the synthetic partial integration strategy CPI is used. The IoU-based optimal matching strategy performs pseudo-label optimization, specifically including: calculating the similarity between the pseudo-label and each segmentation generated by SAM, identifying the segmentation with the highest similarity score, ensuring that it is closely aligned with the overall target mask, and using the intersection over union (IoU) similarity metric to quantify the degree of overlap between two regions: in, represents the predicted mask generated by the teacher model for the jth pixel of the i-th unlabeled image; represents the label value of the jth pixel on the kth mask generated by SAM for the i-th unlabeled image. When the score s k Exceeding a certain threshold IoU rate When , the best matching mask will replace the pseudo-label; The synthetic partial integration strategy CPI specifically includes: When the pseudo-label has an under-segmentation problem, that is, the coverage of the target instance is incomplete and there are pixels in some areas that lack activation, a larger area is identified in the candidate library to correct the pseudo-label. At this time, the ratio of the overlapping area between the pseudo-label and the candidate mask to the pseudo-label is selected, which is calculated as follows: Where, ∈ is a smoothing factor used to prevent the denominator from being zero. When the predefined threshold inter1 is exceeded, the kth segment generated by SAM is selected It is represented as the label value on the kth mask generated by SAM for the i-th unlabeled image, and then the refined pseudo-label constructed by the k-1th segmentation is unioned to replace the original pseudo-label. This method is called CPI-U. On the contrary, when the pseudo-label has an over-segmentation problem, that is, the wrong area is introduced into the segmentation mask, the segmentation function of SAM is used to filter out the extra noise, and the ratio of the overlapping area between the pseudo-label and the candidate mask to the candidate mask is selected, which is calculated as follows: When the ratio When the set threshold inter2 is exceeded, the kth segment generated by SAM is selected And integrate them to refine the pseudo-labels, this method is called CPI-O; When the scores of the candidates calculated by the two strategies for optimizing pseudo-labels do not reach a certain threshold, it indicates that the segmentation generated by SAM does not match the current pseudo-label. In this case, the original pseudo-label is used, and the pixel-level adjustment strategy PWA is used to assign different weights according to the pixel confidence level, as follows: The mapping function Ψ that converts pixel confidence into weight is defined as follows: Among them, γ, σ 2 and μ are hyperparameters, set to 1.3, 0.1, and 0.5, respectively. Therefore, the loss for the i-th unlabeled image is defined as follows: in, and They represent the predicted masks of the student model and the teacher model for the jth pixel of the i-th unlabeled image, respectively.
2. The semi-supervised learning method for directional target segmentation according to claim 1, characterized in that: The step S1 is specifically as follows: In the data splitting stage: for the three RES benchmark datasets RefCOCO, RefCOCO+, and G-Ref, they are split into labeled data D l and unlabeled data D u , where there is labeled data D l It contains the true labels of image-text pairs and segmentation, and the unlabeled data D u Contains only image-text pairs, not annotations of real labels: in, is the i-th labeled image and the i-th unlabeled image, and is the corresponding description text, is the i-th labeled image The true mask label, N l and N u are the number of labeled and unlabeled data, N l <<N u .
3. The semi-supervised learning method for directional target segmentation according to claim 1, characterized in that: In step S4, during the iterative mutual learning phase between the teacher model and the student model: The teacher model generates pseudo labels for unlabeled data to supervise the training of the student model, which is defined as follows: in, and Denote the predicted masks of the jth pixel of the i-th unlabeled image by the student model and the teacher model respectively, and H and W denote the height and width of the i-th unlabeled image; At the same time, the student model continues to be trained on a small amount of labeled data, and the two loss functions are combined for joint optimization, which is defined as follows: Among them, λ sup and λ unsup Respectively represent the supervised loss and unsupervised loss The weight coefficient of .
4. The semi-supervised learning method for directional target segmentation according to claim 1, characterized in that: The parameters of the teacher model are updated by the exponential moving average method, which is defined as follows: i t ←th t +(1-α)θ s Among them, θ t ,θ s denote the parameters of the teacher model and the student model respectively, and α is the decay coefficient of EMA, which is set in a small range between 0.9 and 0.
999.
5. The semi-supervised learning method for directional target segmentation according to claim 1, characterized in that: In the step S4, weak data enhancement is performed before the unlabeled image is input into the teacher model, and weak data enhancement is performed before the unlabeled image is input into the student model.
