A camouflage target detection method and system based on cross-attention fusion

CN122223503BActive Publication Date: 2026-08-07EAST CHINA JIAOTONG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
EAST CHINA JIAOTONG UNIVERSITY
Filing Date
2026-05-19
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0005]为了解决上述技术问题,本发明提出一种基于交叉注意力融合的伪装目标检测方法及系统,以解决现有技术中细节与语义特征失配、边界分割模糊及小目标漏检的问题

Benefits of technology

[0007]相比现有技术,本发明的有益效果为:本发明通过深度耦合高分辨率SAM2细节编码器与低分辨率DINOv2语义编码器,并利用双向交叉注意力实现像素级特征对齐,从根本上解决了传统单骨干网络或浅层融合方法中细节与语义的“局部-全局排他性”问题;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122223503B_ABST
    Figure CN122223503B_ABST
Patent Text Reader

Abstract

The application provides a camouflage target detection method and system based on cross-attention fusion, which comprises the following steps: acquiring an input image, extracting a detail feature map and a semantic feature map of the input image through a complementary double-flow heterogeneous encoder; performing deep feature alignment and adaptive fusion on the detail feature map and the semantic feature map through a collaborative double-encoder fusion module to obtain a multi-scale fusion feature set; performing step-by-step upsampling on the multi-scale fusion feature set through an edge perception refinement decoder module and restoring boundary details to obtain a probability mask graph; calculating a total loss function and training a camouflage target detection model through the total loss function; inputting a target image to be detected into the trained camouflage target detection model for camouflage target recognition to output a corresponding recognition result. The application can solve the problems of detail and semantic feature mismatch, boundary segmentation blur and small target missed detection in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of computer vision and image processing, and specifically relates to a method and system for detecting camouflaged targets based on cross-attention fusion. Background Technology

[0002] Camouflaged object detection (COD) aims to segment objects that are visually difficult to distinguish due to their high similarity to the surrounding environment in color, texture, or shape. Compared to general salient object detection, COD faces a fundamental "local-global exclusivity" dilemma: it needs to utilize high-frequency details (such as edges and textures) to locate blurry boundaries, while relying on low-frequency global semantics to distinguish the target from the background. Existing mainstream methods are mainly divided into two categories, but both have shortcomings: Single-backbone multi-scale networks, such as SINet and BGNet, rely on a single convolutional or Transformer backbone (such as ResNet, PVT, and Swin) to simultaneously encode details and semantics. Downsampling inevitably sacrifices spatial resolution, leading to missed detections of small objects and boundary drift.

[0003] Shallow fusion methods based on Visual Foundation Models (VFM), such as SAM2-UNeXT, attempt to combine SAM2 (details) and DINOv2 (semantics), but only perform simple token-level concatenation or shallow feature injection. They lack a learnable alignment mechanism to address the differences in feature distribution between heterogeneous encoders and do not dynamically balance the contributions of details and semantics, resulting in feature mismatch, redundant noise, and blurred boundaries.

[0004] Therefore, there is an urgent need for a camouflaged target detection method that can deeply coordinate heterogeneous encoders, adaptively balance local details and global semantics, and finely recover boundaries. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention proposes a camouflaged target detection method and system based on cross-attention fusion, which solves the problems of mismatch between details and semantic features, blurred boundary segmentation, and missed detection of small targets in the prior art.

[0006] In a first aspect, the present invention provides the following technical solution: a method for detecting camouflaged targets based on cross-attention fusion, comprising: An input image is acquired, and a detail feature map and a semantic feature map of the input image are extracted by a complementary dual-stream heterogeneous encoder, wherein the complementary dual-stream heterogeneous encoder includes a parallel detail encoder and a semantic encoder. The detailed feature map and the semantic feature map are deeply aligned and adaptively fused by the collaborative dual encoder fusion module to obtain a multi-scale fused feature set; The multi-scale fused feature set is upsampled step by step and boundary details are restored by the edge-aware refinement decoder module to obtain a probability mask map; Based on the complementary dual-stream heterogeneous encoder, the collaborative dual encoder fusion module, and the edge-aware refinement decoder module, a camouflage target detection model is determined, and the total loss function is calculated and the camouflage target detection model is trained using the total loss function. Acquire the image of the target to be detected, input the image of the target to be detected into the trained camouflage target detection model for camouflage target recognition, and output the corresponding recognition result.

[0007] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention solves the problem of “local-global exclusivity” between details and semantics in traditional single backbone networks or shallow fusion methods by deeply coupling the high-resolution SAM2 detail encoder and the low-resolution DINOv2 semantic encoder and using bidirectional cross attention to achieve pixel-level feature alignment. The dynamic weight fusion module designed in this invention can adaptively adjust the contribution ratio of details and semantic features according to the local scene complexity (such as texture similarity and occlusion degree), which significantly improves the robustness in complex camouflage scenes. In this invention, the edge-aware refinement decoder module directly transmits edge information through residual detail transmission and combines channel attention to enhance boundary-related features, avoiding encoder background noise introduced by traditional lateral connections and effectively eliminating boundary blurring and drift phenomena.

[0008] Preferably, the step of extracting the detail feature map and semantic feature map of the input image through the complementary dual-stream heterogeneous encoder includes: The input image is scaled to a first resolution, and then input into a detail encoder for detail extraction to output a set of local detail feature maps. : ; In the formula, These are local detail feature maps at the first to fourth scales, respectively. Each local detail feature map is processed through a lightweight adapter module. Processing is performed to obtain detailed feature maps. The adapter module employs a bottleneck structure: first dimensionality reduction, then dimensionality increase, using the GeLU activation function in between, and adding residual connections. ; In the formula, For the first Local detail feature maps at various scales; The input image is scaled to a second resolution, and then input into a semantic encoder for semantic feature extraction to output a global semantic feature map. ; For the global semantic feature map Bilinear interpolation upsampling is performed to obtain a semantic feature map with the same spatial resolution as the local detail feature map. .

