Camouflaged target detection method, device, computer equipment and storage medium
The camouflage target detection model performs feature pyramid processing and consistency evaluation on the input image, which solves the problem of low camouflage target detection accuracy caused by color and texture interference in the existing technology, and achieves high-accuracy identification and positioning of camouflage targets. .
Patent Information
- Application Number
- CN202410751098.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-06-12
AI Technical Summary
Existing camouflaged target detection methods cannot effectively overcome color and texture interference factors, resulting in low accuracy of camouflaged target detection.
Through the camouflage target detection model, the input image is processed by feature pyramid, the target features are obtained and the consistency is evaluated, the consistency features are generated, and finally target segmentation is achieved to overcome the influence of color and texture interference.
It improves the accuracy of camouflage target detection and can accurately identify and locate camouflage targets in difficult scenes.
Smart Images

Figure CN118334322B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to a method, apparatus, computer device and storage medium for detecting camouflaged targets. Background Art
[0002] Camouflaged target detection is used to detect and segment targets that are difficult to detect in visual scenes. It aims to quickly and accurately detect camouflaged targets that are highly similar to the background or obscured by the background. It is widely used in medical image analysis, ecological protection and other fields.
[0003] In existing camouflaged target detection methods, detection is usually performed based on the texture features of the target and the background. However, for targets with a high degree of camouflage, such as using color interference to weaken the texture features at the junction of the target and the background, the above methods cannot overcome the influence of factors such as color and texture interference on camouflaged target detection, resulting in low target detection accuracy.
[0004] There is no effective solution to the problem that related technologies cannot overcome the influence of factors such as color and texture interference on camouflaged target detection, resulting in low accuracy of target detection. Summary of the invention
[0005] In this embodiment, a camouflaged target detection method, apparatus, computer equipment and storage medium are provided to solve the problem in the related art that the influence of factors such as color and texture interference on camouflaged target detection cannot be overcome, resulting in low accuracy of target detection.
[0006] In a first aspect, a disguised target detection method is provided in this embodiment, and the method includes:
[0007] Processing the input image through the disguised target detection model to obtain a first target segmentation image corresponding to the input image;
[0008] The step of processing the input image by using the disguised target detection model includes:
[0009] Acquire a feature pyramid of the input image, perform target detection on the feature pyramid of the input image, and obtain corresponding target features;
[0010] Based on the feature pyramid and the target feature, performing consistency evaluation on the input image to obtain a consistent feature of the input image;
[0011] Based on the feature pyramid and the consistency feature, the input image is segmented into objects.
[0012] In some embodiments, the step of performing consistency evaluation on the input image based on the feature pyramid and the target feature to obtain a consistency feature of the input image includes:
[0013] Based on the target feature, performing consistency evaluation on internal elements of the target object in the input image to obtain a first consistency feature of the input image;
[0014] Based on the feature pyramid and the target feature, a consistency evaluation is performed on the target object and the background environment in the input image to obtain a second consistency feature of the input image;
[0015] The first consistency feature and the second consistency feature are used as consistency features of the input image.
[0016] In some embodiments, the step of performing consistency evaluation on the target object and the background environment in the input image based on the feature pyramid and the target feature to obtain a second consistency feature of the input image includes:
[0017] Obtaining low-level features of the input image in the feature pyramid;
[0018] Fusing the low-level features of the input image with the target features;
[0019] Based on the fusion result, extracting consistency information between the target object and the background environment in the input image;
[0020] The consistency information between the target object and the background environment is used as the second consistency feature of the input image.
[0021] In some of the embodiments, performing target detection on the feature pyramid of the input image to obtain corresponding target features includes:
[0022] Acquire multiple layers of primary features of the input image from a feature pyramid of the input image;
[0023] Splicing multiple layers of primary features of the input image to obtain spliced features;
[0024] The spliced features are fused through a residual channel attention module;
[0025] According to the fusion result, the corresponding target features are extracted.
[0026] In some of the embodiments, extracting the corresponding target features according to the fusion result includes:
[0027] Extracting channel attention features from the fusion results, and converting the channel attention features into corresponding segmentation features;
[0028] Determining a weight tensor based on the segmentation features and a preset learnable threshold parameter;
[0029] Perform a dot multiplication operation on the weight tensor and the channel attention feature to obtain the corresponding target feature.
[0030] In some embodiments, generating a first target segmentation image corresponding to the input image based on the feature pyramid and the consistency feature includes:
[0031] The consistency feature is gradually fused with the multiple layers of primary features in the feature pyramid to obtain a target fused feature;
[0032] Processing the target fusion features through a segmentation head to obtain a segmentation label image corresponding to the input image;
[0033] The segmented label image is upsampled to obtain the first target segmented image.
[0034] In some of the embodiments, before the input image is processed by the disguised object detection model, the method further includes:
[0035] Pre-training the camouflaged target detection model;
[0036] Specifically, a first target detection model is constructed; the first target detection model includes a preliminary detection module, an image evaluation module and a target segmentation module; the output of the preliminary detection module includes a second target segmentation image, the output of the image evaluation module includes a third target segmentation image, and the output of the target segmentation module includes the first target segmentation image;
[0037] Constructing a loss function based on the first target segmentation image, the second target segmentation image, and the third target segmentation image;
[0038] A training sample of the disguised target detection model is obtained, and the first target detection model is trained based on the training sample and the loss function to obtain the fully trained disguised target detection model.
[0039] In a second aspect, a disguised target detection device is provided in this embodiment, the device comprising: a detection module, an evaluation module and a segmentation module;
[0040] The detection module is used to obtain a feature pyramid of an input image, perform target detection on the feature pyramid of the input image, and obtain corresponding target features;
[0041] The evaluation module is used to perform consistency evaluation on the input image based on the feature pyramid and the target feature to obtain a consistency feature of the input image;
[0042] The segmentation module is used to perform target segmentation on the input image based on the feature pyramid and the consistency feature to obtain a first target segmentation image corresponding to the input image.
[0043] In a third aspect, a computer device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the camouflaged target detection method described in the first aspect when executing the computer program.
[0044] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the camouflaged target detection method described in the first aspect is implemented.
[0045] Compared with the related art, the camouflaged target detection method, apparatus, computer equipment and storage medium provided in the present embodiment obtain corresponding target features by performing target detection on the feature pyramid of the input image; based on the feature pyramid and the target features, the input image is evaluated for consistency to obtain the consistency features of the input image; further, based on the feature pyramid and the consistency features, a first target segmentation image corresponding to the input image is generated, which solves the problem that the influence of factors such as color and texture interference on camouflaged target detection cannot be overcome, resulting in low accuracy of target detection, and achieves overcoming the influence of factors such as color and texture interference on camouflaged target detection, thereby improving the accuracy of camouflaged target detection.
[0046] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0048] Figure 1 It is a hardware structure block diagram of a terminal device of a disguised target detection method provided by an embodiment of the present application;
[0049] Figure 2 is a flow chart of a camouflaged target detection method provided by an embodiment of the present application;
[0050] Figure 3It is an overall framework diagram of a camouflaged target detection method provided by an embodiment of the present application;
[0051] Figure 4 is a schematic diagram of a consistency assessment process provided by an embodiment of the present application;
[0052] Figure 5 It is a schematic diagram of the preprocessing process of the feature pyramid provided by an embodiment of the present application;
[0053] Figure 6 It is a schematic diagram of a process for extracting target features provided by an embodiment of the present application;
[0054] Figure 7 is a schematic diagram of a target segmentation process provided by an embodiment of the present application;
[0055] Figure 8 is a flow chart of a camouflaged target detection method provided by a preferred embodiment of the present application;
[0056] Fig. 9 It is a structural block diagram of a camouflaged target detection device provided in one embodiment of the present application.
[0057] In the figure: 102, processor; 104, memory; 106, transmission device; 108, input and output device; 10, detection module; 20, evaluation module; 30, segmentation module. DETAILED DESCRIPTION
[0058] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0059] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0060] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of the camouflaged target detection method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0061] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the camouflaged target detection method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0062] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0063] In this embodiment, a camouflaged target detection method is provided. Figure 2 is a flow chart of the camouflaged target detection method of this embodiment. Figure 2 As shown, the process includes the following steps:
[0064] The input image is processed by the disguised target detection model to obtain a first target segmentation image corresponding to the input image; wherein the input image is processed by the disguised target detection model, including the following steps:
[0065] Step S210, obtaining a feature pyramid of the input image, performing target detection on the feature pyramid of the input image, and obtaining corresponding target features;
[0066] Step S220, based on the feature pyramid and the target feature, the consistency evaluation is performed on the input image to obtain the consistency feature of the input image;
[0067] Step S230, performing object segmentation on the input image based on the feature pyramid and the consistency feature.
[0068] Specifically, Figure 3As shown, the input image is input into the camouflaged target detection model, and the encoder performs multi-scale feature extraction on the input image to obtain a feature pyramid of the input image. The multi-scale feature extraction method includes but is not limited to Gaussian pyramid, Laplacian pyramid, multi-scale filtering, etc. Among them, the feature pyramid includes multiple layers of primary features corresponding to the input image, and the primary features at different levels have different resolutions. The primary features with higher resolution are low-level features, such as color features, geometric features, etc., and the primary features with lower resolution are high-level features, such as shape features, structural features, and other abstract features with semantic information.
[0069] Furthermore, the feature pyramid of the input image is input into the preliminary detection module of the model, the multiple layers of primary features of the feature pyramid are spliced to obtain spliced features, and the spliced features are fused, so that the corresponding target features can be extracted according to the fusion results to characterize the local features of the image position where the target object is located.
[0070] The low-level features in the feature pyramid are obtained to characterize the global features of the input image, and the low-level features in the feature pyramid and the target features obtained by preliminary detection are input into the image evaluation module of the model to obtain the consistency features of the input image. The consistency of the internal elements of the target object in the input image is evaluated based on the target features to obtain the first consistency features of the input image; the low-level features and the target features of the input image are fused, and based on the fusion results, the consistency information of the target object and the background environment is extracted from the input image. The consistency information of the target object and the background environment is the second consistency feature of the input image, and then the first consistency feature and the second consistency feature are used as the consistency features of the input image.
[0071] Afterwards, the feature pyramid and consistency features of the input image are sent to the target segmentation module, which fuses the consistency features with the multi-layer primary features in the feature pyramid step by step to obtain the target fusion features. The target fusion features are processed by the segmentation head to obtain the segmentation label image corresponding to the input image, and the segmentation label image is upsampled to obtain the first target segmentation image, which can accurately identify and locate the camouflaged target in the input image.
[0072] It should be noted that this embodiment adopts a coarse-to-fine target detection framework, which first extracts the target features corresponding to the input image and fuses them with its global features, and then extracts the consistency features of the image based on the fusion results, so that the consistency features can be used to guide the refined segmentation of the target and improve the accuracy of the output target segmentation image.
[0073] In addition, the target detection model in this embodiment is suitable for scenarios such as medical image analysis, industrial defect detection, and transparent target detection. In the above scenarios, the model can obtain accurate detection and segmentation results, such as polyp detection and segmentation, crack detection of roads or industrial production devices, and recognition and detection of glass windows or glass cups.
[0074] In existing camouflaged target detection methods, detection is usually performed based on the texture features of the target and the background. However, for targets with a high degree of camouflage, such as using color interference to weaken the texture features at the junction of the target and the background, the above methods cannot overcome the influence of factors such as color and texture interference on camouflaged target detection, resulting in low target detection accuracy.
[0075] Compared with the prior art, the present application performs target detection on the feature pyramid of the input image to obtain the corresponding target features; based on the feature pyramid and the target features, the input image is evaluated for consistency to obtain the consistency features of the input image; further, based on the feature pyramid and the consistency features, a first target segmentation image corresponding to the input image is generated. Based on this, by performing consistency evaluation on the input image based on the feature pyramid and the target features of the input image, and guiding the refined segmentation of the image target according to the result of the consistency evaluation, so as to accurately output the final target segmentation image, the problem of being unable to overcome the influence of factors such as color and texture interference on the detection of camouflaged targets, resulting in low accuracy of target detection, is solved, and the influence of factors such as color and texture interference on the detection of camouflaged targets is overcome, thereby improving the accuracy of the detection of camouflaged targets.
[0076] In some embodiments, the step S220 of performing consistency evaluation on the input image based on the feature pyramid and the target feature to obtain the consistency feature of the input image includes the following steps:
[0077] Step S221, based on the target feature, performing consistency evaluation on the internal elements of the target object in the input image to obtain a first consistency feature of the input image;
[0078] Step S222, based on the feature pyramid and the target feature, the consistency of the target object and the background environment in the input image is evaluated to obtain a second consistency feature of the input image;
[0079] Step S223: Using the first consistency feature and the second consistency feature as consistency features of the input image.
[0080] In this embodiment, the consistency features of the input image include a first consistency feature and a second consistency feature. Among them, by processing the target features of the input image, the consistency information of the internal elements of the target object in the input image is extracted as the first consistency feature, that is, the internal consistency feature. The first consistency feature refers to the features with similarity or unity between the various parts of the target object, such as color, texture or shape, etc., so as to effectively analyze the integrity of the internal elements of the camouflaged target; based on the fusion results of the low-level features and the target features, the consistency information of the target object and the background environment in the input image is extracted as the second consistency feature, that is, the external consistency feature. The second consistency feature refers to the features with similarity or unity between the target object and the background environment, so as to effectively analyze the mutual connection between the camouflaged target and the environment.
[0081] It should be noted that the target feature is used to characterize the local features of the image position where the target object is located. Based on the target feature, the internal consistency of the target object can be evaluated, and the low-level features in the feature pyramid are used to characterize the global features of the input image. Based on the fusion results of the low-level features of the input image and the target features, the consistency between the target object and the background environment can be evaluated.
[0082] Through this embodiment, based on the target features, the consistency of the internal elements of the target object in the input image is evaluated to obtain the first consistency feature of the input image, and based on the feature pyramid and the target features, the consistency of the target object in the input image and the background environment is evaluated to obtain the second consistency feature of the input image, and then the first consistency feature and the second consistency feature are used as the consistency features of the input image to achieve accurate evaluation of the internal consistency and external consistency of the input image, and obtain higher-level perceptual features, so as to facilitate the subsequent use of the consistency features to guide the image to perform refined target segmentation, overcome the influence of factors such as color and texture interference on camouflage target detection, and enable it to have the ability to cope with difficult camouflage scenes, such as using color interference to weaken the texture features at the junction of the target and the background.
[0083] In some embodiments, the step S222 of performing consistency evaluation on the target object and the background environment in the input image based on the feature pyramid and the target feature to obtain the second consistency feature of the input image includes the following steps:
[0084] Get low-level features of the input image in the feature pyramid;
[0085] Fuse the low-level features of the input image with the target features;
[0086] Based on the fusion results, the consistency information between the target object and the background environment in the input image is extracted;
[0087] The consistency information between the target object and the background environment is used as the second consistency feature of the input image.
[0088] Specifically, Figure 4 As shown, the low-level features and target features of the input image in the feature pyramid are processed and aligned by the convolution layer respectively, the processed low-level features and target features are spliced, and the splicing results are feature fused through the convolution layer.
[0089] Furthermore, based on the fusion result, the consistency information of the target object and the background environment in the input image is extracted, and the consistency information of the target object and the background environment is used as the second consistency feature of the input image. The second consistency feature refers to a feature with similarity or uniformity between the target object and the background environment, such as color, texture or shape.
[0090] Through this embodiment, low-level features of the input image in the feature pyramid are obtained, and the low-level features of the input image and the target features are fused, so that based on the fusion result, the consistency information of the target object and the background environment in the input image can be extracted, and the consistency information of the target object and the background environment is used as the second consistency feature of the input image. In this way, based on the local features and global features of the input image, the mutual relationship between the camouflaged target and the environment is accurately analyzed, and the external consistency evaluation of the input image is realized.
[0091] In some embodiments, performing target detection on the feature pyramid of the input image in step S210 to obtain corresponding target features includes the following steps:
[0092] Step S211, obtaining multiple layers of primary features of the input image from the feature pyramid of the input image;
[0093] Step S212, stitching multiple layers of primary features of the input image to obtain stitching features;
[0094] Step S213, fusing the splicing features through the residual channel attention module;
[0095] Step S214: extract corresponding target features according to the fusion result.
[0096] Specifically, multiple layers of primary features of the input image are obtained, and each layer of primary features of the input image is pre-processed by a convolution layer. The primary features of each layer with a lower resolution are upsampled to make their size the same as the primary features of the maximum resolution, and the processed primary features of each layer are spliced to obtain the spliced feature f cat .
[0097] Here, the preprocessing process of each layer of primary features is explained using a feature pyramid containing four levels of features. Figure 5As shown, Figure 5 The feature pyramid in contains four levels of features. The features at each level are sorted from large to small according to resolution, namely, primary features, secondary features, tertiary features, and quaternary features. The primary features of each layer are pre-processed by the convolution layer. The secondary, tertiary, and quaternary features with lower resolution are upsampled to make their sizes the same as the primary features, and the processed primary features of each layer are spliced to obtain the spliced feature f cat .
[0098] Furthermore, the concatenated feature f is attentioned by the residual channel attention block (RCAB). cat Perform fusion processing and extract the corresponding channel attention feature f according to the fusion result RCAB Afterwards, the channel attention feature f is transferred through the segmentation head RCAB Converted into the corresponding segmentation feature f seg , based on the segmentation feature f seg And the preset learnable threshold parameters are used to obtain the corresponding target features.
[0099] It should be noted that the residual channel attention module is used to fuse multiple splicing features. It reduces the impact of redundant low-frequency information and retains useful high-frequency information by allocating different sizes of attention to different channels. At the same time, it retains some important low-frequency information through residual connections and improves the stability of model training.
[0100] Through this embodiment, multiple layers of primary features of the input image are spliced to obtain spliced features, and the spliced features are fused through the residual channel attention module, so that the corresponding target features can be extracted according to the fusion results, thereby accurately representing the local features of the position of the target object in the input image.
[0101] In some embodiments, extracting corresponding target features according to the fusion results in step S214 includes the following steps:
[0102] Extract channel attention features from the fusion results and convert the channel attention features into corresponding segmentation features;
[0103] Determine the weight tensor based on the segmentation features and the preset learnable threshold parameters;
[0104] Perform a dot multiplication operation on the weight tensor and the channel attention feature to obtain the corresponding target feature.
[0105] Specifically, Figure 6 As shown, according to the above splicing feature f cat The fusion result of the channel attention feature f is extractedRCAB , and the segmentation head pays attention to the channel feature f RCAB Processing, the channel attention feature f RCAB Converted into the corresponding segmentation feature f seg .
[0106] Furthermore, the segmentation feature f seg and channel attention feature f RCAB The feature is sent to the filter block for processing to eliminate the redundant noise in the feature while retaining the feature elements related to the target object. Among them, a learnable threshold parameter α is preset based on the segmentation feature f seg The formula (1) composed of the learnable threshold parameter α is used to obtain the weight tensor ω, and the formula (1) is specifically as follows:
[0107]
[0108] In formula (1), x represents the segmentation feature f seg The elements in , y represent the elements in the weight tensor ω.
[0109] Afterwards, the weight tensor ω and the channel attention feature f RCAB Perform a dot multiplication operation to obtain the corresponding target features.
[0110] It should be noted that, as can be seen from formula (1), the above processing process regards elements below the threshold parameter α as noise and clears them to zero, while retaining the target area elements with rich information, so that in the subsequent process of evaluating the consistency between the local features and the global features of the input image, the primary features can be used to better characterize the target features of the area where the target object is located.
[0111] Through this embodiment, channel attention features are extracted from the fusion results, the channel attention features are converted into corresponding segmentation features, the weight tensor is determined based on the segmentation features and preset learnable threshold parameters, and the weight tensor and the channel attention features are point multiplied to obtain the corresponding target features, so as to accurately output the local features corresponding to the image target.
[0112] In some embodiments, generating a first target segmented image corresponding to the input image based on the feature pyramid and the consistency feature in step S230 includes the following steps:
[0113] Step S231, the consistency feature is fused with the multi-layer primary features in the feature pyramid step by step to obtain the target fused feature;
[0114] Step S232, processing the target fusion features through the segmentation head to obtain a segmentation label image corresponding to the input image;
[0115] Step S233: up-sample the segmented label image to obtain a first target segmented image.
[0116] Specifically, the consistency features are processed by the convolution layer and the activation function Softmax to obtain the output A, and the primary features with the smallest resolution in the feature pyramid and the features obtained by subsequent fusion need to be processed by the deconvolution layer, so as to use the convolution layer and the deconvolution layer to extract effective feature information and realize the alignment of parameter sizes to facilitate subsequent feature fusion.
[0117] like Figure 7 As shown in the figure, the multi-layer primary features in the feature pyramid are sorted from small to large resolution, and the primary feature with the smallest resolution is determined to be the n-level feature. The n-level feature is processed by the deconvolution layer to obtain the output f n . The output A corresponding to the consistency feature is compared with the output f n Perform weighted fusion to obtain the current fusion feature f An , the specific calculation formula is shown in formula (2):
[0118]
[0119] In formula (2), β represents the weighting coefficient, and β is a learnable parameter.
[0120] Furthermore, according to the arrangement order of the primary features of each layer, the current fusion feature f An The next primary feature is fused. An It is concatenated with the next primary feature, and the concatenated result is fused through the residual channel attention module, and the fused result is processed by upsampling through the deconvolution layer to obtain the next fused feature f An-1 .
[0121] Repeat the above steps of feature fusion, and fuse the primary features of each layer step by step based on the arrangement order of the primary features of each layer, and finally obtain the target fusion feature f A1 Afterwards, the target fusion features are processed by the segmentation head to obtain a segmentation label image corresponding to the input image, and the segmentation label image is upsampled, such as linear upsampling, to obtain a first target segmentation image.
[0122] Among them, each pixel in the segmentation label image is assigned a corresponding label, which is used to indicate the image area or object to which the current pixel belongs.
[0123] Through this embodiment, the consistency feature is fused step by step with the multi-layer primary features in the feature pyramid to obtain the target fusion feature, and the target fusion feature is processed by the segmentation head to obtain the segmentation label image corresponding to the input image, and then the segmentation label image is upsampled to obtain the first target segmentation image, thereby combining the feature pyramid and consistency features of the image to perform refined target segmentation, overcome the influence of factors such as color and texture interference on camouflage target detection, and achieve accurate recognition and positioning of camouflage targets in images.
[0124] In some of the embodiments, before the input image is processed by the disguised object detection model, the following steps are also included:
[0125] Pre-training camouflaged object detection models;
[0126] Specifically, a first target detection model is constructed; the first target detection model includes a preliminary detection module, an image evaluation module and a target segmentation module; the output of the preliminary detection module includes a second target segmentation image, the output of the image evaluation module includes a third target segmentation image, and the output of the target segmentation module includes the first target segmentation image;
[0127] Constructing a loss function based on the first target segmentation image, the second target segmentation image, and the third target segmentation image;
[0128] A training sample of the disguised target detection model is obtained, and the first target detection model is trained based on the training sample and the loss function to obtain a fully trained disguised target detection model.
[0129] Specifically, a first target detection model is pre-constructed, and the model includes an encoder, a preliminary detection module, an image evaluation module and a target segmentation module. The encoder is used to perform multi-scale feature extraction on the input image to obtain a feature pyramid of the input image; the preliminary detection module is used to perform target detection on the feature pyramid of the input image to obtain corresponding target features; the image evaluation module is used to perform consistency evaluation on the input image based on the feature pyramid and the target features to obtain consistency features of the input image; the target segmentation module is used to perform target segmentation on the input image based on the feature pyramid and the consistency features to obtain a first target segmentation image corresponding to the input image.
[0130] It should be noted that when each module processes image features, it outputs the corresponding target segmentation image and the true value segmentation image for calculation. The true value segmentation image contains reference annotations, which are usually obtained by manually performing fine segmentation and annotation on the image. Figure 6 As shown, in the preliminary detection module, the segmentation feature f is obtained seg After that, the segmentation feature f segAfter upsampling and activation function Sigmoid processing, the second target segmentation image M1 corresponding to the input image is obtained; Figure 4 As shown in the figure, in the image evaluation module, the consistency feature is amplified by the deconvolution layer, and the feature information is processed by the residual channel attention module, and then the third target segmentation image M2 is obtained through the segmentation head and normalization processing; and the target segmentation module outputs the final target segmentation image, that is, the first target segmentation image M3.
[0131] Furthermore, based on the second target segmentation image M1, the third target segmentation image M2, the first target segmentation image M3 and the true value segmentation map G, the loss function of the model is constructed, and the specific formula of the loss function is shown in formula (3):
[0132]
[0133] In formula (3), L represents the loss function of the model; L MSE (M1, G) indicates that the second target segmentation image M1 and the true value segmentation image are calculated using the mean square error (MSE); L MSE (M2, G) indicates that the third target segmentation image M2 and the true value segmentation image are calculated using the root mean square error; L MSE (M3, G) indicates that the first target segmentation image M3 and the true value segmentation map are calculated using the structure similarity index measure (SSIM) algorithm. It should be noted that this embodiment does not limit the calculation method of each target segmentation image and the true value segmentation map, and a suitable calculation method can be selected according to actual application requirements.
[0134] Afterwards, a training sample of the disguised target detection model is obtained, and the first target detection model is trained based on the training sample and the loss function. During the training process, the model parameters are optimized using the loss function calculation results to obtain a fully trained disguised target detection model.
[0135] Through this embodiment, a loss function is constructed based on the first target segmentation image, the second target segmentation image and the third target segmentation image output by each module in the model, and based on the training samples and the loss function, the first target detection model is trained to obtain a fully trained camouflaged target detection model, thereby effectively improving the model performance and further ensuring the accuracy of the target segmentation results.
[0136] The present embodiment is described and illustrated below through preferred embodiments.
[0137] Figure 8 is a flow chart of the camouflaged target detection method of this preferred embodiment. Figure 8As shown, the camouflaged target detection method includes the following steps:
[0138] Step S810, performing multi-scale feature extraction on the input image to obtain a feature pyramid of the input image;
[0139] Step S820, stitching multiple layers of primary features of the input image to obtain stitching features;
[0140] Step S830, fusing the spliced features through the residual channel attention module, and extracting the corresponding target features according to the fusion results;
[0141] Step S840, based on the target feature, performing consistency evaluation on the internal elements of the target object in the input image to obtain a first consistency feature of the input image;
[0142] Step S850, based on the feature pyramid and the target feature, performing consistency evaluation on the target object and the background environment in the input image to obtain a second consistency feature of the input image;
[0143] Step S860, using the first consistency feature and the second consistency feature as consistency features of the input image;
[0144] Step S870: performing object segmentation on the input image based on the feature pyramid and the consistency feature to obtain a first object segmentation image corresponding to the input image.
[0145] Through this embodiment, multi-scale feature extraction is performed on the input image to obtain a feature pyramid of the input image, multiple layers of primary features of the input image are spliced to obtain spliced features, the spliced features are fused through the residual channel attention module, and corresponding target features are extracted based on the fusion results, so as to characterize the local features of the position of the target object in the input image.
[0146] Furthermore, based on the target feature, the consistency of the internal elements of the target object in the input image is evaluated to obtain the first consistency feature of the input image, and based on the feature pyramid and the target feature, the consistency of the target object and the background environment in the input image is evaluated to obtain the second consistency feature of the input image. The first consistency feature and the second consistency feature are used as the consistency feature of the input image, so that the input image can be segmented based on the feature pyramid and the consistency feature to obtain the first target segmentation image corresponding to the input image, which solves the problem of being unable to overcome the influence of factors such as color and texture interference on camouflaged target detection, resulting in low accuracy of target detection, and achieves overcoming the influence of factors such as color and texture interference on camouflaged target detection, thereby improving the accuracy of camouflaged target detection.
[0147] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0148] In this embodiment, a disguised target detection device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0149] Fig. 9 is a structural block diagram of the camouflaged target detection device of this embodiment. Fig. 9 As shown, the device comprises: a detection module 10, an evaluation module 20 and a segmentation module 30;
[0150] The detection module 10 is used to obtain a feature pyramid of an input image, perform target detection on the feature pyramid of the input image, and obtain corresponding target features;
[0151] An evaluation module 20, configured to perform consistency evaluation on the input image based on the feature pyramid and the target feature to obtain a consistency feature of the input image;
[0152] The segmentation module 30 is used to perform target segmentation on the input image based on the feature pyramid and the consistency feature to obtain a first target segmentation image corresponding to the input image.
[0153] Through the device provided by this embodiment, target detection is performed on the feature pyramid of the input image to obtain corresponding target features; based on the feature pyramid and the target features, the input image is evaluated for consistency to obtain the consistency features of the input image; further, based on the feature pyramid and the consistency features, a first target segmentation image corresponding to the input image is generated, which solves the problem that the influence of factors such as color and texture interference on camouflaged target detection cannot be overcome, resulting in low accuracy of target detection, and achieves overcoming the influence of factors such as color and texture interference on camouflaged target detection, thereby improving the accuracy of camouflaged target detection.
[0154] In some of the embodiments, the evaluation module 20 is also used to perform consistency evaluation on internal elements of the target object in the input image based on the target features to obtain a first consistency feature of the input image; perform consistency evaluation on the target object and the background environment in the input image based on the feature pyramid and the target features to obtain a second consistency feature of the input image; and use the first consistency feature and the second consistency feature as consistency features of the input image.
[0155] In some of the embodiments, the evaluation module 20 is also used to obtain low-level features of the input image in the feature pyramid; fuse the low-level features of the input image with the target features; based on the fusion result, extract the consistency information between the target object and the background environment in the input image; and use the consistency information between the target object and the background environment as the second consistency feature of the input image.
[0156] In some of the embodiments, the detection module 10 is also used to obtain multiple layers of primary features of the input image from the feature pyramid of the input image; splice the multiple layers of primary features of the input image to obtain spliced features; fuse the spliced features through the residual channel attention module; and extract the corresponding target features based on the fusion results.
[0157] In some of the embodiments, the detection module 10 is also used to extract channel attention features from the fusion results and convert the channel attention features into corresponding segmentation features; determine the weight tensor based on the segmentation features and preset learnable threshold parameters; perform a dot product operation on the weight tensor and the channel attention features to obtain the corresponding target features.
[0158] In some of the embodiments, the segmentation module 30 is also used to fuse the consistency features with the multi-layer primary features in the feature pyramid step by step to obtain the target fusion features; process the target fusion features through the segmentation head to obtain the segmentation label image corresponding to the input image; and upsample the segmentation label image to obtain the first target segmentation image.
[0159] In some of these embodiments, Fig. 9 On the basis of, the device also includes a pre-training module for constructing a first target detection model; the first target detection model includes a preliminary detection module, an image evaluation module and a target segmentation module; the output of the preliminary detection module includes a second target segmentation image, the output of the image evaluation module includes a third target segmentation image, and the output of the target segmentation module includes the first target segmentation image; based on the first target segmentation image, the second target segmentation image and the third target segmentation image, a loss function is constructed; training samples of the camouflaged target detection model are obtained, and based on the training samples and the loss function, the first target detection model is trained to obtain a fully trained camouflaged target detection model.
[0160] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0161] In this embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0162] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0163] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0164] S1, obtain the feature pyramid of the input image, perform target detection on the feature pyramid of the input image, and obtain the corresponding target features;
[0165] S2, based on the feature pyramid and target features, the consistency of the input image is evaluated to obtain the consistency features of the input image;
[0166] S3, performing target segmentation on the input image based on the feature pyramid and the consistency feature to obtain a first target segmentation image corresponding to the input image.
[0167] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0168] In addition, in combination with the camouflaged target detection method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the camouflaged target detection method. The storage medium stores a computer program; when the computer program is executed by a processor, any camouflaged target detection method in the above embodiments is implemented.
[0169] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0170] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0171] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0172] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A camouflaged target detection method, characterized in that: The method comprises: Processing the input image through the disguised target detection model to obtain a first target segmentation image corresponding to the input image; The step of processing the input image by using the disguised target detection model includes: Acquire a feature pyramid of the input image, perform target detection on the feature pyramid of the input image, and obtain corresponding target features; Based on the feature pyramid and the target feature, the input image is evaluated for consistency to obtain the consistency feature of the input image, including: based on the target feature, the internal elements of the target object in the input image are evaluated for consistency to obtain a first consistency feature of the input image, wherein the first consistency feature refers to a feature of similarity or unity between various parts of the target object; obtaining low-level features of the input image in the feature pyramid; fusing the low-level features of the input image with the target feature; based on the fusion result, extracting consistency information between the target object and the background environment in the input image; using the consistency information between the target object and the background environment as a second consistency feature of the input image, wherein the second consistency feature refers to a feature of similarity or unity between the target object and the background environment; using the first consistency feature and the second consistency feature as consistency features of the input image; Based on the feature pyramid and the consistency feature, the input image is segmented, including: sorting the multiple layers of primary features in the feature pyramid from small to large according to resolution; based on the arrangement order of the primary features in each layer, the consistency feature is gradually fused with the multiple layers of primary features in the feature pyramid to obtain a target fused feature; processing the target fused feature through a segmentation head to obtain a segmentation label image corresponding to the input image; and upsampling the segmentation label image to obtain a first target segmented image.
2. The camouflaged target detection method according to claim 1, characterized in that: The performing target detection on the feature pyramid of the input image to obtain corresponding target features includes: Acquire multiple layers of primary features of the input image from a feature pyramid of the input image; Splicing multiple layers of primary features of the input image to obtain spliced features; The spliced features are fused through a residual channel attention module; According to the fusion result, the corresponding target features are extracted.
3. The camouflaged target detection method according to claim 2, characterized in that: The step of extracting the corresponding target features according to the fusion result includes: Extracting channel attention features from the fusion results, and converting the channel attention features into corresponding segmentation features; Determining a weight tensor based on the segmentation features and a preset learnable threshold parameter; Perform a dot multiplication operation on the weight tensor and the channel attention feature to obtain the corresponding target feature.
4. The camouflaged target detection method according to claim 1, characterized in that: Before the input image is processed by the disguised target detection model, the method further includes: Pre-training the camouflaged target detection model; Specifically, a first target detection model is constructed; the first target detection model includes a preliminary detection module, an image evaluation module and a target segmentation module; the output of the preliminary detection module includes a second target segmentation image, the output of the image evaluation module includes a third target segmentation image, and the output of the target segmentation module includes the first target segmentation image; Constructing a loss function based on the first target segmentation image, the second target segmentation image, and the third target segmentation image; A training sample of the disguised target detection model is obtained, and the first target detection model is trained based on the training sample and the loss function to obtain the fully trained disguised target detection model.
5. A disguised target detection device, characterized in that: The device comprises: a detection module, an evaluation module and a segmentation module; The detection module is used to obtain a feature pyramid of an input image, perform target detection on the feature pyramid of the input image, and obtain corresponding target features; The evaluation module is used to perform consistency evaluation on the input image based on the feature pyramid and the target feature to obtain a consistency feature of the input image; The evaluation module is further used to perform consistency evaluation on the internal elements of the target object in the input image based on the target feature to obtain a first consistency feature of the input image, wherein the first consistency feature refers to a feature with similarity or unity between various parts of the target object; obtain low-level features of the input image in the feature pyramid; fuse the low-level features of the input image with the target feature; based on the fusion result, extract consistency information between the target object and the background environment in the input image; use the consistency information between the target object and the background environment as a second consistency feature of the input image, wherein the second consistency feature refers to a feature with similarity or unity between the target object and the background environment; use the first consistency feature and the second consistency feature as consistency features of the input image; The segmentation module is used to perform target segmentation on the input image based on the feature pyramid and the consistency feature to obtain a first target segmentation image corresponding to the input image; The segmentation module is also used to sort the multiple layers of primary features in the feature pyramid from small to large according to resolution; based on the arrangement order of the primary features in each layer, the consistency feature is gradually fused with the multiple layers of primary features in the feature pyramid to obtain a target fused feature; the target fused feature is processed by a segmentation head to obtain a segmentation label image corresponding to the input image; and the segmentation label image is upsampled to obtain a first target segmented image.
6. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps of the camouflaged target detection method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the camouflaged target detection method according to any one of claims 1 to 4 are implemented.
