A small sample camouflage target segmentation method

By constructing the camouflage target segmentation network CAMFS and using the shared backbone network and meta-learning modules, the existing technology's camouflage target segmentation methods have solved the problems of insufficient generalization ability in changeable environments and high dependence on annotated data, and achieved a small number of camouflage target segmentation methods. The ability to quickly adapt and efficiently identify camouflaged targets in the example.

CN118097150BActive Publication Date: 2024-08-27HUBEI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410344583.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2024-08-27
Estimated Expiration
2044-03-25

AI Technical Summary

Technical Problem

Existing camouflage target segmentation methods are difficult to generalize in the changing real world, and traditional methods require a large amount of annotated data, which are costly and time-consuming, and cannot effectively identify camouflaged objects of unseen categories.

Method used

Using a small sample camouflage target segmentation method, the camouflage target segmentation network CAMFS is constructed, including a shared backbone network, a camouflage meta-learning module and a camouflage basic learning decoder. ResNet50 is used to extract semantic information, and the attention mechanism and multi-scale fusion are combined to achieve knowledge transfer. and edge detail capture, reducing dependence on annotation data.

Benefits of technology

It improves the generalization ability of the model, can quickly adapt to new camouflaged target categories in a small number of examples, reduces human resource consumption, improves applicability and flexibility, and enhances target detection capabilities, especially in complex environments to accurately identify camouflaged targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118097150B
    Figure CN118097150B
Patent Text Reader

Abstract

The invention discloses a small sample camouflage target segmentation method, which constructs and trains a camouflage target segmentation network, wherein the camouflage target segmentation network comprises a shared backbone network, a camouflage meta-learning module and a camouflage base learning decoder, wherein a group of support images and a query image are input into the camouflage target segmentation network for processing, wherein the image first obtains two types of feature maps corresponding to the shared backbone network, and then processes the feature map through a positioning and focusing module in the camouflage meta-learning module to obtain a detail feature matrix, and at the same time, the camouflage meta-learning module performs knowledge guidance according to information of the support image to obtain a similarity feature map with the query image; an ASPP module is used to perform feature enhancement on all the obtained feature maps and feature matrices, and classification is performed to obtain a prediction mask, and the camouflage base learning decoder predicts the edge contour of the query set image, generates a prediction mask through continuous iterative refinement, and then the prediction masks of the camouflage meta-learning module and the camouflage base learning decoder are fused to obtain a final prediction mask.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to computer image processing technology, and in particular to a small sample camouflage target segmentation method. Background Art

[0002] Camouflage is a means for animals and plants to defend themselves against natural enemies. Most of the observations of objects by the visual systems of various organisms, including humans, rely on identifying the topological properties of objects. Since camouflaged objects destroy the visual edge information of their "real" bodies, they pose a great obstacle to visual perception. However, camouflage is ubiquitous in nature and industry, so the study of camouflaged objects plays a key role in various fields. With the vigorous development of computers, it has become particularly important to enable machines to assist humans in perceiving camouflaged objects, so people have proposed the camouflaged target segmentation task to solve this problem.

[0003] Existing camouflaged target segmentation methods mainly rely on supervised deep learning methods. The model is trained on specific camouflaged categories to achieve the effect of segmenting specific categories, which requires a large amount of high-quality camouflaged image data to support it. However, the boundaries of camouflaged targets are fuzzy, and it is very time-consuming to label each pixel at the pixel level. It takes hours to label an image, which makes traditional camouflaged object recognition methods expensive. In addition, public camouflaged image segmentation datasets (such as COD10K) only contain dozens of classes and cannot be truly applied to the complex real world. At the same time, supervised training methods can only effectively identify specific categories. When encountering unseen categories, the accuracy of segmentation will face a significant decline. This method cannot be applied to the changing real world, which may have a significant impact in real applications.

[0004] Due to the above-mentioned shortcomings of supervised learning, another approach is to use an unsupervised segmentation model SAM (segment anything Model). The advantage of unsupervised training is that it does not require a large amount of data to be labeled, which reduces the cost of data labeling. SAM can use prompting technology to perform zero-sample learning on new data sets and tasks, and can return valid segmentation masks based on prompts. As a large segmentation model, SAM has demonstrated extremely strong segmentation capabilities in many real-world scenarios. However, when faced with camouflaged images where the foreground and background are not separated and the edge contours are not clear, SAM can only return empty-handed.

[0005] In general, whether using the existing traditional camouflaged target segmentation method or the unsupervised segmentation large model, it is impossible to apply it to the ever-changing real world. These problems have limited the development of machine-assisted humans to perceive camouflaged objects to a certain extent, and have caused considerable obstacles to research. Therefore, how to make the model have strong generalization while still being highly sensitive to camouflaged targets is a difficult problem that needs to be solved urgently. Summary of the invention

[0006] Purpose of the invention: The purpose of the present invention is to solve the deficiencies in the prior art and provide a small sample camouflage target segmentation method.

