Camouflage object detection refinement method based on uncertainty mask Bernoulli diffusion model

By introducing the Bernoulli diffusion model of uncertainty mask in camouflaged object detection, using HUQNet to generate uncertainty mask and modulating the noise injection area, the problem of insufficient segmentation in existing methods when dealing with camouflaged object detection is solved and a more accurate segmentation effect is achieved.

CN120673385APending Publication Date: 2025-09-19TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510778278.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing camouflaged object detection methods have shortcomings in processing large-scale blurred edges, recovering detailed structures, and correcting false positives and false negatives. In particular, when the foreground and background are highly similar, the segmentation results are overly smoothed and the boundaries are inaccurate.

Method used

The uncertainty mask-based Bernoulli diffusion model is adopted. The uncertainty mask is generated by the Hybrid Uncertainty Quantization Network (HUQNet), the noise injection area is modulated, and the segmentation result is refined using the iterative denoising process of the Bernoulli diffusion model.

Benefits of technology

The segmentation quality of the camouflaged object detection task is significantly improved, which can effectively refine fuzzy edges, restore detailed structures, reduce false positives and false negatives, and improve the accuracy and consistency of the segmentation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673385A_ABST
    Figure CN120673385A_ABST
Patent Text Reader

Abstract

The invention discloses a camouflage object detection refining method based on an uncertainty mask Bernoulli diffusion model. The camouflage object detection refining method comprises the following steps: firstly, generating an initial segmentation mask by using a pre-training model; analyzing the image and the initial mask through a hybrid uncertainty quantization network (HUQNet), and generating a spatial uncertainty mask for identifying a residual region; taking the initial mask as a Bernoulli distribution mean value, modulating noise injection in combination with an uncertain mask, iteratively denoising through a Bernoulli diffusion model, and correcting a residual region in a targeted manner; and finally, fusing the refining result and the initial mask to determine an area, and outputting a final segmentation mask. The problems of large-range fuzzy edge, detail loss and false positive / negative correction existing in camouflage object detection in the prior art are solved. The camouflage object detection refinement device provided by the invention has wide application potential in multiple fields by improving the capability of accurately segmenting an object highly fused with the environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a camouflaged object detection technology, and in particular to a camouflaged object detection refinement method based on an uncertainty mask Bernoulli diffusion model. Background Art

[0002] Camouflaged object detection (COD) aims to segment objects that seamlessly blend into their surroundings. This is a challenging task due to the minimal visual differences and high inherent similarity between the object and the background. In recent years, camouflaged object detection has garnered increasing attention and rapid development due to its potential in diverse application scenarios, including biodiversity monitoring, medical image analysis, and industrial defect detection.

[0003] Traditional methods that rely on hand-crafted models and artificially extracted features often struggle to achieve effective segmentation when dealing with complex scenes of camouflaged objects. Thanks to the rapid advancements in deep learning, a large number of representative methods based on convolutional neural networks (CNNs) and Transformers have made significant progress. Most of these methods adopt a discriminative encoder-decoder architecture and employ various carefully designed modules and strategies to combat camouflage, such as enhancing edge information, performing iterative refinement, or leveraging multimodal information. Despite the considerable success of this paradigm, these discriminative methods often lead to overly smoothed segmentation results and inaccurate boundaries. Recently, generative diffusion models, which explicitly model the data distribution, have emerged as a promising alternative. They perform segmentation from the perspective of data generation, have the potential to address the above limitations and demonstrate superior performance.

[0004] Although existing methods have advanced the field of disguised object detection, the inherent difficulty of the task means that there is still significant room for improvement, especially in the refinement of large-scale blurred edges, the recovery of detailed structures, and the correction of significant false positives and false negatives (see Figure 1 ). Existing refiners are mainly limited to traditional segmentation tasks (such as semantic segmentation). The initial coarse segmentation mask that needs to be post-processed is usually basically intact, and the refiner is limited to making minor adjustments. Therefore, when these methods are applied to the task of camouflaged object detection, they cannot meet the aforementioned high-difficulty and large-scale refinement requirements. More importantly, their model design shows insufficient discrimination ability when dealing with high similarity between foreground and background, resulting in incorrect modification of correct areas and even reducing the quality of the initial segmentation results. Currently, this field lacks a segmentation refiner specifically for post-processing the prediction results of existing camouflaged object detection models.

[0005] The main problems of the existing technology are:

[0006] (1) Existing camouflaged object detection methods still have huge room for post-processing improvement in dealing with inherent difficulties (such as refinement of large-scale blurred edges, recovery of detailed structures, and reduction of significant false positives and false negatives).

[0007] (2) Existing segmentation refiners are mainly designed for traditional tasks (such as semantic segmentation). Their initial segmentation masks are usually well-defined, resulting in limited refinement capabilities. They cannot meet the requirements of camouflaged object detection tasks for key refinements (such as handling the high similarity between foreground and background, avoiding incorrect modification of correct areas, and preventing the degradation of initial segmentation quality).

[0008] (3) Currently, the field of camouflaged object detection lacks an effective segmentation refiner for post-processing the prediction results of existing models.

[0009] Segmentation refinement techniques: Segmentation refinement aims to improve the quality of masks output by existing models. This is particularly true for the camouflaged object detection task, where there is significant room for improvement due to its inherent segmentation difficulty. However, directly applying existing refiners to camouflaged object detection can actually lead to a decrease in segmentation quality, highlighting the lack of effective post-processing segmentation refiners in this area. Early research focused on developing refiners for specific models. For example, the PointRend method utilizes a multi-layer perceptron (MLP) to relabel low-confidence prediction regions. The MaskTransfiner method uses a fully convolutional network (FCN) module to detect inconsistencies in segmentation results and refines the labels using a Transformer-based approach. Other research focuses on general refinement techniques. For example, the SAMRefiner method proposes a multi-hint mining strategy to extract diverse input cues from the initial segmentation mask. These cues work in conjunction with the SAM model to achieve refinement. Notably, emerging methods have demonstrated the effectiveness of Bernoulli diffusion models for segmentation refinement. The SegRefiner method explored the direct application of the Bernoulli diffusion model to segmentation refinement, but it only leveraged the initial segmentation mask and failed to fully utilize the prior knowledge of the segmentation model. The HiDiff method introduced an optimized Bernoulli diffusion process for medical image segmentation. However, in challenging scenarios (such as camouflaged object detection), noise injection during the diffusion process can confuse well-segmented regions with uncertain regions, ultimately resulting in incomplete noise removal.

[0010] Uncertainty estimation techniques: Uncertainty represents the degree to which the model does not know its predictions. Intuitively, uncertainty masks highlight areas where the prior segmenter has difficulty processing and where focused refinement attention is required. In theory, there are two main types of uncertainty: epistemic uncertainty (model bias) and aleatoric uncertainty (data bias). Current uncertainty estimation methods mainly follow two paradigms: Bayesian neural networks that learn distributions, or simple fully convolutional discriminators. These methods usually integrate uncertainty perception as an auxiliary component or use it to enhance the interpretability of the results, and therefore usually only require coarse-grained estimates.

