Training method and system of camouflage target detection model and camouflage target detection method
By employing a joint training strategy involving multi-scale mask generation, cue calibration, and feature fusion, the problem of insufficient feature extraction in camouflaged target detection is solved, achieving high accuracy and high stability in the detection of camouflaged targets.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAN THERMAL POWER RES INST CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-19
AI Technical Summary
Existing camouflage target detection technologies struggle to extract sufficiently distinctive features from input data, resulting in low accuracy and frequent false positives and false negatives.
A multi-scale mask generation strategy (MMG) is adopted to locate uncertain regions. Combined with a prompt uncertainty calibration strategy (PUC) and a feature enhancement fusion module (FFM), the model is jointly trained through an uncertain region constraint loss function (URC Loss) to improve the model's ability to detect camouflaged targets.
It can accurately locate uncertain areas, reduce false positives and false negatives, improve the reliability and stability of camouflaged target detection, and enhance the overall positioning and detail recognition capabilities of camouflaged targets.
Smart Images

Figure CN122067009A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing and pattern recognition technology, and relates to a training method, system and method for camouflaged target detection model. Background Technology
[0002] Camouflage target detection aims to identify concealed objects that blend seamlessly into their environment. This technology plays a crucial role in exploring the deep mechanisms of the human perception system, and has therefore garnered significant attention in the field of computer vision. Camouflage typically refers to objects or animals using specific conditions, such as material or lighting, to hide their characteristics or behaviors, thereby avoiding detection. Camouflage targets are mainly divided into two categories: natural organisms and man-made objects. Therefore, camouflage target detection shows enormous application potential in fields such as wildlife conservation and environmental monitoring. By improving computers' ability to identify camouflage targets, we can better address diverse scenarios in real life, providing solid support for social progress and scientific development.
[0003] In recent years, with the rise of convolutional neural networks, deep learning-based methods for detecting camouflaged targets have demonstrated significant advantages. However, the unique characteristics of camouflaged targets make them extremely challenging to recognize visually. While general target segmentation techniques can effectively handle targets with clear boundaries, the high similarity between camouflaged targets and the background makes it difficult for detectors to extract sufficiently discriminative features from the input data. This often leads to misclassifications in practical detection. These misclassified regions are called uncertain regions. These uncertain regions may cause deviations in target localization or incomplete segmentation results, thereby reducing the accuracy and reliability of camouflaged target detection. Summary of the Invention
[0004] The purpose of this invention is to provide a training method, system, and method for camouflaged target detection, in order to solve the technical problems in general target segmentation techniques, such as the difficulty for detectors to extract sufficiently discriminative features from input data and the low accuracy of camouflaged target detection.
[0005] To achieve the above objectives, the present invention employs the following technical solution: In a first aspect, the present invention provides a training method for a camouflaged target detection model, comprising the following steps: S1, construct a first feature extraction network, input multi-scale samples of the input image into the first feature extraction network respectively, and obtain corresponding multi-scale prediction results; generate a region mask based on the comparison between the multi-scale prediction results, the region mask is used to locate and distinguish between definite regions and uncertain regions in the scene; S2, construct a second feature extraction network with the same structure as the first feature extraction network; after concatenating the region mask with the input image, input it into the second feature extraction network for training to obtain calibration features; at the same time, freeze the first feature extraction network and extract the prompt features generated by the first feature extraction network; fuse the prompt features with the calibration features to generate enhanced features; S3. Based on the enhanced features, obtain the final prediction result, and use the uncertain region constraint loss function to calculate the difference between the final prediction result, the region mask and the ground map to obtain the uncertain region constraint loss value. S4, the second feature extraction network is jointly trained by combining the pixel position awareness loss and the uncertain region constraint loss to obtain the camouflage target detection model.
[0006] Secondly, the present invention provides a method for detecting camouflaged targets, employing a camouflaged target detection model, the detection method comprising: Obtain the input image to be detected; The input image to be detected is input into the camouflage target detection model; Acquire and output the camouflage target prediction results generated by the camouflage target detection model.
[0007] Thirdly, the present invention provides a training system for a camouflaged target detection model, comprising: The region mask generation module is used to construct a first feature extraction network, input multi-scale samples of the input image into the first feature extraction network respectively, and obtain corresponding multi-scale prediction results; and generate a region mask based on the comparison between the multi-scale prediction results, wherein the region mask is used to locate and distinguish between definite regions and uncertain regions in the scene. An enhanced feature acquisition module is used to construct a second feature extraction network with the same structure as the first feature extraction network; after concatenating the region mask with the input image, the image is input into the second feature extraction network for training to obtain calibration features, which prompt the network to pay attention to uncertain regions at the response level; at the same time, the first feature extraction network is frozen, and the prompt features generated by the first feature extraction network are extracted; the prompt features are fused with the calibration features to generate enhanced features; The uncertain region constraint loss value acquisition module is used to obtain the final prediction result based on the enhanced features, and to calculate the difference between the final prediction result, the region mask and the ground map using the uncertain region constraint loss function to obtain the uncertain region constraint loss value. The camouflage target detection model generation module is used to jointly train the second feature extraction network by combining pixel position awareness loss and the uncertain region constraint loss to obtain the camouflage target detection model.
[0008] Compared with the prior art, the present invention has the following beneficial effects: This invention accurately provides foreground and uncertain region localization through a multi-scale mask generation strategy (MMG) and generates uncertain region masks, providing a clear direction for subsequent processing. The cue-based uncertainty calibration strategy (PUC) utilizes mask information and location-related cue features to perform calibration at the response and feature levels. Combined with a feature enhancement fusion module (FFM) to enhance feature fusion effects and an uncertain region constraint loss function (URC Loss) to reduce the impact of uncertain regions, the model can more accurately detect camouflaged targets, significantly improving both overall target localization and detailed feature recognition. Uncertain regions are a challenge in camouflaged target detection, often difficult to handle accurately with existing technologies. This invention's MMG strategy accurately locates uncertain regions, the PUC strategy performs targeted calibration and training for uncertain regions, and the URC Loss further constrains the model's detection of uncertain regions, effectively reducing the impact of uncertain regions on detection results, decreasing false positives and false negatives, and improving detection reliability and stability. The joint training strategy comprehensively considers multiple aspects such as pixel position and uncertain regions, enabling the model to fully optimize its parameters during training and improve its ability to detect camouflaged targets in different scenarios.
[0009] This invention acquires an input image to be detected. The input image is then fed into a camouflage target detection model, which possesses the ability to accurately detect camouflage targets. After the input image enters the model, the first feature extraction network performs preliminary processing, extracting multi-scale features to provide a basis for generating region masks. Next, combining information such as the region mask, the second feature extraction network further performs deep analysis, extracting more discriminative features through feature fusion and calibration, thereby better identifying camouflage targets in the image. The camouflage target prediction results generated by the camouflage target detection model are acquired and output, allowing users to intuitively understand whether camouflage targets exist in the image and their specific details. This invention, by employing a specially trained camouflage target detection model, effectively addresses the problem of camouflage targets being highly similar to the background, accurately identifying camouflage targets from complex images, and reducing false positives and false negatives.
[0010] The system of this invention includes: a region mask generation module, an enhanced feature acquisition module, an uncertain region constraint loss value acquisition module, and a camouflage target detection model generation module. The region mask generation module constructs a first feature extraction network, inputting multi-scale samples of the input image into the first feature extraction network to obtain corresponding multi-scale prediction results; based on the comparison between the multi-scale prediction results, a region mask is generated, which is used to locate and distinguish between definite and uncertain regions in the scene. The enhanced feature acquisition module constructs a second feature extraction network with the same structure as the first feature extraction network; after concatenating the region mask with the input image, it is input into the second feature extraction network for training to obtain calibration features, which prompt the network to pay attention to uncertain regions at the response level; simultaneously, the first feature extraction network is frozen, and the prompt features generated by the first feature extraction network are extracted; the prompt features are fused with the calibration features to generate enhanced features; the uncertain region constraint loss value acquisition module obtains the final prediction result based on the enhanced features, calculates the difference between the final prediction result, the region mask, and the ground truth map using an uncertain region constraint loss function, and obtains the uncertain region constraint loss value to constrain the model's detection of uncertain regions. The camouflage target detection model generation module is used to jointly train the second feature extraction network by combining pixel position awareness loss and the uncertain region constraint loss to obtain the camouflage target detection model. The various modules work together to acquire the camouflage target detection model, which can effectively address the problem of camouflage targets being highly similar to the background, accurately identifying camouflage targets from complex images, and reducing false positives and false negatives. Attached Figure Description
[0011] Figure 1 This is a flowchart illustrating the training method of the camouflage target detection model according to an embodiment of the present invention. Figure 2 This is a flowchart of the camouflage target detection method according to an embodiment of the present invention; Figure 3 This is a system block diagram of an embodiment of the present invention; Figure 4 This is a flowchart of the SPURNet algorithm according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the multi-scale feature network (SPURNet) structure according to an embodiment of the present invention; Figure 6 This is a structural diagram of the feature enhancement fusion module according to an embodiment of the present invention. Detailed Implementation
[0012] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0013] It should be noted that the terms "first," "second," etc., in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0014] The present invention will now be described in further detail with reference to the accompanying drawings: Example 1: See Figure 1 This invention discloses a training method for a camouflaged target detection model, comprising the following steps: S1. Construct a first feature extraction network. Input multi-scale samples of the input image into the first feature extraction network. Samples at different scales can capture the features of the camouflaged target at different levels, obtaining corresponding multi-scale prediction results. Through multi-scale analysis, the model can understand the image from multiple perspectives, laying the foundation for accurate mask generation in the subsequent process. Based on the comparison between the multi-scale prediction results, a region mask is generated. The region mask is used to locate and distinguish between definite and uncertain regions in the scene. Definite regions are areas that the model can confidently determine as camouflaged or non-camouflaged targets based on multi-scale features; while uncertain regions are areas that the model finds difficult to accurately determine due to the high similarity between the camouflaged target and the background. The region mask provides clear target guidance for subsequent prompts and calibration steps, enabling the model to process uncertain regions in a targeted manner and improve detection accuracy.
[0015] In this embodiment of the invention, in step S1, the multi-scale sample includes a main scale sample and at least one auxiliary scale sample; the main scale sample is the original image, and the auxiliary scale sample is obtained by scaling the original image.
[0016] In this embodiment of the invention, step S1, which involves generating a region mask based on the comparison between the multi-scale prediction results, includes: The multi-scale prediction results are concatenated along the channel dimension to obtain concatenated features. For the cascaded features, minimum and maximum value operations are performed on the channel dimension to obtain the corresponding minimum value feature map and maximum value feature map; The minimum value feature map and the maximum value feature map are binarized or softened according to a preset threshold to generate corresponding minimum value mask map and maximum value mask map; The minimum value mask image and the maximum value mask image are multiplied element-wise to generate the region mask.
[0017] In this embodiment of the invention, in step S1, the first feature extraction network adopts an encoder-decoder architecture. The encoder of the first feature extraction network is constructed based on a pre-trained PVT_v2 backbone network and is used to extract multi-level features of the input image. The decoder of the first feature extraction network consists of multiple receptive field blocks and generates the multi-scale prediction result through upsampling and splicing operations.
[0018] S2, construct a second feature extraction network with the same structure as the first feature extraction network; concatenate the region mask with the input image and input it into the second feature extraction network for training to obtain calibration features. These calibration features prompt the network to focus on uncertain regions at the response level. The region mask provides the network with prompting information about uncertain regions at the response level, enabling the second feature extraction network to focus on learning the features of uncertain regions. Simultaneously, freeze the first feature extraction network and extract the prompting features generated by the first feature extraction network; fuse the prompting features with the calibration features to generate enhanced features. The fused enhanced features not only grasp the overall features of the image but also highlight the key information of uncertain regions, enabling the model to understand the image content more comprehensively and accurately, providing a higher quality feature foundation for subsequent predictions.
[0019] In this embodiment of the invention, in step S2, the prompt feature and the calibration feature are fused by the feature enhancement and fusion module, as follows: The feature enhancement fusion module is configured to: utilize channel attention mechanism and spatial attention mechanism to interact and weight the cue features and the calibration features, so as to suppress redundant information and enhance the feature expression related to uncertain regions, thereby generating the enhanced features; The second feature extraction network is configured to a single scale of the same size as the input image.
[0020] In this embodiment of the invention, the step of using channel attention and spatial attention mechanisms to interact and weight the cue features and the calibration features to generate the enhanced features includes: The prompt features are processed sequentially using channel attention and spatial attention mechanisms to obtain features enhanced by both channel and spatial attention. The calibration features are processed using a spatial attention mechanism to obtain a spatial attention map; The spatial attention map is element-wise multiplied with the cue features to obtain cue features weighted by spatial attention; The enhanced feature is obtained by element-wise addition of the channel-enhanced and spatially-attention-enhanced features, the spatially-attention-weighted cue features, and the bit cue features.
[0021] S3. Based on the enhanced features, obtain the final prediction result. Calculate the difference between the final prediction result, the region mask, and the ground truth map using the uncertain region constraint loss function to obtain the uncertain region constraint loss value, thereby constraining the model's detection of uncertain regions. By calculating the loss value, the model can understand its shortcomings in uncertain region detection, and thus make targeted adjustments and optimizations during training. This loss function reduces the impact of uncertain regions on camouflaged target detection, prompting the model to pay more attention to the accuracy of uncertain region detection and improving the model's robustness.
[0022] In this embodiment of the invention, in step S3, the calculation formula for the uncertainty region constraint loss function is as follows:
[0023]
[0024] in, For the constraint loss value in the uncertain region, The width of the image. The height of the image. For the truth graph, This represents the final prediction result of the model. Map indicating difficult areas. For area mask, represents the position corresponding to a single-channel feature, and represents the element-wise multiplication operation.
[0025] S4, the second feature extraction network is jointly trained by combining the pixel position-aware loss and the uncertain region constraint loss to obtain the camouflage target detection model. The pixel position-aware loss focuses on the positional information of each pixel in the image, enabling the model to more accurately locate the target's position during prediction, ensuring spatial accuracy of the detection results. The uncertain region constraint loss focuses on the detection accuracy in uncertain regions. Through joint training, the model can comprehensively consider the information from pixel positions and uncertain regions, optimizing the model from multiple aspects, further improving the overall performance of the model, and making the model exhibit stronger adaptability and accuracy in the camouflage target detection task.
[0026] In this embodiment of the invention, step S4, which involves jointly training the second feature extraction network by combining pixel location awareness loss and uncertain region constraint loss to obtain the camouflage target detection model, includes: The pixel position-aware loss is obtained by summing the pixel loss and the global loss. The joint loss is obtained based on the pixel position-aware loss, and the formula for obtaining the joint loss is as follows:
[0027] Among them, the For joint loss, the stated For the output prediction map, the For the truth graph, the Loss due to pixel location perception; The total loss function is adopted, based on the joint loss and the uncertainty region constraint loss. The total loss is obtained by summing the results. The total loss function is as follows:
[0028] Among them, the For the total loss, the stated The loss is due to constraints in the uncertain region.
[0029] Using the total loss function as the optimization objective, the second feature extraction network is iteratively trained and its network parameters are updated until convergence is achieved, thereby obtaining the camouflaged target detection model.
[0030] See Figure 2 The present invention also discloses a method for detecting camouflaged targets, wherein the camouflaged target detection model is trained using the above-described training method, and the detection method includes: S10, Obtain the input image to be detected; S20, the input image to be detected is input into the camouflage target detection model, which has the ability to accurately detect camouflage targets. After the input image to be detected enters the model, the first feature extraction network in the model first performs preliminary processing on the image, extracting multi-scale features to provide a basis for subsequent generation of region masks; then, combined with information such as region masks, the second feature extraction network further performs in-depth analysis on the image, extracting more discriminative features through feature fusion and calibration, thereby enabling better identification of camouflage targets in the image.
[0031] S30, acquire and output the camouflage target prediction results generated by the camouflage target detection model, so that the user can intuitively understand whether there is a camouflage target in the image and the specific situation of the camouflage target.
[0032] This invention employs a specially trained camouflage target detection model, effectively addressing the problem of camouflage targets being highly similar to the background. During training, the model learns a large number of camouflage target and background features, enabling it to accurately identify camouflage targets from complex images and reducing false positives and false negatives. Compared to traditional general-purpose target detection methods, this method demonstrates higher accuracy and reliability in camouflage target detection tasks.
[0033] See Figure 3 The present invention also discloses a training system for a camouflage target detection model, comprising: The region mask generation module is used to construct a first feature extraction network, input multi-scale samples of the input image into the first feature extraction network respectively, and obtain corresponding multi-scale prediction results; and generate a region mask based on the comparison between the multi-scale prediction results, wherein the region mask is used to locate and distinguish between definite regions and uncertain regions in the scene. An enhanced feature acquisition module is used to construct a second feature extraction network with the same structure as the first feature extraction network; after concatenating the region mask with the input image, the image is input into the second feature extraction network for training to obtain calibration features, which prompt the network to pay attention to uncertain regions at the response level; at the same time, the first feature extraction network is frozen, and the prompt features generated by the first feature extraction network are extracted; the prompt features are fused with the calibration features to generate enhanced features; The uncertain region constraint loss value acquisition module is used to obtain the final prediction result based on the enhanced features, calculate the difference between the final prediction result, the region mask and the ground truth map using the uncertain region constraint loss function, and obtain the uncertain region constraint loss value to constrain the model's detection of uncertain regions.
[0034] The camouflage target detection model generation module is used to jointly train the second feature extraction network by combining pixel position awareness loss and the uncertain region constraint loss to obtain the camouflage target detection model.
[0035] The various modules of this invention work together to acquire a camouflage target detection model. This model can effectively address the problem of camouflage targets being highly similar to the background, accurately identify camouflage targets from complex images, and reduce false positives and false negatives.
[0036] This invention accurately locates the foreground and uncertain regions using the MMG strategy and generates uncertain region masks, providing a clear direction for subsequent processing. The PUC strategy utilizes mask information and position-related cue features for calibration at the response and feature levels. Combined with FFM to enhance feature fusion and URC Loss to reduce the impact of uncertain regions, the model can more accurately detect camouflaged targets, significantly improving both overall target localization and detailed feature recognition. Uncertain regions are a challenge in camouflaged target detection, often difficult to handle accurately with existing technologies. This invention's MMG strategy accurately locates uncertain regions, the PUC strategy performs targeted calibration and training for uncertain regions, and URC Loss further constrains the model's detection of uncertain regions, effectively reducing the impact of uncertain regions on detection results, decreasing false positives and false negatives, and improving the reliability and stability of detection. The joint training strategy comprehensively considers information from multiple aspects such as pixel position and uncertain regions, enabling the model to fully optimize its parameters during training and improve its ability to detect camouflaged targets in different scenarios.
[0037] Example 2: See Figure 1 and Figure 4 This embodiment discloses a method for detecting camouflaged targets based on self-prompt in uncertain regions, as detailed below: A multi-scale mask generation strategy (MMG) is disclosed to locate uncertain regions and generate corresponding region masks (trimaps) as prompts for the next stage, enabling the network to perform uncertain region calibration. A prompt-based uncertainty calibration strategy (PUC) is disclosed. This strategy uses a region mask (trimap) to guide the network to focus on uncertain regions and uses features related to the target region as prompt information to calibrate uncertain regions at the response and feature levels. A feature-enhanced fusion module (FFM) is also disclosed to obtain discriminative features and achieve efficient fusion of prompt features and calibration features. An Uncertain Region Constraint Loss (URC Loss) function is disclosed to encourage the network to focus more on uncertain regions.
[0038] This invention discloses a method for detecting camouflaged targets based on self-prompt in uncertain regions, comprising the following steps: S1. In the MMG strategy, a feature extraction network is constructed for camouflage detection. Multi-scale samples are generated by data augmentation of the input image for prediction, and the prediction results are compared to generate a ternary mask, thereby locating and distinguishing certain and uncertain regions in the scene and generating the corresponding region mask (Trimap).
[0039] In step S1, a first feature extraction network is constructed. Considering both efficiency and effectiveness, a main scale and two auxiliary scales are set as inputs and sequentially fed into the network, with parameter updates performed. The main scale is set to 1.0 times the original image size, and the auxiliary scales are set to 0.75 times and 1.25 times the original image size, respectively. After feature extraction, a simple decoder is used to decode the features and obtain the prediction results at each scale. Then, an upsampling operation is performed to unify the input size to ×1.0. Finally, an element-wise comparison operation is used to obtain the corresponding region mask (Trimap). The calculation formula for the above steps is:
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048] in , and These represent input images of the same size, with input scales of 0.75, 1.0, and 1.25 times that of the original image, respectively. , and For multi-scale prediction results, , and These represent the camouflage prediction outputs of images of the same size with input scales of 0.75, 1.0, and 1.25 times that of the original image, respectively. Indicates cascading features, Represents the feature map of the minimum value. Represents the feature map of the maximum value; ( ) indicates a cascading operation; ( ) indicates taking the minimum value in the channel dimension; ( ) indicates taking the maximum value in the channel dimension; This represents the single-channel feature map corresponding to the minimum value; This represents the single-channel feature map corresponding to the maximum value; Represents the minimum value mask image; Represents the maximum value mask; , This indicates the position corresponding to a single-channel feature; This represents the feature extraction network constructed in the MMG strategy; Indicates the region mask.
[0049] The first feature extraction network uses a pre-trained PVT_v2 (Pyramid Vision Transformer V2) as its backbone network to extract multi-level features from the input image. The entire network employs an encoder-decoder architecture. For a given input image, features at different levels can be obtained from the encoder. ,in Layer index representing features, ={1, 2, 3, 4}, and the corresponding feature resolutions are {1 / 4, 1 / 8, 1 / 16, 1 / 32} of the original image. After the feature encoding stage, the decoder network consists of four different receptive field blocks (RFBs) and achieves the predicted output through upsampling and concatenation. To balance the efficiency and performance of the network, receptive field blocks (RFBs) are used at each level to compress the original channel size to 32, thereby obtaining a more compact feature representation.
[0050] In S2, the PUC strategy first creates a second feature extraction network with the same structure and uses a region mask (trimap) generated by the MMG strategy as a cue at the response level to encourage the network to focus on uncertain regions. Simultaneously, freezing the feature extraction network in the MMG strategy provides target location cues for the new feature extraction network, achieving feature-level cues. Furthermore, to improve the network's feature representation, a Feature Enhancement Fusion (FFM) module is proposed to facilitate the fusion of calibration and cue features.
[0051] In step S2, the first feature extraction network used for camouflage object detection in the MMG strategy is frozen, and a second feature extraction network is introduced. The structure of the second feature extraction network is consistent with that of the first feature extraction network used in the MMG strategy. To achieve uncertain region cues at the response level, the generated region mask is concatenated with the input image, and the concatenated image is used as input to train the second feature extraction network. Subsequently, the input is set to a single-scale input of the same size as the original image and re-inputted into the second feature extraction network to obtain cue features with location cues. ( =1, 2, 3, 4) where, This corresponds to different network layers. Next, we will highlight the features. The calibration features of the corresponding layer of the second feature extraction network in the PUC strategy ( =1, 2, 3, 4) are fused. This step aims to enhance the model's understanding of information related to uncertain regions. Furthermore, to enhance the discriminative power of the fused features during the decoding stage and improve the quality of the fused features, a feature enhancement fusion module is introduced. In the calibration of features... and prompt features Before being sent to the decoder, it is first sent to the feature enhancement and fusion module to suppress redundant and interfering information contained in the features of the MMG strategy and to obtain enhanced features with discriminative power. Used for feature decoding to obtain more accurate final prediction results. The enhancement formula is:
[0052] in, For feature enhancement and fusion module; For enhanced features; For calibration features; To provide a hint feature; FFM: The hint feature in the frozen MMG strategy. Calibration features corresponding to the PUC strategy phase layer The input is fed into the feature enhancement module. Due to the cue features... Feature analysis focuses on the entire feature map, therefore it is more effective than calibration features. It contains richer contextual information. To extract more expressive features and suppress irrelevant noise, cue features are sequentially... Input is fed into the channel attention module and the spatial attention module to obtain Furthermore, in order to further promote the use of prompt features... Pay attention to relevant information in uncertain regions and calibrate features. The input is fed into the spatial attention module to obtain the corresponding spatial attention map. And map it to prompt features The above yields fusion features. Finally, these three sets of features are fused using element-wise addition to obtain a discriminative fused feature. Mathematically speaking, the process is as follows:
[0053]
[0054]
[0055]
[0056]
[0057] in, ( ) indicates the channel attention mechanism; ( ) represents spatial attention mechanism; This is a characteristic of enhanced attention through the channel; This is a feature that enhances attention through channels and space; Spatial attention map; These are cue features weighted by spatial attention; To enhance features; indicates element-wise multiplication operation. This indicates an element-wise addition operation.
[0058] S3 introduces the Uncertain Region Constraint Loss (URC Loss) function. This function aims to address the uncertainty caused by inherent differences in the data and reduce the range of the uncertainty region through network constraints.
[0059] In step S3, a Region Constraint Loss (URC Loss) is introduced to constrain the area of the detected uncertain region, thereby addressing the uncertainty caused by inherent data differences (such as input differences and differences between the input and the true value) and striving to reduce the range of the uncertain region. For a given final prediction result (Pre), region mask (Trimap), and ground truth map (GT), the proposed URC Loss is used to obtain the region constraint loss, and the formula for obtaining the region constraint loss is as follows:
[0060]
[0061] in( , This represents the pixel at that location in the corresponding image; and These represent the height and width of the image, respectively. This is a truth graph; (Uncertainty region constraint loss value); Trimap represents the region mask; This represents the difference between the ternary mask and the true label image, and is therefore considered a difficult region to detect; The value represents the final prediction result of the model; | represents the absolute value operation.
[0062] S4. Verify the effectiveness of the camouflage target detection method based on self-prompting in uncertain regions by validating it on a public dataset. In step S4, after the entire model is built, the model is trained using pixel location-aware loss and the aforementioned uncertain region constraint loss function. Specifically, the camouflage prediction map... Truth Plot Truth graph Similar to the ground truth (GT) mentioned above, it can integrate their local structural information, generate different weights for all pixels, and introduce pixel loss ( ) and global loss ( This facilitates network learning and produces clearer details. It also employs a Region Constraint Loss (URC Loss) function to constrain the area of uncertain regions. Total loss ( ) is calculated using the following method:
[0063]
[0064]
[0065] in, Indicates pixel loss; Indicates global loss; To disguise the prediction image; This is a truth graph; For pixel location-aware loss, where, ∈{ , , , The first three correspond to the predicted outputs and their corresponding ground truth (G) images at scales of 0.75, 1.0, and 1.25 respectively in the MMG strategy. Therefore, This includes ; For the first Perceptual loss per pixel location; Total loss; For joint losses; The loss is due to constraints in the uncertain region.
[0066] This invention provides a camouflaged target detection model based on self-prompt for uncertain regions, disclosing two strategies: a multi-scale mask generation (MMG) strategy and a prompt-based uncertainty calibration (PUC) strategy. The MMG strategy provides accurate foreground and uncertain region localization, generating an uncertain region mask (trimap) to prompt the PUC strategy. The PUC strategy utilizes the mask information provided by the MMG strategy and location-related prompt features to achieve calibration at both the response and feature levels. Simultaneously, for feature-level calibration, a feature enhancement fusion module (FFM) is disclosed to further enhance the fusion effect of calibration features and prompt features. An uncertain region constraint loss function (URCLoss) is also disclosed, reducing the impact of uncertain regions on camouflaged target detection and effectively improving the model's detection performance.
[0067] Example 3: like Figure 2 As shown, a training method for a camouflaged target detection model based on self-calibration in uncertain regions includes the following steps: S1. In the MMG strategy, a feature extraction network is constructed for camouflage detection. Multi-scale samples are generated by data augmentation of the input image for prediction, and the prediction results are compared to generate a ternary mask, thereby locating and distinguishing certain and uncertain regions in the scene and generating the corresponding region mask (Trimap). In this embodiment, as Figure 5 As shown in (a), the proposed MMG strategy constructs a feature extraction network and sets a main scale and two auxiliary scales as inputs, which are then fed into the network sequentially for parameter updates. The main scale is set to 1.0 times the original image size, and the auxiliary scales are set to ×0.75 and ×1.25 of the original image size, respectively. After feature extraction, a simple decoder is used to decode the features and obtain the prediction results at each scale. Then, an upsampling operation is performed to unify the input size to ×1.0. Finally, an element-wise comparison operation is used to obtain the corresponding region mask (trimap).
[0068] In S2, the PUC strategy first creates a feature extraction network with the same structure and uses the region mask (trimap) generated by the MMG strategy as a cue at the response level to encourage the network to focus on uncertain regions. Simultaneously, freezing the feature extraction network in the MMG strategy provides target location cues for the new feature extraction network, achieving feature-level cues. Furthermore, to improve the network's feature representation, a Feature Enhancement Fusion (FFM) module is proposed to promote the fusion of calibration and cue features. In this embodiment, as Figure 5 (b) and Figure 6 As shown, in the proposed PUC strategy, the feature extraction network used for camouflage object detection in the MMG strategy is frozen, and a new feature extraction network is introduced, whose structure is consistent with the feature extraction network used in the MMG strategy. To achieve uncertain region cues at the response level, the generated... The original input image is concatenated with the concatenated image, and this concatenated image is then fed into a new feature extraction network for training. Subsequently, the input is set to a single-scale input of the same size as the original image and re-inputted into the network to obtain cue features with location cues. ( = 1, 2, 3, 4) (where, (Corresponding to different network layers). Next, the features will be suggested. The calibration features of the corresponding layer of the new feature extraction network in the PUC strategy ( =1, 2, 3, 4) are fused. This step aims to enhance the model's understanding of information related to uncertain regions. Furthermore, to enhance the discriminative power of the fused features during the decoding stage and improve the quality of the fused features, a Feature Enhancement Fusion Module (FFM) is introduced. and Before being fed into the decoder, it is first fed into the FFM to suppress redundant and interfering information contained in the features of the MMG strategy and to obtain discriminative features. Used for feature decoding to obtain more accurate prediction results. Mathematically, the process is as follows:
[0069] S3, where FFM is the feature enhancement and fusion module; FFM: The hierarchical features in the frozen MMG strategy. Features of the corresponding layer in the PUC strategy phase The input is fed into the feature enhancement module. Because... Feature focus on the entire feature map, therefore compared to It contains richer contextual information. To extract more expressive features and suppress irrelevant noise, the following steps are performed sequentially: Input is fed into the channel attention module and the spatial attention module to obtain Furthermore, in order to further promote Pay attention to relevant information in uncertain areas, The input is fed into the spatial attention module to obtain the corresponding spatial attention map. and map it to In terms of characteristics, we obtained Finally, these three sets of features are fused using element-wise addition to obtain a discriminative fused feature. Mathematically speaking, the process is as follows:
[0070]
[0071]
[0072]
[0073]
[0074] in (*) indicates channel attention mechanism. (*) indicates spatial attention mechanisms; This indicates an element-wise multiplication operation. This represents an element-wise addition operation; The Uncertain Region Constraint Loss (URC Loss) function is introduced. This function aims to address the uncertainty caused by inherent differences in the data and reduce the range of the uncertainty region through network constraints. In this example, a Region-Constrained Loss (URC Loss) function is introduced to constrain the area of the uncertain region in the detection, thereby addressing the uncertainty caused by inherent data differences (such as input differences and differences between the input and the true value) and striving to reduce the extent of the uncertain region. For a given final prediction (Pre), a ternary mask (trimap), and a ground truth map (GT), the proposed URC Loss mathematically proceeds as follows:
[0075]
[0076] in( , ) represents the pixel at that position in the corresponding image, and H and W represent the height and width of the image, respectively.
[0077] Trimap represents a ternary mask. This represents the difference between the ternary mask and the true label image, and is therefore considered a difficult region to detect; Pre represents the model's final predicted output; |*| represents the absolute value operation; The effectiveness of the proposed camouflage target detection model based on self-prompting in uncertain regions is verified by validation on a public dataset; In this embodiment, to verify the effectiveness of the proposed camouflaged target detection model based on self-prompting uncertain regions, performance metrics were evaluated using publicly available datasets CAMO (Camouflaged Animal Mask Outline Dataset), COD10K (Camouflaged Object Detection 10K Dataset), NC4K (NC4K Camouflage Dataset), and CHAMELEON (Chameleon Adaptive Mask Evaluation Library On Natural Scenes).
[0078] The technical effects of the present invention will be further explained below with reference to simulation experiments: 1. Simulation conditions: All simulation experiments were conducted on the operating system Ubuntu 20.04.5, the hardware environment was Nvidia GeForce GTX 1080Ti GPU, and the PyTorch deep learning framework was used.
[0079] 2. Simulation content and result analysis: This invention is compared with several state-of-the-art (SOTA) COD models, including those based on POCINet, SINet, SLSR, MirrorNet, PFNet (Pyramid Feature Network), UJSC, S-MGL, CubeNet, ERRNet (Error Refinement Network), SINet-V2 (Search Identification Network - Version 2), BGNet (Background-Guided Network), BgNet (Boundary-guided network), C2F-Net (Coarse-to-Fine Network), FAPNet (Feature Aggregation and Pyramid Network), BSANet (Boundary-Sensitive Attention Network), DGNet (Dynamic Guidance Network), MSCAF-Net (Multi-Scale Context Attention Fusion Network), and CFANet (Context-aware Feature Aggregation Network). Networks such as Context-Aware Feature Aggregation Network (CAN), SARNet (Spatial Attention Refinement Network), and UEDG were used to conduct experiments on four publicly available COD datasets: CAMO, COD10K, CHAMELEON, and NC4K. The results were obtained by using recognized evaluation metrics for objective evaluation. The simulation results are shown in Table 1. Table 1 shows the quantitative results of different models:
[0080] Table 2 shows the validity validation of each part of the model on the CAMO dataset.
[0081] Table 3 shows the effectiveness verification of the data augmentation scheme on the CAMO and CHAMELEN datasets.
[0082] Table 4 shows the effectiveness verification of the mask generation scheme on the CAMO and CHAMELEN datasets.
[0083] Where MAE represents the mean absolute error, which compares the difference between the camouflaged prediction map S and the ground truth map G. Fβ represents the overall performance of the camouflage target detection model; Sλ represents the structural similarity between the camouflaged prediction graph and the ground truth graph; Eγ represents pixel-level error and image-level error; The lower the MAE, the better; the higher the Fβ, Sλ, and Eγ, the better. In Table 2, "B" represents the baseline model, which uses a single-input approach and has the feature extraction network structure mentioned above. In terms of training strategy, this baseline model only uses binary cross-entropy and cross-union function to train the network. MMG strategy, PUC strategy, FFM and URC Loss represent the strategies, modules and losses proposed in this invention, respectively.
[0084] In Table 3, (×0.75, ×1.0), (×1.0, ×1.25), and (×0.75, ×1.0, ×1.25) represent the scaling schemes of three different MMG strategy inputs; RandAugment represents the color scheme of random input. In Table 4, the average mask scheme, the binary mask scheme (mask values are set to 1.0 and 0.0), another binary mask scheme (mask values are set to 0.0 and 0.5), and the ternary mask scheme (mask values include 0.0, 0.5, and 1.0) all represent different mask generation schemes for the MMG strategy.
[0085] Table 1 shows that, on four public datasets, this invention achieves the best performance compared to other schemes. Table 2 shows that each part of this invention contributes to improving performance. Table 3 shows that, among the MMG policy input schemes, the three-scale schemes proposed in this invention achieve the best results and obtain the best performance. Table 4 demonstrates the rationality of the mask generation strategy in this invention, which can fully provide information about the foreground and uncertain regions to the PUC strategy, thereby obtaining the optimal result.
[0086] This invention comprises two key strategies: a multi-scale mask generation strategy and a cue-based uncertainty calibration strategy. The proposed model architecture is as follows: First, to obtain masks for uncertain regions, a multi-scale mask generation strategy is introduced. This strategy generates masks by comparing prediction results from multi-scale image inputs, providing cue information for the subsequent calibration process. Second, to achieve accurate calibration of uncertain regions, a cue-based uncertainty calibration strategy is proposed. This strategy fully utilizes the cue information provided by the multi-scale mask generation strategy, achieving calibration of uncertain regions at both the response and feature levels through fusion and attention mechanisms. At the feature level, an enhanced feature fusion module is introduced to effectively fuse cue features and calibration features, further improving detection performance. Furthermore, an uncertain region constraint loss is proposed, prompting the network to pay more attention to uncertain regions and narrow their scope, thereby further improving the performance of camouflaged target detection.
[0087] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of this invention.
Claims
1. A training method for a camouflaged target detection model, characterized in that, Includes the following steps: S1, construct a first feature extraction network, input multi-scale samples of the input image into the first feature extraction network respectively, and obtain corresponding multi-scale prediction results; generate a region mask based on the comparison between the multi-scale prediction results, the region mask is used to locate and distinguish between definite regions and uncertain regions in the scene; S2, construct a second feature extraction network with the same structure as the first feature extraction network; after concatenating the region mask with the input image, input it into the second feature extraction network for training to obtain calibration features; at the same time, freeze the first feature extraction network and extract the prompt features generated by the first feature extraction network; The prompt features are fused with the calibration features to generate enhanced features; S3. Based on the enhanced features, obtain the final prediction result, and use the uncertain region constraint loss function to calculate the difference between the final prediction result, the region mask and the ground map to obtain the uncertain region constraint loss value. S4, the second feature extraction network is jointly trained by combining the pixel position awareness loss and the uncertain region constraint loss to obtain the camouflage target detection model.
2. The training method for the camouflaged target detection model according to claim 1, characterized in that, In step S1, the multi-scale sample includes a main scale sample and at least one auxiliary scale sample; the main scale sample is the original image, and the auxiliary scale sample is obtained by scaling the original image.
3. The training method for the camouflaged target detection model according to claim 1 or 2, characterized in that, In step S1, generating a region mask based on the comparison between the multi-scale prediction results includes: The multi-scale prediction results are concatenated along the channel dimension to obtain concatenated features. For the cascaded features, minimum and maximum value operations are performed on the channel dimension to obtain the corresponding minimum value feature map and maximum value feature map; The minimum value feature map and the maximum value feature map are binarized or softened according to a preset threshold to generate corresponding minimum value mask map and maximum value mask map; The minimum value mask image and the maximum value mask image are multiplied element-wise to generate the region mask.
4. The training method for the camouflaged target detection model according to claim 1, characterized in that, In step S1, the first feature extraction network adopts an encoder-decoder architecture. The encoder of the first feature extraction network is constructed based on a pre-trained PVT_v2 backbone network and is used to extract multi-level features of the input image. The decoder of the first feature extraction network consists of multiple receptive field blocks and generates the multi-scale prediction result through upsampling and splicing operations.
5. The training method for the camouflaged target detection model according to claim 1, characterized in that, In step S2, the prompt feature and the calibration feature are fused by the feature enhancement and fusion module, as follows: The feature enhancement fusion module is configured to: use channel attention mechanism and spatial attention mechanism to interact and weight the cue feature and the calibration feature to generate the enhanced feature; The second feature extraction network is configured to a single scale of the same size as the input image.
6. The training method for the camouflaged target detection model according to claim 5, characterized in that, The process of using channel attention and spatial attention mechanisms to interact and weight the cue features and calibration features to generate the enhanced features includes: The prompt features are processed sequentially using channel attention and spatial attention mechanisms to obtain features enhanced by both channel and spatial attention. The calibration features are processed using a spatial attention mechanism to obtain a spatial attention map; The spatial attention map is element-wise multiplied with the cue features to obtain cue features weighted by spatial attention; The enhanced feature is obtained by element-wise addition of the channel-enhanced and spatially-attention-enhanced features, the spatially-attention-weighted cue features, and the bit cue features.
7. The training method for the camouflaged target detection model according to claim 1, characterized in that, In step S3, the formula for calculating the uncertainty region constraint loss function is as follows: in, For the constraint loss value in the uncertain region, The width of the image. The height of the image. For the truth graph, This represents the final prediction result of the model. Map indicating difficult areas. For area mask, represents the position corresponding to a single-channel feature, and represents the element-wise multiplication operation.
8. The training method for the camouflaged target detection model according to claim 1, characterized in that, In step S4, the joint training of the second feature extraction network by combining the pixel location awareness loss and the uncertain region constraint loss to obtain the camouflage target detection model includes: The pixel position-aware loss is obtained by summing the pixel loss and the global loss. The joint loss is obtained based on the pixel position-aware loss, and the formula for obtaining the joint loss is as follows: Among them, the For joint loss, the stated To disguise the prediction map, the For the truth graph, the Loss due to pixel location perception; The total loss function is adopted, based on the joint loss and the uncertainty region constraint loss. The total loss is obtained by summing the results. The total loss function is as follows: Among them, the For the total loss, the stated Loss is constrained by the uncertain region; Using the total loss function as the optimization objective, the second feature extraction network is iteratively trained and its network parameters are updated until convergence is achieved, thereby obtaining the camouflaged target detection model.
9. A method for detecting camouflaged targets, characterized in that, The camouflaged target detection model is trained using the training method described in any one of claims 1 to 8, wherein the detection method comprises: Obtain the input image to be detected; The input image to be detected is input into the camouflage target detection model; Acquire and output the camouflage target prediction results generated by the camouflage target detection model.
10. A training system for a camouflaged target detection model, characterized in that, include: The region mask generation module is used to construct a first feature extraction network, and input multi-scale samples of the input image into the first feature extraction network to obtain the corresponding multi-scale prediction results. A region mask is generated based on the comparison between the multi-scale prediction results. The region mask is used to locate and distinguish between definite and uncertain regions in the scene. An enhanced feature acquisition module is used to construct a second feature extraction network with the same structure as the first feature extraction network. After concatenating the region mask with the input image, the image is input into the second feature extraction network for training to obtain calibration features, which prompt the network to pay attention to uncertain regions at the response level. At the same time, the first feature extraction network is frozen, and the prompt features generated by the first feature extraction network are extracted. The prompt features are fused with the calibration features to generate enhanced features; The uncertain region constraint loss value acquisition module is used to obtain the final prediction result based on the enhanced features, and to calculate the difference between the final prediction result, the region mask and the ground map using the uncertain region constraint loss function to obtain the uncertain region constraint loss value. The camouflage target detection model generation module is used to jointly train the second feature extraction network by combining pixel position awareness loss and the uncertain region constraint loss to obtain the camouflage target detection model.