[0007] Technical solution: A small sample camouflage target segmentation method of the present invention comprises the following steps:

[0008] Step 1: Get the support image set and query image set, and then use the labelme tool to mask the support image and query image;

[0009] Step 2: Construct and train the camouflage target segmentation network CAMFS, and transform any set of support images x in step 1 s and query image x q The camouflaged target segmentation network CAMFS is input for processing. The camouflaged target segmentation network CAMFS includes a shared backbone network, a camouflaged meta-learning module CMLN and a camouflaged base learning decoder CBLD. ResNet50 is used as the shared backbone network. The camouflaged meta-learning module CMLN converts the semantic information of the camouflaged target into a compact feature vector to promote the transfer of knowledge from the support image to the query image. The camouflaged base learning decoder CBLD captures key edge details to enrich the distinction between foreground and background elements, thereby improving segmentation performance.

[0010] Step 2.1: A set of support images x s and query image x q After entering the camouflage target segmentation network CAMFS, the camouflage meta-learning module CMLN performs the following operations:

[0011] Step A: First, the support image x is extracted by the shared backbone network s and query image x q The corresponding semantic information is used to obtain the feature map F of the supporting image. S and the feature map F of the query image Q ;

[0012] Then, the positioning and focusing module FPM is used to locate the feature map F S and feature map F Q Detail feature extraction is performed, where the feature map F S Perform layer-by-layer operations to obtain the support set detail feature maps F2, F3, F4 and the corresponding prior masks P2, P3 and P4; Q The query image detail feature matrix Q is obtained by layer-by-layer operation and channel-by-channel splicing is performed to generate the query image detail feature matrix Q q ;

[0013] Next, the detail feature maps F3 and F4 are concatenated to generate S , O S Generate H through the attention mechanism S ; Q q Convolution is performed to obtain O q ;

[0014] Step B: The camouflage meta-learning module CMLN performs knowledge guidance to transfer the information contained in the hint mask to the image to be segmented, and obtains the similarity feature map C through the MS module. S ;

[0015] Step C: Connect the corresponding feature maps, use the ASPP module to enhance the features of the connected feature matrix, and finally obtain the prediction mask M through the classifier. m ; The corresponding feature maps here include D S , H S , query image 2nd and 3rd layer block feature matrix Prior mask M pr , support image detail feature matrix O S , query image detail feature matrix O q And similarity feature map C S ;

[0016] Among them, D S The method of obtaining is: by extracting the intermediate feature map of backbone Concatenated in the channel dimension, the mask m corresponding to the support image s Implement mask average pooling MAP to generate the attention vector As, and then expand it to the same scale as the intermediate feature map through bilinear interpolation, denoted as D S On the other hand, after convolution operation on As, Hadamard product is performed with the intermediate feature map to generate H S ;

[0017] Step 2.2: The camouflage base learning decoder CBLD performs the following operations:

[0018] Step a: The camouflage base learning decoder CBLD obtains the query image x q The four-layer feature map F Q , and then generate the predicted edge mask through channel dimension connection, convolution fusion and Sigmoid function to obtain high-level semantic information f edge ;f edge Provide semantic information of target boundaries for subsequent processes;

[0019] Step b: The predicted edge mask f edge The features of the query image are input into the EFR module to mine the features of the target area.

[0020] Step c: f edge and Perform multi-scale fusion MFM operation and iteration to obtain the prediction mask M m ;

[0021] Step 3: Fusion and training

[0022] First, we use the query image and its mask from the training set as samples to train the disguised base learning decoder CBLD, and get the total loss L in the CBLD stage. base ;

[0023] Then, the scenario training on the disguised meta-learning module CMLN is used to obtain the binary cross entropy loss L meta During training, the mask M is trained by the probability factor parameter γ m and M B Fuse into the final comprehensive prediction mask.

[0024] Furthermore, in step A, ResNet50 is used as a shared backbone network to extract features. During the training process, the shared backbone network only extracts features and is frozen during training. After inputting the shared backbone network, the extracted feature set is F S ,F Q =F conv (x s ,x q );

[0025] Among them, F conv To share the backbone network, b indicates the block number.

[0026] Furthermore, in step A, the positioning and focusing module FPM is used to locate the feature map F S and feature map F Q The specific process of detailed description is as follows:

[0027] Step I: Use depth-wise separable convolution DW to perform the feature map F S and feature map F Q Reduce the number of channels, the calculation formula is as follows:

[0028] Then get

[0029] in It refers to the block feature maps of the 2nd, 3rd, and 4th layers of the input support set image. F2, F3, and F4 refer to the three sets of feature maps with rich detail information generated by the positioning module and the iterative focusing module.

[0030]

[0031]

[0032]

[0033] P4 and P3 represent the prior masks derived from this feature layer;

[0034] Step II: First, the focusing module vectorizes the block feature map channel by channel to generate three matrices Q, K, and V. C is the number of channels, H×W is the vector length;

[0035] To obtain the relative importance of Q to K, we perform a dot product of the transpose of Q and K and calculate the probability distribution to generate the channel attention matrix A. The specific elements are represented as:

[0036]

[0037] Next, the attention matrix A is multiplied by the matrix V and a residual connection is made with the input, denoted as Then, the number of channels is compressed through convolution operation to generate three matrices. Similar to the above operation, the spatial attention matrix is ​​obtained, and finally F4 and prior mask P4 are obtained;

[0038] Step III: Input F4 and P4 into the Foc module. After input, first perform mask inversion on P4 to enhance the recognition of the background, and perform Hadamard product on F4 with the prior mask and the inversion mask respectively:

[0039] f f =P4⊙F4,f b =(1-P4)⊙F4;

[0040] Then, the foreground and background features are subjected to 1*1 convolution to reduce the number of channels, and then multi-scale feature extraction is performed in parallel through several convolution kernels of different scales, and detailed information is obtained through dilated convolution, which is specifically expressed as follows:

[0041]

[0042] The convolution kernel size and expansion rate are adjusted by i, so that the network can capture features of different scales and concatenate them channel by channel. For example, when i is 2, the convolution sum is 3 and the expansion rate is 4.

[0043] Step IV, the foreground feature FfrF_fr is enhanced by subtracting it from F_4F4 channel by channel and adding it to the background feature F_brFbr channel by channel to enhance the model's recognition and removal of interference information, and generate F_3F3 and P_3P3 as the input of the focusing module for the next iteration.

[0044] Furthermore, the step A converts the feature map F S and feature map F Q The specific process of processing the intermediate feature map in is as follows:

[0045] First, the intermediate feature map Perform channel dimension connection, and the mask m corresponding to the support image s Implement mask average pooling to generate attention vector A S At the same time, it is extended to the intermediate feature map through bilinear interpolation The same scale, denoted as D S ; Then the attention vector A S After convolution operation, the same as the intermediate feature map Perform Hadamard product to generate H S ; This enables the model to extract more important areas from the feature map through mask information;

[0046] Finally, the detail features F2 and F3 are connected in the channel dimension, and the same operation as above is performed to generate O S ;

[0047] The above calculation formula is expressed as:

[0048]

[0049] D s =δ(A s )

[0050]

[0051]

[0052] where δ and They represent bilinear interpolation and channel-by-channel dimension concatenation respectively.

[0053] Furthermore, the specific implementation process of the knowledge guidance in step B is:

[0054] For the feature map F of the support image obtained in step A S and the feature map F of the query image Q First, mark each block and the bottleneck structure under the block as

[0055]

[0056] Where b represents the block sequence, N represents the bottleneck structure number under the block, and B represents the total number of bottleneck structures under the block; taking ResNet-50 as an example, when the block sequence b is set to {1,2,3,4}, B corresponds to {3,4,6,3}, where represents the support set features extracted from the fourth bottleneck structure of the third block;

[0057] Then, to ensure that the mask and the feature maps of each layer can be multiplied pixel by pixel, Bilinear interpolation is performed at different scales, namely:

[0058] Through the feature matrix Adjust the mask matrix

[0059] To match Resolution;

[0060] Next, to transfer knowledge from the prompt information to the target category, the model needs to calculate the cosine distance CS between the feature vector of the support image and the feature vector of the query image one by one b,N , to obtain the visual mapping relationship:

[0061] First, flatten the support image feature matrix into support feature vectors Flatten the corresponding mask matrix into a mask vector And perform Hadamard product on the channel dimension to generate mask feature vector Calculate the average of the elements in the mask vector that are greater than 0 Right now Then, filter out Medium to large , and based on this sequence, filter out The corresponding element in is expressed as

[0062] Each bottleneck feature in is Right now Since a large number of elements are filtered out, The dimension is much smaller than Dimensions;

[0063] The query image feature matrix is ​​then flattened into a query feature vector Through Dot product to calculate cosine similarity;

[0064]

[0065] Set ε to 0.001, and perform cosine similarity calculation on all bottleneck feature vectors, and finally concatenate them in the channel dimension to generate the similarity feature map C. S .

[0066] Furthermore, the step C obtains the prediction mask M through the classifier m The specific formula is:

[0067]

[0068] Since the function of the CBLD unit is to improve the target mask details by capturing the edge information of the camouflaged object. First, the model has extracted the features of each layer of the query image in the feature extraction stage of CMLN. The low-level features contain more texture and edge information, but the low-level information has poor target positioning ability, and the target edge information will be submerged in various image noises. Therefore, it is necessary to introduce high-level semantic features to locate the target-related edge features.

[0069] To this end, the specific implementation method of the camouflage base learning decoder CBLD in step 2.2 is:

[0070] Step a: The camouflage base learning decoder CBLD obtains the query image x q The four-layer feature map of and The channel dimension is connected, and the features are fused through two 3×3 convolutions. Finally, the predicted edge mask f is generated through the Sigmoid function. edge ;

[0071]

[0072] Step b, the obtained f edge The features of the query image are input into the EFR module to mine the features of the target area.