[0011] Disguised object detection related technologies: Early progress in the field of disguised object detection mainly relied on Based on the architecture of convolutional neural networks (CNNs). For example, SINet established a strong baseline through a concise and effective search-recognition framework, utilizing multi-level feature extraction to handle the intrinsic similarity between camouflaged objects and backgrounds. FEDER introduced a learnable wavelet-based feature decomposition and edge reconstruction module to explicitly handle fuzzy boundaries through frequency attention and auxiliary edge-guided refinement. Although CNN performs well in local feature modeling, its limited global context perception capability has given rise to Transformer-based methods. For example, FSPNet enhances locality modeling through non-local token interactions and aggregates multi-scale features through a contracting pyramid decoder to effectively capture subtle clues from indistinguishable backgrounds.

[0012] It should be noted that the information disclosed in the above background technology section is only used to understand the background of this application, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention

[0013] The main purpose of the present invention is to overcome the defects existing in the above-mentioned background technology and provide a camouflaged object detection refinement method based on the uncertainty mask Bernoulli diffusion model.

[0014] To achieve the above object, the present invention adopts the following technical solutions:

[0015] A camouflaged object detection refinement method based on an uncertainty mask Bernoulli diffusion model includes the following steps:

[0016] S1. Initial segmentation mask generation: Use the pre-trained camouflaged object detection model to process the input image and generate an initial segmentation mask;

[0017] S2. Uncertainty Mask Estimation: Analyze the input image and the initial segmentation mask using a Hybrid Uncertainty Quantization Network (HUQNet) to generate a spatial uncertainty mask to identify the residual regions that need to be refined.

[0018] S3. Uncertainty-guided Bernoulli diffusion refinement: Using the initial segmentation mask as the mean of the Bernoulli distribution, the uncertainty mask is combined to modulate the noise injection area; an iterative denoising process is performed using the Bernoulli diffusion model, and targeted corrections are made to the residual area under the guidance of the uncertainty mask to generate a refined segmentation mask;

[0019] S4. Residual fusion output: Fuse the diffusion refinement result with the determined area in the initial segmentation mask and output the final segmentation mask.

[0020] Furthermore, in step S3:

[0021] The forward process of the Bernoulli diffusion model is as follows: spatially modulating the true mask and the initial segmentation mask based on the uncertainty mask to generate a latent variable sequence that obeys the Bernoulli distribution;

[0022] The backward process is as follows: starting from the initial segmentation mask, the denoiser is used to iteratively predict the residual noise, and the data distribution of the residual region is gradually restored.

[0023] Furthermore, the forward process specifically includes:

[0024] Use the uncertainty mask to perform element-by-element multiplication of the true mask and the initial segmentation mask to generate the modulated target mask and the initial mask;

[0025] A forward diffusion chain from the modulated target mask to the modulated initial mask is constructed, where the latent variable sampling at each time step follows a Bernoulli distribution, whose mean parameter is the time-varying weighted interpolation of the true mask and the initial segmentation mask in the uncertainty region.

[0026] Furthermore, the backward process specifically includes:

[0027] Sampling the initial latent variables from a Bernoulli distribution with the initial segmentation mask as its mean;

[0028] At each iteration, the denoiser is used to combine time step information and multi-level features of the prior model to predict the residual noise of the current latent variable.

[0029] The latent variables are updated through denoising prediction, and the segmentation results of the residual area are gradually corrected.

[0030] Furthermore, step S3 further includes:

[0031] Feature Adaptive Fusion: The multi-level features of the prior segmentation model encoder are fused with the corresponding features of the diffusion denoiser. During fusion, the prior feature scale is adjusted through the residual block, and the time step embedding information of the diffusion process is injected.

[0032] Furthermore, the HUQNet in step S2 includes:

[0033] Bayesian neural network branch: Generates a global uncertainty estimation map through probability sampling;

[0034] Discriminative network branch: The residual attention module fuses multi-source uncertainty clues, including entropy maps and Bayesian branch outputs, to generate a local refined uncertainty map;

[0035] Cross-attention fusion module: Integrates the dual-branch outputs to generate the final uncertainty mask.

[0036] Furthermore, the operation of the Bayesian neural network branch includes:

[0037] Perform parallel mean projection and variance projection on the backbone features;

[0038] Calculate pixel-level variance through multiple Monte Carlo sampling;

[0039] Normalize the variance map to generate the uncertainty mask.

[0040] Furthermore, the operation of the residual attention module includes:

[0041] Concatenate the initial segmentation mask, entropy map, and uncertainty map of the Bayesian branch to form a multi-source input;

[0042] Generate spatial attention maps through convolutional blocks;

[0043] The attention map is used to weight the input features of each level of the decoder to suppress the activation intensity of the determined area.

[0044] Furthermore, in step S3:

[0045] The DDIM acceleration strategy is adopted to reduce the number of diffusion sampling steps, and the correct areas in the initial segmentation mask are retained through the residual modeling mechanism, achieving efficient refinement within 3-10 steps.

[0046] A computer program product includes a computer program. When the computer program is executed by a processor, the computer program implements the method for refining camouflaged object detection based on the uncertainty mask Bernoulli diffusion model.

[0047] The present invention has the following beneficial effects:

[0048] This paper proposes a camouflaged object detection refinement method based on an uncertainty mask Bernoulli diffusion model. We design the first highly compatible post-processing segmentation refiner specifically for camouflaged object detection, namely the Uncertainty Masked Bernoulli Diffusion Model (UMBD). This model fully leverages the initial coarse segmentation mask and prior knowledge (model parameters) generated by existing encoder-decoder architecture models. The paper specifically employs the Bernoulli diffusion model, leveraging its binary Bernoulli kernel's high compatibility with the segmentation task (essentially a pixel-by-pixel binary classification task), to re-examine the segmentation refinement process from a generative perspective. The diffusion model's iterative generation process also aligns with the coarse-to-fine refinement process, enabling a synergistic integration of the advantages of discriminative methods (providing prior knowledge) and generative methods (restoring mis-segmented regions). Furthermore, the paper proposes an innovative uncertainty mask generation mechanism, using a hybrid uncertainty quantization network (HUQNet) to accurately estimate the uncertainty of the initial coarse segmentation mask, thereby customizing the noise used in the Bernoulli diffusion process. This mechanism adaptively guides the diffusion refinement model to focus on regions of high uncertainty, i.e., residual regions with poor segmentation performance, thereby promoting more effective refinement while suppressing unnecessary confusion caused by the global noise diffusion typically employed. This is particularly critical given the inherent foreground-background similarity in the disguised object detection task. This approach demonstrates remarkable flexibility and can be seamlessly integrated with existing disguised object detection models, resulting in significant performance improvements both quantitatively and qualitatively.