[0009] Preferably, the step of performing deep feature alignment and adaptive fusion on the detail feature map and the semantic feature map through a collaborative dual encoder fusion module to obtain a multi-scale fused feature set includes: Through the collaborative dual encoder fusion module Convolution converts the detailed feature maps The semantic feature map Projected onto a uniform number of channels To obtain unified detail feature maps respectively Unified semantic feature map : ; ; In the formula, for convolution; Bidirectional multi-head cross-attention is used from the unified feature map Extract the first query matrix From the unified semantic feature map Extracting the second bond matrix Second-value matrix Based on the first query matrix Second bond matrix Second-value matrix Determine the first guiding feature map : ; In the formula, For dimensions; Bidirectional multi-head cross-attention is used to extract information from the unified semantic feature map. Extract the second query matrix From the unified detail feature map Extract the first key matrix First-value matrix Based on the second query matrix First key matrix First-value matrix Determine the second guiding feature map : ; The first guiding feature map With the second guiding feature map spliced ​​along the channel dimension and by Convolution compresses back to a uniform number of channels. To obtain attention fusion feature maps ; The attention fusion feature map Perform global average pooling to obtain a length of The global description vector is then processed sequentially. Convolution, ReLU activation, Convolution and sigmoid function processing are used to generate channel attention weights. ; The channel attention weights With the attention fusion feature map Perform channel-by-channel multiplication to obtain the enhanced feature map. ; The unified semantic feature map is respectively Unified detail feature map and unified semantic feature map Unified detail feature map The element-wise sums are then subjected to global average pooling to obtain the first pooled vector. Second pooling vector Third pooling vector The first pooling vector Second pooling vector Third pooling vector The vectors are concatenated into a long vector, which is then input into a two-layer multilayer perceptron and activated by a sigmoid function to generate the first dynamic weight scalar. Second dynamic weight scalar : Based on the first dynamic weight scalar Second dynamic weight scalar Determine the dynamic weighted fusion features : ; Based on the aforementioned dynamic weighted fusion features Enhanced feature maps and unified semantic feature map Unified detail feature map Determine the multi-scale fusion feature set : ; In the formula, This is for layer normalization processing.

[0010] Preferably, the step of progressively upsampling the multi-scale fused feature set and restoring boundary details through the edge-aware thinning decoder module to obtain the probabilistic mask image includes: Decoding starts from the lowest-resolution fusion feature in the multi-scale fusion feature set and proceeds upwards level by level, working through the current fusion feature. Simultaneously perform bilinear interpolation upsampling and Convolution is performed to obtain upsampled feature maps and residual detail feature maps; Using two stacked The convolutional layer processes the upsampled feature map, each... Batch normalization and ReLU activation are applied after the convolutional layer to obtain the convolutional feature map; The convolutional feature map is subjected to global average pooling, and then channel weights are generated by passing it through two fully connected layers and then via Sigmoid. Through the channel weight Channel-by-channel weighting is applied to the convolutional feature map to obtain the boundary enhancement feature map; The boundary enhancement feature map and the residual detail feature map are added pixel by pixel to obtain the input features for the next decoding stage. ; Iterative repeated bilinear interpolation upsampling Convolution processing Convolution processing, boundary enhancement processing, and the next decoding output are performed to obtain the final decoded feature map with the same resolution as the original input image. Apply to the final decoded feature map Convolution reduces the number of channels to 1, and then the signal is activated by the Sigmoid function to generate the final probability mask.

[0011] Preferably, the total loss function for: ; In the formula, For the true value With the Each predicted output Weighted binary cross-entropy loss between them For the true value With the Each predicted output The weighted IoU loss between them.

[0012] Preferably, each pixel value of the probability mask is between 0 and 1, and the pixel value of the probability mask represents the probability that the target at the corresponding position belongs to the disguised target.

[0013] Secondly, the present invention provides the following technical solution: a camouflaged target detection system based on cross-attention fusion, the system comprising: The feature extraction module is used to acquire the input image and extract the detail feature map and semantic feature map of the input image through a complementary dual-stream heterogeneous encoder, wherein the complementary dual-stream heterogeneous encoder includes a parallel detail encoder and a semantic encoder. The fusion module is used to perform deep feature alignment and adaptive fusion on the detail feature map and the semantic feature map through the collaborative dual encoder fusion module to obtain a multi-scale fused feature set; The recovery module is used to upsample the multi-scale fused feature set step by step and recover the boundary details through the edge-aware refinement decoder module to obtain a probability mask map; The training module is used to determine the camouflage target detection model based on the complementary dual-stream heterogeneous encoder, the collaborative dual encoder fusion module, and the edge-aware refinement decoder module, calculate the total loss function, and train the camouflage target detection model using the total loss function. The recognition module is used to acquire the image of the target to be detected, input the image of the target to be detected into the trained camouflage target detection model for camouflage target recognition, and output the corresponding recognition result.

[0014] Preferably, each pixel value of the probability mask is between 0 and 1, and the pixel value of the probability mask represents the probability that the target at the corresponding position belongs to the disguised target.

[0015] Thirdly, the present invention provides the following technical solution: a computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the camouflage target detection method based on cross-attention fusion as described above.

[0016] Fourthly, the present invention provides the following technical solution: a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-described method for detecting camouflaged targets based on cross-attention fusion. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1This is a flowchart of the camouflage target detection method based on cross-attention fusion provided in Embodiment 1 of the present invention; Figure 2 This is a network structure diagram of the camouflage target detection model provided in Embodiment 1 of the present invention; Figure 3 This is a network structure diagram of the detail encoder provided in Embodiment 1 of the present invention; Figure 4 This is a network structure diagram of the collaborative dual encoder fusion module provided in Embodiment 1 of the present invention; Figure 5 A comparative analysis diagram of the representative state-of-the-art (SOTA) method provided in Embodiment 1 of the present invention and the method provided in the present invention for identifying camouflaged targets; Figure 6 The following are ablation visualization results of different components of CDSE-CAFNet provided in Embodiment 1 of the present invention: (Images) Input image, (GT) Ground truth mapping, (a) Basic backbone network, (b) Basic backbone network, (c) Basic backbone network with DINOv2 and CDEFM added, (d) Basic backbone network including DINOv2, CDEFM and ERD; Figure 7 The ablation visualization results of the dual encoder backbone network provided in Embodiment 1 of the present invention are as follows: (Images) Input image, (GT) Ground truth mapping, (a) Res2Net, (b) PVTv2, (c) Swim, (d) DINOv2-S, (e) DINOv2-B, (f) The method of the present invention; Figure 8 The ablation visualization results of different components of CDEFM provided in Embodiment 1 of the present invention; Figure 9 This is a structural block diagram of the camouflaged target detection system based on cross-attention fusion provided in Embodiment 2 of the present invention; Figure 10 This is a schematic diagram of the hardware structure of a computer provided for another embodiment of the present invention.