[0073] f edge See as The edge prompt guides the model to better mine the features of the target area; the specific operation of EFR is first to edge and Perform Hadamard product and compare pixel by pixel The edge feature information is enhanced by addition, and features are extracted through multi-layer 3x3 convolution. Then the extracted features are subjected to global average pooling GAP to obtain channel attention weights, and multiplied channel by channel with the original features to generate Expressed as Where f is

[0074] Step c: f edgeand Perform multi-scale fusion MFM operation and iteration to obtain the prediction mask M m ,Right now:

[0075] First, f edge and Channel connection is performed, and 3×3 convolutions with different expansion rates are used to integrate multi-scale features to capture information of different spatial resolutions. The features are then combined by serial addition and iterated sequentially to finally obtain the mask M predicted by CBLD. m .

[0076] Furthermore, in step 3, a two-stage training method is used to optimize the model during fusion and training;

[0077] In the first stage, we use query images from the training set as samples for training, namely:

[0078]

[0079] For target mask supervision, binary cross entropy BCE loss and IoU loss are used;

[0080] L BCE =-[m q log(M B )|+(1-m q )log(1-M B )]

[0081]

[0082] Finally, the total loss of the first-stage disguise meta-learning network CMLN is expressed as:

[0083] L base =L BCE +L IoU +λL dice

[0084] The second stage, the disguised base learning decoder CBLD, adopts the scenario training method and uses the binary cross entropy loss expressed as L meta =L BCE (m q , M m ).

[0085] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0086] 1. Improve generalization ability: Through small sample learning, the present invention enables the model to quickly adapt to new camouflaged target categories through a small number of examples, thereby maintaining efficient and accurate segmentation performance in unseen camouflage situations. This is especially important for application scenarios where camouflage patterns are varied and updated quickly.

[0087] 2. Reduce human resource consumption: Traditional supervised learning methods require a large amount of labeled data to train models, which is not only time-consuming but also costly. The present invention can significantly reduce the dependence on a large amount of labeled data, thereby reducing human resource consumption.

[0088] 3. Improve the applicability of the model: The present invention uses a small amount of samples for training, so that the model can quickly adapt to different application scenarios, such as medical image segmentation, military target recognition, etc., which improves the applicability and flexibility of the model.

[0089] 4. Accelerate model deployment: In new application scenarios, the present invention can quickly learn and adapt to new types of camouflaged targets, which makes the model deployment process more efficient and saves users a lot of time and resources.

[0090] 5. Enhanced target detection capability: The present invention can significantly enhance the model's detection capability for camouflaged targets through high-quality acquisition, preprocessing and deep feature extraction of camouflaged images, especially in complex environments, and can more accurately identify and segment camouflaged targets. BRIEF DESCRIPTION OF THE DRAWINGS

[0091] Figure 1 It is a schematic diagram of the overall network framework of the present invention;

[0092] Figure 2 It is a schematic diagram of the process of the present invention;

[0093] Figure 3 It is a schematic diagram of the positioning and focusing module of the present invention;

[0094] Figure 4 is a schematic diagram for comparing the embodiment with the existing few shot segmentation model;

[0095] Figure 5 It is a schematic diagram for comparing the embodiment with the existing COS model. DETAILED DESCRIPTION

[0096] The technical solution of the present invention is described in detail below, but the protection scope of the present invention is not limited to the embodiments.

[0097] like Figure 1 and 2 As shown, the small sample camouflage target segmentation method of the present invention comprises the following steps:

[0098] Step 1: Obtain support image set and query image set; use labelme tool to perform mask annotation on support image and query image;

[0099] Step 2: Construct and train the camouflage target segmentation network CAMFS, and transform any set of support images x in step 1 s and query image x q Input the camouflaged target segmentation network CAMFS for processing. The camouflaged target segmentation network CAMFS includes a shared backbone network, a camouflaged meta-learning module CMLN and a camouflaged base learning decoder CBLD. ResNet50 is used as the shared backbone network.

[0100] Step 2.1: A set of support images x s and query image x q After entering the camouflage target segmentation network CAMFS, the camouflage meta-learning module CMLN performs the following operations:

[0101] Step A: First, the support image x is extracted by the shared backbone network s and query image x q The corresponding semantic information is used to obtain the feature map F of the supporting image. S and the feature map F of the query image Q ; F S ,F Q =F conv (x s ,x q ), where F conv To share the backbone network, b represents the block number;

[0102] Then, the positioning and focusing module FPM is used to locate the feature map F S and feature map F Q Detail feature extraction is performed, where the feature map F S Perform layer-by-layer operations to obtain the support set detail feature maps F2, F3, F4 and the corresponding prior masks P2, p3 and p4; Q The query image detail feature matrix Q is obtained by layer-by-layer operation and channel-by-channel splicing is performed to generate the query image detail feature matrix Q q ;

[0103] Next, the detail feature maps F3 and F4 are concatenated to generate S , O S Generate H through the attention mechanism S ; Q q Convolution is performed to obtain O q ;

