An open-world object detection method based on visual large model enhancement
Through visual large model enhancement and object reconstruction, the Weibull model solves the label bias problem of unknown object recognition in open world target detection, improves detection accuracy and generalization performance, and achieves accurate identification and recognition of known and unknown categories. Incremental learning.
Patent Information
- Application Number
- CN202410301193.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-03-15
AI Technical Summary
Existing open world target detection methods have serious label bias problems when identifying unknown objects, and tend to regard areas that are dissimilar to known objects as background, resulting in low detection accuracy.
Using a method based on visual large model enhancement, the original pseudo-label of the unknown object is obtained through unsupervised learning, and the Weibull model based on object reconstruction is used to model the foreground and background areas, calculate the soft label, and estimate the likelihood score of the unknown object. The target detector is trained with the labels of known objects, and the joint training of RPN region suggestion generation and ROI classification is decoupled to improve the generalization performance of unknown categories.
It reduces the cost of manual annotation, improves the accuracy of target detection in the open world, effectively identifies known and unknown categories, and continuously learns new categories through incremental learning, improving the recognition accuracy of unknown objects.
Smart Images

Figure CN118097289B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information technology, and in particular relates to an open world target detection method based on visual large model enhancement. Background Art
[0002] With the continuous development of deep learning methods, the progress of target detection research has been accelerated. The task of target detection is to identify and locate targets in images. Traditional target detection methods are all aimed at working in a closed set, that is, all classes in the training phase are known, so they can only detect known categories. If our set is in the open world, two more challenging problems arise: 1) During the test process, the image contains unknown categories, and these unknown classes need to be detected as unknown classes; 2) When the corresponding labels are given to the unknown classes, the model needs to incrementally learn new classes. We define this problem as open world label detection.
[0003] Open-world object detection methods need to not only identify known categories, but also identify all unknown instances as unknown. Human annotators can then add labels for classes of interest, and the model incrementally learns these classes in the next task; but in some cases, identifying unknown objects is critical. For example, self-driving cars or robots need to detect unknown obstacles to avoid collisions and ensure safety.
[0004] Current open-world object detection methods focus on labeling those areas that do not overlap with known objects and have high target scores as potential unknown categories through pseudo-labeling, and their performance relies heavily on the supervision of known objects. These methods can successfully detect unknown objects with similar features to known objects. However, they have a serious label bias problem, that is, they tend to regard all areas that are not similar to known objects as part of the background (A method for open-set object detection and recognition based on deep neural networks (CN114241260A)). Summary of the invention
[0005] The present invention aims to solve the above-mentioned problems. To this end, the purpose of the present invention is to propose an open-world target detection method based on visual big model enhancement, which uses the visual big model to preprocess the input image, obtains the original pseudo-label of the unknown object in an unsupervised manner, and then uses the proposed Weibull model based on object reconstruction to model the unknown object, thereby realizing the detection of known and unknown categories in an open environment, reducing the cost of manual labeling, and improving the target detection accuracy in the open world.
[0006] The purpose of the present invention is achieved by at least one of the following technical solutions.
[0007] A method for open world object detection based on visual large model enhancement includes the following steps:
[0008] S1. Use the visual big model to preprocess the input image and obtain the original pseudo label of the unknown object;
[0009] S2. Using the Weibull model based on object reconstruction, the foreground and background regions are modeled, and soft labels are calculated for pseudo unknown objects to estimate the likelihood score of the unknown object and determine whether the unknown object is a real unknown object;
[0010] S3. In the training phase, the joint training of RPN region proposal generation and ROI classification of the decoupled target detector is used to improve the generalization performance of region proposal for unknown categories. Then, the target detector is trained using the labels of known objects and the pseudo labels of unknown objects to obtain the open world target detection model SAM-OWOD based on visual large model enhancement.
[0011] S4. In the reasoning stage, the image that needs to be detected in the open world is input, and the open world object detection model SAM-OWOD based on visual large model enhancement is used to identify known and unknown categories;
[0012] S5. Based on the provided unknown class labels, new classes are learned using incremental learning methods, and then open-world object detection is achieved cyclically.
[0013] Furthermore, in step S1, the input image includes known objects that have been labeled and unknown objects that have not been labeled;
[0014] Use SAM to preprocess the input image, use SAM's ability to segment any object, segment the image, and generate candidate boxes based on the mask. The objects in the candidate boxes include known objects and unknown objects. In order to obtain pseudo labels for unknown objects, use NMS to filter duplicate candidate boxes, and then calculate the IOU of the object candidate boxes generated by SAM and the candidate boxes of the labeled objects. If the IOU is less than the set threshold a, it is considered to be an unknown object, thereby obtaining the original pseudo label of the unknown object.
[0015] The input image is the MS-COCO standard dataset commonly used for target detection. SAM stands for SegmentAnything Model, which is a large-scale visual model for segmenting any object. NMS is the abbreviation of Non-Maximum Suppression. In the field of target detection, NMS is a technology used to screen candidate boxes with the highest confidence. IOU stands for Intersection over Union, which is a metric commonly used to evaluate the degree of overlap between two candidate boxes.
[0016] Further, in step S2, according to the different feature frequencies of the foreground and background in different images, from the perspective of feature frequency, the background area and the foreground area respectively form two different distributions. In the Weibull model ORW based on object reconstruction, the automatic encoder based on data reconstruction learns the frequency information, and models the two different distributions of the reconstruction error through the prior probability distribution. Since the Weibull distribution performs well in fitting various distribution shapes, the Weibull distribution is used as the prior model in the Weibull model ORW based on object reconstruction. The Weibull model ORW based on object reconstruction models the foreground and background areas, calculates soft labels for pseudo unknown objects, and estimates the possibility scores of unknown objects.
[0017] Therefore, in order to model the foreground and background areas, the Weibull model (ORW) based on object reconstruction first uses SAM to segment all objects in the image and generates candidate boxes for all objects based on the mask; then the backbone network is used to reconstruct the input image. Extract feature map , , ,In order to fully represent the semantic information of the object, the candidate boxes of all objects generated by SAM are mapped into the feature map, and the feature vector of the candidate box of each object represents the area within the receptive field;
[0018] In the Weibull model ORW based on object reconstruction, an autoencoder is used to reconstruct these regional features, that is, the feature vector of the candidate box of each object; the encoder and decoder of the autoencoder are respectively denoted as and ; The encoder first transforms the feature map Mapped to a low-dimensional latent space feature map , , the decoder transforms the latent space feature map Reconstruct into the original dimension and obtain the reconstructed features , ;use The distance is used to measure the reconstruction error of each object, and the reconstruction error of each object is used as the training loss of the autoencoder. The process can be expressed as follows:
[0019] ; (1)
[0020] ; (2)
[0022] in, represents the training loss of the autoencoder, Indicates that the input image I belongs to the dimension The matrix of represents the height of the input image I, represents the width of the input image I, represents the number of channels of the input image I, Represents the latent space feature map The size dimension is The matrix of Represents the latent space feature map The number of channels, Represents the position of the feature map in the feature space , and Indicates location In Regional characteristics of the dimension; express Norm loss.
[0023] Furthermore, the regional features of each object represent the features of the anchor box at the corresponding position, so a foreground / background label is assigned to each object according to the corresponding anchor box of each object; as discussed earlier, background regions usually have frequently occurring features, making them easier to reconstruct and having smaller reconstruction errors than the infrequent features of various foreground object regions; when the autoencoder is trained to convergence, by calculating the foreground / background labels of each object Distance, that is Get the reconstruction error map , ; By randomly sampling objects in known and background areas from the training set of the MS-COCO dataset, a set of reconstruction errors are collected and recorded as and ; The reconstruction error of known object regions is usually much larger than that of background regions. Although unknown objects may have different appearances from known objects, they can be assumed to have similar low occurrence frequencies and high reconstruction errors because there are various types of unknown objects; The distribution of all foreground regions is estimated using the reconstruction errors extracted from samples of known objects;
[0024] Since the Weibull distribution has the advantage of fitting a wide range of distribution shapes in many real-world scenes, it is used as a priori model in ORW. The Weibull distributions of the known region and the background region are denoted as and , the specific form is as follows:
[0025] (3)
[0026] in, Represents the reconstruction error value of the sample object; is the probability density function of the exponential Weibull distribution, and is the shape parameter of the probability density function; and background area The sampling reconstruction error of is calculated using the maximum likelihood estimation (MLE) to find the optimal and .
[0027] Furthermore, in the Weibull model based on object reconstruction (ORW), in order to calculate the pseudo unknown object soft label and estimate the possibility score of the unknown object, after modeling the distribution of the foreground and background regions, the probability function and To estimate the possibility of a pseudo unknown object becoming a true unknown object, as follows:
[0028] Given an image A pseudo unknown object in , use the RoIAlign operation to The reconstruction error is pooled into a scalar value as follows:
[0029] (4)
[0030] in, Is a pseudo unknown object The reconstruction error value of Represents the RoIAlign operation, which stands for Region of Interest Align and is a feature alignment operation used in object detection. represents the calculated reconstruction error map; then, the soft label is calculated using the following equation: The likelihood score of an unknown object being a true unknown object is estimated:
[0031] (5)
[0033] in, and are the Weibull probability density functions of the known objects and background areas in the input image, respectively. is a hyperparameter used to scale the likelihood score; when All original pseudo labels will be discarded when , all unknown objects corresponding to the original pseudo labels will be regarded as real unknown objects.
[0034] Further, in step S3, in the open world target detection training process, the RPN region proposal generation and ROI classification stages perform differently, and the proposal generation stage has generalization ability because its category-independent classification can be easily extended to new categories; in contrast, the category-specific ROI classification stage cannot even be used for new categories, resulting in a bias towards basic categories; these different characteristics affect their joint training, because the sensitivity of the ROI classification stage to new categories will hinder the generalization performance of the proposal generation stage; the two stages of the RPN region proposal generation and ROI classification of the target detector are separated and trained separately to avoid such conflicts, and then the target detector is trained using the labels of known objects and the pseudo-labels of unknown objects to improve the accuracy of unknown object recognition; wherein the full name of RPN is Region Proposal Network, which is a module in Faster R-CNN, used to generate candidate regions in target detection, and the full name of ROI is Region of Interest. In the field of target detection, ROI refers to an area in an image that is considered to have special interests or targets. The target detector Faster R-CNN used in the present invention is a two-stage target detection model, as follows:
[0035] In the first stage, the backbone network is used to train the RPN, generate region proposals, and then freeze the RPN training parameters. In the second stage, the generated region proposals are used to continue the ROI classification training. This stage is used to predict unseen categories, and then the unknown object probability score in formula (5) is used. Added to the classification loss of Faster-RCNN detector As a weight term, it learns to identify unknown objects and detect known objects; the modified classification loss equation is as follows:
[0036] (6)
[0037] in, Indicates the regional proposal, It is a regional proposal The loss weight is When it belongs to the area of pseudo unknown object, equal , otherwise it is equal to 1; Indicates area proposal The predicted probability of express The true value of represents the cross entropy loss, Represents the total number of region proposals.
[0038] Furthermore, in step S4, in the reasoning stage, an image that needs to be open-world target detection is input, and the open-world target detection model SAM-OWOD based on visual large model enhancement is adopted to identify known categories according to the labels of known categories, and at the same time identify unknown categories according to the labels of unknown objects obtained through training, and output the detection image.
[0039] Furthermore, in step S5, according to the provided unknown class label, a new unknown class label is input, and the open-world object detection model SAM-OWOD based on visual large model enhancement is obtained by incremental learning, and then the open-world unknown class recognition is realized cyclically;
[0040] The incremental learning obtains an open-world object detection model SAM-OWOD enhanced based on a large visual model, and learns new classes using an incremental learning method based on sample playback, that is, storing a portion of representative old data and adjusting the open-world object detection model enhanced based on a large visual model after each incremental step;
[0041] The parameters of the open-world object detection model SAM-OWOD enhanced based on the visual big model are frozen except for the output layer, and only the parameters of the last output layer are adjusted.
[0042] Furthermore, incremental learning based on sample playback is a machine learning method, which specifically includes the following steps:
[0043] S5.1. Initialize the model: Before incremental learning begins, initialize the SAM-OWOD model and use it to train a portion of the data;
[0044] S5.2, training model: using a portion of the new data to train the SAM-OWOD model to obtain a first model;
[0045] S5.3, sample replay: a set proportion of samples in the previously trained data set is stored in a buffer, called a replay buffer, and then a set proportion of samples are randomly extracted from the replay buffer, and the randomly extracted samples are used together with the current training data to train the SAM-OWOD model to obtain a second model;
[0046] S5.4, model update: merge the first model and the second model to obtain the trained SAM-OWOD model;
[0047] S5.5. Test model: Use the test data set to test the trained SAM-OWOD model;
[0048] S5.6. If there is new data that needs to be trained, return to step S5.2; otherwise, end the incremental learning.
[0049] Furthermore, the open-world object detection model enhanced by the large visual model is adjusted after each incremental step. When receiving labels of unknown categories, in order to avoid retraining the model, a part of representative historical data and new data are used to train the model; the common features learned by the pre-trained model on large-scale data are used to fine-tune only the last few layers of the SAM-OWOD model, so that the SAM-OWOD model can better adapt to new tasks. The specific implementation process is as follows:
[0050] A1. Load the pre-trained SAM-OWOD model: Use the SAM-OWOD model that has been pre-trained on large-scale data as the initial model;
[0051] A2. Freeze model parameters: For layers that do not need fine-tuning, freeze their parameters so that they do not change during training;
[0052] A3. Replace the output layer: Replace the last output layer of the SAM-OWOD model with a new output layer adapted to the task, which includes the number of categories required by the new task;
[0053] A4. Only train the new output layer: Only train the new output layer so that the SAM-OWOD model can better adapt to new tasks;
[0054] A5. Unfreeze parameters: If you need to adjust the parameters of other layers, unfreeze the parameters of the network layer that needs to be adjusted so that the network layer that needs to be adjusted can change during the adjustment;
[0055] A6. Fine-tune the model: Adjust the entire SAM-OWOD model until the SAM-OWOD model converges on the new task.
[0056] Compared with the prior art, the advantages of the present invention are:
[0057] At present, the open-world object detection methods focus on marking those areas that do not overlap with known objects and have high target scores as potential unknown categories by means of pseudo-labels, and their performance depends largely on the supervision of known objects. These methods can successfully detect unknown objects with similar features to known objects. However, they have a serious label bias problem of known categories, that is, they tend to regard all areas that are not similar to known ones as part of the background. The present invention solves the label bias problem in the open-world object process through a large visual model and an unsupervised unknown recognition method, and improves the accuracy of open scene object detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1Flow chart of an open world target detection method based on visual large model enhancement in an embodiment of the present invention;
[0059] Figure 2 Schematic diagram of regional feature reconstruction of an automatic encoder in an embodiment of the present invention;
[0060] Figure 3 A schematic diagram of Weibull regional feature modeling according to an embodiment of the present invention;
[0061] Figure 4 It is a rendering of the effect in the embodiment of the present invention. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings and embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, and all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0063] Example:
[0064] An open-world object detection method based on visual large model enhancement, such as Figure 1 As shown, the following steps are included:
[0065] S1. Use the visual big model to preprocess the input image and obtain the original pseudo label of the unknown object;
[0066] The input image includes known objects that have been labeled, as well as unknown objects that have not been labeled;
[0067] Use SAM to preprocess the input image, use SAM's ability to segment any object, segment the image, and generate candidate boxes based on the mask. The objects in the candidate boxes include known objects and unknown objects. In order to obtain pseudo labels for unknown objects, use NMS to filter duplicate candidate boxes, and then calculate the IOU of the object candidate boxes generated by SAM and the candidate boxes of the labeled objects. If the IOU is less than the set threshold a, it is considered to be an unknown object, thereby obtaining the original pseudo label of the unknown object.
[0068] The input image is the MS-COCO standard dataset commonly used for target detection. SAM stands for SegmentAnything Model, which is a large-scale visual model for segmenting any object. NMS is the abbreviation of Non-Maximum Suppression. In the field of target detection, NMS is a technology used to screen candidate boxes with the highest confidence. IOU stands for Intersection over Union, which is a metric commonly used to evaluate the degree of overlap between two candidate boxes.
[0069] In one embodiment, the IOU threshold a is set to 0.3 and the non-maximum suppression NMS is set to 0.35.
[0070] S2. Using the Weibull model based on object reconstruction, the foreground and background regions are modeled, and soft labels are calculated for pseudo unknown objects to estimate the likelihood score of the unknown object and determine whether the unknown object is a real unknown object;
[0071] like Figure 2 As shown, according to the different feature frequencies of the foreground and background in different images, from the perspective of feature frequency, the background area and the foreground area form two different distributions respectively. In the Weibull model ORW based on object reconstruction, the automatic encoder based on data reconstruction learns the frequency information and models the two different distributions of the reconstruction error through the prior probability distribution. Since the Weibull distribution performs well in fitting various distribution shapes, the Weibull distribution is used as the prior model in the Weibull model ORW based on object reconstruction; the Weibull model ORW based on object reconstruction models the foreground and background areas, calculates soft labels for pseudo unknown objects, and estimates the possibility scores of unknown objects;
[0072] Therefore, in order to model the foreground and background areas, the Weibull model (ORW) based on object reconstruction first uses SAM to segment all objects in the image and generates candidate boxes for all objects based on the mask; then the backbone network is used to reconstruct the input image. Extract feature map , , ,In order to fully represent the semantic information of the object, the candidate boxes of all objects generated by SAM are mapped into the feature map, and the feature vector of the candidate box of each object represents the area within the receptive field;
[0073] In the Weibull model ORW based on object reconstruction, an autoencoder is used to reconstruct these regional features, that is, the feature vector of the candidate box of each object; the encoder and decoder of the autoencoder are respectively denoted as and ; The encoder first transforms the feature map Mapped to a latent space feature map with low dimensionality (number of channels) In one embodiment, the latent space feature map The number of channels is the feature map 1 / 2, , the decoder transforms the latent space feature map Reconstruct into the original dimension and obtain the reconstructed features , ;use The distance is used to measure the reconstruction error of each object, and the reconstruction error of each object is used as the training loss of the autoencoder. The process can be expressed as follows:
[0074] ; (1)
[0075] ; (2)
[0077] in, represents the training loss of the autoencoder, Indicates that the input image I belongs to the dimension The matrix of represents the height of the input image I, represents the width of the input image I, represents the number of channels of the input image I, Represents the latent space feature map The size dimension is The matrix of Represents the latent space feature map The number of channels, Represents the position of the feature map in the feature space , and Indicates location In Regional characteristics of the dimension; express Norm loss.
[0078] Furthermore, the regional features of each object represent the features of the anchor box at the corresponding position, so a foreground / background label is assigned to each object according to the corresponding anchor box of each object; as discussed earlier, background regions usually have frequently occurring features, making them easier to reconstruct and having smaller reconstruction errors than the infrequent features of various foreground object regions; when the autoencoder is trained to convergence, by calculating the foreground / background labels of each object Distance, that is Get the reconstruction error map , ; By randomly sampling objects in known and background areas from the training set of the MS-COCO dataset, a set of reconstruction errors are collected and recorded as and ; The reconstruction error of known object regions is usually much larger than that of background regions. Although unknown objects may have different appearances from known objects, they can be assumed to have similar low occurrence frequencies and high reconstruction errors because there are various types of unknown objects; The distribution of all foreground regions is estimated using the reconstruction errors extracted from samples of known objects;
[0079] like Figure 3 As shown in Figure 2, the Weibull distribution is used as a priori model in ORW because it has advantages in fitting a wide range of distribution shapes in many real-world scenes. The Weibull distributions of the known region and the background region are denoted as and , the specific form is as follows:
[0080] (3)
[0081] in, Represents the reconstruction error value of the sample object; is the probability density function of the exponential Weibull distribution, and is the shape parameter of the probability density function; and background area The sampling reconstruction error of is calculated using the maximum likelihood estimation (MLE) to find the optimal and .
[0082] In the Weibull model based on object reconstruction (ORW), in order to calculate the soft label of the pseudo unknown object and estimate the likelihood score of the pseudo unknown object, after modeling the distribution of the foreground and background regions, the probability function and To estimate the possibility of a pseudo unknown object becoming a true unknown object, as follows:
[0083] Given an image A pseudo unknown object in , use the RoIAlign operation to The reconstruction error is pooled into a scalar value as follows:
[0084] (4)
[0085] in, Is a pseudo unknown object The reconstruction error value of Represents the RoIAlign operation, which stands for Region of Interest Align and is a feature alignment operation used in object detection. represents the calculated reconstruction error map; then, the soft label is calculated using the following equation: The likelihood score of a pseudo unknown object becoming a true unknown object is estimated:
[0086] (5)
[0088] in, and are the Weibull probability density functions of the known objects and background areas in the input image, respectively. is a hyperparameter used to scale the likelihood score; when All original pseudo labels will be discarded when , all unknown objects corresponding to the original pseudo labels will be regarded as real unknown objects.
[0089] S3. In the training phase, the joint training of RPN region proposal generation and ROI classification of the decoupled target detector is used to improve the generalization performance of region proposal for unknown categories. Then, the target detector is trained using the labels of known objects and the pseudo labels of unknown objects to obtain the open world target detection model SAM-OWOD based on visual large model enhancement.
[0090] In the open world object detection training process, the RPN region proposal generation and ROI classification stages perform differently. The proposal generation stage has generalization capabilities because its category-independent classification can be easily extended to new categories. In contrast, the category-specific ROI classification stage cannot even be used for new categories, resulting in a bias towards basic categories. These different characteristics affect their joint training because the sensitivity of the ROI classification stage to new categories hinders the generalization performance of the proposal generation stage. The two stages of the RPN region proposal generation and ROI classification of the object detector are separated and trained separately to avoid such conflicts. Then, the object detector is trained using the labels of known objects and the pseudo-labels of unknown objects to improve the accuracy of unknown object recognition. The full name of RPN is Region Proposal Network, which is a module in Faster R-CNN and is used to generate candidate regions in object detection. The full name of ROI is Region of Interest. In the field of object detection, ROI refers to an area in an image that is considered to have special interests or objects. The object detector Faster R-CNN used in the present invention is a two-stage object detection model, as follows:
[0091] In the first stage, the backbone network is used to train the RPN, generate region proposals, and then freeze the RPN training parameters. In the second stage, the generated region proposals are used to continue the ROI classification training. This stage is used to predict unseen categories, and then the unknown object probability score in formula (5) is used. Added to the classification loss of Faster-RCNN detector As a weight term, it learns to identify unknown objects and detect known objects; the modified classification loss equation is as follows:
[0092] (6)
[0093] in, Indicates the regional proposal, It is a regional proposal The loss weight is When it belongs to the area of pseudo unknown object, equal , otherwise it is equal to 1; Indicates area proposal The predicted probability of express The true value of represents the cross entropy loss, Represents the total number of region proposals.
[0094] S4. In the reasoning stage, the image that needs to be detected in the open world is input, and the open world object detection model SAM-OWOD based on visual large model enhancement is used to identify known and unknown categories;
[0095] In the inference stage, the image that needs to be detected in the open world is input, and the open world object detection model SAM-OWOD based on visual large model enhancement is used to identify known categories according to the labels of known categories, and at the same time identify unknown categories according to the labels of unknown objects obtained through training, and output the detection image.
[0096] S5. Based on the provided unknown class labels, new classes are learned using incremental learning methods, and then open-world object detection is achieved cyclically.
[0097] According to the provided unknown class labels, new unknown class labels are input, and the open-world object detection model SAM-OWOD based on visual large model enhancement is obtained through incremental learning, and then the open-world unknown class recognition is realized cyclically;
[0098] The incremental learning obtains an open-world object detection model SAM-OWOD enhanced based on a large visual model, and learns new classes using an incremental learning method based on sample playback, that is, storing a portion of representative old data and adjusting the open-world object detection model enhanced based on a large visual model after each incremental step;
[0099] The parameters of the open-world object detection model SAM-OWOD enhanced based on the visual big model are frozen except for the output layer, and only the parameters of the last output layer are adjusted.
[0100] Incremental learning based on sample replay is a machine learning method that includes the following steps:
[0101] S5.1. Initialize the model: Before incremental learning begins, initialize the SAM-OWOD model and use it to train a portion of the data;
[0102] S5.2, training model: using a portion of the new data to train the SAM-OWOD model to obtain a first model;
[0103] S5.3, sample replay: a set proportion of samples in the previously trained data set is stored in a buffer, called a replay buffer, and then a set proportion of samples are randomly extracted from the replay buffer, and the randomly extracted samples are used together with the current training data to train the SAM-OWOD model to obtain a second model;
[0104] S5.4, model update: merge the first model and the second model to obtain the trained SAM-OWOD model;
[0105] S5.5. Test model: Use the test data set to test the trained SAM-OWOD model;
[0106] S5.6. If there is new data that needs to be trained, return to step S5.2; otherwise, end the incremental learning.
[0107] The open-world object detection model enhanced by the large visual model is adjusted after each incremental step. When receiving labels of unknown categories, in order to avoid retraining the model, a part of representative historical data and new data are used to train the model; the common features learned by the pre-trained model on large-scale data are used to fine-tune only the last few layers of the SAM-OWOD model, so that the SAM-OWOD model can better adapt to new tasks. The specific implementation process is as follows:
[0108] A1. Load the pre-trained SAM-OWOD model: Use the SAM-OWOD model that has been pre-trained on large-scale data as the initial model;
[0109] A2. Freeze model parameters: For layers that do not need fine-tuning, freeze their parameters so that they do not change during training;
[0110] A3. Replace the output layer: Replace the last output layer of the SAM-OWOD model with a new output layer adapted to the task, which includes the number of categories required by the new task;
[0111] A4. Only train the new output layer: Only train the new output layer so that the SAM-OWOD model can better adapt to new tasks;
[0112] A5. Unfreeze parameters: If you need to adjust the parameters of other layers, unfreeze the parameters of the network layer that needs to be adjusted so that the network layer that needs to be adjusted can change during the adjustment;
[0113] A6. Fine-tune the model: Adjust the entire SAM-OWOD model until the SAM-OWOD model converges on the new task.
[0114] In one embodiment, the obtained effect diagram is as follows: Figure 4 As shown in Figures a and b.
[0115] In one embodiment, in order to prove the effectiveness of the method proposed in this application, a verification experiment is performed as follows:
[0116] A comprehensive evaluation metric is proposed to explore the performance of SAM-OWOD (Open-World Object Detection Model Augmented by Visual Large Models), which includes recognition of objects of unknown categories, detection of known categories, and gradual learning of new categories when providing labels for unknown classes.
[0117] Data segmentation: In the task set ={ , , , }. As shown in Table 1, the 80 categories of COCO are divided into four groups, and each group of data is regarded as a dataset of a streaming task. During the training process of task Tt, all classes of a specific task will be trained at time point Introduced into the system, for the task , { : < } is known, { : > } will be considered unknown. The model is incrementally trained by using only images annotated with known categories for each task, rather than using the entire dataset. Table 1 below shows the composition of tasks in the open-world object detection evaluation criteria:
[0118] Table 1
[0119]
[0120] Evaluation Metrics: We use mAP (mean average precision) as the metric to evaluate the detection performance of known categories. As for unknown categories, we use the unknown object recall (U-Recall) as the main evaluation metric.
[0121] As shown in Table 2, the performance of the present invention on open-world object detection in Task 1, Task 2, Task 3, and Task 4 is compared with the Faster-RCNN+ baseline model, as well as four state-of-the-art open-world object detectors, including ORE, OW-DETR, CAT, and PROB. Faster-RCNN+ fine-tuning means fine-tuning Faster-RCNN using example replay. They can only detect known objects, so their recall results for unknown objects are all zero. The present invention does not apply ORE's energy-based unknown identifier (EBUI) because it requires weak unknown label supervision. The results of ORE, OW-DETR, CAT, and PROB are taken from their papers; from the experimental results, it can be seen that the SAM-OWOD model of the present invention has a huge improvement in unknown recall rate, exceeding CAT by 26.9% on Task 1, 27.7% on Task 2, and 18.8% on Task 3, and also has a good improvement in known detection accuracy.
[0122] Table 2
[0123]
[0124] It should be noted that any person skilled in the art to which the present invention belongs may make changes and modifications in the form and details of implementation without departing from the spirit and scope disclosed by the present invention. Therefore, some equivalent modifications and changes of the present invention should also be within the scope of protection of the claims of the present invention. In addition, although some specific terms are used in this specification, these terms are only for the convenience of description and do not constitute any limitation to the present invention.
Claims
1. A method for open world object detection based on visual large model enhancement, characterized in that: The following steps are involved: S1. Use the visual big model to preprocess the input image and obtain the original pseudo label of the unknown object; S2. Using the Weibull model based on object reconstruction, the foreground and background regions are modeled, and soft labels are calculated for pseudo unknown objects to estimate the likelihood score of the unknown object and determine whether the unknown object is a real unknown object; According to the different feature frequencies of foreground and background in different images, from the perspective of feature frequency, the background area and the foreground area form two different distributions respectively. In the Weibull model ORW based on object reconstruction, the autoencoder based on data reconstruction learns the frequency information and models the two different distributions of reconstruction errors through the prior probability distribution. The Weibull distribution is used as the prior model in the Weibull model ORW based on object reconstruction. The Weibull model ORW based on object reconstruction models the foreground and background areas, calculates soft labels for pseudo unknown objects, and estimates the possibility scores of unknown objects. To model the foreground and background regions, the Weibull model ORW based on object reconstruction first uses SAM to segment all objects in the image and generates candidate boxes for all objects based on the masks; Then use the backbone network to extract the feature map F from the input image I. In order to fully represent the semantic information of the object, the candidate boxes of all objects generated by SAM are mapped to the feature map, and the feature vector of the candidate box of each object represents the area within the receptive field; In the Weibull model ORW based on object reconstruction, an autoencoder is used to reconstruct these regional features, that is, the feature vector of the candidate box of each object; the encoder and decoder of the autoencoder are denoted as E() and D() respectively; the encoder first maps the feature map F to a low-dimensional latent space feature map F latent , The decoder transforms the latent space feature map F latent Reconstruct to the original dimension and get the reconstructed feature F rec , The l2 distance is used to measure the reconstruction error of each object, and the reconstruction error of each object is used as the training loss of the autoencoder. The process can be expressed as follows: F rec =D(E(F)); (1) Among them, L autoencoder represents the training loss of the autoencoder, Indicates that the input image I belongs to the dimension H I ×W I ×3 matrix, H F represents the height of the input image I, W F represents the width of the input image I, C represents the number of channels of the input image I, Represents the latent space feature map F latent Belongs to the size dimension H F ×W F ×C latent The matrix, C latent Represents the latent space feature map F latent The number of channels, [i, j] represents the position (i, j) of the feature map in the feature space, F rec [i,j] and F[i,j] represent the C-dimensional regional features in position [i,j]; L2 represents the l2 norm loss; The regional features of each object represent the features of the anchor box at the corresponding position, and the foreground / background label is assigned to each object according to the corresponding anchor box of each object; when the autoencoder is trained to convergence, the l2 distance of each object is calculated, that is, E[i,j] = L2(F rec [i,j],F[i,j]), and get the reconstruction error graph E, By randomly sampling objects in the known and background regions from the training set of the MS-COCO dataset, we collect a set of reconstruction errors, denoted as ε kn and ε bg ; Use the reconstruction error drawn from samples of known objects to estimate the distribution of all foreground regions; The Weibull distribution of the known area and the background area are denoted as f kn and f bg , the specific form is as follows: Among them, r e represents the reconstruction error value of the sample object; f is the probability density function of the exponential Weibull distribution, a and c are the shape parameters of the probability density function; based on the foreground ε kn and the background area ε bg The sampling reconstruction error is used to calculate the optimal a and c using the maximum likelihood estimation (MLE); In the Weibull model based on object reconstruction (ORW), the pseudo unknown object soft label is calculated and the possibility score of the unknown object is estimated. After modeling the distribution of the foreground and background regions, the probability function f is used. kn and f bg To estimate the probability of an unknown object becoming a truly unknown object, as follows: Given a pseudo unknown object p in image I unk , use the RoIAlign operation to align p unk The reconstruction error is pooled into a scalar value as follows: r e (p unk )=R A (E,p unk ) (4) Among them, r e (p unk ) is a pseudo unknown object p unk The reconstruction error value of R A Represents the RoIAlign operation, which stands for Region of Interest Align and is a feature alignment operation used in object detection. represents the calculated reconstruction error map; then, the soft label is calculated using the following equation: unk ) estimates the likelihood score of the unknown object being a true unknown object: Among them, f kn and f bg are the Weibull probability density functions of known objects and background areas in the input image, respectively, and γ is a hyperparameter used to scale the likelihood score value; when γ——→∞, all original pseudo labels will be discarded, and when γ——→0, all unknown objects corresponding to the original pseudo labels will be regarded as true unknown objects; S3. In the training phase, the joint training of RPN region proposal generation and ROI classification of the decoupled target detector is used to improve the generalization performance of region proposal for unknown categories. Then, the target detector is trained using the labels of known objects and the pseudo labels of unknown objects to obtain the open world target detection model SAM-OWOD based on visual large model enhancement. S4. In the reasoning stage, the image that needs to be detected in the open world is input, and the open world object detection model SAM-OWOD based on visual large model enhancement is used to identify known and unknown categories; S5. Based on the provided unknown class labels, new classes are learned using incremental learning methods, and then open-world object detection is achieved cyclically.
2. The open world target detection method based on visual large model enhancement according to claim 1, characterized in that: In step S1, the input image includes known objects that have been labeled and unknown objects that have not been labeled; Use SAM to preprocess the input image, use SAM's ability to segment any object, segment the image, and generate candidate boxes based on the mask. The objects in the candidate boxes include known objects and unknown objects. In order to obtain pseudo labels for unknown objects, use NMS to filter duplicate candidate boxes, and then calculate the IOU of the object candidate boxes generated by SAM and the candidate boxes of the labeled objects. If the IOU is less than the set threshold a, it is considered to be an unknown object, thereby obtaining the original pseudo label of the unknown object. The input image is the MS-COCO standard dataset commonly used for target detection, the SAM is a large visual model for segmenting any object, NMS is non-maximum suppression, and IOU is a metric used to evaluate the degree of overlap between two candidate boxes.
3. According to the open-world object detection method based on visual large model enhancement according to claim 1, in step S3, the two stages of RPN region proposal generation and ROI classification of the object detector are separated and trained separately, and then the object detector is trained using the labels of known objects and the pseudo labels of unknown objects to improve the accuracy of unknown object recognition, as follows: First, in the first stage, the backbone network is used to train the RPN to generate region proposals, and then the RPN training parameters are frozen. In the second stage, the generated region proposals are used to continue the ROI classification training. This stage is used to predict unseen categories, and then the unknown object probability score s(p unk ) is added to the classification loss L of the Faster-RCNN detector cls As a weight term, it learns to identify unknown objects and detect known objects; the modified classification loss equation is as follows: in, r represents the region proposal, w r is the loss weight of the region proposal r. When r belongs to the region of the pseudo unknown object, r is equal to s(p unk ), otherwise it is equal to 1; p r represents the predicted probability of region proposal r, and Indicates p r The true value, L CE represents the cross entropy loss, N cls Represents the total number of region proposals.
4. The open world target detection method based on visual large model enhancement according to claim 1, characterized in that: In step S4, in the inference stage, an image that needs to be open-world target detection is input, and the open-world target detection model SAM-OWOD based on visual large model enhancement is used to identify known categories according to the labels of known categories, and at the same time identify unknown categories according to the labels of unknown objects obtained through training, and output the detection image.
5. The open world target detection method based on visual large model enhancement according to claim 1, characterized in that: In step S5, according to the provided unknown class label, a new unknown class label is input, and the open-world object detection model SAM-OWOD based on visual large model enhancement is obtained by incremental learning, and then the open-world unknown class recognition is realized cyclically; The incremental learning obtains an open-world object detection model SAM-OWOD enhanced based on a large visual model, and learns new classes using an incremental learning method based on sample playback, that is, storing a portion of representative old data and adjusting the open-world object detection model enhanced based on a large visual model after each incremental step; The parameters of the open-world object detection model SAM-OWOD enhanced based on the visual big model are frozen except for the output layer, and only the parameters of the last output layer are adjusted.
6. The open world target detection method based on visual large model enhancement according to claim 5, characterized in that: Incremental learning based on sample replay is a machine learning method that includes the following steps: S5.
1. Initialize the model: Before incremental learning begins, initialize the SAM-OWOD model and use it to train a portion of the data; S5.2, training model: using a portion of the new data to train the SAM-OWOD model to obtain a first model; S5.3, sample replay: a set proportion of samples in the previously trained data set is stored in a buffer, called a replay buffer, and then a set proportion of samples are randomly extracted from the replay buffer, and the randomly extracted samples are used together with the current training data to train the SAM-OWOD model to obtain a second model; S5.4, model update: merge the first model and the second model to obtain the trained SAM-OWOD model; S5.
5. Test model: Use the test data set to test the trained SAM-OWOD model; S5.
6. If there is new data that needs to be trained, return to step S5.2; otherwise, end the incremental learning.
7. The open world target detection method based on visual large model enhancement according to claim 6, characterized in that: The open-world object detection model enhanced by the large visual model is adjusted after each incremental step. When receiving labels of unknown categories, a part of representative historical data and new data are used to train the model to avoid retraining the model. The common features learned by the pre-trained model on large-scale data are used to fine-tune only the last few layers of the SAM-OWOD model, so that the SAM-OWOD model can better adapt to new tasks. The specific implementation process is as follows: A1. Load the pre-trained SAM-OWOD model: Use the SAM-OWOD model that has been pre-trained on large-scale data as the initial model; A2. Freeze model parameters: For layers that do not need fine-tuning, freeze their parameters so that they do not change during training; A3. Replace the output layer: Replace the last output layer of the SAM-OWOD model with a new output layer adapted to the task, which includes the number of categories required by the new task; A4. Only train the new output layer: Only train the new output layer so that the SAM-OWOD model can better adapt to new tasks; A5. Unfreeze parameters: If you need to adjust the parameters of other layers, unfreeze the parameters of the network layer that needs to be adjusted so that the network layer that needs to be adjusted can change during the adjustment; A6. Fine-tune the model: Adjust the entire SAM-OWOD model until the SAM-OWOD model converges on the new task.