[0049] The UMBD refiner designed in this paper is the first generative post-processing scheme specifically designed for camouflaged object detection. It achieves efficient refinement of the initial segmentation mask through the innovative combination of a Bernoulli diffusion model and a learnable uncertainty masking mechanism (HUQNet). The binary kernel of Bernoulli diffusion is highly compatible with the segmentation task, and its iterative generation process synergistically integrates the prior knowledge of discriminative methods with the mis-segmentation recovery capabilities of generative methods, effectively addressing the overly smoothed segmentation results and imprecise boundaries of traditional methods. Furthermore, HUQNet accurately estimates the uncertainty region, guiding the diffusion process to focus on high-challenge residual regions and preventing global noise from interfering with correctly segmented regions. This approach is particularly suitable for camouflaged scenes with highly similar foreground and background. Experiments demonstrate that this framework is highly compatible with existing methods and can improve the mean absolute error (MAE) by an average of 5.5% and the weighted F-measure by 3.2% on multiple benchmark datasets. Furthermore, the residual modeling allows for significant refinement with only a few diffusion sampling steps (e.g., three), significantly reducing the computational burden and providing an innovative solution that balances performance and efficiency for camouflaged object detection.

[0050] The proposed UMBD refinement framework is highly compatible with existing camouflaged object detection methods and offers substantial benefits. By improving the ability to accurately segment objects that are highly integrated with their surroundings, the proposed camouflaged object detection refiner has broad application potential in a variety of fields.

[0051] Other beneficial effects of the embodiments of the present invention will be further described below. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 This is a corresponding effective refinement result image that can be obtained by processing the initial coarse segmentation masks generated by various COD methods using the method of the embodiment of the present invention.

[0053] Figure 2 UMBD structure and HUQNet architecture diagram of an embodiment of the present invention.

[0054] Figure 3 This is a comparison chart of the qualitative refinement results and uncertainty estimation after using the UMBD refiner in an embodiment of the present invention.

[0055] Figure 4 This is a qualitative comparison diagram of the embodiment of the present invention and other refiners on the camouflaged object detection benchmark dataset.

[0056] Figure 5 This is a qualitative result diagram of UMBD on the polyp segmentation task according to an embodiment of the present invention.

[0057] Figure 6 This is a qualitative refinement result diagram of the UMBD in the transparent object detection task according to an embodiment of the present invention.

[0058] Figure 7 This is an overall flow chart of the camouflaged object detection refinement method based on the uncertainty mask Bernoulli diffusion model of the present invention. DETAILED DESCRIPTION

[0059] The following is a detailed description of the embodiments of the present invention. It should be emphasized that the following description is only exemplary and is not intended to limit the scope of the present invention and its application.

[0060] See Figure 7 The embodiment of the present invention provides a method for detecting and refining camouflaged objects based on an uncertainty mask Bernoulli diffusion model, comprising the following steps:

[0061] Step S1. Initial segmentation mask generation: Process the input image using the pre-trained camouflaged object detection model to generate an initial segmentation mask;

[0062] Step S2. Uncertainty mask estimation: Analyze the input image and the initial segmentation mask through a hybrid uncertainty quantization network (HUQNet) to generate a spatial uncertainty mask to identify the residual area to be refined;

[0063] Step S3. Uncertainty-guided Bernoulli diffusion refinement: Using the initial segmentation mask as the mean of the Bernoulli distribution, the uncertainty mask is combined to modulate the noise injection area; an iterative denoising process is performed using the Bernoulli diffusion model, and targeted corrections are made to the residual area under the guidance of the uncertainty mask to generate a refined segmentation mask;

[0064] Step S4. Residual fusion output: Fuse the diffusion refinement result with the determined area in the initial segmentation mask and output the final segmentation mask.

[0065] In some embodiments, the hybrid uncertainty quantization network (HUQNet) includes a Bayesian neural network branch, a discriminant network branch, and a cross-attention fusion module. The Bayesian neural network branch generates a global uncertainty estimation map through probability sampling. The discriminant network branch fuses multi-source uncertainty clues (including entropy maps and Bayesian branch outputs) through a residual attention module to generate a local refined uncertainty map. The cross-attention fusion module integrates the outputs of the two branches to generate the final uncertainty mask.

[0066] In a further preferred embodiment, the operation of the Bayesian neural network branch includes: performing parallel mean projection and variance projection on the backbone features; calculating pixel-level variance through multiple Monte Carlo samplings; and normalizing the variance map to generate an uncertainty mask.

[0067] In a further preferred embodiment, the operation of the residual attention module includes: splicing the initial segmentation mask, entropy map and uncertainty map of the Bayesian branch to form a multi-source input; generating a spatial attention map through a convolution block; and using the attention map to weight the input features of each level of the decoder to suppress the activation intensity of the determined area.

[0068] In some embodiments, in step S3: the forward process of the Bernoulli diffusion model is: spatially modulating the true mask and the initial segmentation mask based on the uncertainty mask to generate a latent variable sequence that obeys the Bernoulli distribution; the backward process is: starting from the initial segmentation mask, iteratively predicting the residual noise through the denoiser, and gradually restoring the data distribution of the residual area.

[0069] In a further preferred embodiment, the forward process specifically includes: performing element-by-element multiplication of the true mask and the initial segmentation mask using the uncertainty mask to generate a modulated target mask and an initial mask; constructing a forward diffusion chain from the modulated target mask to the modulated initial mask, wherein the latent variable sampling at each time step follows a Bernoulli distribution, whose mean parameter is a time-varying weighted interpolation of the true mask and the initial segmentation mask in the uncertainty region.

[0070] In a further preferred embodiment, the backward process specifically includes: sampling the initial latent variable from a Bernoulli distribution with the initial segmentation mask as the mean; at each iteration step, using a denoiser combined with time step information and multi-level features of the prior model to predict the residual noise of the current latent variable; updating the latent variable through denoising prediction, and gradually correcting the segmentation result of the residual area.

[0071] In some embodiments, step S3 further includes feature adaptation fusion, wherein the multi-level features of the prior segmentation model encoder are fused with the corresponding features of the diffusion denoiser; during the fusion, the prior feature scale is adjusted via the residual block, and the time step embedding information of the diffusion process is injected.

[0072] In some embodiments, in step S3, a DDIM acceleration strategy is used to reduce the number of diffusion sampling steps, and the correct areas in the initial segmentation mask are retained through a residual modeling mechanism, so that efficient refinement within 3-10 steps can be achieved.