[0104] Step B: The camouflage meta-learning module CMLN performs knowledge guidance to transfer the information contained in the hint mask to the image to be segmented, and obtains the similarity feature map C through the MS module.S ;

[0105] Step C: Connect the corresponding feature maps, use the ASPP module to enhance the features of the connected feature matrix, and finally obtain the prediction mask M through the classifier. m ; The corresponding feature maps here include D S , H S , query image 2nd and 3rd layer block feature matrix Prior mask M pr , support image detail feature matrix O S , query image detail feature matrix O q And similarity feature map C S ;

[0106] Step 2.2: The camouflage base learning decoder CBLD performs the following operations:

[0107] Step a: The camouflage base learning decoder CBLD obtains the query image x q The four-layer feature map F Q , and generate the predicted edge mask f through channel dimension connection, convolution fusion and Sigmoid function in turn edge , providing semantic information of the target boundary for subsequent processes;

[0108] Step b: The predicted edge mask f edge The features of the query image are input into the EFR module to mine the features of the target area.

[0109] Step c: f edge and Perform multi-scale fusion MFM operation and iteration to obtain the prediction mask M B ;

[0110] Step 3: Fusion and training

[0111] First, we use the query image and its mask from the training set as samples to train the disguised base learning decoder CBLD, and get the total loss L in the CBLD stage. base ;

[0112] Then, the scenario training on the disguised meta-learning module CMLN is used to obtain the binary cross entropy loss L meta During training, the mask M is trained by the probability factor parameter γ m and M B Fuse into the final comprehensive prediction mask.

[0113] like Figure 3 As shown, in step A of this embodiment, the positioning and focusing module FPM is used to locate the feature map F S and feature map FQ The specific process of detailed description is as follows:

[0114] Step I: Use depth-wise separable convolution DW to perform the feature map F S and feature map F Q Reduce the number of channels, the calculation formula is as follows:

[0115] Then get

[0116] in It refers to the block feature maps of the 2nd, 3rd, and 4th layers of the input. F2, F3, and F4 refer to the three sets of feature maps with rich detail information generated by the positioning module and the iterative focusing module.

[0117]

[0118]

[0119]

[0120] Step II: First, the focusing module vectorizes the block feature map channel by channel to generate three matrices Q, K, and V. C is the number of channels, H×W is the vector length;

[0121] To obtain the relative importance of Q to K, we perform a dot product of the transpose of Q and K and calculate the probability distribution to generate the channel attention matrix A. The specific elements are represented as:

[0122]

[0123] Next, the attention matrix A is multiplied by the matrix V and a residual connection is made with the input, denoted as Then, the number of channels is compressed through convolution operation to generate three matrices. Similar to the above operation, the spatial attention matrix is ​​obtained, and finally F4 and prior mask P4 are obtained;

[0124] Step III: Input F4 and P4 into the Foc module. After input, first perform mask inversion on P4 to enhance the recognition of the background, and perform Hadamard product on F4 with the prior mask and the inversion mask respectively:

[0125] f f =P4⊙F4,f b =(1-P4)⊙F4;

[0126] Then, the foreground and background features are subjected to 1*1 convolution to reduce the number of channels, and then multi-scale feature extraction is performed in parallel through several convolution kernels of different scales, and detailed information is obtained through dilated convolution, which is specifically expressed as follows:

[0127]

[0128] By adjusting different convolution kernel sizes and expansion rates through i, the network can capture features of different scales and splice them channel by channel;

[0129] Step IV: Foreground feature F fr By subtracting F4 channel by channel and adding it to the background feature F br Channel-by-channel addition is performed to enhance the model's recognition and removal of interference information, and F3 and P3 are generated as the input of the focusing module of the next iteration.

[0130] The above feature map F S and feature map F Q The specific process of processing the intermediate feature map in is as follows:

[0131] First, the intermediate feature map Perform channel dimension connection, and the mask m corresponding to the support image s Implement mask average pooling to generate attention vector A S At the same time, it is extended to the intermediate feature map through bilinear interpolation The same scale, denoted as D S ; Then the attention vector A S After convolution operation, the same as the intermediate feature map Perform Hadamard product to generate H S ; This enables the model to extract more important areas from the feature map through mask information;

[0132] Finally, the detail features F2 and F3 are connected in the channel dimension, and the same operation as above is performed to generate O S ;

[0133] The above calculation formula is expressed as:

[0134]

[0135] D s =δ(A s )

[0136]

[0137]

[0138] where δ and Represent bilinear interpolation and channel-by-channel dimension concatenation respectively.

[0139] The specific implementation process of knowledge guidance in step B in this embodiment is as follows:

[0140] For the feature map F of the support image obtained in step A S and the feature map F of the query image Q ,

[0141] First, mark each block and the bottleneck structure under the block as

[0142]

[0143] Where b represents the block number, N represents the bottleneck structure number under the block, and B represents the total number of bottleneck structures under the block;