[0019] The embodiments of the present invention will be further described below with reference to the accompanying drawings. Detailed Implementation

[0020] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain embodiments of the present invention, and should not be construed as limiting the present invention.

[0021] Example 1 In Embodiment 1 of the present invention, as Figure 1As shown, a camouflaged target detection method based on cross-attention fusion includes: S1. Acquire an input image, and extract detail feature maps and semantic feature maps of the input image through a complementary dual-stream heterogeneous encoder. The complementary dual-stream heterogeneous encoder includes a parallel detail encoder and a semantic encoder. Step S1 includes: S11. Scale the input image to a first resolution, and input the scaled input image to a detail encoder for detail extraction to output a set of local detail feature maps. : ; In the formula, These are local detail feature maps at the first to fourth scales, respectively. The first resolution is 1024×1024, the detail encoder is a frozen SAM2-Hiera backbone network, corresponding to a high resolution, and the channel sizes of the local detail feature maps are 144, 288, 576, and 1152, with a spatial resolution of [input value missing]. .

[0022] S12. Each local detail feature map is processed through a lightweight adapter module. Processing is performed to obtain detailed feature maps. The adapter module employs a bottleneck structure: first dimensionality reduction, then dimensionality increase, using the GeLU activation function in between, and adding residual connections. ; In the formula, For the first Local detail feature maps at various scales; S13. Scale the input image to a second resolution, and input the scaled input image to a semantic encoder for semantic feature extraction to output a global semantic feature map. ; The second resolution is 448×448. The semantic encoder is a frozen DINOv2 ViT backbone network, which corresponds to the low resolution. Through parallel high-resolution detail encoder and low-resolution semantic encoder, the local spatial details and global contextual semantics of the input image are extracted respectively, forming an intrinsically complementary feature pyramid.

[0023] S14. The global semantic feature map Bilinear interpolation upsampling is performed to obtain a semantic feature map with the same spatial resolution as the local detail feature map. .

[0024] S2. The detailed feature map and the semantic feature map are deeply aligned and adaptively fused through the collaborative dual encoder fusion module to obtain a multi-scale fused feature set; Step S2 includes: S21, via the collaborative dual encoder fusion module Convolution converts the detailed feature maps The semantic feature map Projected onto a uniform number of channels To obtain unified detail feature maps respectively Unified semantic feature map : ; ; In the formula, for convolution; Specifically, in order to eliminate the channel dimension mismatch between the heterogeneous feature spaces of SAM2 (channel dimensions ranging from 144 to 1152) and DINOv2 (768-DIM features), we first apply a 1×1 convolution to these two streams and project them into a unified C = 256-dimensional channel space, thereby providing aligned input for subsequent bidirectional cross-attention and dynamic fusion.

[0025] S22. Employ bidirectional multi-head cross-attention from the unified detail feature map. Extract the first query matrix From the unified semantic feature map Extracting the second bond matrix Second-value matrix Based on the first query matrix Second bond matrix Second-value matrix Determine the first guiding feature map : ; In the formula, For dimensions; S23. Employ bidirectional multi-head cross-attention from the unified semantic feature map. Extract the second query matrix From the unified detail feature map Extract the first key matrix First-value matrix Based on the second query matrix First key matrix First-value matrix Determine the second guiding feature map : ; Specifically, to facilitate the mutual refinement between the local detail features of SAM2 and the global semantic features of DINOv2, a bidirectional multi-head cross-attention mechanism is introduced (8 attention heads, each with a dimension of...). = 32), this mechanism allows dynamic interaction, the feature feedback of SAM2 refines the features of DINOv2 (guides semantic features to focus on regions with rich details), and vice versa (guides detailed features to conform to global semantic constraints).

[0026] S24. The first guiding feature map With the second guiding feature map spliced ​​along the channel dimension and by Convolution compresses back to a uniform number of channels. To obtain attention fusion feature maps .

[0027] S25. The attention fusion feature map Perform global average pooling to obtain a length of The global description vector is then processed sequentially. Convolution, ReLU activation, Convolution and sigmoid function processing are used to generate channel attention weights. ; S26. Adjust the channel attention weights With the attention fusion feature map Perform channel-by-channel multiplication to obtain the enhanced feature map. ; Specifically, the above process effectively highlights the channels that are crucial for cutting out camouflaged targets, while suppressing irrelevant background channels.

[0028] S27. Process the unified semantic feature map respectively. Unified detail feature map and unified semantic feature map Unified detail feature map The element-wise sums are then subjected to global average pooling to obtain the first pooled vector. Second pooling vector Third pooling vector The first pooling vector Second pooling vector Third pooling vector The vectors are concatenated into a long vector, which is then input into a two-layer multilayer perceptron and activated by a sigmoid function to generate the first dynamic weight scalar. Second dynamic weight scalar : Specifically, the hidden dimension of the multilayer perceptron is 512 and it is activated by ReLU.

[0029] S28, Based on the first dynamic weight scalar Second dynamic weight scalar Determine the dynamic weighted fusion features : .

[0030] S29. Based on the aforementioned dynamic weighted fusion feature Enhanced feature maps and unified semantic feature map Unified detail feature map Determine the multi-scale fusion feature set : ; In the formula, This is for layer normalization processing.

[0031] S3. The multi-scale fused feature set is upsampled step by step and the boundary details are restored through the edge-aware refinement decoder module to obtain the probability mask map; Specifically, in the camouflage object detection task, the high similarity in texture and color between the target and the background is the core reason for the blurred segmentation boundary. Although the traditional U-Net decoder attempts to restore spatial resolution through upsampling and feature concatenation, it has two key defects in the COD scenario: (1) low-level detail noise accumulates during upsampling, leading to boundary drift; (2) high-level semantic information is diluted by redundant background features, leading to edge fragmentation. These defects severely limit the accuracy of segmentation. To solve this problem, this application designs an edge-aware refinement decoder module (ERD). Based on the standard U-Net decoding structure, ERD introduces residual detail transmission and channel-guided boundary enhancement mechanisms, which improve the perception capability and reconstruction accuracy of edge structures, and realize fine-grained restoration of the boundaries of camouflage objects.

