A camouflaged object detection method based on feature extraction
Through the feature extraction-based camouflaged object detection method, using ResNet50 and CBR modules combined with the structural loss function, the problems of object-environment similarity and boundary fuzziness in camouflaged object detection are solved, and the fast and accurate recognition and segmentation of camouflaged objects are achieved.
Patent Information
- Application Number
- CN202310327951.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2043-03-30
AI Technical Summary
Existing technologies have difficulty in efficiently and accurately identifying camouflaged objects, especially due to detection failures caused by the high similarity between objects and the environment and blurred boundaries.
A camouflaged object detection method based on feature extraction is adopted. The ResNet50 feature extraction module, CBR module and feature extraction module are used, combined with bilinear interpolation and structural loss function for training and verification. The accurate segmentation of camouflaged objects is achieved through feature enhancement and background noise removal.
It achieves fast and accurate recognition and segmentation of camouflaged objects, improving the robustness and detection accuracy of the model.
Smart Images

Figure CN116797785B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer vision and deep learning, and in particular to a camouflaged object detection method based on feature extraction. Technical Background
[0002] The task of camouflaged object detection involves identifying objects embedded in their surroundings. These objects often resemble their surroundings closely enough to deceive them. In recent years, camouflaged object detection has garnered widespread attention from researchers due to its broad application value. However, this task presents several challenges: First, any object can be transformed into a camouflaged object under certain conditions, and objects vary in size, shape, and category, increasing the difficulty of detection. Second, the boundaries of camouflaged objects are often blurred and they bear a high degree of similarity to their surroundings, which can often deceive the model and cause detection failure. Therefore, an efficient and accurate camouflaged object detection method is crucial. Summary of the Invention
[0003] To address the shortcomings of the prior art, the present invention provides a method for detecting camouflaged objects based on feature extraction. This method can accurately and quickly identify camouflaged objects and obtain an image that segments the camouflaged objects. The technical solution of the present invention is achieved as follows:
[0004] A method for detecting camouflaged objects based on feature extraction includes the following steps:
[0005] Step (1): Obtain a camouflaged object detection dataset.
[0006] Step (2), data preprocessing;
[0007] The camouflaged object detection image is cropped to a size of 352×352 using a bilinear interpolation algorithm;
[0008] Step (3): Construct a camouflaged object detection model based on feature extraction.
[0009] The camouflaged object detection model based on feature extraction includes a ResNet50 feature extraction module, three CBR modules and a feature extraction module.
[0010] First, the input image is extracted through the ResNet50 feature extraction module to obtain five features X1, X2, X3, X4 and X5 from the deep layer to the shallow deep layer; then X1, X2 and X3 are enhanced through the CBR module to obtain features Z1, Z2 and Z3; then, the feature refinement module is used to refine the three deep layer features Z1, Z2 and Z3 to remove background noise in the features and retain information that is useful for detection, and finally the prediction result P is obtained.
[0011] Step (4) uses the training set to train the constructed camouflaged object detection model based on feature extraction, and uses the structural loss function to supervise the prediction results.
[0012] Step (5) verifies the model training results by inputting the test set data into the trained model, and then obtains the predicted results and compares them with the actual results to verify their effectiveness. The predicted results and the actual results are both binary images with only 0 and 1. The different pixels of an image are obtained by subtracting them, and then divided by the total number of pixels in the entire image to obtain the MAE index. The smaller the index, the better.
[0013] Furthermore, the specific method of step (1) is as follows:
[0014] The camouflaged object detection dataset uses the existing COD10K dataset. This dataset contains 10,000 camouflaged object images, each of which provides manually annotated pixel-level ground truth maps. 6,000 of these images are used to train the proposed model, and 4,000 are used to evaluate the robustness of the proposed model.
[0015] Furthermore, the CBR module consists of a convolution with a kernel size of 3x3 and 64 output channels, a BN layer, and a ReLU activation function.
[0016] The X1, X2 and X3 features obtained by the ResNet50 feature extraction module are respectively processed through a CBR module for feature enhancement and feature channel compression to reduce the computational complexity of the model.
[0017] Furthermore, the feature extraction module consists of n branches and 2n feature fusion modules, which extract features in a progressive bottom-up multi-scale feature fusion manner. The overall structure of the feature extraction module is as follows:
[0018] For the i-th operation, first feature and features Generate features through feature fusion module Next, the characteristics and features Generate features through feature fusion module The structural formula of the feature extraction module is as follows:
[0019]
[0020] The feature fusion module consists of a feature upsampling operation, a feature concatenation operation, and a CBR module. The two input features are upsampled to maintain the same resolution, then concatenated by the feature concatenation operation along the channel dimension. Finally, the CBR module is used to fuse the features.
[0021] Furthermore, the structural loss function is derived from salient object detection, which is composed of binary cross entropy loss and intersection-over-union loss. The structural loss function is as follows:
[0022] L=L wbce +L wiou
[0023] The binary cross entropy loss L wbce The expression is as follows:
[0024]
[0025] H is the output height, W is the output width, g ij Indicates the value of the ground truth corresponding to the pixel (i, j), p ij Indicates the value of the predicted result corresponding to the pixel point (i, j), γ is a hyperparameter; α ij Represents the weight of pixel (i, j).
[0026] The α ij The expression is as follows:
[0027]
[0028] A ij Represents the area of 15 pixels above, below, left and right of pixel point (i, j); if α ij The larger the value is, the more it means that the pixel (i, j) is different from the surrounding pixels, so it is an important pixel and needs more attention.
[0029] The intersection-to-join loss L wiou The expression is as follows:
[0030]
[0031] Furthermore, said n=3.
[0032] Beneficial effects of the present invention:
[0033] The present invention is rationally designed and constructs a camouflaged object detection model based on feature extraction. It enhances the features of the camouflaged object image and removes background noise. It uses a structural loss function to supervise the results, making the prediction results more accurate and robust, thereby achieving precise segmentation of camouflaged objects, which is of great significance to society. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is a flowchart of the overall implementation of an embodiment of the present invention;
[0035] Figure 2 Schematic diagram of the structure of the camouflaged object detection model based on feature extraction of the present invention;
[0036] Figure 3 This is a schematic diagram of the structure of the feature extraction module according to an embodiment of the present invention;
[0037] Figure 4 It is a structural diagram of a feature fusion module according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The present invention will be described in detail below with reference to the accompanying drawings, and the objects and effects of the present invention will become more apparent.
[0039] like Figure 1 As shown, the overall implementation process of the present invention is as follows:
[0040] Step (1) Obtain a camouflaged object detection dataset. The COD10K camouflaged object detection dataset available online is used as the dataset for this task. The dataset is divided into a training set and a test set. The training set is used to train the proposed model, and the test set is used to judge the robustness of the proposed model.
[0041] Step (2): Input the camouflaged object detection image. Input the camouflaged object detection image into the model and crop the image to a size of 352×352 using a bilinear interpolation algorithm.
[0042] Step (3) Use the ResNet50 backbone network to extract multi-level features. The input image is passed through the ResNet50 backbone network to generate 5 features from shallow to deep layers (X5, X4, X3, X2, and X1). Then, X3, X2, and X1 are respectively passed through the CBR module to obtain Z3, Z2, and Z1;
[0043] In step (4), the feature extraction module fuses the three features (Z3, Z2, and Z1) to obtain the final prediction feature. This is then passed through a convolutional layer (CNN) and finally a 1×1 convolutional layer to obtain the prediction result. The prediction result is then supervised using a structural loss function. The number of paths n in the feature extraction module is selected as 3, which is the result of extensive experimental analysis.
[0044] like Figure 2 As shown in FIG, the camouflaged object detection model based on feature extraction has the following operation steps: inputting a 352×352 camouflaged object detection image, extracting features {X1, X2, X3, X4, X5} through the ResNet50 backbone network; then passing the X1, X2 and X3 features through a CBR module respectively to obtain Z1, Z2 and Z3 features; inputting the Z1, Z2 and Z3 features into the Figure 3 In the feature extraction module shown in FIG, a prediction result P is output. The prediction result P is supervised by the structural loss and the prediction result P is used as the final prediction result.
[0045] like Figure 3 As shown in FIG, the feature extraction module of the present invention can extract features multiple times to capture useful information and remove background noise. This increases the accuracy of model detection. Specifically, assuming that n is 2, for the first path, the feature extraction module and features Fusion generation feature Next, the characteristics and features Fusion generation feature For the second path, the characteristics and features Fusion generation feature Next, the characteristics and features Fusion generation feature Finally, the features It is the output feature of the feature extraction module.
[0046] The structure of the feature extraction module offers significant flexibility, allowing the optimal parameter n to be selected based on the task. A larger n increases the module's extraction and background noise removal capabilities, but also makes training more difficult. Conversely, a smaller n makes the module easier to train but its background noise removal capabilities weaken. For camouflaged object detection tasks, images contain significant background noise. A too small n weakens the module's background noise removal capabilities, while a too large n makes training difficult. Therefore, extensive experiments have shown that a feature extraction module with three paths performs optimally, preserving information relevant to the task while removing background noise. Too few paths in the feature extraction module can lead to insufficient extraction, while too many can lead to overfitting, increasing the computational complexity and parameter count, and increasing the computational burden on the computer.
[0047] like Figure 4The figure shows the feature fusion module of the present invention, which fuses features at two scales. Specifically, feature F1, which has a lower resolution, is upsampled to the same size as feature F2. These two features are then concatenated along the channel dimension. Finally, the concatenated features are fused using a CBR module.
[0048] The CBR module is composed of a 3×3 convolutional layer, a BN layer, and a ReLU activation function in series.
[0049] The structural loss function is derived from salient object detection and is composed of binary cross entropy loss and intersection-over-union loss. The structural loss function is as follows:
[0050] L=L wbce +L wiou
[0051] The binary cross entropy loss L wbce The expression is as follows:
[0052]
[0053] H is the output height, W is the output width, g ij Indicates the value of the ground truth corresponding to the pixel (i, j), p ij Indicates the value of the predicted result corresponding to the pixel (i, j), γ is a hyperparameter; α ij Represents the weight of pixel (i, j).
[0054] The α ij The expression is as follows:
[0055]
[0056] A ij Represents the area of 15 pixels above, below, left and right of pixel point (i, j); if α ij The larger the value is, the more it means that the pixel (i, j) is different from the surrounding pixels, so it is an important pixel and needs more attention.
[0057] The intersection-to-join loss L wiou The expression is as follows:
[0058]
[0059] The above description is a further detailed description of the present invention in conjunction with specific / preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. Those skilled in the art of the present invention may make various substitutions or modifications to the described embodiments without departing from the scope of the present invention, and such substitutions or modifications should be considered to fall within the scope of protection of the present invention.
[0060] Parts of the present invention that are not described in detail belong to the common knowledge of those skilled in the art.
Claims
1. A method for detecting camouflaged objects based on feature extraction, characterized in that: The following steps are involved: Step (1), obtaining a camouflaged object detection dataset; Step (2), data preprocessing; The camouflaged object detection image is cropped to a size of 352×352 using a bilinear interpolation algorithm; Step (3), constructing a camouflaged object detection model based on feature extraction; The camouflaged object detection model based on feature extraction includes a ResNet50 feature extraction module, three CBR modules and a feature extraction module; First, the input image is extracted through the ResNet50 feature extraction module to obtain five features X1, X2, X3, X4, and X5 from the deepest layer to the shallowest layer. Then, X1, X2, and X3 are enhanced through the CBR module to obtain features Z1, Z2, and Z3. Then, the feature refinement module is used to refine the three deep features Z1, Z2, and Z3 to remove background noise in the features and retain information that is useful for detection, and finally the prediction result P is obtained. The feature extraction module consists of n branches and 2n feature fusion modules, and performs feature extraction in a progressive bottom-up multi-scale feature fusion manner. The overall structure of the feature extraction module is as follows: For the i-th operation, first feature and features Generate features through feature fusion module Next Features and features Generate features through feature fusion module The structural formula of the feature extraction module is as follows: The feature fusion module consists of a feature upsampling operation, a feature concatenation operation, and a CBR module. The two input features are upsampled to keep the resolution of the two features consistent. The feature concatenation operation is then used to concatenate the two features together according to the channel dimension. Finally, the CBR module is used to fuse the features. Step (4) training the constructed camouflaged object detection model based on feature extraction through the training set, and using the structural loss function to supervise the prediction results; Step (5) verifies the model training results, inputs the test set data into the trained model, and then obtains the predicted results, which are compared with the actual results to verify whether they are effective; the predicted results and the actual results are both binary images with only 0 and 1, and the different pixels of an image are obtained by subtraction, and then divided by the total number of pixels of the entire image to obtain the MAE index. The smaller the index, the better.
2. The method for detecting camouflaged objects based on feature extraction according to claim 1, characterized in that: The specific method of step (1) is as follows: The camouflaged object detection dataset uses the existing COD10K dataset; this dataset contains 10,000 camouflaged object images, each of which provides a manually annotated pixel-level ground truth map. 6,000 of these images are used to train the proposed model, and 4,000 are used to evaluate the robustness of the proposed model.
3. The method for detecting camouflaged objects based on feature extraction according to claim 1, characterized in that: The CBR module consists of a convolution with a kernel size of 3x3 and 64 output channels, a BN layer, and a ReLU activation function; The X1, X2 and X3 features obtained by the ResNet50 feature extraction module are respectively processed through a CBR module for feature enhancement and feature channel compression to reduce the computational complexity of the model.
4. The method for detecting camouflaged objects based on feature extraction according to claim 1, 2 or 3, wherein: The structural loss function is derived from salient object detection and is composed of binary cross entropy loss and intersection-over-union loss. The structural loss function is as follows: L=L wbce +L wiou The binary cross entropy loss L wbce The expression is as follows: H is the output height, W is the output width, g ij Indicates the value of the ground truth corresponding to the pixel (i, j), p ij Indicates the value of the predicted result corresponding to the pixel point (i, j), γ is a hyperparameter; α ij Represents the weight of pixel (i, j); The α ij The expression is as follows: A ij Represents the area of 15 pixels above, below, left and right of pixel point (i, j); if α ij The larger the value is, the more it means that the pixel (i, j) is different from the surrounding pixels, so it is an important pixel and needs more attention. The intersection-to-join loss L wiou The expression is as follows:
5. The method for detecting camouflaged objects based on feature extraction according to claim 1, 2 or 3, wherein: n=3。
Citation Information
Patent Citations
Bidirectional attention-based camouflage object detection method
CN113553973A
Colorectal polyp image segmentation method based on deep learning
CN114972364A