[0073] In general, the main contributions of the present invention can be summarized as follows: First, the present invention proposes the first generative refiner UMBD designed specifically for the task of camouflaged object detection, which is compatible with most existing camouflaged object detection methods and can utilize their prior knowledge. Secondly, the present invention introduces Bernoulli diffusion into the task of camouflaged object detection for the first time. Its feature is that it adopts a learnable uncertainty mask mechanism to guide the refinement process through the novel HUQNet, focusing on challenging uncertain areas. Finally, comprehensive experiments (which will be further described later) demonstrate the high compatibility of the refinement framework of the present invention with various camouflaged object detection methods, and improves the mean absolute error (MAE) by 5.5% and the weighted F-measure by 3.2% on average in the indicator results of various benchmark tests. By leveraging the advantages of residual modeling, the proposed method can achieve significant refinement with only three diffusion sampling steps, thus significantly reducing the computational burden of diffusion model-based methods.

[0074] The following further describes specific embodiments of the present invention, its algorithm examples and experimental verification.

[0075] UMBD-Bernoulli Diffusion Model of Uncertainty Mask

[0076] The proposed UMBD structure is as follows Figure 2 As shown in Figure 2. The refiner based on Bernoulli diffusion uses the prior knowledge in the pre-trained model to focus on the residual area (i.e. the area where the predicted result is significantly different from the true value) through the uncertainty mask to achieve refinement. Figure 2 As shown in (a), the red box on the sample marks the gradual attention and correction process of missing details during the diffusion process: the initial segmentation mask (M c ) is gradually focused in the diffusion process, and finally in the refinement result (M r ) has been corrected. Figure 2 (b) shows the overall architecture of the proposed HUQNet, and the detailed structure of its core modules is shown in Figure 2 (c)-(d).

[0077] This paper proposes the first generative refinement model UMBD (Uncertainty-Masked Bernoulli Diffusion) designed for the task of camouflaged object detection. Its overall architecture is as follows: Figure 2 Inspired by residual learning principles, the core idea of ​​this invention is to focus the diffusion-based refiner on modeling the data distribution of poorly segmented residual regions while protecting correct regions from unnecessary modifications. This is achieved through an explicit uncertainty mask mechanism that spatially adjusts the latent variable according to the uncertainty mask, thereby achieving region-specific noise injection rather than global diffusion, thereby achieving more targeted segmentation mask regeneration.

[0078] As a post-processing refiner for a segmentation task, the present invention first utilizes a pre-trained discriminative camouflaged object detection segmenter, denoted as a priori segmenter f(·), which receives an input image And output the initial segmentation mask M c =f(x)∈[0,1] H×W×1 As the priori mask of the refinement process of the present invention. The corresponding mask truth value is expressed as M GT ∈[0,1] H×W×1 Let U∈[0,1] H×W×1 represents the uncertainty mask, which represents the challenging area where f(·) produces inaccurate segmentation, and its ground truth label U GT It can be defined as M c and M GT The pixel-by-pixel L1 distance between GT =|M c -M GT |. Conversely, 1-U corresponds to M c With M GT The consistent determination area. When U=U GT When the ideal thinning mask M rThe residual refinement formula in formula (1) is generated:

[0079] M r =U⊙M GT +(1-U)⊙M c ,(1)

[0080] where ⊙ represents element-wise multiplication. The diffusion process of our invention aims to learn the data distribution of the first residual term, and the proposed HUQNet (Hybrid Uncertainty Quantization Network) h(·,·) is used to estimate U in this formula.

[0081] The diffusion model generally includes the forward diffusion process and the backward diffusion process. 1:T |y0) uses a Markov chain to gradually transform the data distribution y0~q(y0) into a prior distribution (for example, random Bernoulli noise), and the backward process is a gradual denoising process p θ (y 0:T ), converting the random noise obtained by sampling the prior distribution back to the original data distribution. Compared with the continuous diffusion model based on the Gaussian assumption, there are fewer studies on the Bernoulli diffusion model, in which y T In the classic Bernoulli diffusion model, it is usually defined as following a random Bernoulli distribution The forward process and backward process are expressed as:

[0082]

[0083]

[0084] in is a cosine noise scheduling table, μ θ (y t ,t) is a model that predicts the Bernoulli probability. In order to make the refiner fully utilize M c , the backward process p θ (y t-1 |y t ,f(x)) is different from the classical diffusion model, from the prior distribution Start iterative denoising.

[0085] Based on the above basic principles, the uncertainty mask Bernoulli diffusion model for disguised object detection refinement in the present invention, UMBD, uses a variant of the classic U-Net denoiser g(·) to construct a diffusion refiner, which iteratively improves the initial segmentation mask M provided by the weight-fixed pre-trained segmenter f(·) c .

[0086] Forward Diffusion Process of Uncertain Mask Bernoulli Diffusion Model

[0087] In the forward process, first pass y0=U⊙M GT and Apply the uncertainty mask to M GT and M c Then, the present invention constructs a The forward diffusion process

[0088]

[0089] Using the symbol α t =1-β t and You can sample y in closed form at any time step t according to formula (4) t :

[0090]

[0091] The mean parameter of Bernoulli sampling is expressed as M GT and M c The uncertainty modulated interpolation between y and y, where the interpolation weights vary with time steps. Specifically, Bernoulli sampling, uncertainty-aware customized noise can be used to modulate the y in formula (4) t After reparameterized sampling, it becomes:

[0092]

[0093] Where ⊕ represents the logical operation "XOR". As shown in formula (5), the diffusion process of the present invention injects differential noise related to the uncertainty level into the residual area U⊙M GT To construct the latent variable y t This design explicitly encourages the denoiser g(·) to strengthen its learning of refined knowledge in high uncertainty regions. Without the uncertainty mask mechanism, y t The determined area will also be mixed with noise, causing g(·) to misjudge the necessity of refinement, which is particularly problematic for the camouflaged object detection task with high foreground-background similarity. It is worth noting that the forward process is only used during the training phase (M GT Available) involved, so the U in this part is set to U GT The Bernoulli posterior can be expressed as:

[0094]

[0095] The posterior mean calculation method refers to the general paradigm:

[0096]

[0097] Here, ||·||1 denotes l1 normalization along the channel dimension.

[0098] Backward Diffusion Process of the Uncertainty Mask Bernoulli Diffusion Model

[0099] Backward process is modeled as a Markov chain, starting from First, we gradually capture the underlying data distribution through latent variables:

[0100]

[0101] The backward diffusion process iteratively uses the denoiser g(·) to predict the posterior mean to estimate the Bernoulli noise. Specifically, at the tth time step It can be reparameterized by formula (8) to obtain:

[0102]

[0103] Refinement mask M r The final prediction obtained by using the backward process iteration of formula (9) is generate:

[0104]

[0105] It should be noted that during the training phase, the uncertainty mask is set to U = U GT In the inference stage, the HUQNet network (see the subsequent 2.2 section for details), that is, h(·,·), is used to estimate the uncertainty mask in The details of UMBD training and inference are detailed in the pseudo-code Algorithms 1 and 2.

[0106]

[0107] Feature adaptation fusion module

[0108] In order to further make full use of the prior knowledge of pre-training f(·), the multi-level features of the encoder in f(·) Through formula (10) and the multi-level features of g(·) To perform the fusion:

[0109]