[0032] Step S3 includes: S31. Starting from the lowest resolution fusion feature in the multi-scale fusion feature set, decode upwards level by level, for the current fusion feature... Simultaneously perform bilinear interpolation upsampling and Convolution is performed to obtain upsampled feature maps and residual detail feature maps; Specifically, the decoding process starts from the deepest fusion feature Starting at 1 / 32 of the input resolution, the process proceeds incrementally upwards (features are upsampled by a factor of 2 at each stage). At each decoding stage, the current features are simultaneously upsampled using bilinear interpolation. Convolution can produce upsampled feature maps and residual detail feature maps.

[0033] S32, using two stacked units The convolutional layer processes the upsampled feature map, each... The convolutional layer is followed by batch normalization and ReLU activation to obtain the convolutional feature map.

[0034] S33. Perform global average pooling on the convolutional feature map, and then generate channel weights through two fully connected layers and a Sigmoid function. Through the channel weight Channel-by-channel weighting is applied to the convolutional feature map to obtain the boundary enhancement feature map; Specifically, for the two fully connected layers, the first output dimension is C / 16 and the second output dimension is C.

[0035] S34. The boundary enhancement feature map and the residual detail feature map are added pixel by pixel to obtain the input features for the next decoding stage. ; Specifically, unlike traditional U-Net which relies on lateral connections to achieve the circuit-breaking coding function, ERD uses residual connections to directly transmit edge details within the decoder, avoiding the introduction of encoder-level background noise and improving edge clarity.

[0036] S35, Iterative repeated bilinear interpolation upsampling, Convolution processing Convolution processing, boundary enhancement processing, and the next decoding output are performed to obtain the final decoded feature map with the same resolution as the original input image. Specifically, after iteratively executing steps S31-S35, a final decoded feature map with the same resolution as the input image is obtained after four iterations.

[0037] S36. Apply the final decoded feature map. Convolution reduces the number of channels to 1, and then the Sigmoid activation function is used to generate the final probability mask image. Specifically, each pixel value in the probability mask is between 0 and 1, and the pixel value of the probability mask represents the probability that the target at the corresponding position belongs to the disguised target; Benefiting from residual edge information propagation without lateral connections and channel attention guidance, ERD continuously enhances boundary-related features and suppresses background interference throughout the decoding process. ERD significantly outperforms the standard U-Net decoder and its variants, and significantly improves the boundary integrity and localization accuracy of camouflaged targets.

[0038] S4. Based on the complementary dual-stream heterogeneous encoder, the collaborative dual encoder fusion module, and the edge-aware refinement decoder module, determine the camouflage target detection model, calculate the total loss function, and train the camouflage target detection model using the total loss function; Wherein, the total loss function for: ; In the formula, For the true value With the Each predicted output Weighted binary cross-entropy loss between them For the true value With the Each predicted output Weighted IoU loss between; The AdamW optimizer was used, with a cosine annealing strategy to adjust the learning rate. The training batch size was 1, and the total number of training epochs was 20. Only the parameters in the adapter module, CDEFM module, and ERD decoder were trained, while the dual encoder backbone (SAM2 and DINOv2) remained frozen.

[0039] S5. Obtain the image of the target to be detected, input the image of the target to be detected into the trained camouflage target detection model for camouflage target recognition, and output the corresponding recognition result.

[0040] To verify the effectiveness of the camouflaged target detection model (CDSE-CAFNet) of this invention, the following experiments were conducted: To demonstrate the effectiveness of the proposed CDSECAFNet, we conducted a comprehensive comparison between CDSE-CAFNet and 21 existing state-of-the-art (SOTA) camouflage object detection methods. These methods include 11 CNN-based methods: BGNet, C2F-Net-v2, SegMaR, ZoomNet, OCENet, ERRNet, SINet-V2, MRR-Net, UJSCOD-V2, PUENet, FEDER, PopNet, DGNet, UCOS-DA, and Camouflageator; and 10 transformer-based methods: WS-SAM, FSPNet, Camouformer, Camouflageator, PRBE-Net, PRNet, ZoomNeXt, BDCL-Net, and Camouflageator. For a fair comparison, the prediction results for all methods were provided by the original authors or replicated in the official release. The results are shown in Table 1. Table 1

[0041] in, It is a structural similarity measure used to measure the degree of matching between the predicted result and the true value in terms of overall structure and regional consistency. The value range is [0,1], and the larger the value, the higher the structural fidelity. For the weighted F measure, it is usually taken as =0.3, which combines precision and recall, with an emphasis on suppressing false positives. The higher the value, the better the detection accuracy (enhancing alignment measure). It reflects the consistency between pixel-level local alignment and global distribution; the larger the value, the stronger the ability to preserve details and boundaries. To calculate the mean absolute error, the mean absolute deviation of each pixel between the predicted image and the true value is calculated. The smaller the value, the lower the overall error.

[0042] The proposed CDSE-CAFNet performs best on three benchmark tests (CAMO, COD10K, and NC4K), and shows a significant advantage over the second-best, SAM2-UNeXT, and the third-best, ZoomNeXt, in key metrics. Compared to SAM2-UNeXT, CDSE-CAFNet performs better on the more challenging large-scale COD10K dataset. An increase of 1.4%. It improved by 1.1%, demonstrating stronger structural consistency and more reliable predictions. Furthermore, CDSE-CAFNet shows more significant advantages compared to ZoomNeXt: It improved by 3.4% on CAMO. The 3.0% increase on NC4K indicates that the method of this invention more effectively improves the overall segmentation quality in complex scenarios. Overall, the significant percentage increase on these key metrics verifies the robustness and superiority of CDSE-CAFNet across different scenarios and dataset scales.

