Infrared target small sample detection method based on cross-modal prompt learning
Through cross-modal prompt learning and knowledge distillation technology, combined with metric learning, the problem of scarcity of VOCs detection data and complex scenes in infrared imaging technology is solved, the detection efficiency and accuracy are improved, and the detection of small sample or zero sample scenes is realized. Effective detection.
Patent Information
- Application Number
- CN202410624123.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-20
AI Technical Summary
Existing infrared imaging technology has problems in industrial VOCs gas detection such as data scarcity, complex scenes, difficulty in labeling, and poor discriminability, resulting in low detection efficiency and insufficient accuracy.
The infrared target small sample detection method based on cross-modal prompt learning is adopted, combined with metric learning and knowledge distillation technology, to reduce overfitting through text prompts and generate soft prompts to achieve VOCs detection in small sample or zero sample scenes.
It improves the detection ability of complex VOCs scenes, reduces the over-fitting phenomenon, improves the efficiency of migration to practical applications, and achieves effective learning and detection of a small amount of data.
Smart Images

Figure CN118552491A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of environmental detection, and in particular to a small sample detection method of infrared targets based on cross-modal cue learning. Background Art
[0002] The leakage and emission of volatile organic compounds (VOCs) gases are one of the main causes of air pollution. VOCs are chemically active and prone to explosion, posing a threat to our lives and property. Therefore, effective detection and control of industrial VOCs gases is one of the main issues in environmental protection. The detection method that combines infrared imaging and deep learning has achieved good results. However, there are still many challenges in actual application scenarios. For example, there is a lack of high-quality industrial VOCs scene data, the actual VOCs emission scenes are complex with gas obstruction and high transparency of the gas center, and VOCs are poorly distinguishable in infrared imaging and difficult to label. Summary of the invention
[0003] To solve the above technical problems, the present invention provides a small sample detection method for infrared targets based on cross-modal prompt learning, which adopts a metric-based meta-learning method to realize small sample detection, wherein text prompts are added to reduce the overfitting problem brought by small sample training, and knowledge distillation is introduced to learn a soft prompt generator, thereby realizing VOCs detection in small sample or zero sample scenes; it can realize the learning and detection of small and complex VOCs scene data.
[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0005] A small sample detection method for infrared targets based on cross-modal cue learning specifically includes the following steps:
[0006] Step 1: Create a base class dataset containing VOCs gas emission scenes, and use two shared weight visual backbone networks to extract the features of the support images and query images in the base class dataset respectively; classify the support images and query images, and each category has a class name;
[0007] Step 2: Based on the supporting image features and the text encoding tokens obtained after encoding the class name, a cross-modal generator is used to establish the connection between the text modality and the image modality, and generate fused modality features;
[0008] Step 3: Based on the query image features and the fused modal features, a candidate box is obtained through a candidate box generator; the ROI network is then used to extract the candidate regions of the query image features and the supporting image features respectively, and the candidate regions are again connected to the modalities using a cross-modal generator;
[0009] Step 4: Classify and regress the candidate regions to obtain the prediction results.
[0010] Furthermore, step one specifically includes the following steps:
[0011] S11, based on the public infrared dataset, the supporting images containing VOCs leakage scenes are synthesized by rendering tools, and the query images containing VOCs emission scenes in real environments are collected to produce the base class dataset;
[0012] S12, sample multiple training sets from the base class dataset, each training set D = {S, Q}, S is the dataset of support images, Q is the dataset of query images, datasets S and Q have N categories, each category contains K images and a set of class names corresponding to N categories t i is the class name corresponding to the i-th class;
[0013] S13, using the visual backbone network to extract support image features and query image features:
[0014]
[0015]
[0016] Among them, F v is the visual backbone network, is the jth support image of the i-th category in the dataset S, is the j-th query image of the i-th category in the dataset Q; and Respectively represent the support image features and query image features corresponding to category i; H v , W v and C v Represent the height, width and number of channels of image features respectively.
[0017] Furthermore, the visual backbone network is a Faster RCNN feature extraction network, a deep residual network or a VGG network.
[0018] Further, the cross-modal generator includes a soft prompt generator, a text modality encoder, a text network feature extractor, and a fusion device;
[0019] Step 2 specifically includes the following steps:
[0020] S21, first, encode the class name using the text modality encoder:
[0021] l i =E(t i );
[0022] Among them, l i is the text encoding token corresponding to the class name of the i-th category; E(·) is the text modality encoder, which consists of a fully connected layer;
[0023] S22, using the soft prompt generator to generate soft prompts, and introducing text prompts to learn cross-modal features. Here, the distillation learning method is adopted, that is, the teacher network will add l i Prompt learning is performed without adding l to the student network i :
[0024]
[0025]
[0026]
[0027]
[0028] Among them, G S (·) and G T (·) are the soft hint generators for the student network and the teacher network respectively, and are the student soft prompts and teacher soft prompts corresponding to category i, and are the cross-modal features generated by the student network and the teacher-student network, POOL(·) is the pooling operation, M is the number of text encoding tokens, and C t is the dimension after text encoding, F t It is a text network feature extractor;
[0029] S23, using the fuser to fuse support image features and cross-modal features:
[0030]
[0031]
[0032] Among them, F(·) is the abstract expression of FC(·), which is a fully connected layer; and They respectively represent the fused modal features generated by the student network corresponding to category i and multiple fused modal features generated by the teacher network.
[0033] Furthermore, step three specifically includes:
[0034] S31: query image features and the fused modal features generated by the student network Or query image features and the fused modal features generated by the teacher network Input into the candidate box generator;
[0035]
[0036] or
[0037] Among them, PG(·) is the candidate box generator in the Faster RCNN network; in the network training stage pass Get, in the network verification phase pass get, and They are respectively the candidate boxes selected from the query image features and the candidate boxes selected from the fusion modality features;
[0038] S32: Extract candidate regions in query image features and support image features through ROI network:
[0039]
[0040]
[0041] Among them, ROI(·) is the ROI network, which specifically adopts the Faster RCNN network; T q and T p They are the candidate regions in the query image features and the candidate regions in the support image features respectively;
[0042] S33: T p Input it into the cross-modal generator again to obtain the re-integrated modal features corresponding to the student network and the teacher network
[0043] Furthermore, step four specifically includes:
[0044] S41: The candidate region T in the query image feature q , and the corresponding reintegrated modal features of the student network and the teacher network Send to the detection head for classification and regression prediction:
[0045] or
[0046] Among them, PC(·) is the detection head of the existing Faster RCNN network, and Ans is the actual prediction result; during the network training phase, Ans is Get, in the network verification phase Ans through get.
[0047] Furthermore, when training the detection model composed of the visual backbone network, the cross-modal generator, the candidate box generator, the ROI network and the detection head, the overall loss function L TOT for:
[0048] L TOT =L RPN +L RCNN +L KD +L C ;
[0049] L RPN and L RCNN are the loss of the candidate box generator and the classification regression loss of the detection head; L KD Losses for the student network and the teacher network are used to constrain the semantic consistency of the student network and the teacher network in extracting categories:
[0050]
[0051] L C It is a contrast loss used to strengthen the spatial connection between supporting image features and cross-modal features:
[0052]
[0053] Among them, τ is a hyperparameter.
[0054] Compared with the prior art, the beneficial technical effects of the present invention are:
[0055] Small sample detection is used to realize VOCs gas detection in unknown scenarios, and overfitting is reduced through prompt learning. Distillation learning is used to achieve small sample less or zero labeling, which improves the efficiency of migration to practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a schematic diagram of the framework of the detection model adopted in the present invention. DETAILED DESCRIPTION
[0057] A preferred embodiment of the present invention is described in detail below with reference to the accompanying drawings.
[0058] A small sample detection method for infrared targets based on cross-modal cue learning is based on the twin Faster RCNN network. It is generally divided into two parts: generating candidate regions and candidate region classification and regression. In general, it includes the following steps:
[0059] Step 1: Create a base class dataset containing VOCs gas emission scenes and use a shared weight visual backbone network to extract target features.
[0060] Furthermore, step one specifically includes the following steps:
[0061] S11: Based on the public infrared dataset, VOCs leakage scenes are synthesized through rendering tools, and VOCs emission scenes in real environments are collected to produce a base class dataset.
[0062] S12: Sample multiple training sets from the base class dataset, each training set is represented as D = {S, Q}, where D is the training set, S is the support image dataset, which is a collection of VOCs synthetic scene images, and Q is the query image dataset, which is a collection of images of real VOCs emission scenes. Each dataset can be represented as N categories, each category has K images and corresponding class names.
[0063] S13: Extracting support image features and query image features using the visual backbone network:
[0064]
[0065]
[0066] Among them, F v is the visual backbone network feature extractor, and They are the set of K support images of category i and the set of K query images of category i. and They represent the support image features and query image features corresponding to category i respectively. v , W v and C v Respectively represent the height, width and number of channels supporting image features.
[0067] It should be noted that the shared visual backbone network can be a Faster RCNN feature extraction network, or a common backbone network such as ResNet and Vgg.
[0068] Step 2: Use the cross-modal generator to establish the connection between the text modality and the image modality and generate fused modality features.
[0069] Step 2 specifically includes the following steps:
[0070] S21: The cross-modal generator consists of a soft prompt generator, a text modality encoder, a text network feature extractor, and a fusion unit. First, the class name is encoded using the text modality encoder, as shown below:
[0071] l i =E(t i );
[0072] Among them, li is the text encoding token corresponding to category i, and E(·) is the text modality encoder, which actually consists of fully connected layers.
[0073] S22: Use the soft prompt generator to generate soft prompts and introduce text prompts to learn cross-modal features. The distillation learning method is used here, that is, the teacher network will add l i Prompt learning, while student networks do not add l i The specific expressions are as follows:
[0074]
[0075]
[0076]
[0077]
[0078] Among them, G S (·) and G T (·) are the soft hint generators for the student network and the teacher network respectively, and are the student soft prompts and teacher soft prompts generated for category i, and are the cross-modal features of the student network and the teacher network, POOL(·) is the pooling operation, M is the number of prompt tokens, and C t is the dimension after text encoding, F t It is a text network feature extractor.
[0079] S23: Use the fuser to fuse the original support image features and the cross-modal features, which is specifically expressed as follows:
[0080]
[0081]
[0082] Among them, F(·) is the abstract expression of PC(·), is the fully connected layer, and Represent the fusion modal features of the student network and the teacher network respectively.
[0083] In step three, the query features and support features are extracted separately using the ROI network, and the support features are again connected to the modality using the cross-modal generator.
[0084] Step three specifically includes the following steps:
[0085] S31: query image features and fusion modality features Input into the candidate box generator, specifically expressed as follows:
[0086]
[0087] or
[0088] Among them, PG(·) is the candidate box generator in the existing Faster RCNN network, and They are the selected candidate boxes respectively.
[0089] S32: Use the ROI network to extract the candidate regions in the query feature and the support feature respectively, as shown below:
[0090]
[0091]
[0092] Among them, RoI(·) is the existing Faster RCNN network structure, T q and T p They are respectively candidate regions.
[0093] S33: T p Input it into the cross-modal generator again, and perform the operation in step 2 to obtain in and Represent the fusion modal features of the student network and the teacher network respectively.
[0094] Step 4: classify and regress the candidate regions; specifically, the candidate regions are sent to the FasterRCNN detection head for classification and regression prediction, which is specifically expressed as follows:
[0095] or
[0096] Among them, PC(·) is the existing Faster RCNN detection head structure, and Ans is the actual prediction result.
[0097] It should be noted that when training the entire network model, four types of loss functions are used to constrain learning, which are specifically expressed as follows:
[0098] L TOT =L RPN +L RCNN +L KD +L C .
[0099] Among them, L TOT The overall loss of the network model, LRPN and L RCNN They are the candidate box loss and classification regression loss in the Faster RCNN network. KD It is the loss of student and teacher networks, which is used to constrain the semantic consistency of the extracted categories of student and teacher networks. It is specifically expressed as follows:
[0100]
[0101] L C It is a contrast loss, which is used to strengthen the spatial connection between the original support image features and the cross-modal features. It is specifically expressed as follows:
[0102]
[0103] Among them, τ is a hyperparameter.
[0104] In summary, the infrared target small sample detection method based on cross-modal prompt learning proposed in the present invention overcomes the shortcomings of the existing methods, realizes the detection of VOCs by meta-learning, introduces the text modality, prompts the learning of semantic information that better represents VOCs, and adopts the knowledge distillation method to learn the soft prompt generator, avoiding the dependence on prior knowledge of class names, thereby realizing small sample or zero sample detection of VOCs.
[0105] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention, and any reference numerals in the claims should not be regarded as limiting the claims involved.
[0106] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
Claims
1. A small sample detection method for infrared targets based on cross-modal cue learning, characterized in that: The specific steps include: Step 1: Create a base class dataset containing VOCs gas emission scenes, and use two shared-weight visual backbone networks to extract the features of the support images and query images in the base class dataset respectively; Classify support images and query images, each category has a class name; Step 2: Based on the supporting image features and the text encoding tokens obtained after encoding the class name, a cross-modal generator is used to establish the connection between the text modality and the image modality, and generate fused modality features; Step 3: Based on the query image features and the fused modal features, a candidate box is obtained through a candidate box generator; the ROI network is then used to extract the candidate regions of the query image features and the supporting image features respectively, and the candidate regions are again connected to the modalities using a cross-modal generator; Step 4: Classify and regress the candidate regions to obtain the prediction results.
2. The infrared target small sample detection method based on cross-modal cue learning according to claim 1 is characterized in that: Step 1 specifically includes the following steps: S11, based on the public infrared dataset, the supporting images containing VOCs leakage scenes are synthesized by rendering tools, and the query images containing VOCs emission scenes in real environments are collected to produce the base class dataset; S12, sample multiple training sets from the base class dataset, each training set D = {S, Q}, S is the dataset of support images, Q is the dataset of query images, datasets S and Q have N categories, each category contains K images and a set of class names corresponding to N categories t i is the class name corresponding to the i-th class; S13, using the visual backbone network to extract support image features and query image features: Among them, F v is the visual backbone network, is the jth support image of the i-th category in the dataset S, is the j-th query image of the i-th category in the dataset Q; and Respectively represent the support image features and query image features corresponding to category i; H v , W v and C v Represent the height, width and number of channels of image features respectively.
3. The infrared target small sample detection method based on cross-modal cue learning according to claim 2 is characterized in that: The visual backbone network is a Faster RCNN feature extraction network, a deep residual network or a VGG network.
4. The infrared target small sample detection method based on cross-modal cue learning according to claim 2 is characterized in that: The cross-modal generator includes a soft prompt generator, a text modality encoder, a text network feature extractor and a fusion device; Step 2 specifically includes the following steps: S21, first, encode the class name using the text modality encoder: l i =E(t i ); Among them, l i is the text encoding token corresponding to the class name of the i-th category; E(·) is the text modality encoder, which consists of a fully connected layer; S22, using the soft prompt generator to generate soft prompts, and introducing text prompts to learn cross-modal features. Here, the distillation learning method is adopted, that is, the teacher network will add l i Prompt learning is performed without adding l to the student network i : Among them, G S (·) and G T (·) are the soft hint generators for the student network and the teacher network respectively, and are the student soft prompts and teacher soft prompts corresponding to category i, and are the cross-modal features generated by the student network and the teacher-student network, POOL(·) is the pooling operation, M is the number of text encoding tokens, and C t is the dimension after text encoding, F t It is a text network feature extractor; S23, using the fuser to fuse support image features and cross-modal features: Among them, F(·) is the abstract expression of FC(·), which is a fully connected layer; and They respectively represent the fused modal features generated by the student network corresponding to category i and multiple fused modal features generated by the teacher network.
5. The infrared target small sample detection method based on cross-modal cue learning according to claim 4 is characterized in that: Step three specifically includes: S31: query image features and the fused modal features generated by the student network Or query image features and the fused modal features generated by the teacher network Input into the candidate box generator; or Among them, PG(·) is the candidate box generator in the Faster RCNN network; in the network training stage pass Get, in the network verification phase pass get, and They are respectively the candidate boxes selected from the query image features and the candidate boxes selected from the fusion modality features; S32: Extract candidate regions in query image features and support image features through ROI network: Among them, RoI(·) is the ROI network, which specifically adopts the Faster RCNN network; T q and T p They are the candidate regions in the query image features and the candidate regions in the support image features respectively; S33: T p Input it into the cross-modal generator again to obtain the re-integrated modal features corresponding to the student network and the teacher network 6. The infrared target small sample detection method based on cross-modal cue learning according to claim 5 is characterized in that: Step 4 specifically includes: S41: The candidate region T in the query image feature q , and the corresponding reintegrated modal features of the student network and the teacher network Send to the detection head for classification and regression prediction: or Among them, PC(·) is the detection head of the existing Faster RCNN network, and Ans is the actual prediction result; during the network training phase, Ans is Get, in the network verification phase Ans through get.
7. The infrared target small sample detection method based on cross-modal cue learning according to claim 6 is characterized in that: When training the detection model consisting of the visual backbone network, cross-modal generator, candidate box generator, ROI network and detection head, the overall loss function L is used. TOT for: L TOT =L RPN +L RCNN +L KD +L C ; L RPN and L RCNN are the loss of the candidate box generator and the classification regression loss of the detection head; L KD Losses for the student network and the teacher network are used to constrain the semantic consistency of the student network and the teacher network in extracting categories: L C It is a contrast loss used to strengthen the spatial connection between supporting image features and cross-modal features: Among them, τ is a hyperparameter.
Citation Information
Patent Citations
Weak supervision target detection method and system based on transfer learning
CN113239924A
Zero sample cross-modal retrieval method based on Transform network selective distillation
CN115563327A
Small sample target detection method based on attention mechanism and contrast learning
CN116051893A
Semi-supervised small sample target detection method based on pseudo labels
CN116958889A
Object selection based on region of interest fusion
US20170168709A1
Cited By
Social big data cross-modal meta-learning early rumor detection method based on small samples
CN119739930A