[0110] in Represents function composition operation, represents vector concatenation, represents a convolution operation with a kernel size of k and a stride of s. represents the time-condition bias modulation, Indicates that the feature Certain adjustments are made through residual block processing to adapt the features of each level of the denoiser, thereby integrating the prior knowledge of f(·) into the diffusion process.

[0111] Residual Block While adjusting and adapting the pre-trained features, the time step information of the diffusion process is also modulated and integrated into the features at all levels. and time embedding Generate embedded features through formula (11) where C' is empirically set to 256.

[0112]

[0113] Among them, the time condition parameter Depend on (As shown in formula (12)), σ SiLU represents the SiLU activation function, and Norm(·) represents channel normalization.

[0114]

[0115] Model training and inference

[0116] The present invention adopts the loss function To train g(·), the loss function consists of KL divergence loss, weighted intersection-over-union (IoU) loss, and weighted binary cross entropy (BCE) loss:

[0117]

[0118] In formula (13) Obtained by formula (9), where represents the noise prediction obtained from g(·) at the current sampling training time step (as shown in Algorithm 1). During the inference process (as described in Algorithm 2), we first use f(·) and h(·,·) to generate the initial segmentation mask and the corresponding uncertainty estimate. Then, we use Sample the initial latent variable y for the Bernoulli distribution mean T , and then iteratively refine to obtain M r To speed up sampling, adopt DDIM strategy and set parameters To reduce the randomness of the backward process.

[0119] HUQNet-Hybrid Uncertainty Quantization Network

[0120] This paper proposes HUQNet (Hybrid Uncertainty Quantization Network) for uncertainty estimation, which outputs uncertainty mask As the required U in the inference sampling stage GT The hybrid model consists of a Bayesian neural network (BNN) branch and a discriminant network branch, both of which share a backbone network. By sharing the backbone network and fusing multiple output results, this dual-branch design has a clear division of labor and promotes each other. The BNN branch can achieve global perception through distribution modeling, while the discriminant method focuses on local details. The two promote each other and discover areas that are ignored by the prior segmenter. The network design is as follows Figure 2 As shown in (b,c,d).

[0121] BNN branches

[0122] The HUQNet proposed in this paper first uses the ResNet50 backbone network to Extract multi-level features The BNN branch of HUQNet is parameterized by Gaussian and measures the uncertainty score c for each pixel from the perspective of probabilistic representation learning: c = μ + ∈ σ, and Where μ, σ represent the learned mean and variance maps. Figure 2 As shown in (c), the BNN branch processes the backbone feature f3 through parallel μ-feature projection and σ-feature projection to obtain the mean and variance maps: Uncertainty mask U B Through K times Monte Carlo sampling, we can get: Where Norm(·) represents mean-maximum normalization, and Var(·) is the variance calculation operation.

[0123] Residual attention module of the discriminative network branch