[0144] Then, to ensure that the mask and the feature maps of each layer can be multiplied pixel by pixel, Bilinear interpolation is performed at different scales, namely:

[0145] Through the feature matrix Adjust the mask matrix

[0146] To match Resolution;

[0147] Next, the cosine distance CS between the support image feature vector and the query image feature vector is calculated one by one b,N , the method is: first flatten the support image feature matrix into the support feature vector Flatten the corresponding mask matrix into a mask vector And perform Hadamard product on the channel dimension to generate mask feature vector Calculate the average of the elements in the mask vector that are greater than 0 Right now Then, filter out Medium to large , and based on this sequence, filter out The corresponding element in is expressed as

[0148] Each bottleneck feature in is Right now Since a large number of elements are filtered out, The dimension is much smaller than Dimensions;

[0149] The query image feature matrix is ​​then flattened into a query feature vector Through Dot product to calculate cosine similarity;

[0150]

[0151] Set ε to 0.001, and perform cosine similarity calculation on all bottleneck feature vectors, and finally concatenate them in the channel dimension to generate the similarity feature map C. s .

[0152] In this embodiment, step C obtains the prediction mask M through the classifier. m The specific formula is

[0153]

[0154] The specific implementation method of the camouflage base learning decoder CBLD in step 2.2 is:

[0155] Step a: The camouflage base learning decoder CBLD obtains the query image x q The four-layer feature map of and The channel dimension is connected, and the features are fused through two 3×3 convolutions. Finally, the predicted edge mask f is generated through the Sigmoid function. edge ;

[0156]

[0157] Step b, the obtained f edge The features of the query image are input into the EFR module to mine the features of the target area.

[0158] f edge See as The edge prompt guides the model to better mine the features of the target area; the specific operation of EFR is first to edge and Perform Hadamard product and compare pixel by pixel The edge feature information is enhanced by addition, and features are extracted through multi-layer 3x3 convolution. Then the extracted features are subjected to global average pooling GAP to obtain channel attention weights, and multiplied channel by channel with the original features to generate Expressed as The calculation formula of f is:

[0159]

[0160] Step c: f edge and Perform multi-scale fusion MFM operation and iteration to obtain the prediction mask M m ,Right now:

[0161] First, fedge and Channel connection is performed, and 3×3 convolutions with different expansion rates are used to integrate multi-scale features to capture information of different spatial resolutions. The features are then combined by serial addition and iterated sequentially to finally obtain the mask M predicted by CBLD. m .

[0162] Example

[0163] This embodiment experiments on the technical solution of the present invention. First, 5322 camouflage images of 20 categories are collected to obtain as comprehensive and accurate data as possible. After that, these images are preprocessed to eliminate noise, enhance contrast, and make other necessary adjustments to improve the quality of the images.

[0164] After preprocessing, a deep neural network (ResNet-50) in computer vision is used as the backbone network for image feature extraction. Subsequently, the small sample learning method of the present invention is used to guide the model to segment the query image with the support image as a prompt. This operation is of great significance, improving the generalization of the camouflage segmentation model and providing a new direction for model deployment in real scenes to detect camouflaged objects. The purpose of this study is to use the idea of ​​small sample learning to improve the generalization ability of camouflage target segmentation models (such as in the fields of medicine and military), thereby providing technical support for many fields such as machine-assisted medical care or informationized weaponry.

[0165] Based on the above, reducing the reliance on labeled data and enhancing the generalization ability of disguised object segmentation while maintaining accurate segmentation of disguised objects is a problem that urgently needs to be solved in the field of disguised object segmentation. We adopt the idea of ​​few-shot learning, a meta-learning method that enables the model to learn from a small set of labeled data and generalize to new, unseen data. Few-shot learning extracts samples from each class as a support set, which is a key hint for the model to understand the task at hand and significantly reduces the reliance on large labeled datasets while enhancing the generalization of the model. A key focus of our work is to overcome the challenge of extracting fine-grained information, such as edge details of disguised objects. This is critical to ensure effective segmentation and generalization of disguised object segmentation models.

[0166] This embodiment further compares the technical solution of the present invention with the existing few shot segmentation model and the existing COS model. The comparison results are as follows: Figure 4 and Figure 5 As shown in FIG. 1 , the effect of the CAMFS of the present invention on the COS-FSS dataset compared with the existing fewshot segmentation model is shown in FIG. Figure 4and Table 1. The results show that compared with MSANet, FB-IoU and mIoU are improved by 1.74% and 3.31%, respectively. For PFEnet, the CAMFS of the present invention shows improvements of 6.08% and 8.76%, respectively. This performance gain can be attributed to the effective capture of camouflage details and the knowledge transfer from support images to query images in the model of the present invention, that is, the present invention shows superior segmentation performance in the challenging COS task, especially for objects with blurred outlines.

[0167] Table 1 Comparison data between the present invention and the existing few shot segmentation model

[0168]