[0043] Then, a qualitative comparison was performed using a representative state-of-the-art (SOTA) method and the method provided in this invention. The results are as follows: Figure 5As shown, overall, CDSE-CAFNet demonstrates more accurate localization and more complete segmentation, covering various scenes, including small objects (rows 1 and 5), medium-sized objects (rows 2, 3, and 11), large objects (rows 6, 7, and 10), multiple objects (row 8), and occlusion scenarios (rows 4, 6, and 9). Compared to the powerful underlying SAM2-UNeXT, although it leverages the complementary potential of SAM2 and DINOv2, it primarily relies on token-level concatenation and lacks learnable cross-stream alignment and dynamic weighting. This makes it difficult to bridge the distribution gap between SAM2's high-resolution detail features and DINOv2's low-resolution semantic embeddings. Therefore, SAM2-UNeXT is more prone to semantic-detail mismatches in complex backgrounds and weak boundary conditions, leading to foreground fragmentation, local missed detections, boundary leakage, and boundary drift; especially in occluded and low-contrast scenes (e.g., rows 1, 2, and 5), it often fails to reliably complete occluded regions or generates unnecessary activations on similar textures. In contrast, when the target portion is occluded by natural obstacles (e.g., rows 10 and 11), CDEFM achieves pixel-level alignment through bidirectional multi-head cross-attention and further employs dynamic fusion to adaptively balance details and semantic cues, resulting in more robust occlusion completion and clearer foreground-background separation. For fine and complex structures (e.g., the crab legs in rows 2 and 3), the proposed ERD enhances edge responses through residual detail transport and channel attention, effectively mitigating boundary blurring and displacement, while SAM2-UNeXT often suffers from breakage or adhesion issues in such elongated structures. Furthermore, in multi-object scenes (row 8), the complementary dual-encoder feature stream provides richer contextual information, enabling the simultaneous capture of multiple camouflaged instances and reducing false positives and false negatives; in contrast, FSPNet and DGNet are more susceptible to inter-object interference or background artifacts, leading to erroneous activations. Furthermore, under conditions of high texture similarity (rows 5 and 10) or strong background clutter (row 7), CDSE-CAFNet maintains stronger robustness through deep coupling and alignment with detail and semantic cues, better suppressing background noise and stably highlighting real targets. These visual results validate that the proposed “detail-semantic” complementary fusion and edge-aware decoding provide more reliable and accurate camouflaged object segmentation under various complex conditions.

[0044] Next, system ablation experiments were conducted on different modules in the model of this invention. The quantitative results of four progressive ablation settings on the CAMO, COD10K, and NC4K datasets are shown in Table 2. Table 2

[0045] The experimental configuration is as follows: a: The baseline retains only the SAM2 encoder and SimpleUp decoder, excluding DINOv2 and feature fusion; b: DINOv2 is added to form a dual encoder architecture, but fusion is limited to SimpleFusion (connection + 1×1 convolution), and the decoder uses SimpleUp; c: SimpleFusion is replaced by the Collaborative Dual Encoder Fusion Module (CDEFM), while the SimpleUp decoder is retained; d: The SimpleUp decoder is upgraded to the Edge Aware Refinement Decoder Module (ERD) with residual connections and SE-Block, ultimately forming the complete CDSE-CAFNet.

[0046] The results for b, c, and d showed significant improvement compared to the baseline, validating the effectiveness of each module. Figure 6 As shown, the dual encoding mechanism gradually improves the accuracy of camouflaged target extraction: compared with the baseline, group b significantly reduces mask holes, confirming that missing detection is reduced with the global semantics of DINOv2; group c suppresses edge spurs and improves the distinction between the target and the background due to CDEFM multi-head cross attention, dynamic weight adjustment; and group d, the complete CDSECAFNet, utilizes ERD residual connections and SE-Block to sharpen boundaries and restore details, achieving optimal mask consistency and highest edge closure. In occluded and low-contrast scenes, it provides segmentation results through "semantic closure and geometric fitting".

[0047] To explore the impact of different backbone networks as dual encoders, a systematic experiment was conducted by replacing DINOv2 with Res2Net, PVTv2, and SwinTransformer as complementary encoders to SAM2, evaluating their performance and adaptability in extracting low-resolution semantic features. Furthermore, the contributions of different scale versions of DINOv2 (including frozen small and basic versions) as auxiliary encoders for the overall framework were analyzed, and the results are shown in Table 3. Table 3

[0048] When using Res2Net as the encoder, on the CAMO dataset = 0.865 and = 0.045, a relatively weak performance, indicating limitations in its global semantic modeling. PVTv2 shows a slight improvement, reaching = 0.874, = 0.040, optimizing multi-scale feature extraction. The Swin transform performs best. = 0.891 and = 0.038, implemented on the COD10K dataset. = 0.917, = 0.017, demonstrating its superior multi-scale feature modeling capabilities.

[0049] When comparing DINOv2 versions, performance improves with increasing model size. The minor version of DINOv2-S implements... = 0.892 and = 0.036, while the basic version of DINOv2B further improves to = 0.903 and =0.035, indicating that larger-scale DINOv2 has significant advantages in global semantic representation, especially when implemented on the NC4K dataset. = 0.925. For example... Figure 7 As shown, predictions using DINOv2-Large as the auxiliary encoder accurately depict fine structures such as spider stings and heron toenails, effectively suppressing background interference. This indicates that the fusion of deep semantics from DINOv2 and shallow detail from SAM2 is most effective for distinguishing and segmenting complex camouflaged targets.

[0050] To validate the effectiveness of CDEFM, five ablation experiments were designed, progressively removing core sub-components to quantify the impact of each module on model performance. First, the original multi-head cross-attention mechanism was replaced with a simple channel connection (denoted as w / o CA) to assess the module's necessity for feature alignment. The original 8-head attention was also simplified to a single-head attention (denoted as w / SHA) for comparison with the baseline model. Second, the effect of retaining only the attention output and removing the context enhancement module (denoted as w / o CE) to suppress background noise was evaluated. Furthermore, adaptive weights were replaced with fixed proportional weights to test the dynamic adjustment mechanism (denoted as w / o DW). Finally, to evaluate the impact of normalization on fusion stability, the residual normalization step (denoted as w / o RN) was removed.

[0051] The experimental results are shown in Table 4. After removing the multi-head cross-attention mechanism, It dropped to 0.880. The value increased to 0.045, indicating that this module is crucial for accurate alignment of SAM2 and DINOv2 features. This is despite the fact that single-head attention is used... It rose back to 0.890. It dropped to 0.040, but performance was still below the baseline. = 0.914, = 0.033), which confirms the advantage of multi-head designs in capturing complex feature dependencies. After removing the context enhancement module, It dropped to 0.895. The value increased to 0.038, demonstrating its positive contribution to model performance. Replacing dynamic fusion with fixed weights... It dropped to 0.887. The value increased to 0.042, highlighting the importance of adaptive weights in balancing dual encoder outputs. After removing residual normalization, It dropped to 0.890. The increase to 0.040 indicates that this module plays a key role in stabilizing feature fusion and ensuring consistency. Figure 8 The visualization results of the different components of CDEFM are presented.