[0124] In order to enable the uncertainty quantization decoder to fully utilize the existing information and effectively explore the current uncertainty estimate (such as U B ), the present invention adopts a residual attention module (RAM, such as Figure 2 As shown in (d), this module dynamically adjusts the features passed to the decoder by fusing multi-source uncertainty estimates. Considering the initial segmentation mask M c Entropy graph (U E ) is also an effective uncertainty estimate, which takes the existing information M c 、U E and U B Spliced ​​together to form the input of RAM The convolution fusion (CF) module is a classic stacked convolution block design. cat After the generation, the attention map M is obtained attn The specific design of the module is shown in formula (14):

[0125]

[0126] Among them, the repeated convolution block is defined as

[0127] When using bilinear interpolation to attn Resolution and features at all levels After matching, the features at all levels are processed by the residual attention mechanism (Formula (15)) to obtain the refined features

[0128] f i ′=f i ⊙(1-M attn ). (15)

[0129] Decoder of the discriminative network branch

[0130] Multi-level features processed by RAM Refine step by step from level 4 to level 1. Let U4 = f4′ represent the initial highest level feature. The refined feature Iterative calculation based on the following formula (16):

[0131]

[0132] Where TConv(·) represents transposed convolution, and DAB(·) is a composite module consisting of Dropout, LeakyReLU activation, and batch normalization. The discriminant branch finally outputs U D It is the lowest level feature U1.

[0133] Efficient cross-attention fusion module

[0134] Efficient cross-attention module fuses multi-source uncertainty masks (i.e., U E 、U B 、U D ), the final result is obtained by window-based cross attention in a way that reduces computational overhead This operation is done in several steps. First, the input U D and Apply window partitioning to get and where Φ win Represents a 16 × 16 window partition. These windowed image patches are then converted into query (Q), key (K), and value (V) matrices through projection: and And calculate multi-head cross attention (Number of attention heads d h =4). By After normalization, the final result Obtained through window merging and residual connection: The residual connection retains the discriminant branch U D The main uncertainty information from U E and U B Supplementary auxiliary information.

[0135] HUQNet model training

[0136] The training objective of the BNN branch combines the reconstruction loss (binary cross entropy BCE) and distribution regularization (KL divergence):

[0137]

[0138] where η is set to 0.1 based on experience, c (k) is a random sample from the learned distribution samples. Discriminant Branch training uses binary cross entropy BCE loss and Dice loss. The total loss function is:

[0139]

[0140] Examples

[0141] The proposed UMBD was implemented in the PyTorch environment and trained using three RTX 4090 GPUs. The input resolution followed the configuration of the prior camouflaged object detection method, and the batch size was set to 36. The model training of the present invention used the AdamW optimizer with a polynomial decay scheduling strategy. Referring to the relevant technical implementation, the initial learning rate was empirically set to: denoiser (1×10 -4 ), HUQNet backbone network (ResNet50 pre-trained on ImageNet, 1×10 -7 ), BNN branch (1×10 -6 ), and the rest of the modules in HUQNet (1×10 -3 During training, a cosine noise schedule was applied with a total time step of T = 1000. During inference, DDIM subsequence sampling was used with a time step of T = 10, consistent with existing diffusion-based camouflaged object detection methods. All reported results are the average of five runs using different random seeds.

[0142] Training strategy

[0143] To avoid overfitting when training the denoiser g(·), the output of HUQNet needs to be used in the validation phase of its training. To perform inference sampling, we designed a three-stage training strategy: (1) pre-training HUQNet for 80 epochs until convergence is near; (2) training g(·) until convergence, while keeping HUQNet parameters frozen during the validation phase to ensure sampling stability; (3) with g(·) parameters frozen, fine-tuning HUQNet until convergence is achieved to achieve the best overall performance of the integrated system.

[0144] Denoiser settings details

[0145] The present invention adopts U-Net structure as denoising network. The U-Net is modified to receive 5-channel input (consisting of input image x, prior mask M c and latent variable y t spliced ​​together), and output the estimated noise of 1 channel Apart from the above modifications, the rest of the network remains unchanged.

[0146] Datasets and evaluation metrics

[0147] The present invention conducts experiments on four datasets of common test benchmarks for camouflaged object detection tasks: CHAMELEON, CAMO, COD10K, and NC4K. During training, 1000 images from the CAMO dataset and 3040 images from the COD10K dataset are used. The remaining images from these two datasets and all images from other datasets constitute the test set. The present invention adopts four widely used metrics: mean absolute error (M), weighted F-measure Adaptive E-measure (E φ ) and structural measures (S α ). The lower the M value, and E φ and S α Higher values ​​indicate better performance.

[0148] Experimental results

[0149] Segmentation refinement gain effect

[0150] Table 1: Quantitative performance gains of disguised object detection methods using different backbone networks after using the proposed UMBD refiner. The average improvement (%) for each backbone group is marked in bold.

[0151]

[0152] Figure 3 Shows qualitative refinement results using the UMBD refiner of the present invention, including uncertainty estimates and the corresponding true value label U GTThe three rows of samples are from SINet, FEDER, and Camoformer.

[0153] As shown in Table 1, the UMBD framework proposed in this paper is compatible with a variety of existing camouflaged object detection methods and has achieved significant quantitative refinement gains. Table 1 focuses on the classification and shows its universal compatibility on three different backbone networks (ResNet50, Res2Net50 and PVTv2). It is worth noting that the framework has an average improvement of 5.5% in mean absolute error (MAE) and 3.2% in weighted F-measure. Even for the SOTA camouflaged objects based on Transformer, the proposed framework has a good performance. Physical examination method The present invention can still bring considerable performance enhancement, which highlights the UMBD framework effectiveness and generalization ability.

[0154] like Figure 1 、 Figure 3 As shown, the present invention significantly reduces various types of errors such as blurred edges, missing details, and large-scale false positives and false negatives. Figure 1 In the figure, the first row shows the processing of blurred edges; the second row shows the recovery of fine details; and the third and fourth rows show the reduction of large-area false positives and false negatives. The bar graph on the right quantitatively shows the significant improvement achieved by the present invention. Figure 3 Columns (e)-(f) show the uncertainty masks estimated by HUQNet. and its corresponding true value. HUQNet can not only accurately find the ambiguous areas of the initial segmentation result, but also focus on the large areas ignored by the prior segmenter, thus providing a robust uncertainty estimate for the diffusion refinement process.

[0155] Comparison with existing segmentation refiners

[0156] Table 2: Quantitative comparison of the existing cutting-edge segmentation refiners and the proposed UMBD. The best and suboptimal results are marked with different bold fonts.

[0157]

[0158] The proposed UMBD was evaluated against three existing optimal segmentation refiners: Hidiff, Segrefiner (the only two diffusion-based refiners currently available), and SAMRefiner (the currently optimal refinement method). As shown in Table 2, a comprehensive evaluation using SINetV2 and FEDER as prior segmenters demonstrates that the proposed method exhibits superior performance across most evaluation metrics.

[0159] Figure 4Qualitative comparisons with other refiners on a camouflaged object detection benchmark dataset are shown. The blue / yellow backgrounds represent the refined outputs of SINetV2 and FEDER, respectively.

[0160] It is worth noting that although SAMRefiner It achieved a higher score on the metric, but performed worse than the initial segmentation mask on the other three metrics, and showed degradation of structure and details in the refined results, such as Figure 4 This is because the SAM basic model it is based on is not fully applicable to the disguised object detection task. In fact, the inherent complexity of the disguised object detection task makes the refinement process particularly difficult, and the UMBD of the present invention is currently the only one that can achieve stable performance improvement.

[0161] Existing diffusion-based refiners fail to focus on modeling residual regions through the uncertainty mask mechanism. Considering the high similarity between foreground and background in the camouflaged object detection task, learning global diffusion noise will inadvertently introduce uncertainty into the correctly segmented regions, resulting in incomplete denoising or error accumulation in the incorrectly segmented regions (see Figure 4 of (d,e)).

[0162] Algorithm efficiency analysis

[0163] Table 3: Effect of reducing the sampling step size T on refinement performance. The best results are marked in bold.

[0164]

[0165] As shown in Table 3, when the sampling step size T is reduced from 10 to 3, the decrease in refinement gain is minimal. This phenomenon is due to the residual modeling mechanism of the present invention, which effectively preserves the original correctly segmented regions. Although reducing T within this range may slightly affect the quality of the refined regions, it avoids a catastrophic collapse in the overall segmentation quality, which is a significant efficiency improvement compared to other diffusion-based segmentation methods.

[0166] The present invention has multiple transition schemes, that is, the results obtained by running only some components during the design process. In this section, the performance of different transition schemes is described. The present invention conducts an ablation study on the COD10K dataset, using the pre-trained SINetV2 as the prior segmenter.

[0167] Table 4: Effects of uncertainty mask mechanism and HUQNet.

[0168]

[0169] As shown in Table 4, disabling the uncertainty mask mechanism in the UMBD refiner of the present invention leads to incomplete noise removal similar to the Hidiff method, which verifies the key role of this mechanism. Even if the output of the HUQNet proposed in the present invention is replaced by the uncertainty mask obtained by non-learnable methods (e.g., the entropy map U E ), the UMBD framework can still perform the initial segmentation mask M c Effective refinement is achieved, which demonstrates the robustness of the framework of the present invention, but the refinement effect is far inferior to the output results using HUQNet. When any of the modules in HUQNet are removed, performance degradation is observed, which emphasizes the necessity of these components. It is worth noting that without the RAM module that injects prior knowledge at each stage of the feature, the basic encoder-decoder architecture cannot provide effective uncertainty estimation for the highly challenging camouflaged object detection task, and thus cannot achieve effective refinement. In addition, a comparison is made between completely removing the BNN branch and retaining the BNN branch but not using its output U B The case shows that even without explicitly integrating U B ,The shared backbone network can also enable the BNN branch to play a role in promoting the training of the discriminative branch.

[0170] Effect Analysis of Bernoulli Diffusion Model

[0171] Table 5: Effect of different diffusion process kernel selections on performance.

[0172]

[0173] Table 6: Ablation study with respect to the number of sampling steps T. Refinement times are measured on RTX 4090.

[0174]

[0175] As shown in Table 5, replacing the Bernoulli kernel with a Gaussian kernel in the diffusion model of the present invention leads to a decrease in performance, which verifies that the Bernoulli diffusion model is more suitable for segmentation refinement tasks. Thanks to the residual modeling strategy of the present invention, the diffusion process focuses on poorly segmented areas instead of modeling the segmentation mask globally from scratch. Therefore, as shown in Table 6, the present invention can still produce significant refinement results even when the number of inference steps is reduced (for example, T=3). Although the standard setting of T=10 is adopted in the deployment details of Section 2, the present invention allows the number of sampling steps to be dynamically adjusted in the application according to the refinement quality required by the actual scenario, which effectively reduces the large amount of computational overhead that is usually difficult to avoid in diffusion-based methods. The time consumption is measured by inference at a resolution of 384×384 using an RTX 4090 GPU.

[0176] The innovative work, important features and advantages of the present invention mainly include:

[0177] (1) This paper proposes the first generative refiner UMBD designed specifically for the disguised object detection task, which is compatible with most existing disguised object detection methods and can utilize their prior knowledge.

[0178] (2) This paper introduces Bernoulli diffusion into the camouflaged object detection task for the first time. Its feature is to adopt a learnable uncertainty mask mechanism to guide the refinement process through the novel HUQNet, focusing on the challenging uncertain regions.

[0179] (3) Comprehensive experiments demonstrate the high compatibility of the proposed refinement framework with various camouflaged object detection methods, and improve the average mean absolute error (MAE) by 5.5% and the weighted F-measure by 3.2% in the performance of various benchmarks. By leveraging the advantages of residual modeling, the proposed method can achieve significant refinement with only three diffusion sampling steps, thus significantly reducing the computational burden of diffusion model-based methods.

[0180] The Uncertainty Mask-Based Bernoulli Diffusion (UMBD) proposed in this paper addresses the limitations of existing segmentation and refinement methods when applied to camouflaged object detection tasks and specifically improves the refinement effect. Its main advantages are reflected in the following aspects:

[0181] First, to address the challenges existing refiners face in camouflaged object detection, such as large-scale blurred edges, insufficient recovery of detailed structures, and significant false positives and negatives, this paper applies the Bernoulli diffusion model to the refinement process for camouflaged object detection. The binary Bernoulli kernel of the Bernoulli diffusion model is a natural fit for segmentation tasks (essentially a pixel-by-pixel binary classification problem), and its iterative generative nature is highly consistent with the coarse-to-fine refinement process. This enables UMBD to synergistically integrate the advantages of discriminative methods that provide prior knowledge with the advantages of generative methods that recover mis-segmented regions guided by residual modeling, resulting in more effective refinement of the initial coarse segmentation mask. This significantly differs from conventional refiners that can only perform minor adjustments or lack such generative refinement capabilities.

[0182] Secondly, in response to the problem that existing methods have insufficient discrimination ability when dealing with the high similarity between foreground and background in camouflaged object detection tasks, which easily leads to erroneous modification of correctly segmented areas or even quality degradation, the present invention innovatively proposes an uncertainty mask generation mechanism. This mechanism accurately estimates the degree of uncertainty of each area in the initial coarse segmentation mask through a specially designed hybrid uncertainty quantization network (HUQNet). Based on this uncertainty mask, UMBD can customize the noise injection in the Bernoulli diffusion process, so that the model adaptively focuses its refinement attention on areas with high uncertainty (i.e., residual areas with poor segmentation effects). This targeted processing method avoids the unnecessary interference and confusion of correctly segmented areas that may be caused by traditional global noise injection, especially in camouflaged scenes where the foreground and background are highly similar, and can more effectively protect the correctly segmented parts and accurately correct the erroneous parts.

[0183] Furthermore, the UMBD refiner of this invention exhibits excellent compatibility and seamless integration with most existing camouflaged object detection models. It leverages the coarse segmentation masks it outputs and prior knowledge (model parameters) for post-processing refinement, achieving significant quantitative improvements (e.g., an average 5.5% improvement in mean absolute error and a 3.2% improvement in weighted F-measure) and qualitative performance across multiple benchmark datasets. Furthermore, thanks to its residual modeling approach, UMBD achieves significant refinement with only a few diffusion sampling steps (e.g., three), significantly reducing the high computational overhead typically associated with diffusion-based models.

[0184] This paper designs an efficient and robust post-processing refiner specifically tailored to the specific characteristics of the camouflaged object detection task. This approach, based on an in-depth analysis of the shortcomings and challenges of existing technologies (including general refiners and preliminary diffusion model applications) for the challenging and specific scenario of camouflaged object detection, specifically combines the characteristics of Bernoulli diffusion with an innovative uncertainty guidance mechanism. This unique solution is a customized and deeply integrated solution tailored to the specific challenges of this task.

[0185] In particular, the UMBD refinement framework proposed in the present invention is highly compatible with various existing disguised object detection methods and brings substantial gains.

[0186] application

[0187] The proposed camouflaged object detection refiner improves the ability to accurately segment objects that are highly integrated with the environment and has broad application potential in multiple fields, including but not limited to:

[0188] The proposed refiner not only performs well in the camouflaged object detection task, but its versatility is also verified through experiments on a wider range of hidden object segmentation scenarios, as follows:

[0189] 1. Medical image analysis (such as polyp segmentation)

[0190] In medical image analysis, early-stage lesions (such as tiny polyps and early lung infection areas) often have unclear boundaries and similar features to surrounding normal tissue, making them difficult to accurately segment. The thinning technology of the present invention can refine the initial detection results of these hidden lesions, more accurately depicting their boundaries and extent, thereby assisting doctors in early diagnosis, disease assessment, and the development of more precise treatment plans.

[0191] Specifically, the UMBD refinement framework proposed in this invention can be applied to polyp segmentation tasks in medical images. For example, on standard polyp segmentation datasets such as CVC-300 and ETIS, combined with existing segmentation methods such as PraNet and UACANet, the refiner of this invention can achieve significant refinement gains, and its effect is even more obvious than in the camouflaged object detection task. Table 7 and Figure 5 Real The experimental results show that this method can effectively deal with fuzzy and large false positive / false negative areas, and Small target structures are refined. Evaluation usually uses mean absolute error (M), mean intersection over union (mIoU) and adaptive F-measure (F β ) and other indicators.

[0192] Table 7: Quantitative refinement gains on the polyp segmentation task. The average improvement (%) is marked in bold.

[0193]

[0194] Figure 5 The qualitative results of the UMBD proposed in this paper on the polyp segmentation task are shown.

[0195] 2. Industrial inspection (such as transparent object detection)

[0196] On industrial production lines, many surface defects (such as scratches, blemishes, and discolored areas) can be difficult to detect using traditional inspection methods because they resemble the product's material and color. The refiner technology in this paper can help more accurately outline these hidden defects, improving the accuracy of the inspection system and ensuring product quality.

[0197] Specifically, the UMBD refinement framework of the present invention can be extended to the field of transparent object detection. For example, on standard transparent object detection datasets such as the GDD glass object dataset and the MSD mirror dataset, the refiner of the present invention can achieve significant refinement effects (as shown in Table 8 and Table 9 ) compared with the segmentation results of methods such as EBLNet. Figure 6It is particularly noteworthy that UMBD shows excellent ability in correcting large areas of incorrect segmentation in the initial segmentation mask, further demonstrating its good generalization and application potential in different hidden object segmentation scenarios. The evaluation is usually carried out using mean absolute error (M), mean intersection over union (mIoU) and weighted F-measure and other indicators.

[0198] Table 8: Quantitative refinement gains on the transparent object detection task. Improvements (%) are in bold.

[0199]

[0200] Figure 6 The qualitative refinement results of the proposed UMBD on the transparent object detection task are demonstrated.

[0201] 3. Precision agriculture and ecological monitoring

[0202] In the agricultural field, accurate detection of pests that are highly integrated with the crop background, and specific growth stages Hidden crops or fruits whose maturity is difficult to discern are crucial. The refiner of this invention helps improve the recognition accuracy of these targets by providing a finer segmentation mask, thereby supporting early warning of pests and diseases, crop growth status monitoring, and fruit maturity assessment, serving precision agriculture management.

[0203] 4. Security monitoring and emergency search and rescue

[0204] In complex surveillance environments or field search and rescue scenarios, target individuals or objects may be difficult to detect due to camouflage or similarity to surrounding features. The refiner of the present invention can refine and confirm the boundaries of initially detected suspicious targets, helping to improve the early warning accuracy of security systems and locate targets more quickly and accurately during search and rescue operations.

[0205] 5. Autonomous driving and robotic perception

[0206] Autonomous systems (such as self-driving cars and service robots) operating in complex and dynamic environments need to accurately perceive various objects, including obstacles or targets that are difficult to detect due to transparency, reflectivity, or similar color and texture to the background. The refinement technology of this invention can enhance the system's segmentation accuracy of these hidden objects, thereby improving the safety and robustness of its environmental understanding, path planning, and autonomous navigation.

[0207] The above are just some examples of the application fields of the disguised object detection refiner. In fact, the UMBD segmentation refinement framework proposed in this invention can be extended to other conventional segmentation tasks such as salient object detection. Therefore, its actual application may involve more fields.

[0208] An embodiment of the present invention further provides a storage medium for storing a computer program, which at least performs the above method when executed.

[0209] An embodiment of the present invention further provides a control device, comprising a processor and a storage medium for storing a computer program; wherein the processor is configured to execute at least the method described above when executing the computer program.

[0210] An embodiment of the present invention further provides a processor, which executes a computer program and at least performs the method described above.

[0211] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a magnetic disk memory or a magnetic tape memory. The storage medium described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0212] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0213] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0214] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0215] Those skilled in the art will understand that all or part of the steps of the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc. Various media that can store program codes.