[0169] In addition, this example also compares the segmentation performance of the CAMFS model of the present invention with that of 10 other existing segmentation models in unseen categories. Figure 5 , Table 2 and Table 3. On the one hand, this shows that the present invention outperforms other segmentation models. On the other hand, this shows that the general semantic segmentation model is worse than the COS model in camouflage target segmentation. The general semantic segmentation model (Table 3) is better than the COS model in S α The average value is 6.53% lower than that of the COS model (Table 2). This is due to the low sensitivity of general semantic segmentation models to disguised objects, difficulty in handling boundaries, or defects in separating foreground and background.

[0170] Table 2 Comparison data of CAMFS of the present invention and existing camouflage target segmentation model

[0171]

[0172] Table 3 Comparison data of CAMFS of the present invention and general semantic segmentation model

[0173]

[0174] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

Claims

1. A small sample camouflage target segmentation method, characterized in that: The following steps are involved: Step 1: Obtain support image set and query image set; use labelme tool to perform mask annotation on support image and query image; Step 2: Construct and train the camouflage target segmentation network CAMFS, and transform any set of support images x in step 1 s and query image x q Input the camouflaged target segmentation network CAMFS for processing. The camouflaged target segmentation network CAMFS includes a shared backbone network, a camouflaged meta-learning module CMLN and a camouflaged base learning decoder CBLD. ResNet50 is used as the shared backbone network. Step 2.1: A set of support images x s and query image x q After entering the camouflage target segmentation network CAMFS, the camouflage meta-learning module CMLN performs the following operations: Step A: First, the support image x is extracted by the shared backbone network s and query image x q The corresponding semantic information is used to obtain the feature map F of the supporting image. S and the feature map F of the query image Q ; Then, the positioning and focusing module FPM is used to locate the feature map F S and feature map F Q Detail feature extraction is performed, where the feature map F S Perform layer-by-layer operations to obtain the support set detail feature maps F2, F3, F4 and the corresponding prior masks P2, P3 and P4; Q The query image detail feature matrix Q is obtained by layer-by-layer operation and channel-by-channel splicing is performed to generate the query image detail feature matrix Q q Next, the detail feature maps F3 and F4 are spliced ​​to generate channel O S , O S Generate H through the attention mechanism S ; Q q Convolution is performed to obtain O q ; The H S and O S The specific generation method is: First, the intermediate feature map Perform channel dimension connection, and the mask m corresponding to the support image s Implement mask average pooling to generate attention vector A S At the same time, it is extended to the intermediate feature map through bilinear interpolation The same scale, denoted as D S ; Then the attention vector A S After convolution operation, the same as the intermediate feature map Perform Hadamard product to generate H S ; This enables the model to extract more important areas from the feature map through mask information; finally, the detail feature maps F2 and F3 are connected in the channel dimension, and the same operation as above is performed to generate O S ; D s =δ(A s ) where δ and Respectively represent bilinear interpolation and channel-by-channel dimensional splicing; Step B: The camouflage meta-learning module CMLN performs knowledge guidance to transfer the information contained in the hint mask to the image to be segmented, and obtains the similarity feature map C through the MS module. S ; Step C: Connect the corresponding feature maps, use the ASPP module to enhance the features of the connected feature matrix, and finally obtain the prediction mask M through the classifier. m ; The corresponding feature maps here include D S , H S , query image 2nd and 3rd layer block feature matrix Prior mask M pr , support image detail feature matrix O S , query image detail feature matrix O q And similarity feature map C S ; Step 2.2: The camouflage base learning decoder CBLD performs the following operations: Step a: The camouflage base learning decoder CBLD obtains the query image x q The four-layer feature map F Q , and generate the predicted edge mask f through channel dimension connection, convolution fusion and Sigmoid function in turn edge , providing semantic information of the target boundary for subsequent processes; Step b: The predicted edge mask f edge The features of the query image are input into the EFR module to mine the features of the target area. Step c: f edge and Perform multi-scale fusion MFM operation and iteration to obtain the prediction mask M B ; Step 3: Fusion and training First, we use the query image and its mask from the training set as samples to train the disguised base learning decoder CBLD, and get the total loss L in the CBLD stage. base ; Then, the scenario training on the disguised meta-learning module CMLN is used to obtain the binary cross entropy loss L meta During training, the mask M is trained by the probability factor parameter γ m and M B Fuse into the final comprehensive prediction mask.

2. The small sample camouflage target segmentation method according to claim 1 is characterized in that: In step A, ResNet50 is used as a shared backbone network to extract features. During the training process, the shared backbone network only extracts features and is frozen during training. After inputting the shared backbone network, the extracted feature set is F S ,F Q =F conv (x s ,x q ); Among them, F conv To share the backbone network, b indicates the block number.