[0052] Table 4

[0053] To verify the impact of ERD, it was compared with three other decoding strategies, and the results are detailed in Table 5. "Simple Up" is the same as variant (c) in Table 1. "w / o SE" and "w / o Residual" refer to models that omit the SE module and residual connections, respectively. As shown in Table 5, "Simple Up" achieved the worst results due to the lack of a boundary refinement mechanism. Compared to "Simple Up," "w / o SE" and "w / o Residual" employed different detail preservation or channel enhancement methods, improving feature representation and thus increasing detection accuracy. However, both methods rely on a single optimization mechanism, making it difficult to simultaneously meet the dual requirements of "detail integrity in complex boundary scenes" and "boundary feature saliency." Our method employs a collaborative strategy of residual connections and channel attention: low-level details are stably preserved during upsampling through residual connections, and the feature response of boundary regions is accurately enhanced through SE-Block. These two mechanisms complement each other, exploring more comprehensive boundary details and semantic responses, ultimately achieving the best performance across all metrics.

[0054] Table 5

[0055] The impact of different resolution combinations was then explored, as shown in Table 6. A uniform low-resolution setting (352×352 for both SAM2 and DINOv2) yielded the worst results. This is because the lack of high-resolution input prevented SAM2 from capturing the fine details of the camouflaged target, resulting in blurred boundaries and insufficient semantic distinction. Performance improved when the DINOv2 resolution was reduced to 224×224, but still fell short of the optimal combination. The main issue is that while SAM2's higher resolution preserved some local texture, DINOv2's lower resolution weakened its global semantic modeling capabilities. Performance approached the optimal level when the DINOv2 resolution was increased to 672×672, but the computational cost increased significantly, making it unsuitable for practical deployment. In contrast, our dynamic resolution strategy (1024×1024 for SAM2, paired with 448×448 for DINOv2) achieved the best balance, where HR: the size (pixel side length) of the target / ground high-resolution image, and LR: the size (pixel side length) of the low-resolution image input to the network.

[0056] Table 6

[0057] The camouflaged target detection method based on cross-attention fusion provided in Embodiment 1 of this invention solves the problem of "local-global exclusivity" between details and semantics in traditional single-backbone networks or shallow fusion methods by deeply coupling a high-resolution SAM2 detail encoder and a low-resolution DINOv2 semantic encoder and using bidirectional cross-attention to achieve pixel-level feature alignment. The dynamic weight fusion module designed in this invention can adaptively adjust the contribution ratio of details and semantic features according to the local scene complexity (such as texture similarity and occlusion degree), which significantly improves the robustness in complex camouflage scenes. In this invention, the edge-aware refinement decoder module directly transmits edge information through residual detail transmission and combines channel attention to enhance boundary-related features, avoiding encoder background noise introduced by traditional lateral connections and effectively eliminating boundary blurring and drift phenomena.

[0058] Example 2 like Figure 2 As shown, in Embodiment 2 of the present invention, a camouflaged target detection system based on cross-attention fusion is provided, the system comprising: Feature extraction module 1 is used to acquire an input image and extract detail feature maps and semantic feature maps of the input image through a complementary dual-stream heterogeneous encoder. The complementary dual-stream heterogeneous encoder includes a parallel detail encoder and a semantic encoder. Fusion module 2 is used to perform deep feature alignment and adaptive fusion on the detail feature map and the semantic feature map through the collaborative dual encoder fusion module to obtain a multi-scale fused feature set; Recovery module 3 is used to upsample the multi-scale fused feature set step by step and restore the boundary details through the edge-aware refinement decoder module to obtain a probability mask map; Training module 4 is used to determine the camouflage target detection model based on the complementary dual-stream heterogeneous encoder, the collaborative dual encoder fusion module, and the edge-aware refinement decoder module, calculate the total loss function, and train the camouflage target detection model using the total loss function. The recognition module 5 is used to acquire the image of the target to be detected, input the image of the target to be detected into the trained camouflage target detection model for camouflage target recognition, and output the corresponding recognition result.

[0059] Specifically, feature extraction module 1 is used for: The input image is scaled to a first resolution, and then input into a detail encoder for detail extraction to output a set of local detail feature maps. : ; In the formula, These are local detail feature maps at the first to fourth scales, respectively. Each local detail feature map is processed through a lightweight adapter module. Processing is performed to obtain detailed feature maps. The adapter module employs a bottleneck structure: first dimensionality reduction, then dimensionality increase, using the GeLU activation function in between, and adding residual connections. ; In the formula, For the first Local detail feature maps at various scales; The input image is scaled to a second resolution, and then input into a semantic encoder for semantic feature extraction to output a global semantic feature map. ; For the global semantic feature map Bilinear interpolation upsampling is performed to obtain a semantic feature map with the same spatial resolution as the local detail feature map. .

[0060] Specifically, fusion module 2 is used for: Through the collaborative dual encoder fusion module Convolution converts the detailed feature maps The semantic feature map Projected onto a uniform number of channels To obtain unified detail feature maps respectively Unified semantic feature map : ; ; In the formula, for convolution; Bidirectional multi-head cross-attention is used from the unified feature map Extract the first query matrix From the unified semantic feature map Extracting the second bond matrix Second-value matrix Based on the first query matrix Second bond matrix Second-value matrix Determine the first guiding feature map : ; In the formula, For dimensions; Bidirectional multi-head cross-attention is used to extract information from the unified semantic feature map. Extract the second query matrix From the unified detail feature map Extract the first key matrix First-value matrix Based on the second query matrix First key matrix First-value matrix Determine the second guiding feature map : ; The first guiding feature map With the second guiding feature map spliced ​​along the channel dimension and by Convolution compresses back to a uniform number of channels. To obtain attention fusion feature maps ; The attention fusion feature map Perform global average pooling to obtain a length of The global description vector is then processed sequentially. Convolution, ReLU activation, Convolution and sigmoid function processing are used to generate channel attention weights. ; The channel attention weights With the attention fusion feature map Perform channel-by-channel multiplication to obtain the enhanced feature map. ; The unified semantic feature map is respectively Unified detail feature map and unified semantic feature map Unified detail feature map The element-wise sums are then subjected to global average pooling to obtain the first pooled vector. Second pooling vector Third pooling vector The first pooling vector Second pooling vector Third pooling vector The vectors are concatenated into a long vector, which is then input into a two-layer multilayer perceptron and activated by a sigmoid function to generate the first dynamic weight scalar. Second dynamic weight scalar : Based on the first dynamic weight scalar Second dynamic weight scalar Determine the dynamic weighted fusion features : ; Based on the aforementioned dynamic weighted fusion features Enhanced feature maps and unified semantic feature map Unified detail feature map Determine the multi-scale fusion feature set : ; In the formula, This is for layer normalization processing.