[0216] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0217] The methods disclosed in the several method embodiments provided by the present invention, in the absence of conflict Any combination can be made to obtain new method embodiments.

[0218] The features disclosed in several product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.

[0219] The features disclosed in several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0220] The above is a further detailed description of the present invention in conjunction with specific preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. Those skilled in the art will recognize that, without departing from the scope of the present invention, several equivalent substitutions or obvious variations can be made, and the performance or use of the same should be considered to fall within the scope of protection of the present invention.

Claims

1. A camouflaged object detection refinement method based on the uncertainty mask Bernoulli diffusion model, characterized in that: The steps include: S1. Initial segmentation mask generation: Use the pre-trained camouflaged object detection model to process the input image and generate an initial segmentation mask; S2. Uncertainty Mask Estimation: Analyze the input image and the initial segmentation mask using a Hybrid Uncertainty Quantization Network (HUQNet) to generate a spatial uncertainty mask to identify the residual regions that need to be refined. S3. Uncertainty-guided Bernoulli diffusion refinement: Using the initial segmentation mask as the mean of the Bernoulli distribution, the uncertainty mask is combined to modulate the noise injection area; An iterative denoising process is performed through the Bernoulli diffusion model, and the residual area is corrected in a targeted manner under the guidance of the uncertainty mask to generate a refined segmentation mask; S4. Residual fusion output: Fuse the diffusion refinement result with the determined area in the initial segmentation mask and output the final segmentation mask.