3. The small sample camouflage target segmentation method according to claim 1, characterized in that: In step A, the positioning focusing module FPM is used to determine the characteristic map F S and feature map F Q The specific process of detailed description is as follows: Step I: Use depth-wise separable convolution DW to perform the feature map F S and feature map F Q Reduce the number of channels, the calculation formula is as follows: Then get in It refers to the block feature maps of the 2nd, 3rd, and 4th layers of the input support set image. F2, F3, and F4 refer to the three sets of feature maps with rich detail information generated by the positioning module and the iterative focusing module. Step II: First, the focusing module vectorizes the block feature map channel by channel to generate three matrices Q, K, and V. C is the number of channels, H×W is the vector length; To obtain the relative importance of Q to K, we perform a dot product of the transpose of Q and K and calculate the probability distribution to generate the channel attention matrix A. The specific elements are represented as: Next, the attention matrix A is multiplied by the matrix V and a residual connection is made with the input, denoted as Then, the number of channels is compressed through convolution operation to generate three matrices. Similar to the above operation, the spatial attention matrix is ​​obtained, and finally F4 and prior mask P4 are obtained; Step III: Input F4 and P4 into the Foc module. After input, first perform mask inversion on P4 to enhance the recognition of the background, and perform Hadamard product on F4 with the prior mask and the inversion mask respectively: f f =P4☉F4,f b =(1-P4)☉F4; Then, the number of channels is reduced by 1*1 convolution for the foreground and background features, and then multi-scale feature extraction is performed in parallel through several convolution kernels of different scales, and detailed information is obtained by dilation convolution, which is specifically expressed as follows: By adjusting different convolution kernel sizes and expansion rates through i, the network can capture features of different scales and splice them channel by channel; Step IV: Foreground feature F fr By subtracting F4 channel by channel and adding it to the background feature F br Channel-by-channel addition is performed to enhance the model's recognition and removal of interference information, and F3 and P3 are generated as the input of the focusing module of the next iteration.

4. The small sample camouflage target segmentation method according to claim 1, characterized in that: The specific implementation process of the knowledge guidance in step B is as follows: For the feature map F of the support image obtained in step A S and the feature map F of the query image Q , First, mark each block and the bottleneck structure under the block as Where b represents the block number, N represents the bottleneck structure number under the block, and B represents the total number of bottleneck structures under the block; Then, to ensure that the mask and the feature maps of each layer can be multiplied pixel by pixel, Perform bilinear interpolation operations at different scales, that is, through the feature matrix Adjust the mask matrix To match resolution; then, the cosine distance CS between the support image feature vector and the query image feature vector is calculated one by one b,N , the method is: First, flatten the support image feature matrix into support feature vectors Flatten the corresponding mask matrix into a mask vector And perform Hadamard product on the channel dimension to generate mask feature vector Calculate the average of the elements in the mask vector that are greater than 0 Right now Then, filter out Medium or larger , and based on this sequence, filter out The corresponding element in is expressed as Each bottleneck feature in is Right now Since a large number of elements are filtered out, The dimension is much smaller than Dimensions; The query image feature matrix is ​​then flattened into a query feature vector Through Dot product to calculate cosine similarity; Set ε to 0.001, and perform cosine similarity calculation on all bottleneck feature vectors, and finally concatenate them in the channel dimension to generate the similarity feature map C. S .

5. The small sample camouflage target segmentation method according to claim 1, characterized in that: The step C obtains the prediction mask M through the classifier m The specific formula is 6. The small sample camouflage target segmentation method according to claim 1, characterized in that: The specific implementation method of the camouflage base learning decoder CBLD in step 2.2 is: Step a: The camouflage base learning decoder CBLD obtains the query image x q The four-layer feature map of and The channel dimension is connected, and the features are fused through two 3×3 convolutions. Finally, the predicted edge mask f is generated through the Sigmoid function. edge ; Step b, the obtained f edge The features of the query image are input into the EFR module to mine the features of the target area. f edge See as The edge prompt guides the model to better mine the features of the target area; the specific operation of EFR is first to edge and Perform Hadamard product and compare pixel by pixel The edge feature information is enhanced by addition, and features are extracted through multi-layer 3x3 convolution. Then the extracted features are subjected to global average pooling GAP to obtain channel attention weights, and multiplied channel by channel with the original features to generate Expressed as The calculation formula of f is: Step c: f edge and Perform multi-scale fusion MFM operation and iteration to obtain the prediction mask M m , that is: first f edge and Channel connection is performed, and 3×3 convolutions with different expansion rates are used to integrate multi-scale features to capture information of different spatial resolutions. The features are then combined by serial addition and iterated sequentially to finally obtain the mask M predicted by CBLD. m .

7. The small sample camouflage target segmentation method according to claim 1, characterized in that: The step 3 adopts a two-stage training method to optimize the model during fusion and training; In the first stage, we use query images from the training set as samples for training, namely: For target mask supervision, binary cross entropy BCE loss and IoU loss are used; L BCE =-[m q log(M B )|+(1-m q )log(1-M B )] Finally, the total loss of the first-stage disguise meta-learning network CMLN is expressed as: THE base =L BCE +L IoU +λL dice The second stage, the disguised base learning decoder CBLD, adopts the scenario training method and uses the binary cross entropy loss expressed as L meta =L BCE (m q , M m ).