A camouflaged target segmentation method based on enlarged sampling
Through the method based on amplified sampling and the multi-stage learning framework, the shortcomings of existing camouflage object segmentation technology in small object segmentation are solved, the accuracy of camouflage object segmentation and edge detail extraction capabilities are improved, and the generated segmentation results are closer to the true value.
Patent Information
- Application Number
- CN202210070125.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-01-21
AI Technical Summary
Existing camouflage object segmentation technology has shortcomings in small object segmentation, especially when the foreground and background are similar, it is difficult to segment finely, and edge details cannot be effectively extracted.
A method based on amplification sampling is adopted to enlarge the key areas in the image through non-uniform sampling. A multi-stage learning framework and segmentation network are used, and the attention map and Gaussian function are combined for image expansion and sampling to enhance the segmentation accuracy of camouflaged objects.
It improves the accuracy of camouflage object segmentation, especially in small target object segmentation. It can extract edge details more accurately, generate segmentation results closer to the true value, and gradually improve segmentation details in multi-stage learning.
Smart Images

Figure CN114494293B
Abstract
Description
Technical Field
[0001] The invention relates to the field of computer vision image segmentation, and in particular to a camouflage target segmentation method based on magnified sampling. Background Art
[0002] Image segmentation is a method of obtaining the mask of the target object in the image. It is one of the most important applications in computer vision systems and is widely used in medical diagnosis, agricultural pest inspection, military fields, etc. In the image segmentation process, especially for the segmentation of camouflaged objects, it is a huge challenge to finely segment small objects when the foreground and background are similar.
[0003] Camouflaged or hidden objects are difficult to detect because they are subtly different from the background environment. To overcome this difficulty, many works are devoted to using complex common salient object segmentation techniques to solve camouflaged object segmentation. For example, the earliest camouflaged object segmentation method SINet (Deng-Ping Fan, Ge-Peng Ji, Guolei Sun, Ming-Ming Cheng, Jianbing Shen, and Ling Shao. Camouflaged object detection. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR, pages 2774–2784, 2020), the model it proposed is built on the cascade decoder of salient object segmentation and introduces reverse attention, but it cannot extract edge details. In addition, CANet (Jiawei Liu, Jing Zhang, and Nick Barnes. Confidence-aware learning for camouflaged object detection. CoRR, abs / 2106.11641, 2021.2) focuses on how to extract more accurate camouflaged object edges, and MGL (Qiang Zhai, Xin Li, Fan Yang, Chenglizhao Chen, Hong Cheng, and Deng-Ping Fan. Mutual graph learning for camouflaged object detection. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR, pages 12997–13007, 2021) uses edge learning combined with graph learning to extract more accurate segmentation results. However, these methods ignore the fine segmentation of small objects. Summary of the invention
[0004] In order to overcome the shortcomings of existing camouflaged object segmentation in small object segmentation, the present invention provides a camouflaged target segmentation method based on magnified sampling, which can perform non-uniform sampling on the image, continuously magnify the key area in the image, and increase the pixels of this area, thereby improving the segmentation accuracy of the camouflaged object, especially the segmentation accuracy of small target objects.
[0005] The technical solution of the present invention is as follows:
[0006] A camouflaged target segmentation method based on enlarged sampling includes the following processes:
[0007] Step 100: Divide the dataset into a training set and a test set, and obtain the discrimination truth value using the positioning information and edge information;
[0008] Step 200: Iterate the training process, where the number of iterations \(i\in[1,N]\);
[0009] Step 201: Training. Input the training image \(I\) i into the segmentation network to obtain the trained model Net i , and use the loss function to constrain the model;
[0010] Step 202: Enlargement. Perform dilation processing according to the binary truth value of the training set to obtain the attention map \(D\) i . Sample the training image \(I\) i , the binary truth value and the discrimination truth value according to the attention map, and respectively obtain the enlarged \(I\) i+1 , the binary truth value and the discrimination truth value
[0011] Step 203: Iteration. Initialize Net i with the parameters of Net i+1 ; repeat Steps 201 - 203;
[0012] Step 300: Iterate the testing process, where the number of iterations \(i\in[1,N]\);
[0013] Step 301: Testing. Input the test image \(T\) i into the trained model Net i to obtain the prediction result
[0014] Step 302: Enlargement. When \(i < N\), perform dilation processing according to the prediction result to obtain the attention map . Sample the test image \(T\) i according to the attention map to obtain the enlarged \(T\) i+1 ; repeat Steps 301 - 302;
[0015] Step 400: Iterative anti - sampling and evaluation of results, where the number of iterations \(i\in[1,N]\);
[0016] Step 401: When \(i>1\), perform anti - sampling on according to the attention map of the previous stage, and repeat this process until is obtained as the final prediction result, and compare it with the corresponding binary truth value to obtain the evaluation result.
[0017] Preferably, in step 100, the true value is distinguished to make the network focus on the edge and positioning information of the camouflaged object, and the design method is as follows:
[0018] Identify the truth value G dis As supervision information, it contains the positioning information and edge information of the camouflaged object, which is calculated by the following formula:
[0019] G dis =G bin ∩(G fix ∪A(σ,λ,G edge ))
[0020] Where A(·) is the Gaussian function, σ is the Gaussian blur parameter, λ is the kernel size parameter, G bin is a binary truth value, G fix and G edge They are positioning information and edge information respectively; since G fix is non-binary, so G edge is a non-binary mask ranging from 0 to 255.
[0021] Preferably, in step 201, the segmentation network is used to obtain image features, and the design method is as follows:
[0022] The network is built on a two-branch network architecture. For the first branch, it includes four convolutional blocks and a discriminative decoder to generate the final prediction result. The second branch adds three new convolutional blocks after the first block of the first branch and passes these four convolutional blocks through a binary decoder to generate the final prediction result. In addition, the second convolutional block from the first branch is combined with the discriminative decoder output of the first branch by using a holistic attention module (HA) to generate the second block of the second branch.
[0023] The discriminative decoder and the binary decoder have the same network structure. The input feature map first enters the atrous spatial pyramid pooling (ASPP) component, with the goal of achieving multi-scale receptive fields in the image. It is then passed to the Distraction Module (DM). The Distraction Module is designed to decompose the previous feature map into foreground and background feature blocks by adding two parallel residual channel attention blocks (see Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and YunFu. Image super-resolution using very deep residual channel attention networks. In European Conference on Computer Vision, ECCV, volume 11211, pages 294–310, 2018). Afterwards, element-wise subtraction is used to invert the background features, and element-wise addition is used to enhance the foreground features. The residual channel attention block consists of two layers of convolution and one channel attention. The input feature first passes through two layers of convolution, and then this feature map is input into the channel attention. After passing through an activation function, it is multiplied with the original feature map and then added to the initial input to obtain the output feature of the residual channel attention module. The output feature f of the distraction operation d It is expressed as:
[0024] f d =BR(βf a +BR(-αf b ))
[0025] Where BR is a combination of batch normalization and ReLU activation function, f a and f b Represent foreground and background features respectively. α and β are two learnable parameters, initialized to 1.
[0026] Finally, another atrous spatial pyramid pooling component ASPP is added after the distraction module DM to output features.
[0027] The entire network is trained end-to-end, and the two network branches correspond to two loss functions, namely, the discriminant loss L dis and binary loss L bin , the discrimination loss L dis Denotes the discriminative prediction P obtained by the discriminative decoder dis and discriminate the truth value G dis The loss, binary loss L bin Represents the binary prediction P obtained by the binary decoder bin With the binary truth value Gbin Combined with the weighted binary cross entropy loss function And weighted IoU loss function Get the structural loss function:
[0028]
[0029] Finally, the loss function of the entire network is calculated as:
[0030] L total =L dis +L bin =L str (P dis ,G dis )+L str (P bin ,G bin )
[0031] Preferably, step 202 and step 302 specifically include:
[0032] The attention map is used to calculate the mapping function between the coordinates of the original image and the sampled image. The area with a larger attention value is more likely to be sampled. First, the attention map D is decomposed into two dimensions, and the marginal distribution is obtained by calculating the maximum value of the attention map on the x-axis and y-axis:
[0033]
[0034] where w and h are the width and height of D.
[0035] In step 202, based on the given binary truth value G bin , use the Gaussian function to perform an expansion operation, expand the original prediction area, and obtain the attention map:
[0036]
[0037] Where σ is the Gaussian blur parameter and λ is the kernel size parameter. Then, an attention-based sampling algorithm is used to enlarge the camouflaged target. Given the original image I, the sampling function Defined as:
[0038]
[0039] in Representation function The inverse function of .
[0040] In step 302, based on the given binary prediction P bin , use the Gaussian function to perform an expansion operation, expand the original prediction area, and obtain the attention map:
[0041]
[0042] Where σ is the Gaussian blur parameter and λ is the kernel size parameter. Then, an attention-based sampling algorithm is used to enlarge the camouflaged target. Given the original image T, the sampling function Defined as:
[0043]
[0044] in Representation function The inverse function of .
[0045] Beneficial effects of the present invention:
[0046] In order to verify the multi-stage learning framework, the present invention sets the number of stages of magnification sampling to four stages. The experimental results show that the present invention can obtain a relatively rough target area in stage 1. In the following stages, the segmentation results are gradually improved, with more and more details, and the output of the final stage becomes closer to the binary truth value.
[0047] The present invention is compared with the most advanced camouflage object segmentation methods, including SINet, LSR, MGL, and PFNet. For fair comparison, the results of these methods are directly provided by their authors or their original training models. Compared with the four most advanced methods, the present invention method can generate better segmentation results than the most advanced methods in stage 1, the binary prediction map generated in stage 4 is closer to the true value, and the segmentation effect of small target objects is more accurate, and more edge details can be extracted. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a workflow diagram of the camouflaged target segmentation method based on magnified sampling provided by the present invention;
[0049] Figure 2 It is a specific operation diagram of the camouflaged target segmentation method based on magnified sampling provided by the present invention;
[0050] Figure 3 It is a schematic diagram of the calculation to discern the true value;
[0051] Figure 4 is a schematic diagram of the segmentation network;
[0052] Figure 5 It is a schematic diagram of the calculation of the amplified sampling;
[0053] Figure 6 It is a comparison of the results of multi-stage amplification sampling in the present invention;
[0054] Figure 7 It is a visual comparison of the results of the present invention and other methods. DETAILED DESCRIPTION
[0055] The specific implementation of the present invention is further described below in conjunction with the accompanying drawings and technical solutions.
[0056] Figure 1 : is a workflow diagram of the camouflaged target segmentation method based on magnified sampling provided by the present invention. Figure 2 As shown in the figure, it is assumed that the network training phase is two times, including the following process:
[0057] Step 100, divide the data set into a training set and a test set, and use the positioning information and edge information to obtain the true value of the discrimination. Figure 3 The calculation process of the true value of the training set is shown. The true value is calculated by the following formula:
[0058] G dis =G bin ∩(G fix ∪A(σ,λ,G edge ))
[0059] Where A(·) is the Gaussian function, σ is the Gaussian blur parameter, and λ is the kernel size parameter. bin is a binary truth value, G fix and G edge They are positioning information and edge information respectively. fix is non-binary, so G edge is a non-binary mask ranging from 0 to 255.
[0060] Step 200, iterative training process. The network trained in each stage is consistent with the network parameters, which are, the backbone of the network is Resnet50, all input images are resized to 352×352, and the output predictions are resized back to the original object size to compare with their binary true values. Bilinear interpolation is used for image resizing. The Adam optimizer (see Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR, 2015) is used, the network learning rate is 2.5e-5, and the decay rate is 0.9. The network is experimented on a Tesla V100. Each training stage takes about 6 hours, the batch size is 24, and the epoch is set to 50.
[0061] The iterative steps are as follows, where the number of iterations i∈[1,N], N=2:
[0062] Step 201: training. 1 Input the segmentation network to get the trained model Net 1 , use the loss function to constrain the model. The specific network design is as follows Figure 4 As shown:
[0063] The network is built on a two-branch network architecture. For the first branch, it includes four convolutional blocks and a discriminative decoder to generate the final prediction result. The second branch adds three new convolutional blocks after the first block of the first branch and passes these four convolutional blocks through a binary decoder to generate the final prediction result. In addition, the second convolutional block from the first branch is combined with the discriminative decoder output of the first branch by using a holistic attention module (HA) to generate the second block of the second branch.
[0064] The discriminative decoder and the binary decoder have the same network structure. The input feature map is firstly subjected to the Atrous Spatial Pyramid Pooling (ASPP) component with dilation rates D r =3,6,12,18, the purpose is to achieve multi-scale receptive field in the image. Then it is passed to the distraction module (DM). DM is an effective technique that decomposes the previous feature map into foreground and background feature blocks by adding two parallel residual channel attention blocks (RCAB). After that, the present invention uses element-wise subtraction to invert the background features and element-wise addition to enhance the foreground features. The output feature f of the distraction operation d It is expressed as:
[0065] f d =BR(βf a +BR(-αf b ))
[0066] Where BR is a combination of batch normalization and ReLU activation function, f a and f b Represent foreground and background features respectively. α and β are two learnable parameters, initialized to 1.
[0067] Finally, another ASPP component is added after DM to output features.
[0068] The entire network is trained end-to-end, and the two network branches correspond to two loss functions, namely, the discriminant loss L dis and binary loss L bin , the former represents the discriminative prediction P obtained by the discriminative decoder dis and discriminate the truth value G dis The loss of the binary decoder is P bin With the binary truth value G bin Combined with the weighted binary cross entropy loss function And weighted IoU loss function Get the structural loss function:
[0069]
[0070] Finally, the loss function of the entire network is calculated as:
[0071] L total =L dis +L bin =L str (P dis ,G dis )+L str (P bin ,G bin )
[0072] Step 202: Amplify and perform expansion processing according to the binary truth value of the training set to obtain the attention D 1 , according to the attention map, the training image I 1 , binary truth value and discerning truth value Sampling is performed to obtain the amplified I 2 , binary truth value and discerning truth value like Figure 5 The specific operations are as follows:
[0073] Based on a given binary truth value Use the Gaussian function to perform an expansion operation, expand the original prediction area, and obtain the attention map:
[0074]
[0075] Then, an attention-based sampling algorithm is used to enlarge the camouflaged target. 1 For example, the sampling function Defined as:
[0076]
[0077] in Representation function The inverse function of .
[0078] Step 203, use Net 1 Initialize Net with parameters 2 ; Iteration steps 201 to 203, the specific operation is to use the enlarged I 2 , binary truth value and discerning truth value Train the network and get the trained Net 2 .
[0079] Step 300, iterate the test process to Figure 2 take as an example, the number of iterations \(i\in[1,N]\), \(N = 2\);
[0080] Step 301, input the test image \(T\) 1 into the trained model Net 1 to obtain the prediction result
[0081] Step 302, magnification. When \(i < N\), \(N = 2\), perform dilation processing according to the prediction result to obtain the attention Sample the test image \(T\) according to the attention map 1 to obtain the magnified \(T\) 2 ;
[0082] Repeat Step 301. The specific repetition steps are as follows: input the test image \(T\) 2 into the trained model Net 2 to obtain the prediction result
[0083] The sampling operation of the test set is as follows:
[0084] Based on the given binary prediction perform dilation operation using the Gaussian function to expand the original prediction area to obtain the attention map:
[0085]
[0086] After that, use the attention-based sampling algorithm to magnify the camouflage target. Given the original image \(T\) 1 , the sampling function \(Sampler(T\) 1 , \(D)\) is defined as:
[0087]
[0088] where \(D\) -1 \((\cdot)\) represents the inverse function of the function \(D(\cdot)\).
[0089] Step 400, iterative inverse sampling, evaluate the results. The prediction results of different iterations are as Figure 6 shown.
[0090] Step 401, when \(i>1\), perform inverse sampling on according to the previous stage to obtain the new denoted as as the final prediction result, and compare it with the corresponding binary ground truth to obtain the evaluation result.
[0091] Such as Figure 6As shown in the figure, after four iterations, the segmentation result of each stage is more refined than that of the previous stage, and the segmentation result tends to be stable as the number of iterations increases.
[0092] like Figure 7 As shown, compared with the experimental results of the other four methods, the segmentation results of the present invention are more accurate, especially in expressing the edge details of small target objects.
Claims
1. A camouflaged target segmentation method based on enlarged sampling, characterized in that: The process includes: Step 100, dividing the data set into a training set and a test set, and using the positioning information and edge information to obtain the true value of the discrimination; Step 200, iterative training process, the number of iterations i∈[1,N]; Step 201: training, training image I i Input the segmentation network to get the trained model Net i , use the loss function to constrain the model; Step 202: Amplify and perform expansion processing according to the binary truth value of the training set to obtain the attention D i , according to the attention map, the training image I i , binary truth value and discerning truth value Sampling is performed to obtain the amplified I i+1 , binary truth value and discerning truth value Step 203, iterate, use Net i Initialize Net with parameters i+1 ; Repeat steps 201 to 203; Step 300, iterative testing process, the number of iterations i∈[1,N]; Step 301, test, test image T i Input the trained model Net i , and get the prediction result Step 302, magnification. When i < N, according to the prediction result perform dilation processing to obtain the attention Sample the test image T according to the attention map i to obtain the magnified T i+1 ; Repeat steps 301 to 302; Step 400, reverse sampling the prediction results, evaluating the results, the number of iterations i∈[1,N]; Step 401, when i>1, according to the attention of the previous stage right Perform reverse sampling and repeat this process until you get The final prediction result is compared with the corresponding binary true value to obtain the evaluation result.
2. The method for segmenting a camouflaged target based on magnified sampling according to claim 1, characterized in that: In step 100, the true value is distinguished to make the network focus on the edge and positioning information of the camouflaged object. The design method is as follows: Identify the truth value G dis As supervision information, it contains the positioning information and edge information of the camouflaged object, which is calculated by the following formula: G dis =G bin ∩(G fix ∪A(σ,λ,G edge )) Where A(·) is the Gaussian function, σ is the Gaussian blur parameter, λ is the kernel size parameter, G bin is a binary truth value, G fix and G edge They are positioning information and edge information; G fix is non-binary, G edge is a non-binary mask ranging from 0 to 255.
3. A camouflaged target segmentation method based on enlarged sampling according to claim 1 or 2, characterized in that: In step 201, the segmentation network is used to obtain image features, and the design method is as follows: The network is built on a two-branch network architecture; for the first branch, it includes four convolutional blocks and a discriminative decoder that generates the final prediction result; the second branch adds three new convolutional blocks after the first block of the first branch, and passes these four convolutional blocks through a binary decoder to generate the final prediction result; the second convolutional block from the first branch is combined with the discriminative decoder output of the first branch by using an overall attention module to generate the second block of the second branch; The discriminative decoder and the binary decoder have the same network structure; the input feature map is first a dilated spatial pyramid pooling component and then passed to the distraction module; the distraction module is specifically as follows: the previous features are decomposed into foreground and background feature blocks by adding two parallel residual channel attention blocks, and then the background features are inverted by element-wise subtraction, and the foreground features are enhanced by element-wise addition; the residual channel attention block consists of two layers of convolution and one channel attention, the input feature first passes through two layers of convolution, and then this feature map is input into the channel attention, after an activation function, it is multiplied with the original feature map, and then added to the initial input to obtain the output feature of the residual channel attention module; the output feature f of the distraction operation d It is expressed as: f d =BR(βf a +BR(-αf b )) Where BR is a combination of batch normalization and ReLU activation function, f a and f b Represent foreground and background features respectively; α and β are two learnable parameters, initialized to 1; Finally, another atrous spatial pyramid pooling component is added to the distraction module to output features; The entire network is trained end-to-end, and the two network branches correspond to two loss functions, namely, the discriminant loss L dis and binary loss L bin , the discrimination loss L dis Denotes the discriminative prediction P obtained by the discriminative decoder dis and discriminate the truth value G dis The loss, binary loss L bin Represents the binary prediction P obtained by the binary decoder bin With the binary truth value G bin loss; combined with the weighted binary cross entropy loss function And weighted IoU loss function Get the structural loss function: Finally, the loss function of the entire network is calculated as: L total =L dis +L bin =L str (P dis ,G dis )+L str (P bin ,G bin )。 4. A camouflaged target segmentation method based on enlarged sampling according to claim 1 or 2, characterized in that: The attention map is used to calculate the mapping function between the coordinates of the original image and the sampled image. The area with a larger attention value is more likely to be sampled. First, the attention map D is decomposed into two dimensions, and the marginal distribution is obtained by calculating the maximum value of the attention map on the x-axis and y-axis: Where w and h are the width and height of D; In step 202, based on the given binary truth value G bin , use the Gaussian function to perform an expansion operation, expand the original prediction area, and obtain the attention map: Where σ is the Gaussian blur parameter and λ is the kernel size parameter; Then, an attention-based sampling algorithm is used to enlarge the camouflaged target; given the original image I, the sampling function Defined as: in Representation function The inverse function of In step 302, based on the given binary prediction P bin , use the Gaussian function to perform an expansion operation, expand the original prediction area, and obtain the attention map: Where σ is the Gaussian blur parameter and λ is the kernel size parameter; Then, an attention-based sampling algorithm is used to enlarge the camouflaged target; given the original image T, the sampling function Defined as: in Representation function The inverse function of .