[0061] Specifically, recovery module 3 is used for: Decoding starts from the lowest-resolution fusion feature in the multi-scale fusion feature set and proceeds upwards level by level, working through the current fusion feature. Simultaneously perform bilinear interpolation upsampling and Convolution is performed to obtain upsampled feature maps and residual detail feature maps; Using two stacked The convolutional layer processes the upsampled feature map, each... Batch normalization and ReLU activation are applied after the convolutional layer to obtain the convolutional feature map; The convolutional feature map is subjected to global average pooling, and then channel weights are generated by passing it through two fully connected layers and then via Sigmoid. Through the channel weight Channel-by-channel weighting is applied to the convolutional feature map to obtain the boundary enhancement feature map; The boundary enhancement feature map and the residual detail feature map are added pixel by pixel to obtain the input features for the next decoding stage. ; Iterative repeated bilinear interpolation upsampling Convolution processing Convolution processing, boundary enhancement processing, and the next decoding output are performed to obtain the final decoded feature map with the same resolution as the original input image. Apply to the final decoded feature map Convolution reduces the number of channels to 1, and then the signal is activated by the Sigmoid function to generate the final probability mask.

[0062] Wherein, the total loss function for: ; In the formula, For the true value With the Each predicted output Weighted binary cross-entropy loss between them For the true value With the Each predicted output The weighted IoU loss between them.

[0063] In this probability mask, each pixel value is between 0 and 1, and the pixel value of the probability mask represents the probability that the target at the corresponding position belongs to the disguised target.

[0064] In other embodiments of the present invention, the present invention provides the following technical solution: a computer, including a memory 102, a processor 101, and a computer program stored in the memory 102 and executable on the processor 101, wherein the processor 101 executes the computer program to implement the camouflage target detection method based on cross-attention fusion as described above.

[0065] Specifically, the processor 101 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.

[0066] The memory 102 may include a large-capacity memory for data or instructions. For example, and not limitingly, the memory 102 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 102 may include removable or non-removable (or fixed) media. Where appropriate, the memory 102 may be internal or external to a data processing device. In a particular embodiment, the memory 102 is non-volatile memory. In a particular embodiment, the memory 102 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random Access Memory (FPMDRAM), Extended Data Out Dynamic Random Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.

[0067] The memory 102 can be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 101.

[0068] The processor 101 implements the aforementioned camouflage target detection method based on cross-attention fusion by reading and executing computer program instructions stored in the memory 102.

[0069] In some embodiments, the computer may further include a communication interface 103 and a bus 100. For example, Figure 3 As shown, the processor 101, memory 102, and communication interface 103 are connected through bus 100 and complete communication with each other.

[0070] The communication interface 103 is used to enable communication between the various modules, devices, units, and / or equipment in the embodiments of the present invention. The communication interface 103 can also enable data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.

[0071] Bus 100 includes hardware, software, or both, that couples components of a computer device together. Bus 100 includes, but is not limited to, at least one of the following: data bus, address bus, control bus, expansion bus, and local bus. For example, and not as a limitation, bus 100 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 100 may include one or more buses. Although specific buses are described and illustrated in the embodiments of the present invention, the present invention is contemplated by any suitable bus or interconnect.

[0072] The computer can execute the cross-attention fusion-based camouflage target detection method of the present invention based on the acquired cross-attention fusion-based camouflage target detection system, thereby realizing cross-attention fusion-based camouflage target detection.

[0073] In some further embodiments of the present invention, in conjunction with the above-described method for detecting camouflaged targets based on cross-attention fusion, the present invention provides the following technical solution: a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-described method for detecting camouflaged targets based on cross-attention fusion.

[0074] Those skilled in the art will understand that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0075] More specific examples of readable media (a non-exhaustive list) include: electrical connections (electronic devices) with one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0076] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0077] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0078] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A method for detecting camouflaged targets based on cross-attention fusion, characterized in that, include: The input image is acquired, and its detail feature map and semantic feature map are extracted using a complementary two-stream heterogeneous encoder. The complementary two-stream heterogeneous encoder includes a parallel detail encoder and a semantic encoder, comprising: The input image, scaled to a first resolution, is then fed into a detail encoder for detail extraction. The input image, scaled to a second resolution, is then fed into a semantic encoder for semantic feature extraction. The first resolution is 1024×1024, and the detail encoder is a frozen SAM2-Hiera backbone network. The second resolution is 448×448, and the semantic encoder is a frozen DINOv2 ViT backbone network. The detail encoder corresponds to the high resolution, and the semantic encoder corresponds to the low resolution. Through the parallel high-resolution detail encoder and low-resolution semantic encoder, the local spatial details and global contextual semantics of the input image are extracted respectively, forming an intrinsically complementary feature pyramid. A collaborative dual encoder fusion module performs deep feature alignment and adaptive fusion on detail feature maps and semantic feature maps to obtain a multi-scale fused feature set, including: Through the collaborative dual encoder fusion module Convolution converts the detailed feature maps The semantic feature map Projected onto a uniform number of channels To obtain unified detail feature maps respectively Unified semantic feature map : ; ; In the formula, for convolution; Bidirectional multi-head cross-attention is used from the unified feature map Extract the first query matrix From the unified semantic feature map Extracting the second bond matrix Second-value matrix Based on the first query matrix Second bond matrix Second-value matrix Determine the first guiding feature map : ; In the formula, For dimensions; Bidirectional multi-head cross-attention is used to extract information from the unified semantic feature map. Extract the second query matrix From the unified detail feature map Extract the first key matrix First-value matrix Based on the second query matrix First key matrix First-value matrix Determine the second guiding feature map : ; The first guiding feature map With the second guiding feature map spliced ​​along the channel dimension and by Convolution compresses back to a uniform number of channels. To obtain attention fusion feature maps ; The attention fusion feature map Perform global average pooling to obtain a length of The global description vector is then processed sequentially. Convolution, ReLU activation, Convolution and sigmoid function processing are used to generate channel attention weights. ; The channel attention weights With the attention fusion feature map Perform channel-by-channel multiplication to obtain the enhanced feature map. ; The unified semantic feature map is respectively Unified detail feature map and unified semantic feature map Unified detail feature map The element-wise sums are then subjected to global average pooling to obtain the first pooled vector. Second pooling vector Third pooling vector The first pooling vector Second pooling vector Third pooling vector The vectors are concatenated into a long vector, which is then input into a two-layer multilayer perceptron and activated by a sigmoid function to generate the first dynamic weight scalar. Second dynamic weight scalar : Based on the first dynamic weight scalar Second dynamic weight scalar Determine the dynamic weighted fusion features : ; Based on the aforementioned dynamic weighted fusion features Enhanced feature maps and unified semantic feature map Unified detail feature map Determine the multi-scale fusion feature set : ; In the formula, For layer normalization processing; The multi-scale fused feature set is upsampled step by step and boundary details are restored by the edge-aware refinement decoder module to obtain a probability mask map; Based on the complementary dual-stream heterogeneous encoder, the collaborative dual encoder fusion module, and the edge-aware refinement decoder module, a camouflage target detection model is determined, and the total loss function is calculated and the camouflage target detection model is trained using the total loss function. Acquire the image of the target to be detected, input the image of the target to be detected into the trained camouflage target detection model for camouflage target recognition, and output the corresponding recognition result.