2. The method according to claim 1, wherein In step S3: The forward process of the Bernoulli diffusion model is as follows: spatially modulating the true mask and the initial segmentation mask based on the uncertainty mask to generate a latent variable sequence that obeys the Bernoulli distribution; The backward process is as follows: starting from the initial segmentation mask, the denoiser is used to iteratively predict the residual noise, and the data distribution of the residual region is gradually restored.

3. The method according to claim 2, wherein The forward process specifically includes: Use the uncertainty mask to perform element-by-element multiplication of the true mask and the initial segmentation mask to generate the modulated target mask and the initial mask; A forward diffusion chain from the modulated target mask to the modulated initial mask is constructed, where the latent variable sampling at each time step follows a Bernoulli distribution, whose mean parameter is the time-varying weighted interpolation of the true mask and the initial segmentation mask in the uncertainty region.

4. The method according to claim 2 or 3, wherein: The backward process specifically includes: Sampling the initial latent variables from a Bernoulli distribution with the initial segmentation mask as its mean; At each iteration, the denoiser is used to combine time step information and multi-level features of the prior model to predict the residual noise of the current latent variable. The latent variables are updated through denoising prediction, and the segmentation results of the residual area are gradually corrected.

5. The method according to any one of claims 1 to 4, characterized in that Step S3 further includes: Feature Adaptive Fusion: The multi-level features of the prior segmentation model encoder are fused with the corresponding features of the diffusion denoiser. During fusion, the prior feature scale is adjusted through the residual block, and the time step embedding information of the diffusion process is injected.

6. The method according to any one of claims 1 to 5, characterized in that The HUQNet in step S2 includes: Bayesian neural network branch: Generates a global uncertainty estimation map through probability sampling; Discriminative network branch: The residual attention module fuses multi-source uncertainty clues, including entropy maps and Bayesian branch outputs, to generate a local refined uncertainty map; Cross-attention fusion module: Integrates the dual-branch outputs to generate the final uncertainty mask.

7. The method according to claim 6, wherein The operation of the Bayesian neural network branch includes: Perform parallel mean projection and variance projection on the backbone features; Calculate pixel-level variance through multiple Monte Carlo sampling; Normalize the variance map to generate the uncertainty mask.

8. The method according to claim 6 or 7, wherein: The operations of the residual attention module include: Concatenate the initial segmentation mask, entropy map, and uncertainty map of the Bayesian branch to form a multi-source input; Generate spatial attention maps through convolutional blocks; The attention map is used to weight the input features of each level of the decoder to suppress the activation intensity of the determined area.

9. The method according to any one of claims 1 to 8, wherein In step S3: The DDIM acceleration strategy is adopted to reduce the number of diffusion sampling steps, and the correct areas in the initial segmentation mask are retained through the residual modeling mechanism, achieving efficient refinement within 3-10 steps.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for detecting and refining camouflaged objects based on an uncertainty mask Bernoulli diffusion model according to any one of claims 1 to 9 is implemented.

Citation Information

Cited By

  • Fruit maturity detection and grading picking method and system

    CN121999481A

  • A method and system for fruit maturity detection, grading, and harvesting.

    CN121999481B

  • Stacked object boundary extraction method and device based on image recognition and medium

    CN122265665A