Method and system for camouflage target structure stability detection for graffiti supervision
By introducing context stabilization and adaptive reweighting of prediction errors in camouflage target detection, the problem of target structure degradation under graffiti supervision is solved, the structural integrity and stability of camouflage target detection are improved, and it is suitable for target detection in complex backgrounds.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CENT SOUTH UNIV
- Filing Date
- 2026-04-20
- Publication Date
- 2026-06-23
AI Technical Summary
In existing technologies for camouflaged target detection, the target structure is prone to degradation under graffiti supervision, and the robustness across different scenarios is insufficient, making it difficult to maintain the integrity and stability of the target structure under weak supervision.
By introducing context stabilization and adaptive reweighting of prediction errors into the feature extraction network, the relational modeling of high-level features and the assignment of supervision signals are optimized, thereby improving the structural integrity and stability of camouflaged target detection.
Without adding additional dense annotations, it improves the reliability of structural representation and cross-scene stability of camouflaged target detection, and reduces the risk of structural error propagation in complex backgrounds.
Smart Images

Figure CN122066966B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of camouflage target recognition, and in particular to a method and system for detecting the structural stability of camouflage targets for graffiti supervision. Background Technology
[0002] Camouflage target recognition aims to detect targets in complex natural scenes that are highly similar to the background in color, texture, and local statistical properties. This task has wide applications in fields such as wildlife monitoring, military reconnaissance, medical image analysis, and autonomous driving. Because camouflage targets have extremely low contrast with the background, traditional target detection and saliency detection methods struggle to effectively identify such targets.
[0003] In recent years, with the development of deep learning, researchers have proposed a variety of camouflaged target detection methods based on deep neural networks. These methods typically enhance the model's structural awareness capabilities through multi-scale feature fusion, attention mechanisms, and contextual modeling. For example, some methods enhance target structural information through mutual graph learning or boundary-guided attention, while others improve structural recovery capabilities in complex scenes through multi-scale semantic fusion.
[0004] However, most related methods rely on dense pixel-level annotations for training. Due to the blurred boundaries and complex structures of camouflaged targets, accurate pixel-level annotation is extremely costly, and the annotation results are also prone to subjective differences. Therefore, weakly supervised camouflaged target detection has gradually become a research hotspot, with graffiti annotation considered an effective solution that balances annotation cost and performance. Graffiti supervision only annotates a small number of pixels, significantly reducing annotation costs, but it also brings new problems:
[0005] Sparse supervision signal: The graffiti covers only a very small number of pixels, resulting in a severe lack of training signal.
[0006] Structural degradation problem: In scenarios where the foreground and background are highly similar, limited supervision can easily lead to misjudgments by the model in local areas. As the errors gradually spread, they can cause fragmentation of the target structure, missing regions, or overall morphological degradation.
[0007] Insufficient robustness across scenarios: During the testing phase, when the distribution of the input image differs from that of the training data, structural errors are often amplified, leading to unstable detection results.
[0008] Existing methods typically optimize only during the training phase, such as by using pseudo-labels, structure propagation, or local structure constraints to enhance weak supervision signals. However, these methods still struggle to fundamentally address the structural degradation problem caused by sparse supervision, particularly lacking a unified mechanism that can simultaneously suppress structural degradation during both training and testing. Current methods often improve performance by increasing network layers, stacking attention modules, or employing general multi-scale fusion techniques, but under weak supervision, these approaches are insufficient to fundamentally suppress the generation and propagation of structural errors. Therefore, a novel camouflaged object detection method is needed to enhance target structure perception under weak supervision and suppress structural prediction instability during the inference phase, thereby improving the overall robustness of the model. Summary of the Invention
[0009] The technical problem to be solved by the present invention is to provide a method and system for detecting the structural stability of camouflaged targets for graffiti supervision, which improves the structural integrity and stability of the prediction results of camouflaged targets without adding additional dense annotations, in order to address the shortcomings of the existing technology.
[0010] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a method for detecting the structural stability of camouflaged targets for graffiti supervision, comprising the following steps:
[0011] S1. Obtain the training image and its corresponding sparse supervision annotation; the sparse supervision annotation includes foreground graffiti and background graffiti;
[0012] S2. Input the training image into a feature extraction network to obtain low-level features and high-level features. The low-level features primarily represent edge, texture, and local spatial structure information in the input image, while the high-level features primarily represent semantic information and contextual response information of the target region. In a preferred embodiment, before fusing with the enhanced high-level features, the low-level features may undergo one or more of the following processing: local contextual contrast enhancement, edge enhancement, or spatial attention enhancement, to improve their ability to express differences in target boundaries and local structures. The enhanced low-level features are then fused with the high-level features after contextual stabilization and relation aggregation to generate the final prediction result.
[0013] S3. Obtain the prediction result using the low-level features and high-level features. Based on the prediction result, calculate the prediction error within the set of supervised pixels covered by the sparse supervised annotations, and adaptively reweight the supervised loss according to the prediction error.
[0014] S4. Update the parameters of the feature extraction network based on the reweighted loss function to obtain a weakly supervised camouflage target detection model. In a preferred embodiment, the feature extraction network uses a convolutional neural network or a visual Transformer network with hierarchical feature output capability, preferably one of ResNet-50, ResNet-101, ConvNeXt, VisionTransformer, or Swin Transformer. The prediction result acquisition structure can adopt an encoder-decoder structure, a feature pyramid fusion structure, or a multi-layer feature fusion structure with lateral connections to achieve joint modeling of high-level semantic information and low-level structural information.
[0015] In the weakly supervised training process, this invention adaptively reweights the supervision signal based on the prediction error on the supervision pixels, so that limited supervision is preferentially applied to high-risk structural regions. Without adding additional dense annotations, this improves the structural integrity and stability of the camouflage target prediction results.
[0016] The process of obtaining the prediction results includes:
[0017] Perform depthwise separable convolution and nonlinear mapping on the high-level features to obtain the basic response features. ;
[0018] Multiple context sampling branches are constructed based on the basic response features, and different sampling scales or different dilation rates are introduced into each branch. The basic response features are then adjusted based on the sampling scales or dilation rates. Perform dynamic sampling to obtain the features of each branch;
[0019] Local context information is extracted from the features of each branch using a local pooling operator. Global average pooling is then performed on this local context information to extract global context information. Based on the local and global context information, local and global attention maps are obtained. Finally, these local and global attention maps are fused to obtain hybrid context attention information. Based on the spatial mean response of each branch feature, a spatial attention map is constructed. ;
[0020] By utilizing the aforementioned branch features, mixed contextual attention information, and spatial attention graph, the stabilization features of each branch are obtained;
[0021] Spatial attention weights of each branch are obtained by utilizing the features of each branch, and relation aggregation results are obtained based on the flattened representation of the stabilization features of the corresponding branches.
[0022] The prediction result is obtained by fusing the relationship aggregation result with the low-level features.
[0023] In camouflaged target detection tasks, targets and backgrounds are often highly similar in color, texture, and local statistical properties, making the contextual responses in high-level features susceptible to background interference. In weakly supervised scenarios such as graffiti supervision, the model can only obtain explicit constraints at a limited number of supervised locations, thus making it more prone to relying on implicit contextual relationships in high-level features to complete the target region. If long-distance relationship modeling is directly performed on the original high-level features, local unstable responses will extend to a larger spatial range during subsequent dependency propagation, ultimately manifesting as target structure shift and region fragmentation. This invention introduces contextual stabilization processing before high-level features enter long-distance relationship modeling, ensuring that relationship propagation is based on more reliable contextual evidence and reducing the possibility of unstable context spreading over a larger spatial range. Because subsequent relationship modeling is based on more reliable features, it is more conducive to maintaining the overall outline of the target, the connectivity of its internal regions, and the continuity of its boundaries. Compared to methods that rely solely on general multi-scale fusion or directly perform global relationship modeling, this invention is more effective in maintaining the integrity of the target structure under weak supervision.
[0024] The basic response characteristics Represented as: ;in, For activation function, Indicates characteristics of high-level personnel Perform depthwise separable convolution operations.
[0025] Branch characteristics of the i-th branch at the current position coordinates Represented as: ;in, For the set of relative offsets of the reference sampling grid, For learnable weights, Indicates the current position coordinates. For expansion rate, Indicates the first The branch is at the current position Corresponding relative offset The sampling offset.
[0026] Mixed contextual attention information ;in, This indicates that the attention image will be adjusted to the input space size. Transformation operators, and These represent local attention diagrams and global attention diagrams, respectively. This represents learnable gating parameters and a spatial attention graph. ,in, Represents the Sigmoid mapping. This indicates the generation of the spatial attention map. Let i be the branch characteristics of the i-th branch. Indicates the first Branching characteristics of a branch Perform mean aggregation on the channel dimension. Let... ,but In its first One sample, spatial location The value at that location is .
[0027] Stabilization characteristics ;in, It represents the Hadamardi (or Hadama) stack.
[0028] Relational aggregation results ;in, For learnable residual coefficients, Indicates stabilization characteristics Zhanping said, Pay attention to weights in the space.
[0029] Before fusing the relationship aggregation result with the low-level features, the process further includes: weighted fusion of the relationship aggregation result with the basic response features to obtain the final relationship aggregation result. Through this fusion process, while preserving the input information, the enhancement effects of multi-branch context sampling and relationship aggregation are combined to obtain a more stable high-level structure representation.
[0030] loss function The expression is: ;in, For the error-aware reweighted supervision term, the first... The error-perceived reweighted supervision term for each sample is represented as follows: The foreground probability of the b-th sample The probability tensor of the b-th sample , , This represents the probability tensor of the b-th sample at position in the first channel. The value at position, the first Supervision label for each sample , For binary classification cross-entropy loss, the first... Weights of each sample , Indicates the upper limit of the weight, the first Error-aware base weights for each sample , No. Marginal weights of each sample adjustment coefficient , Indicates the current training round. Indicates the duration of progressively increasing intensity. Indicates the maximum adjustment intensity. Indicates the first Edge response map of each sample In position The response value at that location, Indicates the first Edge response map of each sample The maximum response value in, the first Prediction error per sample , The first sparse supervision labeling determined The set of supervised pixels for each sample. Edge weight adjustment coefficient, To prevent stable terms with a denominator of zero, Indicates the number of supervised pixels. These are detail consistency constraints used to improve boundary and local detail consistency. , , , This indicates a consistency constraint between the prediction results and the supervision labels. This represents the consistency constraint on the boundary pixels. and These represent the weight coefficients of the corresponding items. and These represent the gradient operators in the horizontal and vertical directions, respectively; the edge response map of the b-th sample. The supervision label of the b-th sample Obtained through edge extraction, specifically represented as ,in and These are Sobel horizontal and vertical convolution kernels, respectively. For auxiliary deep supervision items used to provide additional supervision at different levels, , , No. The supervision item corresponding to each auxiliary output Represented as M represents the number of auxiliary output layers. Indicates the first Supervision weights for each auxiliary output, Indicates the first The sample at the th Prediction results on each auxiliary output Indicates the first Each auxiliary output corresponds to a supervision label at a given scale. Indicates the first The sample at the th A set of supervised pixels at an auxiliary output scale. Indicates the first The number of pixels in the supervised pixel set of the auxiliary output, where H and W represent the height and width of the space, respectively.
[0031] In weakly supervised camouflage target detection tasks, a major challenge in training constraints lies in the extremely limited number of supervised pixels. If a uniform weight is applied to all supervised pixels, the limited supervised signals are evenly distributed, making it difficult to concentrate them on the most critical and challenging locations. In practice, supervised pixels with large prediction errors typically correspond to highly confusing regions between the target and background, boundary transition regions, or regions with weak structural connections. These locations significantly impact the overall structural stability. If stronger constraints are not applied to these high-risk locations during training, local errors can easily accumulate and evolve into larger-scale structural deviations during iterations. To address this, this invention proposes a supervised reweighting mechanism based on prediction error, prioritizing the application of limited supervision to locations more prone to structural degradation, thereby improving the effectiveness of training constraints under weak supervision conditions.
[0032] As an inventive concept, the present invention also provides a camouflage target structure stability detection system for graffiti supervision, including a memory, a processor, and a computer program stored in the memory; the processor executes the computer program to implement the steps of the above method.
[0033] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0034] 1. This invention improves the reliability of target structure representation in highly confusing scenarios by stabilizing the contextual information in high-level features before long-distance relationship modeling, thereby reducing the continuous amplification of complex backgrounds and unreliable responses during relationship propagation.
[0035] 2. This invention improves the effectiveness of training constraints under weak supervision by adaptively reweighting sparse supervision signals based on the prediction error on the supervised pixels during the training process, so that limited supervision is preferentially applied to positions more prone to structural degradation. Attached Figure Description
[0036] Figure 1 This is a schematic diagram illustrating the principle of the high-level feature context stabilization and relation aggregation method in an embodiment of the present invention.
[0037] Figure 2 This is a schematic diagram of the supervised reweighting mechanism based on prediction error in an embodiment of the present invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] Example 1
[0040] Embodiment 1 of this invention proposes a structural stabilization method for weakly supervised camouflage target detection. This method is used to detect and restore the structure of camouflage targets under conditions relying solely on sparse supervision information such as graffiti annotations, focusing on addressing the structural degradation problem caused by insufficient supervision information in existing weakly supervised camouflage target detection methods. Structural degradation mainly manifests as fragmentation of the target region, local missing parts, boundary breaks, and unstable prediction results in complex scenes. Existing methods typically improve performance by increasing the number of network layers, stacking attention modules, or using general multi-scale fusion methods. However, under weak supervision, these methods are insufficient to fundamentally suppress the generation and propagation of structural errors. This embodiment of the invention addresses this problem by improving the high-level feature relationship modeling process and the supervision allocation process during the training phase, thereby improving the structural integrity and stability of camouflage target prediction results without adding additional dense annotations.
[0041] The technical solution of this embodiment can be summarized as follows: First, the training image and its corresponding sparse supervision annotation are obtained. The sparse supervision annotation is preferably foreground graffiti and background graffiti, used to determine the position and category of some foreground and background pixels. Then, the training image is input into the feature extraction network to obtain a hierarchical feature representation containing low-level texture information and high-level semantic information. In this embodiment, the training image is processed by the feature extraction network to obtain a hierarchical feature representation. Among them, the lower-level features mainly include target edges, texture details, and local spatial difference information, while the higher-level features mainly include semantic information of the target region and contextual response. In a preferred embodiment, the low-level features are first subjected to local structure enhancement processing before participating in the final prediction. The local structure enhancement processing can be implemented by local context contrast enhancement, edge response enhancement, spatial attention enhancement, or a combination thereof, the purpose of which is to retain the boundary and local shape cues that are easily lost under weak supervision. The enhanced low-level features are then fused with the high-level features after context stabilization and relation aggregation to jointly generate the final prediction result.
[0042] For high-level features, this embodiment of the invention does not directly model long-distance relationships. Instead, it first performs context stabilization to enhance the reliability of contextual information involved in subsequent relationship propagation. After this process, long-distance dependencies are established on the stabilized high-level features to obtain a more consistent representation of the target structure. After the model outputs prediction results, the prediction error is calculated only within the set of supervised pixels covered by sparse supervision annotations. The supervision loss is then adaptively reweighted based on the prediction error, prioritizing locations more prone to structural degradation during training. Finally, the model parameters are updated based on the reweighted loss function, resulting in a trained weakly supervised camouflage target detection model. During the inference phase, the image to be tested is input into the trained model to output the corresponding camouflage target detection result.
[0043] The key aspects of this embodiment are as follows: First, before performing relational modeling on high-level features, context stabilization is performed to prevent unstable contexts from being further amplified during long-distance dependency propagation. Second, during weakly supervised training, the supervision signal is adaptively reweighted based on the prediction error on the supervised pixels, allowing limited supervision to prioritize high-risk structural regions. These two processes correspond to stabilization at the feature representation level and strengthening at the supervision constraint level, respectively, and both work together to address the structural degradation problem under weak supervision. Furthermore, in this embodiment, the feature extraction network is not limited to a single, unique structure, as long as it can output hierarchical features. Preferably, the feature extraction network can use ResNet-50 as the backbone network to obtain both low-level and high-level features; in other implementations, network structures with hierarchical feature output capabilities, such as ResNet-101, ConvNeXt, Vision Transformer, or Swin Transformer, can also be used. Correspondingly, the prediction result acquisition part can employ an encoder-decoder structure, a feature pyramid fusion structure, or a multi-layer feature fusion structure with lateral connections; any structure capable of enhancing the joint fusion of high-level and low-level structural features can be applied in the implementation of this invention.
[0044] In camouflaged target detection tasks, targets and backgrounds are often highly similar in color, texture, and local statistical properties. Therefore, the contextual responses in high-level features are easily influenced by the background. In weakly supervised scenarios such as graffiti supervision, the model can only obtain explicit constraints at a few supervised locations, making it more susceptible to relying on implicit contextual relationships in high-level features to complete the target region. If long-distance relationship modeling is performed directly on the original high-level features, the locally unstable responses will extend to a larger spatial range in subsequent dependency propagation, ultimately manifesting as target structure shift and region fragmentation. To address this issue, this invention introduces contextual stabilization processing before high-level features enter long-distance relationship modeling, ensuring that relationship propagation is based on more reliable contextual evidence.
[0045] In a preferred embodiment, the input high-level features are assumed to be... ,in For batch size, For the number of channels, and This represents the spatial dimensions. First, depthwise separable convolution and nonlinear mapping are performed on the input features to obtain the basic response features. ,in The activation function is preferably ReLU. The purpose of setting the basic response features is to pre-integrate the high-level input features at a low computational cost, providing a stable input for subsequent multi-branch context sampling.
[0046] To cover contextual information across different spatial ranges, embodiments of the present invention preferably construct multiple contextual sampling branches based on the basic response features. Let the number of branches be... In the preferred embodiment, take For the first The branch can introduce different sampling scales or different dilation rates. The offset field is generated by a lightweight offset prediction head.
[0047] ,in This indicates the sampling window size. Subsequently, dynamic sampling is performed on the basic response features to obtain the branch features. ,in For the set of relative offsets of the reference sampling grid, For learnable weights, This represents the current position coordinates. The technical significance of the above processing is that the sampling position is no longer fixed, but is adaptively adjusted according to the current input content, thereby making the context sampling results more consistent with the real structural distribution of the camouflaged target in a complex background.
[0048] After obtaining branch characteristics Subsequently, this embodiment of the invention does not immediately perform long-distance relationship modeling, but first performs context stabilization processing on each branch feature. This processing preferably utilizes three types of information simultaneously—local context, global context, and spatial location response—to construct stabilized features. First, local context is extracted from the branch features using a local pooling operator, which can be denoted as... Then, global average pooling is used to extract the global context, which can be denoted as: Subsequently, a local attention map is obtained using shared mapping. and global attention diagram And through learnable gating parameters By fusion, a hybrid contextual attention is obtained. ,in This indicates that the attention image will be adjusted to the input space size. The transformation operator. Meanwhile, to emphasize structurally relevant locations, a spatial attention map can be constructed based on the spatial mean response of the branch characteristics. ,in Represents the Sigmoid mapping. This represents the spatial attention generation function. Finally, the branched features are combined with the aforementioned hybrid contextual attention and spatial attention to obtain the stabilized features. ,in This represents the Hadamard product. The purpose of this process is to first filter and robusten the contextual evidence in the high-level features before sending it to the subsequent relation propagation stage, thereby reducing the destructive effect of confusing backgrounds and local noise on long-distance dependency modeling.
[0049] After completing the context stabilization process, the embodiments of the present invention further refine the stabilized features. Perform long-distance relationship aggregation. For each branch, it is preferable to establish affinity relationships between spatial locations using query features and key features. Let... , in , The optimal number of channels after dimensionality reduction is [number]. Flatten the space into Then, the affinity matrix between positions can be calculated, and the spatial attention weights can be obtained by Softmax normalization. Furthermore, let express If the expression is flattened, then the result of relation aggregation can be written as: ,in The learnable residual coefficients are preferably initialized to 0 to control the strength of introducing long-range relationships, keeping the training stable in the early stages and gradually enhancing the global dependency modeling effect in later stages. This process enables the propagation of long-range relationships based on more reliable features.
[0050] In a preferred embodiment, the branch relationships are aggregated and output. It can also be compared with basic response characteristics They are combined using a weighted fusion method. Let the fusion weight be... After Softmax normalization, the result is obtained Then the final high-level enhanced output can be written as ,in This represents the residual mapping of input features. Through this fusion process, while preserving input information, the enhancement effects of multi-branch context sampling and relation aggregation can be combined to obtain a more stable high-level structural representation.
[0051] In weakly supervised camouflage target detection tasks, another major challenge in training constraints lies in the extremely limited number of supervised pixels. If a uniform weight is applied to all supervised pixels, the limited supervised signals will be evenly distributed, making it difficult to concentrate their effect on the most critical and challenging locations. In practice, supervised pixels with large prediction errors typically correspond to highly confusing regions between the target and background, boundary transition regions, or regions with weak structural connections. These locations have a significant impact on the overall structural stability. If stronger constraints are not applied to these high-risk locations during training, local errors can easily accumulate and evolve into larger-scale structural deviations during iterations. Therefore, this invention proposes a supervised reweighting mechanism based on prediction error.
[0052] Let the model output a binary classification logit as... superscript Indicates the first Training samples. The probability tensor is obtained after Softmax normalization. And let the foreground probability be . Let the set of supervised pixels determined by sparse supervised annotations be . The corresponding supervision label is Then the prediction error on the supervised pixel can be defined as The aforementioned error metric directly reflects the current learning state of the supervised pixel. A larger error indicates greater instability at that location and a greater need for additional constraints. Therefore, this embodiment of the invention generates supervised weights based on the prediction error, rather than applying a uniform training intensity to all supervised pixels.
[0053] To avoid excessive weight fluctuations due to large local errors in the early stages of training, this invention preferably introduces an adjustment coefficient that gradually increases with the training process. ,in Indicates the current training round. Indicates the duration of progressively increasing intensity. This represents the maximum adjustment strength. Then, the error-aware base weights are constructed. Therefore, supervised pixels with larger prediction errors will receive higher weights, while locations with smaller errors will maintain a supervision strength close to the base weight of 1. This process achieves dynamic redistribution of limited supervision signals, allowing the training process to prioritize correcting locations more likely to cause structural degradation.
[0054] In a preferred embodiment, the present invention may further introduce edge-sensitive weights to enhance the learning constraints on boundaries and structural transition regions. Specifically, edge response maps can be computed on a sparse supervision mask. And define the edge weights as ,in Edge weight adjustment coefficient, To prevent stable terms with a denominator of zero, the final supervisory weights can be written as: ,in This indicates the upper limit of the weights, used to prevent individual supervised pixels from having excessively large weights that could disrupt training stability. It should be noted that edge weights only adjust the supervision intensity within the existing supervised pixel range; they do not introduce new supervised pixels or add additional manual annotations. Therefore, this step is an additional implementation that improves the efficiency of supervision utilization under existing sparse supervision conditions.
[0055] Based on the aforementioned supervision weights, this embodiment of the invention can further construct a weighted supervision loss. Let the binary classification cross-entropy be... Then the first The error-perceived reweighted supervision term for each sample can be written as: ,in This represents the number of supervised pixels. The overall error-aware reweighted supervision loss can be obtained by averaging the batch of samples. Therefore, this invention directly transforms the prediction error into the supervision intensity in the training loss, which differs from the traditional uniform supervision method and the method of mining general hard samples only at the sample level. Instead, it performs refined supervision allocation at the pixel level around the requirement of structure preservation.
[0056] In a preferred embodiment, the overall training objective can be further combined with an auxiliary deep supervision term and a detail consistency constraint term to form a composite training objective. ,in The aforementioned error perception reweighted supervision term, This is a detail consistency constraint, used to further improve boundaries and local details after the main structure has been initially formed. To assist deep supervision, additional constraints are provided at different levels to alleviate the under-constraint problem caused by sparse supervision.
[0057] This embodiment first acquires the training image and its corresponding sparse supervision annotations, and determines the supervision pixel set based on the annotations. Then, a hierarchical feature representation of the image is obtained through a feature extraction module, where high-level features are used for subsequent structure-related context modeling. Next, context stabilization processing is performed on the high-level features, and stable context features are obtained through multi-range context sampling, local and global context filtering, and spatial attention enhancement. Subsequently, long-distance relationship aggregation is performed on the stabilized features to enhance the structural connections between spatially separated but semantically belonging regions of the same target, and the camouflage target prediction result is output. After obtaining the prediction result, the prediction error is calculated only within the supervision pixel set, and supervision weights are generated based on the prediction error to reweight the supervision loss; if necessary, auxiliary deep supervision and detail consistency constraints can also be superimposed to jointly complete the model parameter update. After training, the test image is input into the trained model to output the corresponding camouflage target detection result.
[0058] In the inference phase, the basic implementation of this embodiment is to directly input the image to be tested into the trained detection model and output the prediction result of the camouflaged target. Without changing the core technical solution of this invention, conventional inference enhancement strategies can also be superimposed to further improve the prediction stability in complex scenes, but the inference enhancement strategies are not considered as the core distinguishing technical features of this invention.
[0059] On the one hand, this embodiment improves the reliability of high-level features participating in relationship propagation by introducing context stabilization processing before long-distance relationship modeling, and reduces the spread of erroneous contexts in global dependency modeling. On the other hand, by adaptively reweighting sparse supervision signals based on prediction errors during training, the constraint effect of limited supervision on high-risk regions is enhanced, and the ability of the training process to correct structural errors is improved.
[0060] Specifically, this invention firstly effectively suppresses structural degradation of targets under weak supervision. Existing graffiti-supervised camouflage target detection methods, due to the limited number of supervised pixels, often only directly constrain local areas of the target. When the foreground and background are highly similar, local misjudgments can easily spread further through context propagation, gradually evolving into structural errors such as target region fragmentation, local missing parts, and boundary breaks. This invention introduces context stabilization processing before long-distance relationship modeling, allowing contextual information in high-level features to be filtered and corrected before entering the relationship propagation stage, thereby reducing the possibility of unstable contexts spreading over a large spatial range. Since subsequent relationship modeling is based on more reliable features, it is more conducive to maintaining the overall outline of the target, the connectivity of its internal regions, and the continuity of its boundaries. Compared with methods that rely solely on general multi-scale fusion or directly perform global relationship modeling, this invention is more conducive to maintaining the integrity of the target structure under weak supervision.
[0061] This invention further enhances the contextual discrimination capability in highly obfuscated scenarios. The challenge of camouflaged target detection lies in the high degree of similarity between the target and the background in local appearance. If the model directly establishes long-distance dependencies on the original high-level features, background interference and local erroneous responses are easily propagated, causing non-target regions to be falsely activated or the true target region to be further weakened. This invention divides the processing of high-level features into two sequential stages: contextual stabilization and relation aggregation. Essentially, it first improves the reliability of contextual evidence before performing long-distance dependency propagation. This processing logic changes the traditional approach of directly performing non-local modeling on high-level features, allowing the subsequently established spatial relationships to more effectively reflect the real connections between different regions within the target, rather than simply diffusing obfuscated information from the original high-level semantics. Therefore, this invention not only improves the coherence of the target structure but also enhances the model's ability to distinguish camouflaged targets in complex backgrounds.
[0062] This invention also improves the utilization efficiency of weakly supervised training signals. For sparse supervision methods such as graffiti supervision, the supervision signal only acts on a small number of pixel locations. If a uniform weight training method is used, the limited supervision will be evenly distributed, making it difficult to concentrate on key areas that truly affect structural stability. This invention calculates the prediction error on supervised pixels during training and generates supervision weights based on the prediction error. This gives stronger supervision constraints to locations with larger prediction errors and higher structural degradation risks, while keeping lower or basic supervision intensity at locations with smaller prediction errors. Thus, the training process is no longer a uniform optimization of all supervised pixels, but rather a more targeted gradient allocation around high-risk areas. This mechanism improves the utilization efficiency of sparse supervision without adding any additional annotations, enabling limited supervision to more effectively correct erroneous responses in highly confused regions, boundary transition regions, and locally weak structural regions.
[0063] For weakly supervised camouflage target detection tasks, simply increasing the supervision strength or simply enhancing high-level relationship modeling can lead to training instability. On the one hand, introducing strong global relationship propagation too early when high-level features are not yet reliable can easily amplify local errors; on the other hand, assigning excessively strong weights to high-error pixels directly in the early stages of training can easily cause fluctuations in the optimization process. To address these issues, this embodiment adopts a sequential design of stabilization followed by relationship aggregation on the high-level feature side, and a reweighting strategy that gradually increases the weight based on prediction error on the training loss side, thus balancing structural recovery capability and training process stability. This embodiment does not achieve performance gains by simply adding complex modules, but rather by simultaneously constraining the feature propagation order and supervision allocation method, making it easier for the model to form a stable convergence process under weak supervision conditions.
[0064] Experimental results show that this embodiment demonstrates superior structure prediction quality on multiple publicly available camouflage target detection datasets and exhibits better stability across different scenarios. In a set of experiments, using the S-COD dataset as the training set, the method of this invention was validated on the CAMO, CHAMELEON, and COD10K test sets and compared with baseline methods. Experimental results show that the method of this embodiment demonstrates improvements in all structure-related evaluation metrics.
[0065] The average relative improvement of the three benchmarks are respectively Up 4.26%, Up 1.11%, Up 2.11% and The gain is 1.61%. This gain is not concentrated on a single dataset, such as the method of this embodiment on CHAMELEON. The relative improvement was 8.70%, and it brought [a certain percentage] to COD10K. 2.64% and The relative improvement is 2.78%. Since this embodiment does not require additional dense pixel annotations, but directly improves the feature relationship modeling and supervision allocation methods under existing sparse supervision conditions, it can improve the structural quality of camouflaged target detection while maintaining low annotation costs. This embodiment has good practical application significance for environmental monitoring, wildlife protection, medical image-assisted analysis, and other applications requiring target detection or region identification in complex backgrounds. Compared with methods that rely on dense annotations or highly depend on scene priors, this embodiment can obtain more stable structural prediction results at lower annotation costs, thus having strong application value.
[0066] Figure 1 This is a schematic diagram illustrating the context stabilization and relationship aggregation of high-level features in an embodiment of the present invention. Before performing long-distance relationship modeling on high-level features, their context information is first stabilized, and then relationship aggregation is performed based on the stabilized features. Figure 1 The left side shows the base response formed after preprocessing of the input high-level features, and the sampling of contextual information in different spatial ranges by multiple branches; Figure 1 The middle section illustrates the process of multi-layer context stabilization for the features of each branch. This process comprehensively utilizes local context information, global context information, and spatial response information to filter and enhance the contextual evidence related to the target structure. Figure 1 The right side shows that after completing the context stabilization process, nonlocal relation aggregation is performed on the stabilized features to establish more reliable long-distance structural associations; Figure 1 The symbols and connections shown at the bottom illustrate the basic operational relationships such as feature fusion, weighted mapping, and activation processing. The key technical point illustrated in this diagram is the processing order: context stabilization is performed first, followed by relationship aggregation, to reduce the risk of unstable contexts being amplified during long-running dependency propagation.
[0067] Figure 2 This is a schematic diagram of a supervised reweighting mechanism based on prediction error in an embodiment of the present invention. During weakly supervised training, adaptive supervised weights are constructed based on the prediction error on the supervised pixels, and the supervised loss is reweighted using these supervised weights. Figure 2 The left side shows the correspondence between the main network output, auxiliary output and sparse supervision annotation during the training process, where the main output is used to generate the current prediction result and the sparse supervision annotation is used to generate supervision labels; Figure 2The right side shows the core process of error-aware reweighted supervision, which includes calculating the prediction error from the prediction result and the supervision label, extracting the edge response from the supervision label, generating the basic supervision weight from the prediction error, generating the edge weight from the edge response, synthesizing the final supervision weight from the basic supervision weight and the edge weight, and using the final supervision weight to weight the supervision loss. Figure 2 The consistency constraints and contextual semantic constraints shown are auxiliary training constraints in the preferred embodiment, which aim to enhance the stability of the training process, but... Figure 2 The core technology focuses on the error-aware reweighting supervision mechanism itself. Figure 2 It is evident that the supervision signal is no longer applied evenly to all supervised pixels, but rather, based on the prediction error and structurally sensitive information, it imposes stronger constraints on high-risk regions, thereby improving the training effectiveness under sparse supervision conditions.
[0068] Example 2
[0069] Embodiment 2 of the present invention provides a terminal device corresponding to Embodiment 1 above. The terminal device can be a processing device for a client, such as a mobile phone, a laptop, a tablet computer, a desktop computer, etc., to execute the method of the above embodiments.
[0070] The terminal device in this embodiment includes a memory, a processor, and a computer program stored in the memory; the processor executes the computer program in the memory to implement the steps of the method in Embodiment 1 described above.
[0071] In some implementations, the memory may be high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device.
[0072] In other implementations, the processor can be any type of general-purpose processor, such as a central processing unit (CPU) or a digital signal processor (DSP), and there is no limitation here.
[0073] Example 3
[0074] Embodiment 3 of the present invention provides a computer-readable storage medium corresponding to Embodiment 1 above, on which a computer program / instructions are stored. When the computer program / instructions are executed by a processor, they implement the steps of the method of Embodiment 1 above.
[0075] A computer-readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof.
[0076] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0077] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0078] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0079] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0080] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for detecting the structural stability of camouflaged targets under graffiti supervision, characterized in that, Includes the following steps: S1. Obtain the training image and its corresponding sparse supervision annotation, wherein the sparse supervision annotation includes foreground graffiti and background graffiti; S2. Input the training image into the feature extraction network to obtain low-level features and high-level features; S3. Perform context stabilization processing on the high-level features to obtain stabilized high-level features, and perform relation aggregation on the stabilized high-level features to obtain enhanced high-level features; The enhanced high-level features are fused with the low-level features to obtain the prediction result; S4. Based on the prediction results, calculate the prediction error within the set of supervised pixels covered by the sparse supervised annotations, and adaptively reweight the supervised loss according to the prediction error. S5. Update the parameters of the feature extraction network based on the reweighted loss function to obtain a weakly supervised camouflage target detection model; The enhanced high-level feature acquisition process includes: Perform depthwise separable convolution and nonlinear mapping on the high-level features to obtain the basic response features. ; Multiple context sampling branches are constructed based on the basic response features. Different inflation rates are set for each branch, and dynamic sampling is performed to obtain the features of each branch. Local context information and global context information are extracted from the features of each branch, and hybrid context attention information is generated based on the local context information and global context information. A spatial attention map is also generated based on the features of each branch. Based on the branch features, mixed contextual attention information, and spatial attention graph, the stabilization features of each branch are obtained; Based on the stabilized features, relation aggregation is performed to obtain the relation aggregation results of each branch, which is the enhanced high-level feature.
2. The method according to claim 1, characterized in that, The basic response characteristics Represented as: ;in, For activation function, Indicates characteristics of high-level personnel Perform depthwise separable convolution operations.
3. The method for detecting the structural stability of camouflaged targets under graffiti supervision according to claim 1, characterized in that, Branch characteristics of the i-th branch at the current position coordinates Represented as: ;in, For the set of relative offsets of the reference sampling grid, For learnable weights, Indicates the current position coordinates. For expansion rate, Indicates the first The branch is at the current position Corresponding relative offset The sampling offset.
4. The method according to claim 1, characterized in that, No. Mixed contextual attention information of branching and the Spatial attention diagram of branch Local attention maps are obtained by generating them based on local and global context information, respectively. and global attention diagram The local attention map and the global attention map are weighted and fused using learnable gating parameters, and the fusion result is adjusted to the input space size to obtain the first... Mixed contextual attention information of branching The branch features are averaged by channels, then convolutional mapping is performed, followed by Sigmoid mapping to obtain the first... Spatial attention diagram of branch .
5. The method according to claim 1, characterized in that, The stabilization feature is expressed as: ;in, This represents element-wise multiplication. Indicates the first Branching characteristics of a branch Indicates the first Pay attention to the mixed context information of the branches. Indicates the first Spatial attention diagram of branches.
6. The method according to claim 1, characterized in that, The result of the relation aggregation is expressed as follows: ;in, For learnable residual coefficients, Indicates the first Branch stabilization characteristics Zhanping said, For the first Pay attention to the spatial weights of the branches, and reshape() represents size reconstruction.
7. The method according to claim 1, characterized in that, Before being fused with the enhanced high-level features, the low-level features are further subjected to one or more of the following processing methods: local contextual contrast enhancement, edge enhancement, and spatial attention enhancement. The enhanced low-level features are then fused with the enhanced high-level features.
8. The method for detecting the structural stability of camouflaged targets under graffiti supervision according to claim 1, characterized in that, loss function The expression is: ;in, For the error-aware reweighted supervision term, the first... The error-perceived reweighted supervision term for each sample is represented as follows: The foreground probability of the b-th sample The probability tensor of the b-th sample , , This represents the probability tensor of the b-th sample at position in the first channel. The value at position, the first Supervision label for each sample , For binary classification cross-entropy loss, the first... Weights of each sample , Indicates the upper limit of the weight, the first Error-aware base weights for each sample , No. Marginal weights of each sample adjustment coefficient , Indicates the current training round. Indicates the duration of progressively increasing intensity. Indicates the maximum adjustment intensity. Indicates the first Edge response map of each sample In position The response value at that location, Indicates the first Edge response map of each sample The maximum response value in, the first Prediction error per sample , The first sparse supervision labeling determined The set of supervised pixels for each sample. Edge weight adjustment coefficient, To prevent stable terms with a denominator of zero, Indicates the number of supervised pixels. These are detail consistency constraints used to improve boundary and local detail consistency. , , , This indicates a consistency constraint between the prediction results and the supervision labels. This represents the consistency constraint on the boundary pixels. and These represent the weight coefficients of the corresponding items. and These represent the gradient operators in the horizontal and vertical directions, respectively; the first... Edge response map of each sample By the Supervision label for each sample Obtained through edge extraction, specifically represented as ,in and These are Sobel horizontal and vertical convolution kernels, respectively. For auxiliary deep supervision items used to provide additional supervision at different levels, , , No. The supervision item corresponding to each auxiliary output Represented as M represents the number of auxiliary output layers. Indicates the first Supervision weights for each auxiliary output, Indicates the first The sample at the th Prediction results on each auxiliary output Indicates the first Each auxiliary output corresponds to a supervision label at a given scale. Indicates the first The sample at the th A set of supervised pixels at an auxiliary output scale. Indicates the first The number of pixels in the supervised pixel set of the auxiliary output, where H and W represent the height and width of the space, respectively.
9. A camouflage target structure stability detection system for graffiti supervision, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Weakly supervised vehicle feasible region segmentation method fusing road space prior and region-level features
CN114359873A
Weak supervision saliency target detection method based on enhanced graffiti annotation
CN118230106A