2. The camouflaged target detection method based on cross-attention fusion according to claim 1, characterized in that, The steps of extracting detail feature maps and semantic feature maps of the input image using a complementary dual-stream heterogeneous encoder include: The input image is scaled to a first resolution, and then input into a detail encoder for detail extraction to output a set of local detail feature maps. : ; In the formula, These are local detail feature maps at the first to fourth scales, respectively. Each local detail feature map is processed through a lightweight adapter module. Processing is performed to obtain detailed feature maps. The adapter module employs a bottleneck structure: first dimensionality reduction, then dimensionality increase, using the GeLU activation function in between, and adding residual connections. ; In the formula, For the first Local detail feature maps at various scales; The input image is scaled to a second resolution, and then input into a semantic encoder for semantic feature extraction to output a global semantic feature map. ; For the global semantic feature map Bilinear interpolation upsampling is performed to obtain a semantic feature map with the same spatial resolution as the local detail feature map. .

3. The camouflaged target detection method based on cross-attention fusion according to claim 1, characterized in that, The step of progressively upsampling the multi-scale fused feature set and restoring boundary details through the edge-aware refinement decoder module to obtain the probabilistic mask image includes: Decoding starts from the lowest-resolution fusion feature in the multi-scale fusion feature set and proceeds upwards level by level, working through the current fusion feature. Simultaneously perform bilinear interpolation upsampling and Convolution is performed to obtain upsampled feature maps and residual detail feature maps; Using two stacked The convolutional layer processes the upsampled feature map, each... Batch normalization and ReLU activation are applied after the convolutional layer to obtain the convolutional feature map; The convolutional feature map is subjected to global average pooling, and then channel weights are generated by passing it through two fully connected layers and then via Sigmoid. Through the channel weight Channel-by-channel weighting is applied to the convolutional feature map to obtain the boundary enhancement feature map; The boundary enhancement feature map and the residual detail feature map are added pixel by pixel to obtain the input features for the next decoding stage. ; Iterative repeated bilinear interpolation upsampling Convolution processing Convolution processing, boundary enhancement processing, and the next decoding output are performed to obtain the final decoded feature map with the same resolution as the original input image. Apply to the final decoded feature map Convolution reduces the number of channels to 1, and then the signal is activated by the Sigmoid function to generate the final probability mask.

4. The camouflaged target detection method based on cross-attention fusion according to claim 1, characterized in that, The total loss function for: ; In the formula, For the true value With the Each predicted output Weighted binary cross-entropy loss between them For the true value With the Each predicted output The weighted IoU loss between them.

5. The camouflaged target detection method based on cross-attention fusion according to claim 1, characterized in that, Each pixel value in the probability mask is between 0 and 1, and the pixel value of the probability mask represents the probability that the target at the corresponding position belongs to the disguised target.

6. A camouflaged target detection system based on cross-attention fusion, wherein the system employs the camouflaged target detection method based on cross-attention fusion as described in claim 1, characterized in that, The system includes: The feature extraction module is used to acquire the input image and extract the detail feature map and semantic feature map of the input image through a complementary dual-stream heterogeneous encoder, wherein the complementary dual-stream heterogeneous encoder includes a parallel detail encoder and a semantic encoder. The fusion module is used to perform deep feature alignment and adaptive fusion on the detail feature map and the semantic feature map through the collaborative dual encoder fusion module to obtain a multi-scale fused feature set; The recovery module is used to upsample the multi-scale fused feature set step by step and recover the boundary details through the edge-aware refinement decoder module to obtain a probability mask map; The training module is used to determine the camouflage target detection model based on the complementary dual-stream heterogeneous encoder, the collaborative dual encoder fusion module, and the edge-aware refinement decoder module, calculate the total loss function, and train the camouflage target detection model using the total loss function. The recognition module is used to acquire the image of the target to be detected, input the image of the target to be detected into the trained camouflage target detection model for camouflage target recognition, and output the corresponding recognition result.

7. The camouflaged target detection system based on cross-attention fusion according to claim 6, characterized in that, Each pixel value in the probability mask is between 0 and 1, and the pixel value of the probability mask represents the probability that the target at the corresponding position belongs to the disguised target.

8. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the camouflage target detection method based on cross-attention fusion as described in any one of claims 1 to 5.

9. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the camouflage target detection method based on cross-attention fusion as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Surgical instrument segmentation method based on double prior guidance networks

    CN121147241A

  • Three-dimensional point-cloud semantic segmentation method based on multi-level boundary enhancement for unstructured environment

    WO2024230038A1