Camouflage target detection system, method and device based on cache reuse diffusion network
Patent Information
- Application Number
- CN202610714404.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-22
- Publication Date
- 2026-08-18
AI Technical Summary
[0007]第一,现有基于扩散模型的伪装目标检测方法需要进行多步迭代去噪,每个去噪时间步均执行完整网络计算,存在大量重复计算,导致推理耗时长、部署效率低
[0039]本发明具有的优点和积极效果是:
Smart Images

Figure CN122597761A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision, image segmentation and deep learning, and in particular to a camouflaged target detection system, method and device based on a cached reuse diffusion network. Background Technology
[0002] Currently, camouflaged target detection refers to accurately locating and segmenting target regions from image scenes that are highly similar to the background. Because camouflaged targets often closely match their surroundings in terms of color, texture, brightness, shape, and boundaries, this task is more challenging than ordinary salient target detection and semantic segmentation. This technology can be applied to fields such as medical image analysis, industrial defect detection, ecological monitoring, military reconnaissance, intelligent security, and target perception in complex scenes.
[0003] Existing methods for camouflaged target detection mainly include convolutional neural network (CNN)-based methods, visual Transformer-based methods, and diffusion model-based methods that have emerged in recent years. Traditional CNN methods can extract local texture and edge information, but they lack the ability to model long-distance dependencies, global semantic relationships, and fine-grained camouflage differences in complex backgrounds. Visual Transformer-based methods can enhance global context modeling capabilities, but they are still susceptible to background interference, especially when target boundaries are blurred, target scale varies significantly, or foreground and background textures are highly consistent, potentially leading to missed detections, false detections, or incomplete boundaries.
[0004] Diffusion models, due to their advantages of stepwise denoising, strong detail reconstruction capabilities, and good uncertainty modeling ability, have been increasingly adopted for image segmentation and camouflaged target detection tasks. Diffusion models typically start with random noise or a noisy mask and gradually recover the target segmentation mask through multi-step iterative denoising, thus achieving relatively fine segmentation results. However, the multi-step sampling process of diffusion models requires repeated network inference at each time step, resulting in high computational cost and high inference latency, limiting their application in real-time or resource-constrained scenarios.
[0005] Furthermore, existing diffusion-based camouflage target detection methods typically do not fully utilize the varying degrees of feature change between different denoising time steps. The applicant's analysis revealed that during the continuous denoising process of the diffusion model, some shallow, high-resolution features show minimal change between adjacent time steps, resulting in significant computational redundancy; while mid-to-deep semantic features have a greater impact on the final camouflage target localization and segmentation quality, requiring more comprehensive dynamic updates. Therefore, how to reduce redundant computations in the diffusion model while maintaining detection accuracy, and further improve the fusion of camouflage target details, semantics, and localization information, is a pressing issue that needs to be addressed in current technology.
[0006] Therefore, the existing technology has the following problems:
[0007] First, existing camouflage target detection methods based on diffusion models require multi-step iterative denoising, with each denoising time step involving a complete network computation, resulting in a large amount of repetitive computation, leading to long inference time and low deployment efficiency.
[0008] Second, when processing complex images where the camouflaged target and the background are highly similar, existing methods struggle to simultaneously consider spatial details, deep semantics, and target localization information, which can easily lead to problems such as unclear target boundaries, missed detections in local areas, and false detections of the background.
[0009] Third, existing feature fusion methods often use fixed or simple splicing methods for features at different scales, making it difficult to adaptively adjust the information flow according to the importance of the camouflaged target region, resulting in insufficient background noise suppression capabilities.
[0010] Fourth, existing diffusion-based detection networks do not fully utilize the time-step variation patterns of features at different levels during diffusion denoising, and fail to allocate different computational resources to stable and sensitive features, making it difficult to balance computational efficiency and detection accuracy. Summary of the Invention
[0011] This invention provides a camouflaged target detection system, method, and device based on a cached reuse diffusion network to solve the technical problems existing in the prior art, thereby achieving high-precision and low-latency camouflaged target segmentation.
[0012] The technical solution adopted by this invention to solve the technical problems existing in the prior art is as follows:
[0013] A camouflaged target detection system based on a cache reuse diffusion network, comprising: a cache reuse control module, an hourglass-shaped time-aware visual encoding module, an adaptive multi-scale feature fusion module, and a denoising network;
[0014] The hourglass-shaped time-aware visual coding module includes multiple sequentially connected visual Transformer encoders; it is used to map discrete time steps into time series, and integrate time series information into RGB images and noise masks through a self-attention mechanism, and extract features through the visual Transformer encoders.
[0015] The cache reuse control module, which is connected to the hourglass-type time-aware visual encoding module, is used to determine whether to perform a complete calculation based on the current time step and refresh interval, and to control the hourglass-type time-aware visual encoding module to perform writing, reading and reuse of shallow feature residual increments.
[0016] The adaptive multi-scale feature fusion module is used to enhance the features extracted by the hourglass-shaped time-aware visual coding module, and obtain three types of information: spatial detail information based on shallow features, global semantic information based on deep features, and positional cue information. These three types of information are then fused to obtain conditional guided features for guiding the denoising network.
[0017] The denoising network consists of an encoder and a decoder. The encoder extracts noisy mask features through convolutional downsampling and enhances temporal awareness by combining temporal embedding. The decoder fuses the noisy mask features extracted by the encoder with the conditionally guided features obtained by the adaptive multi-scale feature fusion module, and performs channel compression and stepwise upsampling on the fused features to restore spatial resolution and output the denoised features of the final mask prediction.
[0018] Furthermore, the adaptive multi-scale feature fusion module includes a receptive field enhancement module, a cross-scale fusion module, and a gated cross-attention module. The hourglass-shaped time-aware visual encoding module outputs multi-level features to the receptive field enhancement module. The receptive field enhancement module sets convolutional branches of different sizes corresponding to the multi-level features, with each convolutional branch corresponding to a first-level feature input. The receptive field enhancement module obtains contextual information under different receptive fields and enhances the difference expression between the camouflaged target and the background. The cross-scale fusion module is used to perform preliminary cross-scale fusion on the features of different scales after convolutional branch enhancement to obtain spatial detail features, semantic features, and intermediate layer features for localization. The gated cross-attention module is used to perform bidirectional cross-attention fusion on spatial detail features and semantic features, and adaptively controls the information flow through a gating mechanism. Finally, it is fused with location cue information through convolution after concatenation.
[0019] Furthermore, each convolutional branch includes a 1×1 convolutional unit, an asymmetric convolutional unit, and a dilated convolutional unit connected in sequence; the 1×1 convolutional unit is used for channel alignment and lightweight mapping; the asymmetric convolutional unit and the dilated convolutional unit are used to expand the receptive field and capture different ranges of context.
[0020] Furthermore, the cross-scale fusion module upsamples, downsamples, splices, or fuses the enhanced multi-scale features to generate three types of complementary features: the first type is spatial detail features, which are used to preserve the boundaries of the camouflaged target and local texture differences; the second type is semantic features, which are used to express the overall structure of the target and category-independent semantics; and the third type is localization features, which are used to provide the target's location range and regional constraints.
[0021] Furthermore, the gated cross-attention module maps spatial detail features and semantic features to queries, keys, and values respectively, and performs bidirectional interaction through linear attention. It uses kernel function mapping to reduce the attention complexity to a linear level. At the same time, it generates corresponding attention head-level gating weights for spatial detail features and semantic features respectively, and obtains adaptive control coefficients through sigmoid activation to enhance the information of the effective camouflage region and suppress background noise. It concatenates the spatial detail features, semantic features, and upsampled localization features enhanced by gated cross-attention, and generates conditionally guided features through convolution, batch normalization, and ReLU activation.
[0022] Furthermore, the hourglass-shaped time-aware visual encoding module includes multiple visual Transformer encoders with time-step perception functions of diffusion model connected in sequence. Each visual Transformer encoder outputs feature maps of different scales. The visual Transformer encoder located in the middle position forms a semantic bottleneck to extract high-level semantic information. The subsequent visual Transformer encoders gradually recover higher-resolution features to preserve spatial details and target boundary information.
[0023] This invention also provides a method for detecting camouflaged targets based on a cache-reuse-diffusion network, utilizing the aforementioned cache-reuse-diffusion network-based camouflaged target detection system. This method includes the following steps:
[0024] Acquire the RGB image to be detected; during the training phase, obtain the corresponding binary labeled mask of the disguised target, and gradually add Gaussian noise to the mask of the disguised target to obtain the noisy mask at different time steps;
[0025] The following methodological steps are performed during both the training and inference sampling phases:
[0026] The RGB image, the noise mask of the current time step, and the time step information are input into the hourglass-shaped time-aware visual coding module. The visual Transformer encoder first maps the discrete time steps into continuous time series codes and injects the time series codes into the visual token sequence. Then, multi-scale features are extracted and feature maps with different spatial resolutions are output.
[0027] Feature maps with different spatial resolutions are input into the adaptive multi-scale feature fusion module. The adaptive multi-scale feature fusion module dynamically generates pixel-level adaptive weights based on the spatial detail information of shallow features and the global semantic and positional cue information of deep features, and fuses features of different scales to obtain differentiated weighted enhanced fusion features and condition-guided features.
[0028] The denoising network takes input condition-guided features and noisy images as input, predicts the clean mask corresponding to the current time step, calculates the mask of the previous time step, and obtains the final camouflaged target detection result through multiple iterations.
[0029] During the inference sampling phase, the hourglass-type time-aware visual coding module employs the following shallow feature cache reuse strategy: alternating between the full computation phase and the cache reuse phase within a set refresh interval; specifically, during the full computation phase, each visual Transformer encoder in the hourglass-type time-aware visual coding module performs normal computation and caches the residual incremental features of the shallow high-resolution layers; during the cache reuse phase, for shallow feature layers, higher computational operations are skipped, and the most recently cached residual increments are directly reused; for mid-to-deep feature layers, full computation is still maintained.
[0030] Furthermore, within the adaptive multi-scale feature fusion module, a receptive field enhancement module, a cross-scale fusion module, and a gated cross-attention module are sequentially connected; wherein:
[0031] The receptive field enhancement module contains multiple convolutional branches with different receptive fields to obtain contextual information under different receptive fields and enhance the differential representation between the camouflaged target and the background;
[0032] The cross-scale fusion module is used to perform preliminary cross-scale fusion on features of different scales after convolutional branch enhancement, to obtain spatial detail features, semantic features, and intermediate layer features for localization.
[0033] The gated cross-attention module performs bidirectional cross-attention fusion of spatial detail features and semantic features, and adaptively controls the information flow through a gating mechanism. This module uses linear attention to reduce computational complexity, while highlighting effective camouflage regions and suppressing irrelevant background noise according to the gating weights. Subsequently, the spatial detail features, semantic features and upsampled localization features are concatenated, and a unified conditional guided feature is generated through convolution, normalization and activation operations.
[0034] Furthermore, during the training phase, the training image and its corresponding camouflaged target binary segmentation mask are first obtained. Let the real mask be x0. During the forward diffusion process, Gaussian noise is gradually added to x0 according to preset noise scheduling parameters to obtain the noisy mask x at the t-th time step. t Let the total number of time steps be T; noise scheduling adopts linear scheduling or cosine scheduling.
[0035] Then, the original RGB image I and the noise mask x are... tThe time step t is input to the hourglass-shaped time-aware visual encoding module, where the time encoding module maps the discrete time step t into a continuous vector to obtain a time series. This time series is added as a time token to the visual token sequence and input together with the image feature token into the hourglass-shaped time-aware visual encoding module. The time series is then fused with the image feature token through a self-attention mechanism. In this way, the hourglass-shaped time-aware visual encoding module can perceive whether it is in the early, middle or late stage of diffusion denoising and dynamically adjust the feature extraction according to different time steps.
[0036] During training, a combined loss method, including mean squared error loss and IoU loss, is used for optimization.
[0037] During the inference sampling phase, a random noise mask is first initialized, and then reverse denoising is performed from step T to step 0 according to a preset time step. In each denoising time step, the system predicts and updates based on the input image and the current noise mask.
[0038] The present invention also provides a camouflaged target detection device based on a cached multiplexing diffusion network, comprising a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program and, when executing the computer program, implement the steps of the camouflaged target detection method based on the cached multiplexing diffusion network as described above.
[0039] The advantages and positive effects of this invention are:
[0040] The cache reuse strategy proposed in this invention can significantly reduce redundant computations in the multi-step sampling process of the diffusion model. Since shallow features change little between adjacent denoising time steps, this invention avoids repeating the complete computation at each time step by caching and reusing the residual increments of shallow features, thereby improving inference speed.
[0041] This invention can maintain high detection accuracy while accelerating inference. Experimental results show that when the shallow cache refresh interval is 3, the model accuracy does not decrease significantly; when the refresh interval is 5, the inference time for a single image can be reduced from approximately 160.66 ms to approximately 125.89 ms, achieving an acceleration of approximately 1.28 times.
[0042] The time-aware hourglass-shaped time-aware visual coding module proposed in this invention can inject diffusion time step information into the feature extraction process, enabling the network to dynamically adjust the visual feature expression according to different denoising stages, thereby improving the denoising guidance capability of diffusion-based camouflage target detection.
[0043] The adaptive multi-scale feature fusion mechanism proposed in this invention can simultaneously utilize spatial details, deep semantics, and localization cues. The receptive field enhancement module can extract contextual information at different scales, the cross-scale fusion module can integrate multi-layer features, and the gated cross-attention module can adaptively filter effective information, thereby improving the ability to distinguish camouflaged targets in complex backgrounds.
[0044] This invention effectively improves the problems of boundary ambiguity, target under-detection, and background false detection in camouflaged target detection. By jointly guiding spatial detail features, semantic features, and localization features, the final predicted mask has better structural integrity and boundary accuracy.
[0045] This invention achieves superior detection performance compared to many existing methods on publicly available camouflaged target detection datasets such as CAMO, COD10K, and NC4K. For example, the MAE can reach approximately 0.027 on the NC4K dataset, indicating that this invention has good detection accuracy and generalization ability.
[0046] The technical solution of this invention is not only applicable to camouflaged target detection, but can also be extended to other image segmentation tasks that require high-precision mask prediction and involve multi-step iterative redundant calculations, such as medical image segmentation, weak boundary target detection, transparent target detection, defect detection, etc. Attached Figure Description
[0047] Figure 1 This is the schematic diagram of the workflow of a camouflaged target detection method based on a cache reuse diffusion network according to the present invention;
[0048] In the picture:
[0049] THVT stands for Hourglass Time-Aware Visual Encoding Module;
[0050] AMFF stands for Adaptive Multi-Scale Feature Fusion Module;
[0051] DN stands for Denoising Network;
[0052] Indicates; the forward propagation process;
[0053] Indicates; the forward propagation process;
[0054] Represents an RGB image;
[0055] This represents the image during the denoising process at step t;
[0056] This represents the image during the denoising process at step t-1.
[0057] Represents the original image;
[0058] This represents the image during the denoising process at step T.
[0059] This represents the predicted original image obtained after T-step denoising.
[0060] Represents the MSE loss function;
[0061] This represents the IOU loss function.
[0062] Figure 2 This is a structural diagram of the cache reuse diffusion network of the present invention;
[0063] In the picture:
[0064] THVT stands for Hourglass Time-Aware Visual Encoding Module;
[0065] AMFF stands for Adaptive Multi-Scale Feature Fusion Module;
[0066] DN stands for Denoising Network;
[0067] ViT layers 1-5 correspond to layers 1 to 5 of the hourglass-shaped time-aware visual coding module;
[0068] F1, F2, F3, F4, and F5 represent the multi-scale features output from layers 1 to 5 of the hourglass-shaped time-aware visual coding module.
[0069] RFM represents the convolutional branch of the receptive field enhancement module;
[0070] R1, R2, R3, R4, and R5 represent the enhanced features after RFM processing;
[0071] CFM stands for the fusion unit of the cross-scale fusion module;
[0072] GCAM stands for Gated Cross-Attention Module;
[0073] CBR represents a feature processing unit consisting of convolution, batch normalization, and ReLU activation functions;
[0074] C represents the feature concatenation / feature splicing operation;
[0075] Representing spatial details;
[0076] Represents semantic features;
[0077] Indicates conditional features;
[0078] This represents the image / result of the denoising process at step t;
[0079] This represents the image / result of the denoising process in step t-1;
[0080] Indicates the original image / final result;
[0081] This represents the original image predicted by the current denoising step;
[0082] This represents the input RGB image;
[0083] RGB represents the input red, green, and blue three-channel image;
[0084] The noise map represents a noisy image during the diffusion process;
[0085] An encoder represents the network structure in a denoising network that encodes the input features;
[0086] The decoder represents the network structure in the denoising network that decodes the encoded features and generates the prediction results;
[0087] Skip connections represent feature connections across layers;
[0088] Temporal step fusion representation is the process of incorporating diffuse temporal step information into feature representation;
[0089] Pixel rearrangement refers to the operation of rearranging the feature map at the pixel level;
[0090] The t-1th iteration represents the iterative process of gradually denoising from the t-th step to the 1st step.
[0091] Figure 3 This is a schematic diagram of the receptive field enhancement module of the present invention;
[0092] In the picture:
[0093] d represents the expansion rate.
[0094] Figure 4 This is a schematic diagram of the structure of a gated cross-attention module according to the present invention;
[0095] In the picture:
[0096] Gating mechanisms for representing branches of spatial detail features;
[0097] Gating mechanisms for representing semantic feature branches;
[0098] Indicates location-related features;
[0099] Representing spatial details;
[0100] Represents semantic features;
[0101] Queries that represent spatial details;
[0102] Values representing spatial detail features;
[0103] Keys representing spatial details;
[0104] Queries that represent semantic features;
[0105] The value represents the semantic feature;
[0106] Keys representing semantic features;
[0107] The output projection matrix represents the spatial detail features.
[0108] The output projection matrix represents the semantic features.
[0109] Figure 5 This is a flowchart of a layer-level cache reuse mechanism according to the present invention;
[0110] In the picture:
[0111] L1-L5 represent layers 1 to 5 of the hourglass-shaped time-aware visual coding module.
[0112] Figure 6 This is a flowchart of a block-level cache reuse mechanism according to the present invention;
[0113] In the picture:
[0114] This represents the feature after processing by the k-th block in one of the layers of the hourglass-type time-aware visual coding module. Detailed Implementation
[0115] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0116] In the description of this invention, the terms "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," and "bottom," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and do not require the invention to be constructed and operated in a specific orientation; therefore, they should not be construed as limitations on the invention. The terms "connected" and "linked" used in this invention should be interpreted broadly. For example, they can refer to a fixed connection or a detachable connection; a direct connection or an indirect connection through intermediate components; or an electrical connection or signal transmission. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0117] The Chinese definitions of the following English words, phrases, and abbreviations are as follows:
[0118] RGB: A three-channel image consisting of red, green, and blue colors;
[0119] CD-Net: The camouflage target detection network proposed in this paper;
[0120] token: word element;
[0121] Transformer: A deep learning model / architecture based on self-attention mechanism;
[0122] adaptive: adaptable;
[0123] multi-scale: (This likely refers to a scale or scale of operations)
[0124] feature: characteristic;
[0125] fusion: integration;
[0126] RFM: Receptive Field Enhancement Module;
[0127] CFM: Cross-scale fusion module;
[0128] GCAM: Cross-attention module of gating mechanism;
[0129] ReLU: an activation function;
[0130] IoU: Interaction ratio;
[0131] Fcon: Conditional feature;
[0132] Sigmoid: an activation function;
[0133] CAMO: Camouflaged Target Detection Dataset;
[0134] COD10K: A large-scale dataset for detecting camouflaged targets;
[0135] NC4K: Camouflaged Target Detection Dataset;
[0136] MAE: Mean Absolute Error.
[0137] Please see Figures 1 to 6 A camouflaged target detection system based on a cache reuse diffusion network is proposed. The system includes: a cache reuse control module, an hourglass-shaped time-aware visual encoding module, an adaptive multi-scale feature fusion module, and a denoising network.
[0138] The hourglass-shaped time-aware visual coding module includes multiple sequentially connected visual Transformer encoders; it is used to map discrete time steps into time series, and integrate time series information into RGB images and noise masks through a self-attention mechanism, and extract features through the visual Transformer encoders.
[0139] The cache reuse control module, which is connected to the hourglass-type time-aware visual encoding module, is used to determine whether to perform a complete calculation based on the current time step and refresh interval, and to control the hourglass-type time-aware visual encoding module to perform writing, reading and reuse of shallow feature residual increments.
[0140] The adaptive multi-scale feature fusion module is used to enhance the features extracted by the hourglass-shaped time-aware visual coding module, and obtain three types of information: spatial detail information based on shallow features, global semantic information based on deep features, and positional cue information. These three types of information are then fused to obtain conditional guided features for guiding the denoising network.
[0141] The denoising network consists of an encoder and a decoder. The encoder extracts noisy mask features through convolutional downsampling and enhances temporal awareness by combining temporal embedding. The decoder fuses the noisy mask features extracted by the encoder with the conditionally guided features obtained by the adaptive multi-scale feature fusion module, and performs channel compression and stepwise upsampling on the fused features to restore spatial resolution and output the denoised features of the final mask prediction.
[0142] The hourglass-shaped time-aware visual encoding module features an hourglass-shaped symmetrical encoding and decoding structure plus time-aware embedding. It first downsamples and compresses temporal visual information, then upsamples to restore the scale, and bidirectionally fuses temporal dynamics and spatial visual information to complete multi-scale feature layered output.
[0143] In the hourglass-shaped time-aware visual coding module, the output features gradually deepen from both sides towards the center layer of the hourglass bottleneck, with the features output from each outer layer being relatively shallower than the features output from its inner layers. The features output from the high-resolution stages on both sides are shallower than those from the center layer of the hourglass bottleneck.
[0144] Using a specific layer and its symmetrical layers in an hourglass-shaped symmetric encoding / decoding structure as the dividing line, the features output by each layer are divided into: shallow features and deep features.
[0145] Shallow features: hourglass-shaped time perception, feature representation of the high-resolution stages on both sides of the visual coding module, and the output level is the early downsampling layer and high-resolution branch output of the encoder.
[0146] The features of shallow features are: fine-grained spatial texture: edges, contours, colors, and local pixel details; short-term instantaneous temporal changes: small inter-frame displacements and local motion micro-movements; high resolution, low semantics, and strong details.
[0147] Shallow features are used to accurately locate visual targets, capture short-term dynamic changes, and preserve original visual details, and are used for detection, localization, and fine-grained temporal matching.
[0148] Deep features: Features output from the intermediate low-resolution stage in the hourglass-shaped time-aware visual coding module are used to characterize the high-level semantics and global contextual information of the target.
[0149] The output layers of deep features are the hourglass bottleneck center layer and the deepest compression layer of the encoder.
[0150] The features of deep features are: global high-level semantics: object category, scene structure, behavioral intent; long-range temporal dependence: cross-frame long temporal logic, overall motion trend, temporal context association; low-resolution, strong abstraction, and globally aggregated temporal information.
[0151] Deep features are used to understand the semantics of the overall scene, model long-term behavioral patterns, perform global feature classification / temporal reasoning, and recognize behavior. They represent the local texture, edge, and spatial details of the target.
[0152] Hourglass module feature fusion process:
[0153] Downsampling: Extract shallow spatial detail features from the original image and gradually compress and aggregate them into deep temporal semantic features;
[0154] Bottleneck: Embedding time-aware coding to enhance inter-frame temporal correlation;
[0155] Upsampling: Deep features are restored upwards and fused with shallow features via skip connections;
[0156] Final output: Separate shallow feature map and deep temporal feature vector / feature map results.
[0157] Preferably, the adaptive multi-scale feature fusion module may include a receptive field enhancement module, a cross-scale fusion module, and a gated cross-attention module; the hourglass-shaped time-aware visual encoding module contains multiple sequentially connected visual Transformer encoders, each of which can output features, and the output features of each visual Transformer encoder are called first-level features. The hourglass-shaped time-aware visual encoding module can output multi-level features to the receptive field enhancement module, which can set convolutional branches of different sizes corresponding to the multi-level features, with each convolutional branch corresponding to the input first-level feature; the receptive field enhancement module obtains contextual information under different receptive fields and enhances the difference expression between the camouflaged target and the background; the features processed by the convolutional branches are called enhanced features.
[0158] The cross-scale fusion module is used to perform preliminary cross-scale fusion on features of different scales after convolutional branch enhancement, which can obtain spatial detail features, semantic features, and intermediate layer features for localization. The cross-scale fusion module includes multiple fusion units, which correspond to the enhanced features of the input shallow features.
[0159] The gated cross-attention module performs bidirectional cross-attention fusion of spatial detail features and semantic features, and adaptively controls the information flow through a gating mechanism. Finally, it is fused with positional cue information through convolution after concatenation. The gated cross-attention module takes deep feature enhancements as input.
[0160] Please see Figure 2 The hourglass-shaped time-aware visual coding module consists of five sequentially connected visual Transformer encoders. Each visual Transformer encoder outputs a feature, and the output feature of each visual Transformer encoder is called a level feature, namely F1, F2, F3, F4, and F5.
[0161] The hourglass-shaped time-aware visual encoding module outputs five levels of features to the receptive field enhancement module. The receptive field enhancement module sets five convolutional branches of different sizes corresponding to the five levels of features. Each convolutional branch corresponds to one level of input features, and the five convolutional branches of different sizes correspond to five output features, namely R1, R2, R3, R4, and R5. R1, R2, R3, R4, and R5 represent the enhanced features after RFM processing. Using the second and fourth layers as a dividing line, F1, F2, F4, and F5 are called shallow features, and F3 is called a deep feature. The enhanced features R1, R2, R4, and R5 of the shallow features are input to the fusion units of the cross-scale fusion module. After fusion by the cross-scale fusion module, spatial detail features are obtained. semantic features And intermediate layer features used for positioning.
[0162] The enhanced feature R3 of the deep features is used as a localization cue feature. The corresponding input is fed into the gated cross-attention module, which then processes the spatial detail features. and semantic features Bidirectional cross-attention fusion is performed, and the gated cross-attention module adaptively controls the information flow through a gating mechanism.
[0163] Gating mechanism through spatial detail feature branches The output weights of spatial detail features are controlled through a gating mechanism in the semantic feature branch. The output weights of semantic features are controlled. Differentiated weighted enhanced fusion features and conditionally guided features are obtained. The conditional features output by the gated cross-attention module are used as the conditionally guided features of the denoising network.
[0164] The denoising network takes input condition-guided features and noisy images as input, predicts the clean mask corresponding to the current time step, calculates the mask of the previous time step, and obtains the final camouflaged target detection result through multiple iterations.
[0165] Preferably, each convolutional branch may include a 1×1 convolutional unit, an asymmetric convolutional unit, and a dilated convolutional unit connected in sequence; the 1×1 convolutional unit is used for channel alignment and lightweight mapping; the asymmetric convolutional unit and the dilated convolutional unit are used to expand the receptive field and capture different ranges of context.
[0166] Preferably, the cross-scale fusion module can upsample, downsample, stitch together, or fuse the enhanced multi-scale features to generate three types of complementary features: the first type is spatial detail features, which are used to preserve the boundaries of the camouflaged target and local texture differences; the second type is semantic features, which are used to express the overall structure of the target and category-independent semantics; and the third type is localization features, which are used to provide the target's location range and regional constraints.
[0167] Preferably, the gated cross-attention module can map spatial detail features and semantic features to queries, keys, and values respectively, and perform bidirectional interaction through linear attention; it can reduce the attention complexity to a linear level by using kernel function mapping; at the same time, it generates corresponding attention head-level gating weights for spatial detail features and semantic features respectively, and obtains adaptive control coefficients through sigmoid activation to enhance the information of the effective camouflage region and suppress background noise. It concatenates the spatial detail features, semantic features, and upsampled localization features enhanced by gated cross-attention, and generates conditionally guided features through convolution, batch normalization, and ReLU activation.
[0168] Preferably, the hourglass-shaped time-aware visual encoding module may include multiple visual Transformer encoders with time-step perception functions of diffusion model connected in sequence. Each visual Transformer encoder can output feature maps of different scales. The visual Transformer encoder located in the middle position forms a semantic bottleneck to extract high-level semantic information. The visual Transformer encoders that follow can gradually recover higher resolution features to preserve spatial details and target boundary information.
[0169] This invention also provides a method for detecting camouflaged targets based on a cache-reuse-diffusion network, utilizing the aforementioned cache-reuse-diffusion network-based camouflaged target detection system. This method includes the following steps:
[0170] Acquire the RGB image to be detected; during the training phase, obtain the corresponding binary labeled mask of the disguised target, and gradually add Gaussian noise to the mask of the disguised target to obtain the noisy mask at different time steps;
[0171] The following methodological steps are performed during both the training and inference sampling phases:
[0172] The RGB image, the noise mask of the current time step, and the time step information are input into the hourglass-shaped time-aware visual coding module. The visual Transformer encoder first maps the discrete time steps into continuous time series codes and injects the time series codes into the visual token sequence. Then, multi-scale features are extracted and feature maps with different spatial resolutions are output.
[0173] Feature maps with different spatial resolutions are input into the adaptive multi-scale feature fusion module. The adaptive multi-scale feature fusion module dynamically generates pixel-level adaptive weights based on the spatial detail information of shallow features and the global semantic and positional cue information of deep features, and fuses features of different scales to obtain differentiated weighted enhanced fusion features and condition-guided features.
[0174] The denoising network takes input condition-guided features and noisy images as input, predicts the clean mask corresponding to the current time step, calculates the mask of the previous time step, and obtains the final camouflaged target detection result through multiple iterations.
[0175] During the inference sampling phase, the hourglass-type time-aware visual coding module employs the following shallow feature cache reuse strategy: alternating between the full computation phase and the cache reuse phase within a set refresh interval; specifically, during the full computation phase, each visual Transformer encoder in the hourglass-type time-aware visual coding module performs normal computation and caches the residual incremental features of the shallow high-resolution layers; during the cache reuse phase, for shallow feature layers, higher computational operations are skipped, and the most recently cached residual increments are directly reused; for mid-to-deep feature layers, full computation is still maintained.
[0176] Preferably, the adaptive multi-scale feature fusion module may include a receptive field enhancement module, a cross-scale fusion module, and a gated cross-attention module connected in sequence; wherein:
[0177] The receptive field enhancement module can contain multiple convolutional branches with different receptive fields to obtain contextual information under different receptive fields and enhance the expression of differences between camouflaged targets and the background;
[0178] The cross-scale fusion module is used to perform preliminary cross-scale fusion on features of different scales after convolutional branch enhancement, to obtain spatial detail features, semantic features, and intermediate layer features for localization.
[0179] The gated cross-attention module performs bidirectional cross-attention fusion of spatial detail features and semantic features, and adaptively controls the information flow through a gating mechanism. This module uses linear attention to reduce computational complexity, while highlighting effective camouflage regions and suppressing irrelevant background noise according to the gating weights. Subsequently, the spatial detail features, semantic features and upsampled localization features are concatenated, and a unified conditional guided feature is generated through convolution, normalization and activation operations.
[0180] Preferably, during the training phase, the training image and its corresponding camouflaged target binary segmentation mask can be obtained first; let the real mask be x0, and during the forward diffusion process, Gaussian noise is gradually added to x0 according to preset noise scheduling parameters to obtain the noisy mask x at the t-th time step. t Let the total number of time steps be T; noise scheduling adopts linear scheduling or cosine scheduling.
[0181] Subsequently, the original RGB image I and the noise mask x can be... tThe time step t is input to the hourglass-shaped time-aware visual encoding module, where the time encoding module maps the discrete time step t into a continuous vector to obtain a time series. This time series is added as a time token to the visual token sequence and input together with the image feature token into the hourglass-shaped time-aware visual encoding module. The time series is then fused with the image feature token through a self-attention mechanism. In this way, the hourglass-shaped time-aware visual encoding module can perceive whether it is in the early, middle or late stage of diffusion denoising and dynamically adjust the feature extraction according to different time steps.
[0182] During training, a combined loss method, including mean squared error loss and IoU loss, is used for optimization.
[0183] During the inference sampling phase, a random noise mask is first initialized, and then reverse denoising is performed from step T to step 0 according to a preset time step. In each denoising time step, the system predicts and updates based on the input image and the current noise mask.
[0184] The present invention also provides a camouflaged target detection device based on a cached multiplexing diffusion network, comprising a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program and, when executing the computer program, implement the steps of the camouflaged target detection method based on the cached multiplexing diffusion network as described above.
[0185] The structure, workflow, and working principle of the present invention are further illustrated below with reference to preferred embodiments:
[0186] A camouflaged target detection system based on a cache reuse diffusion network, denoted as CD-Net, includes: a cache reuse control module, an hourglass-shaped time-aware visual encoding module, an adaptive multi-scale feature fusion module, and a denoising network;
[0187] The hourglass-shaped time-aware visual coding module includes multiple sequentially connected visual Transformer encoders; it is used to map discrete time steps into time series, and integrate time series information into RGB images and noise masks through a self-attention mechanism, and extract features through the visual Transformer encoders.
[0188] The cache reuse control module, which is connected to the hourglass-type time-aware visual encoding module, is used to determine whether to perform a complete calculation based on the current time step and refresh interval, and to control the hourglass-type time-aware visual encoding module to perform writing, reading and reuse of shallow feature residual increments.
[0189] The adaptive multi-scale feature fusion module is used to enhance the features extracted by the hourglass-shaped time-aware visual coding module, and obtain three types of information: spatial detail information based on shallow features, global semantic information based on deep features, and positional cue information. These three types of information are then fused to obtain conditional guided features for guiding the denoising network.
[0190] The denoising network consists of an encoder and a decoder. The encoder extracts noisy mask features through convolutional downsampling and enhances temporal awareness by combining temporal embedding. The decoder fuses the noisy mask features extracted by the encoder with the conditionally guided features obtained by the adaptive multi-scale feature fusion module, and performs channel compression and stepwise upsampling on the fused features to restore spatial resolution and output the denoised features of the final mask prediction.
[0191] A method for detecting camouflaged targets based on a cached reuse diffusion network, which utilizes the aforementioned cached reuse diffusion network-based camouflaged target detection system, is based on a diffusion probability model. The method uses the camouflaged target segmentation mask as the object of diffusion and reverse denoising. Through a time-aware hourglass-shaped time-aware visual coding module, an adaptive multi-scale feature fusion module, and a shallow feature cache reuse strategy, it achieves high-precision and high-efficiency camouflaged target detection.
[0192] This camouflaged target detection method based on cache reuse diffusion networks includes a training phase and an inference phase.
[0193] The training phase includes the following steps:
[0194] A1. Obtain the RGB image to be detected, and obtain the corresponding binary label mask of the camouflaged target during the training phase.
[0195] During the training phase, the training images and their corresponding binary segmentation masks for camouflaged targets are first obtained. Gaussian noise is then progressively added to the camouflaged target masks to obtain noisy masks at different time steps.
[0196] Let the true mask be x0. During the forward diffusion process, Gaussian noise is gradually added to x0 according to preset noise scheduling parameters to obtain the noisy mask x at the t-th time step. t Noise scheduling parameters can employ linear scheduling, cosine scheduling, or other scheduling methods suitable for diffusion models.
[0197] A2, the RGB image, the noise mask of the current time step, and the time step information are input into the hourglass-shaped time-aware visual coding module. This hourglass-shaped time-aware visual coding module maps discrete time steps to a time series, integrates the time series information into the RGB image and the noise mask through a self-attention mechanism, and extracts features through a visual Transformer encoder;
[0198] Take the original RGB image I and the noise mask x t The time step t is input into the hourglass-shaped time-aware visual encoding module. First, a temporal embedding layer maps the discrete time step t into a continuous vector, yielding a temporal embedding. This temporal embedding is added as a temporal token to the visual token sequence and, along with the image feature token, is input into the multi-head self-attention module and feedforward network within the hourglass-shaped time-aware visual encoding module. In this way, the hourglass-shaped time-aware visual encoding module can perceive whether it is in the early, middle, or late stage of diffusion denoising and dynamically adjust feature extraction according to different time steps.
[0199] The hourglass-shaped time-aware visual encoding module comprises five sequentially connected visual Transformer encoders, forming five consecutive processing stages that output feature maps at different scales. The spatial resolutions of each stage can be H / 4, H / 8, H / 16, H / 8, and H / 4, respectively, where H represents the height of the input image. This hourglass-shaped structure forms a semantic bottleneck in the middle stage, used to extract high-level semantic information; in subsequent stages, it gradually recovers higher-resolution features to preserve spatial details and target boundary information.
[0200] A five-level hourglass-shaped visual Transformer encoder extracts multi-scale features and outputs feature maps with different spatial resolutions. This structure can obtain deep semantic information while preserving shallow spatial details.
[0201] A 3. Input multi-scale features into the adaptive multi-scale feature fusion module AMFF. This module includes the receptive field enhancement module RFM, the cross-scale fusion module CFM, and the gated cross-attention module GCAM.
[0202] The Receptive Field Enhancement Module (RFM) employs a multi-branch structure to process each level of features, including 1×1 convolution branches, asymmetric convolution branches, dilated convolution branches, global average pooling branches, and residual branches, to obtain contextual information under different receptive fields and enhance the expression of subtle differences between camouflaged targets and the background.
[0203] After obtaining multi-scale features, they are input into the receptive field enhancement module RFM. For each level of input features, RFM sets up multiple parallel branches. The first branch uses 1×1 convolutions for channel alignment and lightweight mapping as a residual branch; other branches use asymmetric convolutions and dilated convolutions of different scales to expand the receptive field and capture context of different ranges; a global average pooling branch is also set up to obtain global semantic information. The outputs of each branch are concatenated along the channel dimension and then fused by convolution to generate enhanced features.
[0204] The cross-scale fusion module (CFM) performs initial fusion of the enhanced multi-level features, forming features that emphasize spatial details, features that emphasize semantic expression, and intermediate layer features for localization.
[0205] The enhanced multi-scale features are further input into the cross-scale fusion module CFM. CFM upsamples, downsamples, concatenates, or fuses features at different levels to generate three types of complementary features: the first type is spatial detail features, which are used to preserve the boundaries of camouflaged targets and local texture differences; the second type is semantic features, which are used to express the overall structure of the target and category-independent semantics; and the third type is localization features, which are used to provide the approximate location of the target and regional constraints.
[0206] The Gated Cross-Attention Module (GCAM) performs bidirectional cross-attention fusion of spatial detail features and semantic features, and adaptively controls the information flow through a gating mechanism. This module utilizes linear attention to reduce computational complexity, while highlighting effective camouflage regions and suppressing irrelevant background noise based on gating weights. Subsequently, the spatial detail features, semantic features, and upsampled localization features are concatenated, and a unified conditional guided feature is generated through convolution, normalization, and activation operations.
[0207] Spatial detail features and semantic features are input into the gated cross-attention module GCAM. GCAM maps spatial detail features and semantic features to queries, keys, and values, respectively; specifically, spatial detail features are mapped to queries, keys, and values, and semantic features are mapped to queries, keys, and values; and bidirectional interaction is achieved through linear attention. To reduce the computational overhead of ordinary attention mechanisms, GCAM utilizes kernel function mapping to reduce attention complexity to a linear level. Simultaneously, GCAM generates gating weights for each branch, obtaining adaptive control coefficients through sigmoid activation, used to enhance information in effective camouflage regions and suppress background noise. Finally, the spatial detail features, semantic features, and upsampled localization features enhanced by gated cross-attention are concatenated, and a conditional guided feature Fcon is generated through convolution, batch normalization, and ReLU activation.
[0208] 4. Input the condition-guided features into the denoising prediction module to predict the clean mask corresponding to the current time step or the mask of the previous time step, and obtain the final camouflaged target detection result through multi-step iteration.
[0209] The denoising prediction module uses the conditionally guided feature Fcon and the current noisy mask x. t Given time step t as input, predict the clean mask x0 or the mask from the previous time step x. t-1 During training, the network can be optimized using a combination of mean squared error loss and IoU loss to make the predicted mask both close to the real mask and maintain good region overlap and boundary structure.
[0210] Reasoning stage:
[0211] Steps A1-A4 in the training phase also apply to the inference phase, with the difference being:
[0212] Corresponding to step A3, to reduce the computational load during the inference phase, this invention introduces a hierarchical cache reuse strategy in the encoder. Specifically, let the cache refresh interval be I. When the refresh condition is met at the current time step, the network performs complete computation, meaning all layers of the encoder normally perform multi-head self-attention, feedforward network, and residual update, and the residual increments of shallow high-resolution layers are saved as cache. When the refresh condition is not met at the current time step, for shallow feature layers, the network skips some computationally intensive nonlinear mappings, directly reads the most recently cached residual increment, and adds it to the current input features; for mid-to-deep feature layers, the network continues to perform complete computation to ensure dynamic updates of target semantic, structural, and localization information.
[0213] Corresponding to step A4, during the inference phase, the random noise mask x is first initialized. T Then, reverse denoising is performed from T to 0 according to a preset time step. In each denoising time step, the network predicts a clearer target mask based on the input image and the current noise mask, until the final disguised target segmentation result is obtained.
[0214] Working principle of the invention:
[0215] Shallow features mainly contain edge, texture, and local structural information, and their changes are relatively small between adjacent denoising time steps. Mid-to-deep features contain more complex task-related semantics, which have a greater impact on the final camouflaged target segmentation quality and their changes are more significant. Therefore, this invention uses shallow features as cached and reused objects, and concentrates computing resources on updating mid-to-deep features, thereby improving inference efficiency with minimal or even negligible loss of precision.
[0216] The aforementioned hourglass-shaped time-aware visual coding module, adaptive multi-scale feature fusion module, denoising network, cache reuse control module, receptive field enhancement module, cross-scale fusion module, gated cross-attention module, 1×1 convolutional unit, asymmetric convolutional unit, dilated convolutional unit, and global average pooling unit can all adopt applicable functional modules in the prior art, or adopt functional modules in the prior art and construct them using conventional technical means.
[0217] The embodiments described above are only used to illustrate the technical ideas and features of the present invention. Their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The patent scope of the present invention should not be limited by these embodiments. That is, any equivalent changes or modifications made in accordance with the spirit disclosed in the present invention still fall within the patent scope of the present invention.
Claims
1. A camouflage target detection system based on cache- multiplex diffusion network, characterized in that, The system includes: a cache reuse control module, an hourglass-shaped time-aware visual coding module, an adaptive multi-scale feature fusion module, and a denoising network; The hourglass-shaped time-aware visual coding module includes multiple sequentially connected visual Transformer encoders; it is used to map discrete time steps into time series, and integrate time series information into RGB images and noise masks through a self-attention mechanism, and extract features through the visual Transformer encoders. The cache reuse control module, which is connected to the hourglass-type time-aware visual encoding module, is used to determine whether to perform a complete calculation based on the current time step and refresh interval, and to control the hourglass-type time-aware visual encoding module to perform writing, reading and reuse of shallow feature residual increments. The adaptive multi-scale feature fusion module is used to enhance the features extracted by the hourglass-shaped time-aware visual coding module, and obtain three types of information: spatial detail information based on shallow features, global semantic information based on deep features, and positional cue information. These three types of information are then fused to obtain conditional guided features for guiding the denoising network. The denoising network consists of an encoder and a decoder. The encoder extracts noisy mask features through convolutional downsampling and enhances temporal awareness by combining temporal embedding. The decoder fuses the noisy mask features extracted by the encoder with the conditionally guided features obtained by the adaptive multi-scale feature fusion module, and performs channel compression and stepwise upsampling on the fused features to restore spatial resolution and output the denoised features of the final mask prediction.
2. The camouflaged target detection system based on a cache reuse diffusion network according to claim 1, characterized in that, The adaptive multi-scale feature fusion module includes a receptive field enhancement module, a cross-scale fusion module, and a gated cross-attention module; the hourglass-shaped time-aware visual coding module outputs multi-level features to the receptive field enhancement module, and the receptive field enhancement module sets convolutional branches of different sizes for the multi-level features, with each convolutional branch corresponding to a first-level input feature; The receptive field enhancement module obtains contextual information under different receptive fields and enhances the difference expression between the camouflaged target and the background; the cross-scale fusion module is used to perform preliminary cross-scale fusion of features of different scales after convolutional branch enhancement to obtain spatial detail features, semantic features, and intermediate layer features for localization; the gated cross-attention module is used to perform bidirectional cross-attention fusion of spatial detail features and semantic features, and adaptively controls the information flow through a gating mechanism, and finally fuses with the location cue information through convolution after concatenation.
3. The camouflaged target detection system based on a cache reuse diffusion network according to claim 2, characterized in that, Each convolutional branch consists of a series of 1×1 convolutional units, asymmetric convolutional units, and dilated convolutional units; the 1×1 convolutional units are used for channel alignment and lightweight mapping; the asymmetric and dilated convolutional units are used to expand the receptive field and capture different ranges of context.
4. The camouflaged target detection system based on a cache reuse diffusion network according to claim 2, characterized in that, The cross-scale fusion module upsamples, downsamples, splices, or fuses the enhanced multi-scale features to generate three types of complementary features: the first type is spatial detail features, which are used to preserve the boundaries of the camouflaged target and local texture differences; the second type is semantic features, which are used to express the overall structure of the target and category-independent semantics; and the third type is localization features, which are used to provide the target's location range and regional constraints.
5. The camouflaged target detection system based on a cache reuse diffusion network according to claim 4, characterized in that, The gated cross-attention module maps spatial detail features and semantic features to queries, keys, and values, respectively, and performs bidirectional interaction through linear attention. It reduces the attention complexity to a linear level by using kernel function mapping. At the same time, it generates corresponding attention head-level gating weights for spatial detail features and semantic features, and obtains adaptive control coefficients through sigmoid activation to enhance the information of the effective camouflage region and suppress background noise. It concatenates the spatial detail features, semantic features, and upsampled localization features enhanced by gated cross-attention, and generates conditional guided features through convolution, batch normalization, and ReLU activation.
6. The camouflaged target detection system based on a cache reuse diffusion network according to claim 1, characterized in that, The hourglass-shaped time-aware visual encoding module includes multiple visual Transformer encoders with time-step perception functions of diffusion model connected in sequence. Each visual Transformer encoder outputs feature maps of different scales. The visual Transformer encoder located in the middle position forms a semantic bottleneck to extract high-level semantic information. The subsequent visual Transformer encoders gradually recover higher-resolution features to preserve spatial details and target boundary information.
7. A method for detecting camouflaged targets based on a cache-reuse-diffusion network using the camouflaged target detection system based on a cache-reuse-diffusion network as described in claim 1, characterized in that, This method includes the following steps: Acquire the RGB image to be detected; during the training phase, obtain the corresponding binary labeled mask of the disguised target, and gradually add Gaussian noise to the mask of the disguised target to obtain the noisy mask at different time steps; The following methodological steps are performed during both the training and inference sampling phases: The RGB image, the noise mask of the current time step, and the time step information are input into the hourglass-shaped time-aware visual coding module. The visual Transformer encoder first maps the discrete time steps into continuous time series codes and injects the time series codes into the visual token sequence. Then, multi-scale features are extracted and feature maps with different spatial resolutions are output. Input feature maps with different spatial resolutions into the adaptive multi-scale feature fusion module; The adaptive multi-scale feature fusion module dynamically generates pixel-level adaptive weights based on the spatial detail information of shallow features and the global semantic and positional cue information of deep features, and fuses features at different scales to obtain differentiated weighted enhanced fusion features and condition-guided features. The denoising network takes input condition-guided features and noisy images as input, predicts the clean mask corresponding to the current time step, calculates the mask of the previous time step, and obtains the final camouflaged target detection result through multiple iterations. During the inference sampling phase, the hourglass-type time-aware visual coding module adopts the following shallow feature caching and reuse strategy: the full calculation phase and the cache reuse phase are executed alternately within the set refresh interval; in the full calculation phase, each visual Transformer encoder in the hourglass-type time-aware visual coding module performs normal calculation and caches the residual incremental features of the shallow high-resolution layer. During the cache reuse phase, for shallow feature layers, operations with higher computational complexity are skipped, and the residual increment of the most recent cache is reused directly; for medium and deep feature layers, the complete computation is still maintained.
8. The camouflaged target detection method based on a cache reuse diffusion network according to claim 7, characterized in that, Within the adaptive multi-scale feature fusion module, a receptive field enhancement module, a cross-scale fusion module, and a gated cross-attention module are sequentially connected; wherein: The receptive field enhancement module contains multiple convolutional branches with different receptive fields to obtain contextual information under different receptive fields and enhance the differential representation between the camouflaged target and the background; The cross-scale fusion module is used to perform preliminary cross-scale fusion on features of different scales after convolutional branch enhancement, to obtain spatial detail features, semantic features, and intermediate layer features for localization. The gated cross-attention module performs bidirectional cross-attention fusion of spatial detail features and semantic features, and adaptively controls the information flow through a gating mechanism. This module uses linear attention to reduce computational complexity, while highlighting effective camouflage regions and suppressing irrelevant background noise according to the gating weights. Subsequently, the spatial detail features, semantic features and upsampled localization features are concatenated, and a unified conditional guided feature is generated through convolution, normalization and activation operations.
9. The camouflaged target detection method based on a cache reuse diffusion network according to claim 7, characterized in that, In the training stage, first, a training image and a corresponding camouflage target binary segmentation mask are obtained; let the real mask be x0, in the diffusion forward process, Gaussian noise is gradually added to x0 according to a preset noise scheduling parameter, and a noisy mask x at the t th time step is obtained t ; let the total number of time steps be T; Noise scheduling can employ either linear or cosine scheduling methods. Subsequently, the original RGB image I, the noise-added mask x t and a time step t input a sandglass-shaped time-aware visual encoding module, wherein the time encoding module maps the discrete time step t into a continuous vector to obtain a time sequence; the time sequence is added to the visual token sequence as a time token and input into the sandglass-shaped time-aware visual encoding module together with the image feature token and fused through a self-attention mechanism and the image feature token; in this way, the sandglass-shaped time-aware visual encoding module perceives that the current is in the early, middle or late stage of diffusion denoising and dynamically adjusts feature extraction according to different time steps; During training, a combined loss method, including mean squared error loss and IoU loss, is used for optimization. During the inference sampling phase, a random noise mask is first initialized, and then reverse denoising is performed from step T to step 0 according to a preset time step. In each denoising time step, the system predicts and updates based on the input image and the current noise mask.
10. A camouflaged target detection device based on a cache reuse diffusion network, comprising a memory and a processor, characterized in that, The memory is used to store a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the steps of the camouflaged target detection method based on a cached multiplexing diffusion network as described in any one of claims 7 to 9.