Image detection method, training method and device of detection model

CN122336586BActive Publication Date: 2026-08-21INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202610749737.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-28
Publication Date
2026-08-21
Estimated Expiration
2046-05-28

AI Technical Summary

Technical Problem

[0003]然而,相关技术中主要关注语义层面的上下文关系,而忽略了在编码过程中信息丢失问题,导致检测准确度低

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122336586B_ABST
    Figure CN122336586B_ABST
Patent Text Reader

Abstract

The application provides an image detection method, a detection model training method and equipment, which can be applied to the technical field of image processing. The method comprises the following steps: performing multi-scale feature extraction on a first image and a second image respectively to obtain a plurality of first initial features of the first image and a plurality of second initial features of the second image, the first image and the second image being obtained by using a remote sensing device to collect images of a target region at different times; for any two adjacent scales, loss information between the first initial features of the two scales and loss information between the second initial features are fused to obtain loss fusion features; according to the loss fusion features, a difference between the first initial features and the second initial features is compensated by using an attention mechanism to obtain target compensation features; and the target compensation features are detected to obtain a detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to an image detection method, a training method for a detection model, and an apparatus. Background Technology

[0002] Remote sensing image change detection is an important research direction in remote sensing image analysis. Its core objective is to compare and analyze dual-temporal optical remote sensing images of the same area acquired at different times and generate pixel-level change masks to reflect the dynamic changes in land cover and land use.

[0003] However, related technologies mainly focus on semantic contextual relationships, while ignoring the problem of information loss during the encoding process, resulting in low detection accuracy. Summary of the Invention

[0004] In view of the above problems, this application provides an image detection method, a training method for the detection model, and an apparatus.

[0005] According to one aspect of this application, an image detection method is provided, comprising: performing multi-scale feature extraction on a first image and a second image respectively to obtain multiple first initial features of the first image and multiple second initial features of the second image, wherein the first image and the second image are obtained by acquiring images of a target region at different times using a remote sensing device; for any two adjacent scales, fusing loss information between the first initial features and the second initial features at each scale to obtain loss fusion features; based on the loss fusion features, using an attention mechanism to perform feature compensation on the difference information between the first initial features and the second initial features to obtain target compensation features; and detecting the target compensation features to obtain a detection result, wherein the detection result characterizes the change of a target object located within the target region over time.

[0006] According to another aspect of this application, a method for training a detection model is provided, comprising: acquiring training samples, the training samples including a first sample image, a second sample image, and sample labels, wherein the sample labels indicate whether a target object in the first sample image has changed relative to the second sample image; performing multi-scale feature extraction on the first sample image and the second sample image respectively to obtain multiple first initial features of the first sample image and multiple second initial features of the second sample image; for any two adjacent scales, fusing the loss information between the first initial features of the two scales and the loss information between the second initial features of the two scales to obtain sample loss fusion features; based on the sample loss fusion features, using an attention mechanism to perform feature compensation on the difference information between the first initial features of the samples and the second initial features of the samples to obtain sample target compensation features; detecting the sample target compensation features to obtain sample detection results; and training a detection model based on the cross-entropy loss value between the sample detection results and the sample labels to obtain a trained detection model.

[0007] Another aspect of this application provides an image detection apparatus, comprising: a first extraction module, configured to perform multi-scale feature extraction on a first image and a second image respectively, to obtain multiple first initial features of the first image and multiple second initial features of the second image, wherein the first image and the second image are obtained by acquiring images of a target region at different times using a remote sensing device; a first fusion module, configured to fuse loss information between the first initial features and the second initial features at any two adjacent scales, to obtain loss fusion features; a first compensation module, configured to perform feature compensation on the difference information between the first initial features and the second initial features using an attention mechanism based on the loss fusion features, to obtain target compensation features; and a first detection module, configured to detect the target compensation features, to obtain a detection result, wherein the detection result characterizes the change of a target object located within the target region over time.

[0008] Another aspect of this application provides a training apparatus for a detection model, comprising: an acquisition module for acquiring training samples, the training samples including a first sample image, a second sample image, and sample labels, the sample labels indicating whether a target object in the first sample image has changed relative to the second sample image; a second extraction module for performing multi-scale feature extraction on the first sample image and the second sample image respectively, to obtain multiple first initial features of the first sample image and multiple second initial features of the second sample image; a second fusion module for fusing loss information between the first initial features and the second initial features of each of the two adjacent scales, to obtain sample loss fusion features; a second compensation module for performing feature compensation on the difference information between the first initial features and the second initial features of the samples based on the sample loss fusion features using an attention mechanism, to obtain sample target compensation features; and a second detection module for detecting the sample target compensation features to obtain sample detection results.

[0009] Another aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the steps of the one or more computer programs are executed on the one or more processors to implement the methods described above.

[0010] Another aspect of this application provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.

[0011] Another aspect of this application provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description

[0012] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments of this application with reference to the accompanying drawings, in which the accompanying drawings are provided.

[0013] Figure 1 The illustration shows an application scenario of the image detection method, the training method of the detection model, and the device according to embodiments of this application.

[0014] Figure 2 A flowchart of an image detection method according to an embodiment of this application is shown.

[0015] Figure 3 A schematic diagram of a compensation module according to an embodiment of this application is shown.

[0016] Figure 4 A schematic diagram of a multi-scale convolution module according to an embodiment of this application is shown.

[0017] Figure 5 A schematic diagram of a fuzz enhancement module according to an embodiment of this application is shown.

[0018] Figure 6 A schematic diagram of a loss extraction network according to an embodiment of this application is shown.

[0019] Figure 7 A schematic diagram of a decoder according to an embodiment of this application is shown.

[0020] Figure 8 A flowchart of a training method for a detection model according to an embodiment of this application is shown.

[0021] Figure 9 A schematic diagram of a detection model according to an embodiment of this application is shown.

[0022] Figure 10 A schematic diagram of sample detection results according to an embodiment of this application is shown.

[0023] Figure 11 A block diagram of an electronic device suitable for implementing an image detection method according to an embodiment of this application is shown.

[0024] Figure 12 A structural block diagram of a training apparatus for a detection model according to an embodiment of this application is shown.

[0025] Figure 13 A block diagram of an electronic device suitable for implementing an image detection method and a training method for a detection model, according to an embodiment of this application, is shown. Detailed Implementation

[0026] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0027] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0028] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0029] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0030] In the technical solution of this application, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.

[0031] In related technologies, multi-scale feature encoding strategies are commonly used to address the problem of multi-scale targets in remote sensing images. Multi-scale encoders extract and fuse features at different levels, enabling the model to account for both overall changes in large areas and detailed changes in local areas, thus improving its adaptability to targets of different scales and complex scenes. However, the multi-scale feature fusion process primarily focuses on semantic contextual relationships, neglecting the loss of high-frequency detail information caused by progressive downsampling during encoding. This deficiency leads to blurred edges of changed regions and a lack of clarity in target boundaries when generating change masks, thereby reducing the accuracy of detection results. This problem of missing high-frequency information is particularly pronounced in scenes with small targets or complex backgrounds, easily causing missed or false detections of changing targets.

[0032] In view of this, embodiments of this application provide an image detection method, comprising: performing multi-scale feature extraction on a first image and a second image respectively to obtain multiple first initial features of the first image and multiple second initial features of the second image, wherein the first image and the second image are obtained by acquiring images of a target region at different times using a remote sensing device; for any two adjacent scales, fusing the loss information between the first initial features and the loss information between the second initial features at each scale to obtain loss fusion features; based on the loss fusion features, using an attention mechanism to perform feature compensation on the difference information between the first initial features and the second initial features to obtain target compensation features; and detecting the target compensation features to obtain a detection result. From the perspective of loss fusion feature compensation, the initial features encoded at multiple scales are optimized to improve the overall performance of image detection.

[0033] Figure 1 The illustration shows an application scenario of the image detection method, the training method of the detection model, and the device according to embodiments of this application.

[0034] like Figure 1 As shown, the application scenario 100 of the image detection method, detection model training method, and device according to embodiments of this application includes a terminal device 101, a server 102, and a network 103. The network 103 serves as a medium for providing a communication link between the terminal device 101 and the server 102. The network 103 may include various connection types, such as wired, wireless communication links, or fiber optic cables. The test server 102 may be a server providing test services. The terminal device 101 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0035] Server 102 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal device 101 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0036] It should be noted that the image detection method provided in this application embodiment can generally be executed by server 102. Accordingly, the training method of the detection model provided in this application embodiment can generally be set in server 102.

[0037] It should be understood that Figure 1 The number of terminal devices shown is merely illustrative. Depending on implementation needs, there can be any number of terminal devices and servers.

[0038] Figure 2 A flowchart of an image detection method according to an embodiment of this application is shown.

[0039] like Figure 2 As shown, the method 200 includes operations S210 to S240.

[0040] In operation S210, multi-scale feature extraction is performed on the first image and the second image respectively to obtain multiple first initial features of the first image and multiple second initial features of the second image.

[0041] In operation S220, for any two adjacent scales, the loss information between the first initial features of each scale and the loss information between the second initial features are fused to obtain the loss fusion feature.

[0042] In operation S230, based on the loss fusion features, the attention mechanism is used to perform feature compensation on the difference information between the first initial feature and the second initial feature to obtain the target compensation feature.

[0043] In operation S240, the target compensation features are detected, and the detection results are obtained.

[0044] The first image and the second image are obtained by acquiring images of the target area at different times using remote sensing equipment. The target area is the area to be detected, which includes ground features such as buildings and plants.

[0045] The first and second images are dual-temporal images. By comparing and analyzing the first and second images, the changes of ground features in the target area during the time period between the two moments can be identified.

[0046] The multi-scale feature extraction network can be a four-stage dual-time twin feature extraction network, built on the encoder (Transformer). The two branches of the multi-scale feature extraction network share parameter weights.

[0047] The first and second images are input into a weight-shared dual-branch feature extraction network to extract four initial features with scales ranging from large to small and four initial features with scales ranging from large to small.

[0048] For example, a multi-scale feature extraction network includes a four-stage bi-branch feature extraction network, which obtains the first initial features of the first image at four scales, from large to small. , , , And the second initial features of the second image, varying from large to small at four scales. , , , . The moment when the first image was acquired. This refers to the acquisition time of the second image. The smaller the scale, the lower the resolution.

[0049] Multi-scale feature extraction networks can adopt a feature overlap downsampling mechanism to obtain initial features at different scales while efficiently fusing the initial features. ,in, This represents the first or second initial feature that has a sequence relationship. This represents the sequence features fused through overlapping downsampling. Indicates the number of feature channels. Indicates the sequence downsampling ratio. Indicates the sequence length. This represents an array shape transformation operation. This represents a linear mapping layer. The first initial feature is the feature of the first image at the spectral, texture, geometric, and semantic levels, and the second initial feature is the feature of the second image at the spectral, texture, geometric, and semantic levels.

[0050] For any two adjacent scales, first extract the loss information between the first initial feature and the second initial feature of each scale, and then fuse the two loss information to obtain the loss fusion feature.

[0051] The loss information can be calculated using a difference algorithm. The loss information of the first initial feature represents the high-frequency detail information lost during the process of scale-wise feature downsampling of the first image. The loss information of the second initial feature represents the high-frequency detail information lost during the process of scale-wise feature downsampling of the second image. The loss fusion feature represents the high-frequency detail information lost during the process of scale-wise feature downsampling of the first and second images.

[0052] For example, starting with the original scale of the image, and using the original scale and the first scale as adjacent scales, the first initial features of the first scale are extracted respectively. With the first image Loss information and second initial features With the second image The loss information between the two is then fused to obtain a loss fusion feature that matches the original scale. For the first scale, firstly extract the initial features for both the first and second scales respectively. and Loss information and second initial features and The loss information between the two is then fused to obtain a loss fusion feature that matches the first scale. Thus, loss fusion features matching the second scale are obtained. and loss fusion features matched with the 3rd scale .

[0053] The change detection module is used to detect the difference information between the first and second initial features at the same scale, obtaining the difference information corresponding to multiple scales. The difference information represents the information of the changes of ground features in the target area over time.

[0054] An attention mechanism is used to fuse multiple differential information and multiple loss fusion features to obtain target compensation features. The target compensation features represent the supplementation of lost high-frequency detail information in the variation information between the first and second initial features at different scales.

[0055] The target compensation features are detected using a classification head to obtain the detection results.

[0056] The detection results characterize the changes of target objects within the target area over time. Target objects include ground features such as buildings and plants.

[0057] For example, the detection result is a binary mask image, where a pixel value of 0 represents no change and a pixel value of 1 represents a change.

[0058] According to embodiments of this application, high-frequency detail information lost during multi-scale feature encoding of the first and second images is extracted and fused across scales to obtain loss fusion features. During image difference information detection, an attention mechanism is used to supplement the loss fusion features into the difference information between the first and second initial features on a scale-by-scale basis to model global contextual relevance, thereby obtaining a more clearly defined multi-scale change representation of edges. During the difference information decoding process, the attention mechanism is used again to supplement the loss fusion features, thereby obtaining target compensation features with clearer edge and detail representation. The model can effectively alleviate edge blurring and detail loss problems while maintaining global semantic modeling capabilities, improving the detection accuracy of small targets and complex scenes, and enhancing the accuracy of detection results.

[0059] According to an embodiment of this application, multi-scale feature extraction is performed on a first image to obtain multiple first initial features of the first image, including: performing multi-scale convolution operation on the first image to obtain local features corresponding to each of the multiple scales; and using a multilayer perceptron to perform feature transformation on the multiple local features to obtain multiple sample first initial features.

[0060] Multi-scale feature extraction networks can also employ dynamic positional encoding mechanisms. ,in, This indicates either the first image or the second image. This represents the first or second initial feature of the output after positional encoding. This refers to the Multi-Layer Perceptron. This indicates a convolutional layer with a kernel size of 3x3. This represents the Gaussian Error Linear Unit.

[0061] Compared to fixed-position coding, dynamic position coding allows for input of two time-varying first and second images of different sizes, making feature extraction more flexible.

[0062] According to an embodiment of this application, based on the loss fusion features, an attention mechanism is used to perform feature compensation on the difference information between the first initial feature and the second initial feature to obtain target compensation features. This includes: for multiple scales, performing attention fusion on the difference information between the first initial feature and the second initial feature at each scale based on the loss fusion features at each scale to obtain multiple difference compensation features; fusing the multiple difference compensation features to obtain target fusion features; and performing attention fusion on the target fusion features based on the loss fusion features at the target scale to obtain target compensation features.

[0063] For each scale, attention fusion is performed on the difference information between the first and second initial features of the scale based on the loss fusion features at that scale to obtain the difference compensation features for that scale.

[0064] For example, for the first scale, the change detection module is first used to detect the first and second initial features corresponding to the first scale to obtain the difference information of the first scale. The loss fusion feature of the first scale is then used to supplement the difference information of the first scale using the cross attention mechanism to obtain the difference compensation feature of the first scale.

[0065] The difference compensation feature represents the feature that supplements the high-frequency detail information lost at the corresponding scale during the difference detection process between the first initial feature and the second initial feature on a scale-by-scale basis.

[0066] The difference compensation features corresponding to multiple scales are stacked along the channel dimension to obtain the target fusion feature. ,in, Characterizing the difference compensation features at the first scale, Characterizing the difference compensation features at the second scale, Characterize the differential compensation features at the third scale. Characterizing the differential compensation features at the fourth scale. This is a stacking operation.

[0067] The target scale represents the original scale of the first or second image. The loss fusion feature at the target scale is obtained by fusing the loss information between the first initial feature at the largest scale and the first image, and the loss information between the second initial feature at the largest scale and the second image. For example, the loss fusion feature at the target scale is: .

[0068] Loss fusion features at the target scale represent the most frequently lost high-frequency detail information during the multi-stage process of image feature extraction.

[0069] During the upsampling decoding of the target fusion features, a cross-attention mechanism is used to perform attention fusion on the loss fusion features and the target fusion features at the target scale to obtain the target compensation features.

[0070] By supplementing the corresponding difference information with the loss fusion features through the attention mechanism, difference compensation features with clearer multi-scale change representation of edges are obtained. In the process of decoding the target fusion features, the attention mechanism is also introduced to model the global context correlation and supplement the loss fusion features at the target scale again. The loss fusion features at the target scale are the most high-frequency detail information lost in the multi-stage process of feature encoding of the image, thus obtaining target compensation features with clearer edge and detail representation.

[0071] According to an embodiment of this application, attention fusion is performed on the difference information between the first initial feature and the second initial feature at the scale based on the loss fusion features at the scale to obtain difference compensation features, including: attention fusion is performed on the difference information between the first initial feature and the second initial feature at the scale based on the loss fusion features at the scale to obtain initial compensation features; feature enhancement is performed on the initial compensation features to obtain difference compensation features.

[0072] The loss compensation module can be constructed based on convolutional layers, normalization layers, and activation layers. An attention mechanism is embedded in the loss compensation module.

[0073] The loss compensation module uses the loss fusion features at different scales to perform attention fusion on the difference information between the first and second initial features at different scales to obtain the initial compensation features.

[0074] For example, the extracted first and second initial features are grouped according to the same scale and paired with the loss fusion features at the corresponding scale to obtain four sets of input {( , (), , , (), , , (), , , )}.

[0075] For example, the loss compensation module can be input layer by layer in a progressive manner from small to large scale. At the smallest scale (the 4th scale), the change detection module is first used to process the first and second initial features. , ) is detected to obtain the difference information at the fourth scale. The initial compensation feature at the fourth scale is the difference information at the fourth scale. After upsampling, the initial compensation feature at the fourth scale is compared with the first and second initial features at the third scale. , The detection is performed to obtain the difference information at the third scale, and the loss at the third scale is fused with the features using a cross-attention mechanism. The initial compensation features at the third scale are added to the difference information. The initial compensation features at the third scale are then upsampled and passed to a higher scale. This process is repeated until the initial compensation features at the fourth scale are obtained.

[0076] Edge detail information can be enhanced on the initial compensation features to obtain difference compensation features.

[0077] According to an embodiment of this application, based on the loss fusion features at scale, attention fusion is performed on the difference information between the first initial feature and the second initial feature at scale to obtain the initial compensation feature, including: based on the initial compensation feature corresponding to the first scale, difference detection is performed on the first initial feature and the second initial feature corresponding to the scale to obtain the difference information at scale, wherein the first scale is an adjacent scale smaller than the scale, and the initial compensation feature of the smallest scale among multiple scales is determined based on the difference information of the smallest scale; based on the loss fusion features at scale, the difference information at scale is fused using an attention mechanism to obtain the initial compensation feature at scale.

[0078] The loss compensation module includes a change detection layer, which inputs the initial compensation features corresponding to the first scale, the first initial features and the second initial features corresponding to the scale into the change detection layer, and outputs the difference information at this scale.

[0079] The first scale is the adjacent scale that is smaller than the first scale.

[0080] For example, considering four scales from largest to smallest, namely scale 1, scale 2, scale 3, and scale 4, with scale 4 being the smallest scale, the initial compensation feature of scale 4 is the difference information of scale 4. When calculating the initial compensation feature of scale 3, the first scale of scale 3 is scale 4; when calculating the initial compensation feature of scale 2, the first scale of scale 2 is scale 3; and when calculating the initial compensation feature of scale 1, the first scale of scale 1 is scale 2.

[0081] For example, the difference information at the fourth scale Among them, the initial compensation features of the fourth scale , Represents the change detection layer. This is the first initial feature at the fourth scale. This is the second initial feature of the fourth scale.

[0082] In one embodiment, the difference information at the i-th scale As shown in formula (1):

[0083] (1).

[0084] in, Let i be the first initial feature at the i-th scale. The second initial feature is the one at the i-th scale. The initial compensation feature is defined for the (i+1)th scale, where the (i+1)th scale is the neighboring scale smaller than the ith scale. This is an upsampling operation.

[0085] Figure 3 A schematic diagram of a compensation module according to an embodiment of this application is shown.

[0086] like Figure 3 As shown, the loss compensation module includes a change detection layer, which comprises a convolutional sub-layer (conv), a batch normalization sub-layer (BN), and a sigmoid activation sub-layer. The first initial features at the i-th scale are... The second initial feature at the i-th scale and the initial compensation features at the (i+1)th scale The input is fed into the change detection layer, and the output is the difference information at the i-th scale. Features are fused using the loss at the i-th scale. After passing through the convolutional sub-layer, it is used as the key value K to represent the difference information. As the query Q and value V, an attention mechanism is used to fuse the key value K, query Q, and value V, and then the fused result is combined with the initial compensation feature at the (i+1)th scale. The initial compensation features at the i-th scale are obtained by fusion. .

[0087] By using initial compensation features supplemented with loss fusion features at small scales to assist image change detection, higher-scale difference information is obtained, thus yielding initial compensation features from large to small scale.

[0088] By adopting a progressive approach from small to large scales, loss fusion features are explicitly introduced layer by layer. An attention mechanism is used to supplement the loss fusion features into the difference information of the corresponding scales. This compensates for the edge blurring and loss of detail caused by each scale during the multi-scale feature encoding process of the image. As a result, the model can capture large-scale structures while retaining and enhancing fine-grained edge and texture information, thereby significantly improving the accuracy of image detection and boundary characterization.

[0089] According to an embodiment of this application, based on the loss fusion features at different scales, an attention mechanism is used to fuse the difference information at different scales to obtain initial compensation features at different scales. This includes: extracting key features from the loss fusion features at different scales using convolutional features; extracting query features and value features from the difference information at different scales using convolutional features; fusing the key features, query features, and value features using a cross-attention mechanism to obtain attention weights; and obtaining initial compensation features based on the attention weights and the difference information.

[0090] Features are fused using a 3×3 convolutional layer on the loss at the i-th scale. Convolutional feature extraction is performed to obtain key features. .

[0091] Utilizing 3×3 convolutional layers to obtain differential information at the i-th scale Perform convolutional feature extraction to obtain query features. Value characteristics .

[0092] In one embodiment, the initial compensation feature at the i-th scale As shown in formulas (2) and (3):

[0093] (2);

[0094] (3).

[0095] in, Attention weights at the i-th scale , For activation function, This is a scaling factor to prevent gradient vanishing or exploding. This represents the difference information at the i-th scale.

[0096] According to an embodiment of this application, feature enhancement is performed on the initial compensation features to obtain differential compensation features, including: dividing the initial compensation features based on the number of convolution channels of the multi-scale convolution module to obtain multiple sub-compensation features, wherein the multi-scale convolution module includes multiple parallel convolution channels; extracting features from the multiple sub-compensation features using the multiple convolution channels to obtain edge features of each of the multiple sub-compensation features; fusing the initial compensation features and the multiple edge features to obtain edge enhancement features; and enhancing the blurred regions in the edge enhancement features to obtain differential compensation features, wherein the blurred regions represent the regions in the edge enhancement features where the pixel values ​​meet a preset threshold range.

[0097] The compensation network also includes multi-scale convolutional modules.

[0098] Each initial compensation feature is interpolated and upsampled to the same scale as the initial compensation feature at scale 1, and then each is split into 4 equal parts according to the channel dimension to obtain 4 sub-compensation features. ,in, For interpolation upsampling operation, This means that the initial compensation features after upsampling are divided into four equal parts according to the channel dimension.

[0099] The multi-scale convolution module can include four parallel convolution channels, each consisting of a square convolution kernel, two orthogonal strip convolution kernels, and an identity mapping. The shape of the convolution kernel is determined based on the edge width characteristics of the target object in the target region, such as the regular square outline of a building.

[0100] The four convolution channels can be used separately. , , and The convolution kernel comprehensively captures the edge features of changes in target objects in the image, from the distribution of target objects at large scale to the details of changes in target objects at small scale.

[0101] Multiple convolutional channels are used to extract features from multiple sub-compensation features, resulting in edge features for each sub-compensation feature.

[0102] The initial compensation features and multiple edge features are stacked by channel to obtain edge enhancement features. Edge enhancement features represent the perceptual information about changes in the edges of the target object.

[0103] Figure 4 A schematic diagram of a multi-scale convolution module according to an embodiment of this application is shown.

[0104] like Figure 4As shown, the multi-scale convolution module includes three parallel convolution channels. Each convolution channel includes a convolutional sub-layer, a batch normalization sub-layer, and a Gaussian Error Linear Unit (GRLU). The kernel shapes of the multiple convolutional sub-layers are K, respectively. A horizontal rectangle of 1, 1 The vertical rectangle of K and K A square of size K, where k can be 11, 7, 5, or 3. Initial compensation features at the i-th scale based on the number of convolutional channels in the multi-scale convolutional module. The system is divided into multiple sub-compensation features; multiple convolutional channels are used to extract features from each sub-compensation feature to obtain their respective edge features; the initial compensation feature and the multiple edge features are then fused to obtain the edge enhancement feature at the i-th scale. .

[0105] First, identify the regions in the edge enhancement feature whose pixel values ​​meet the preset threshold range. Then, extract features from the blurred regions in the edge enhancement feature to obtain the difference compensation feature.

[0106] For example, the preset threshold range can be (0.3, 0.7).

[0107] By extracting and refining the initial compensation features at different scales through parallel multi-convolution channels, the model can capture the overall distribution of target objects in the target region at a large scale, while preserving fine edge and texture information at a small scale. Through fusion with the channel dimension of the initial compensation features, the resulting edge enhancement features achieve a balance between global consistency and local sensitivity, thereby effectively improving the accuracy and robustness of boundary characterization in image detection and enhancing the model's ability to perceive target edges that change at different scales.

[0108] According to an embodiment of this application, enhancing a blurred region in an edge enhancement feature to obtain a difference compensation feature includes: determining a blurred region based on pixel values ​​in the edge enhancement feature and a preset threshold; extracting features from pixels located in the blurred region in the edge enhancement feature to obtain a blurred region enhancement feature; and fusing the edge enhancement feature and the blurred region enhancement feature to obtain a difference compensation feature.

[0109] Figure 5 A schematic diagram of a fuzz enhancement module according to an embodiment of this application is shown.

[0110] like Figure 5 As shown, the compensation network also includes a blur enhancement module. The blur enhancement module comprises activation sub-layers and convolutional sub-layers, which enhance edge features. The input is fed into the activation sublayer to obtain binary pixel values. Blur regions are determined based on these binary pixel values. Then, a convolutional sublayer extracts features from pixels located within the blur regions in the edge enhancement features, resulting in blur region enhancement features. Finally, the edge enhancement features and blur region enhancement features are multiplied by pixels, and the multiplied features are concatenated with the edge enhancement features to obtain the difference compensation features. .

[0111] In remote sensing images, some target objects are often highly similar to the background, have blurred boundaries, or are occluded, making conventional feature extraction prone to resulting in unclear predictions.

[0112] For example, if the pixel value in the edge enhancement feature is close to 1 or 0, the model can accurately determine whether there has been a change when classifying, but it is difficult to distinguish pixels close to 0.5.

[0113] A preset threshold range is used to determine blurry areas close to 0.5; for example, it can be set to (0.3, 0.7). Blurry areas are defined in regions where pixel values ​​in the edge enhancement feature fall within the preset threshold range.

[0114] Blurred region enhancement features are features used to extract deep features from fuzzy regions.

[0115] In one embodiment, the difference compensation feature at the i-th scale As shown in formula (4):

[0116] (4).

[0117] in, Represents a convolutional sublayer. Represents the activation of the sub-layer. Represents pixel dot product operation. The edge enhancement feature represents the i-th scale.

[0118] When the binary pixel value is close to 0 or 1 The closer the value is to 0, the more the difference compensation feature at scale i becomes the edge enhancement feature at scale i, without any enhancement learning; when the binary pixel value is close to 0.5, The closer it is to 1, the more the difference compensation feature at the i-th scale becomes a fusion feature enhanced by convolution on the edge enhancement feature at the i-th scale.

[0119] By assigning higher weights to blurry regions with pixel values ​​close to 0.5, the feature expression of blurry regions is explicitly highlighted. Then, by fusing residual connections with edge enhancement features, global information is effectively preserved while strengthening edges and details. This can improve the model's sensitivity to blurry regions and boundary characterization ability at multiple scales, and enhance the model's ability to distinguish blurry regions and difficult-to-distinguish changing target objects.

[0120] According to an embodiment of this application, loss information between first initial features and second initial features corresponding to two scales is fused to obtain loss fusion features, including: processing the first initial features corresponding to each of the two scales using a difference algorithm to obtain first loss information; processing the second initial features corresponding to each of the two scales using a difference algorithm to obtain second loss information; extracting features from the information fused based on the first and second loss information to obtain initial fusion features; and batch normalizing the initial fusion features to obtain loss fusion features.

[0121] For multiple initial features at scales from large to small, the first loss information between the first initial feature at the largest scale and the first image is extracted first. Then, the first loss information between the first initial features at two adjacent scales is extracted. The first loss information between two adjacent scales is defined as the loss information corresponding to the higher scale of the two scales.

[0122] For multiple second initial features at scales from large to small, first extract the second loss information between the second initial feature at the largest scale and the second image, and then extract the second loss information between the second initial features at two adjacent scales.

[0123] In one embodiment, the first loss information at the i-th scale As shown in formula (5):

[0124] (5).

[0125] in, For 2x interpolation upsampling, the (i+1)th scale is smaller than the ith scale.

[0126] In one embodiment, the loss fusion feature at the i-th scale As shown in formula (6):

[0127] (6).

[0128] in, An edge-guided adaptive filter. This is an operation that overlays data along the channel dimension. The second loss information at the i-th scale.

[0129] The first initial feature at the largest scale is upsampled by 4x interpolation to extract the first loss information between the first initial feature and the first image; the second initial feature at the largest scale is upsampled by 4x interpolation to extract the second loss information between the second initial feature and the second image; the first loss information and the second loss information are then fused to obtain the loss fusion feature corresponding to the target scale. .

[0130] For example, group the first and second initial features at the same adjacent scales in pairs, and group the first and second initial features at the largest scale with the first image. Second image One group, making a total of 4 groups: { ( , , , (), , , , (), , , , (), , , , The four sets of input data are fed into the loss extraction network to obtain four loss fusion features.

[0131] Figure 6 A schematic diagram of a loss extraction network according to an embodiment of this application is shown.

[0132] like Figure 6 As shown, the loss extraction network includes an adaptive filter. The adaptive filter comprises convolutional sub-layers and batch normalization sub-layers. It extracts the first initial features at the i-th scale. The first initial feature at the (i+1)th scale The first loss information between them is used to extract the second initial feature at the i-th scale. The second initial feature at the (i+1)th scale The second loss information between the first and second loss information is used to extract features from the information fused based on the first and second loss information using a convolutional sub-layer, resulting in initial fused features. A normalization sub-layer then performs batch normalization on the initial fused features to obtain the loss fused features. .

[0133] Since changes in remote sensing images are often reflected in edge and detail areas, directly using multi-scale features for image detection can easily lead to blurred boundaries and loss of detail.

[0134] By using a differential algorithm to explicitly extract loss information from initial features at adjacent scales and suppressing noise interference under the action of an edge-guided adaptive filter, high-frequency information missing during feature downsampling is extracted, thereby generating a purer and more discriminative high-frequency variation loss fusion feature. This allows for better focus on target edges and fine-grained regions in subsequent processing, effectively improving the accuracy and robustness of image detection.

[0135] According to an embodiment of this application, attention fusion is performed on the target fusion features based on the loss fusion features at the target scale to obtain target compensation features, including: decoding the target fusion features to obtain a first decoded feature; decoding the features fused based on the target fusion features and the first decoded feature to obtain a second decoded feature; fusing the target fusion features, the first decoded feature and the second decoded feature to obtain a decoded fusion feature; and fusing the decoded fusion features based on the loss fusion features that match the target scale using a cross-attention mechanism to obtain target compensation features.

[0136] Figure 7 A schematic diagram of a decoder according to an embodiment of this application is shown.

[0137] like Figure 7 As shown, the decoder includes a first decoding module 710, a second decoding module 720, and a loss compensation module. The first decoding module 710 includes an average pooling layer (AvgPool), a maximum pooling layer (MaxPool), a multi-layer perceptron (MLP), and an activation layer (SigmoidLayer). The second decoding module 720 includes an average pooling layer, a maximum pooling layer, a convolutional layer, and an activation layer.

[0138] Target fusion features The first decoding module 710 is input for decoding processing to obtain the first decoding feature.

[0139] In one embodiment, the first decoding feature As shown in formula (7):

[0140] (7).

[0141] in, Features are fused to target specific features.

[0142] The first decoded feature and the second decoded feature are multiplied by pixels to obtain a fused image. The fused image is then input into the second decoding module 720 for decoding processing to obtain the second decoded feature.

[0143] The target fusion feature, the first decoding feature, and the second decoding feature are multiplied by pixels to obtain the decoding fusion feature.

[0144] Utilizing 3×3 convolutional layers to fuse features based on target scale matching loss Convolutional feature extraction is performed to obtain key features. .

[0145] Utilizing 3×3 convolutional layers to decode and fuse features Perform convolutional feature extraction to obtain query features. Value characteristics .

[0146] Key features are analyzed using the cross-attention mechanism in the loss compensation module. Query features Sum value characteristics Perform fusion to obtain fusion weights For fusion weights Features fused with decoding The data is concatenated to obtain the target compensation features. These features are then input into a classifier to obtain the detection results.

[0147] By fusing features along the channel dimension and introducing an attention mechanism in the spatial decoding dimension, both global context and local details are considered during feature aggregation. Furthermore, by combining target-scale loss fusion features, edge and detail information easily lost during downsampling is re-injected into the decoding fusion features. Finally, after decoding and upsampling, the module can generate change masks with accurate edges and stronger target relevance, improving the accuracy of image change detection.

[0148] According to an embodiment of this application, decoding the feature obtained by fusing the target fusion feature and the first decoding feature to obtain the second decoding feature includes: fusing the target fusion feature and the first decoding feature to obtain an intermediate decoding feature; performing pooling processing on the intermediate decoding feature to obtain a pooled feature; and performing convolution processing on the pooled feature to obtain the second decoding feature.

[0149] Pixel electrowinning is performed on the target fusion feature and the first decoded feature to obtain the intermediate decoded feature.

[0150] The intermediate decoded features are subjected to average pooling and max pooling respectively. The results of average pooling and max pooling are then fused to obtain the pooled features.

[0151] The pooling features are processed by convolution and activation using a 7×7 convolutional layer to obtain the second decoded features.

[0152] In one embodiment, the second decoding feature As shown in formula (8):

[0153] (8).

[0154] in, These are intermediate decoding features.

[0155] Figure 8A flowchart of a training method for a detection model according to an embodiment of this application is shown.

[0156] like Figure 8 As shown, the method 800 includes operations S810 to S860.

[0157] During operation of S810, training samples are acquired, including a first sample image, a second sample image, and sample labels.

[0158] In operation S820, multi-scale feature extraction is performed on the first sample image and the second sample image respectively to obtain multiple initial features of the first sample image and multiple initial features of the second sample image.

[0159] In operation S830, for any two adjacent scales, the loss information between the first initial features of the samples at each scale and the loss information between the second initial features of the samples are fused to obtain the sample loss fusion feature.

[0160] In the S840 operation, based on the sample loss fusion features, the attention mechanism is used to compensate for the difference information between the first initial feature and the second initial feature of the sample, thus obtaining the sample target compensation feature.

[0161] The S850 is used to detect the target compensation features of the sample, and the sample detection results are obtained.

[0162] When operating the S860, the detection model is trained based on the cross-entropy loss value between the sample detection result and the sample label, resulting in a trained detection model.

[0163] The sample label indicates whether the target object in the first sample image has changed relative to the second sample image. The sample label is a binary mask image.

[0164] Figure 9 A schematic diagram of a detection model according to an embodiment of this application is shown.

[0165] like Figure 9 As shown, the detection model includes a multi-scale feature extraction network, a loss extraction network, a compensation network, a decoder, and a classification head. The compensation network includes a loss compensation module, a multi-scale convolution module, and a blur enhancement module.

[0166] Training samples are obtained, and a set of samples consisting of the first sample image and the second sample image is used as the input of the detection model. A multi-scale feature extraction network is used to extract multi-scale features from the first sample image and the second sample image respectively, to obtain multiple first initial features of the first sample image and multiple second initial features of the second sample image. A loss extraction network is used to fuse the loss information between the first initial features of the samples and the loss information between the second initial features of the samples at any two adjacent scales, to obtain the sample loss fusion feature.

[0167] By using a compensation network for multiple scales, attention fusion is performed on the difference information between the first initial feature and the second initial feature of the sample at each scale based on the sample loss fusion features at each scale, resulting in multiple sample difference compensation features. The decoder then performs attention fusion on the sample target fusion features based on the sample loss fusion features at the target scale, resulting in sample target compensation features. Finally, the classification head is used to detect the sample target compensation features, resulting in sample detection results.

[0168] In one embodiment, the cross-entropy loss value As shown in formula (9):

[0169] (9).

[0170] in, This represents the Cross-Entropy Loss function. Indicates sample label, This indicates the sample test results.

[0171] The network parameters of the detection model are iteratively adjusted based on the cross-entropy loss value until the cross-entropy loss value is less than a preset threshold or the number of iterations reaches a preset number of iterations, at which point training stops and the trained detection model is obtained.

[0172] Cross-entropy loss is used to calibrate pixel-level change probabilities, enabling the detection model's output to quickly approximate the sample labels and improve detection accuracy.

[0173] According to an embodiment of this application, the training method further includes: performing multi-scale feature extraction on sample labels to obtain label features corresponding to each of the multiple scales; obtaining edge loss values ​​based on the loss values ​​between the label features corresponding to each of the multiple scales and the sample loss fusion features; and training a detection model based on the edge loss values ​​and the cross-entropy loss values ​​to obtain a trained detection model.

[0174] The sample labels are downsampled multiple times to different scales to obtain label features corresponding to each scale.

[0175] The edge loss value is obtained by processing the loss values ​​between the label features and sample loss fusion features corresponding to multiple scales using the Dice Similarity Coefficient. The edge loss value represents the total loss of information about the edge regions of the image.

[0176] Based on edge loss value and cross-entropy loss value The sum of these values ​​yields the total loss value. The detection model is trained using the total loss value to obtain the trained detection model.

[0177] The edge loss function aims to minimize the information loss of changing edge regions between the first and second images, making the model pay more attention to changing edge regions during the training phase, thereby improving the accuracy of model detection.

[0178] According to an embodiment of this application, an edge loss value is obtained based on the loss value between the label features and sample loss fusion features corresponding to multiple scales, including: processing the sample loss fusion features of multiple scales respectively using activation functions to obtain sample activation results for each scale; processing the label features of multiple scales respectively using an edge detection algorithm to obtain edge detection results corresponding to each scale; obtaining multiple edge sub-loss values ​​for each scale based on the loss value between the sample activation results and edge detection results corresponding to each scale; and obtaining the edge loss value based on the edge sub-loss values ​​for each scale.

[0179] In one embodiment, the edge detection result at the i-th scale As shown in formula (10):

[0180] (10).

[0181] in, Indicates edge detection algorithm, This indicates downsampling using linear interpolation. times, Indicates the sample label.

[0182] The sample loss fusion features at multiple scales are processed using activation functions to obtain multiple sample activation results. The sample activation results and edge detection results are presented as binary mask images.

[0183] For each scale, the loss value between the sample activation result and the edge detection result corresponding to the scale is calculated using the edge loss function to obtain the edge sub-loss value.

[0184] In one embodiment, edge loss value As shown in formula (11):

[0185] (11).

[0186] in, This represents the edge sub-loss value at the i-th scale. This represents the weight of the i-th scale.

[0187] Figure 10 A schematic diagram of sample detection results according to an embodiment of this application is shown.

[0188] like Figure 10 As shown, a validation dataset for detecting changes in buildings was used. Changes in roads and rivers are irrelevant change tasks, as indicated by the sample labels. The results show that road changes appeared in all sample detection results, and river changes appeared in some sample detection results. Changes in irrelevant change tasks can be effectively filtered out, allowing the sample detection results to focus only on changes in buildings such as houses (white area).

[0189] Figure 11 A structural block diagram of an image detection apparatus according to an embodiment of this application is shown.

[0190] like Figure 11 As shown, the image detection device 1100 of this embodiment includes a first extraction module 1110, a first fusion module 1120, a first compensation module 1130 and a first detection module 1140.

[0191] The first extraction module 1110 is used to perform multi-scale feature extraction on the first image and the second image respectively, to obtain multiple first initial features of the first image and multiple second initial features of the second image. The first image and the second image are obtained by acquiring images of the target area at different times using remote sensing equipment.

[0192] The first fusion module 1120 is used to fuse the loss information between the first initial features of the two adjacent scales and the loss information between the second initial features of the two scales to obtain loss fusion features.

[0193] The first compensation module 1130 is used to perform feature compensation on the difference information between the first initial feature and the second initial feature based on the loss fusion features and using an attention mechanism to obtain the target compensation feature.

[0194] The first detection module 1140 is used to detect the target compensation features and obtain the detection results, which represent the changes of the target object located in the target area over time.

[0195] Figure 12 A structural block diagram of a training apparatus for a detection model according to an embodiment of this application is shown.

[0196] like Figure 12 As shown, the training device 1200 for the detection model in this embodiment includes an acquisition module 1210, a second extraction module 1220, a second fusion module 1230, a second compensation module 1240, a second detection module 1250, and a training module 1260.

[0197] The acquisition module 1210 is used to acquire training samples, which include a first sample image, a second sample image, and sample labels. The sample labels indicate whether the target object in the first sample image has changed relative to the second sample image.

[0198] The second extraction module 1220 is used to perform multi-scale feature extraction on the first sample image and the second sample image respectively, to obtain multiple first initial features of the first sample image and multiple second initial features of the second sample image.

[0199] The second fusion module 1230 is used to fuse the loss information between the first initial features of the samples and the loss information between the second initial features of the samples for any two adjacent scales, so as to obtain the sample loss fusion features.

[0200] The second compensation module 1240 is used to compensate for the difference information between the first initial feature and the second initial feature of the sample by using an attention mechanism based on the sample loss fusion features, so as to obtain the sample target compensation feature.

[0201] The second detection module 1250 is used to detect the target compensation features of the sample and obtain the sample detection results.

[0202] The training module 1260 is used to train the detection model based on the cross-entropy loss value between the sample detection results and the sample labels, and obtain the trained detection model.

[0203] Figure 13 A block diagram of an electronic device suitable for implementing an image detection method and a training method for a detection model, according to an embodiment of this application, is shown.

[0204] Figure 13 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0205] like Figure 13As shown, a computer electronic device 1300 according to an embodiment of this application includes a processor 1301, which can perform various appropriate actions and processes according to a program stored in a ROM 1302 (read-only memory) or a program loaded from a storage portion 1308 into a RAM 1303 (random access memory). The processor 1301 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1301 may also include onboard memory for caching purposes. The processor 1301 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.

[0206] RAM 1303 stores various programs and data required for the operation of electronic device 1300. Processor 1301, ROM 1302, and RAM 1303 are interconnected via bus 1304. Processor 1301 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 1302 and / or RAM 1303. It should be noted that programs may also be stored in one or more memories other than ROM 1302 and RAM 1303. Processor 1301 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in one or more memories.

[0207] According to embodiments of this application, the electronic device 1300 may further include an input / output (I / O) interface 1305, which is also connected to a bus 1304. The electronic device 1300 may also include one or more of the following components connected to the input / output (I / O) interface 1305: an input section 1306 including a keyboard, mouse, etc.; an output section 1307 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN card, modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the input / output (I / O) interface 1305 as needed. A removable medium 1311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1310 as needed so that computer programs read from it can be installed into the storage section 1308 as needed.

[0208] According to embodiments of this application, the method flow according to embodiments of this application can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1309, and / or installed from removable medium 1311. When the computer program is executed by processor 1301, it performs the functions defined in the system of embodiments of this application. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0209] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the image detection method according to the embodiments of this application.

[0210] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0211] For example, according to embodiments of this application, a computer-readable storage medium may include the ROM 1302 and / or RAM 1303 described above and / or one or more memories other than ROM 1302 and RAM 1303.

[0212] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods provided in the embodiments of this application. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the image detection method provided in the embodiments of this application.

[0213] When the computer program is executed by the processor 1301, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc. described above can be implemented by computer program modules.

[0214] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1309, and / or installed from the removable medium 1311. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0215] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0216] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations are not explicitly described in this application. In particular, without departing from the spirit and teachings of this application, the features described in the various embodiments of this application can be combined and / or combined in various ways. All such combinations and / or combinations fall within the scope of this application.

[0217] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of this application, those skilled in the art can make various substitutions and modifications, all of which should fall within the scope of this application.

Claims

1. An image detection method, characterized in that, include: Multi-scale feature extraction is performed on the first image and the second image respectively to obtain multiple first initial features of the first image and multiple second initial features of the second image. The first image and the second image are obtained by acquiring images of the target area at different times using remote sensing equipment. For any two adjacent scales, the loss information between the first initial feature and the loss information between the second initial feature and each of the two scales are fused to obtain the loss fusion feature; Based on the loss fusion features, an attention mechanism is used to compensate for the difference information between the first initial feature and the second initial feature to obtain the target compensation features, including: For multiple scales, attention fusion is performed on the difference information between the first initial feature and the second initial feature at each scale based on the loss fusion features at each scale to obtain multiple difference compensation features. The difference compensation features represent features that supplement the high-frequency detail information lost at the corresponding scale during the difference detection process between the first initial feature and the second initial feature at each scale. The target fused feature is obtained by fusing multiple difference compensation features. Based on the loss fusion features at the target scale, attention fusion is performed on the target fusion features to obtain the target compensation features; The target compensation features are detected to obtain detection results, which characterize the changes of the target object located within the target area over time.

2. The method according to claim 1, characterized in that, The step of performing attention fusion on the difference information between the first initial feature and the second initial feature at the scale based on the loss fusion features at the scale to obtain difference compensation features includes: Based on the loss fusion features at the scale, attention fusion is performed on the difference information between the first initial feature and the second initial feature at the scale to obtain the initial compensation feature; The initial compensation features are enhanced to obtain the difference compensation features.

3. The method according to claim 2, characterized in that, Based on the loss fusion features at the stated scale, attention fusion is performed on the difference information between the first initial feature and the second initial feature at the stated scale to obtain initial compensation features, including: Based on the initial compensation features corresponding to the first scale, difference detection is performed on the first initial features and the second initial features corresponding to the scale to obtain the difference information of the scale. The first scale is an adjacent scale smaller than the scale. The initial compensation features of the smallest scale among the multiple scales are determined based on the difference information of the smallest scale. Based on the loss fusion features at the scale, the difference information at the scale is fused using an attention mechanism to obtain the initial compensation features at the scale.

4. The method according to claim 3, characterized in that, The step of fusing the difference information at the scale using an attention mechanism based on the loss fusion features at the scale to obtain the initial compensation features at the scale includes: Convolutional feature extraction is performed on the loss fusion features at the aforementioned scale to obtain key features; Convolutional feature extraction is performed on the difference information at the scale to obtain query features and value features; The key features, query features, and value features are fused using a cross-attention mechanism to obtain attention weights; The initial compensation features are obtained based on the attention weights and the difference information.

5. The method according to claim 2, characterized in that, The step of enhancing the initial compensation features to obtain the difference compensation features includes: The initial compensation features are divided based on the number of convolution channels in the multi-scale convolution module to obtain multiple sub-compensation features. The multi-scale convolution module includes multiple parallel convolution channels. The multiple convolutional channels are used to extract features from the multiple sub-compensation features respectively, thereby obtaining the edge features of each of the multiple sub-compensation features; The initial compensation feature and multiple edge features are fused to obtain the edge enhancement feature; The blurred regions in the edge enhancement feature are enhanced to obtain the difference compensation feature, wherein the blurred regions represent the areas in the edge enhancement feature where the pixel values ​​meet a preset threshold range.

6. The method according to claim 5, characterized in that, The enhancement of the blurred regions in the edge enhancement features to obtain difference compensation features includes: The blurred region is determined based on the pixel values ​​in the edge enhancement features and the preset threshold; Feature extraction is performed on the pixels located in the blurred region in the edge enhancement feature to obtain the blurred region enhancement feature; The edge enhancement feature and the blurred region enhancement feature are fused to obtain the difference compensation feature.

7. The method according to claim 1, characterized in that, The process of fusing the loss information between the first initial features and the loss information between the second initial features at each of the two scales to obtain loss fusion features includes: The first initial features corresponding to the two scales are processed using a difference algorithm to obtain the first loss information; The second initial features corresponding to the two scales are processed using a difference algorithm to obtain the second loss information; Feature extraction is performed on the information fused from the first loss information and the second loss information to obtain initial fused features; The initial fusion features are batch normalized to obtain the loss fusion features.

8. The method according to claim 1, characterized in that, The step of performing attention fusion on the target fusion features based on the loss fusion features at the target scale to obtain target compensation features includes: The target fusion features are decoded to obtain the first decoded features; The feature fused based on the target fusion feature and the first decoding feature is decoded to obtain the second decoding feature; The target fusion feature, the first decoding feature, and the second decoding feature are fused to obtain the decoding fusion feature; Based on the loss fusion features that match the target scale, the decoding fusion features are fused using a cross-attention mechanism to obtain the target compensation features.

9. The method according to claim 8, characterized in that, The step of decoding the features fused based on the target fusion features and the first decoding features to obtain the second decoding features includes: The target fusion feature and the first decoding feature are fused together to obtain the intermediate decoding feature; The intermediate decoded features are pooled to obtain pooled features; The pooling features are convolved to obtain the second decoding features.

10. The method according to claim 1, characterized in that, Multi-scale feature extraction is performed on the first image to obtain multiple initial features of the first image, including: Perform multi-scale convolution operations on the first image to obtain the local features corresponding to each scale. By using a multilayer perceptron to perform feature transformation on multiple local features, the first initial features of multiple samples are obtained.

11. A method for training a detection model, characterized in that, The method includes: Acquire training samples, which include a first sample image, a second sample image, and sample labels. The sample labels indicate whether the target object in the first sample image has changed relative to the second sample image. Multi-scale feature extraction is performed on the first sample image and the second sample image respectively to obtain multiple first initial features of the first sample image and multiple second initial features of the second sample image; For any two adjacent scales, the loss information between the first initial features of the samples and the loss information between the second initial features of the samples at each of the two scales are fused to obtain the sample loss fusion features; Based on the sample loss fusion features, an attention mechanism is used to compensate for the difference information between the first initial feature and the second initial feature of the sample, resulting in sample target compensation features, including: For multiple scales, attention fusion is performed on the difference information between the first initial feature and the second initial feature of the sample at each scale according to the sample loss fusion feature at each scale, to obtain multiple sample difference compensation features. The sample difference compensation features represent features that supplement the high-frequency detail information lost at the corresponding scale during the difference detection process between the first initial feature and the second initial feature at each scale. The sample difference compensation features are fused together to obtain the sample target fusion features; Based on the sample loss fusion features at the target scale, attention fusion is performed on the sample target fusion features to obtain sample target compensation features; The sample target compensation features are detected to obtain the sample detection results; The detection model is trained based on the cross-entropy loss value between the sample detection result and the sample label, resulting in a trained detection model.

12. The method according to claim 11, characterized in that, The method further includes: Multi-scale feature extraction is performed on the sample labels to obtain label features corresponding to each of the multiple scales; The edge loss value is obtained based on the loss value between the label features corresponding to each of the multiple scales and the sample loss fusion feature; The detection model is trained based on the edge loss value and the cross-entropy loss value to obtain the trained detection model.

13. The method according to claim 12, characterized in that, The step of obtaining the edge loss value based on the loss value between the label features corresponding to multiple scales and the sample loss fusion feature includes: The sample loss fusion features at each of the multiple scales are processed using activation functions to obtain the sample activation results at each of the multiple scales. The label features of each of the multiple scales are processed using an edge detection algorithm to obtain edge detection results corresponding to each of the multiple scales. For each of the aforementioned scales, multiple edge sub-loss values ​​are obtained based on the loss value between the sample activation result and the edge detection result corresponding to the scale. The edge loss value is obtained based on the respective edge sub-loss values ​​of the multiple scales.

14. An electronic device comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Remote sensing change detection method based on edge enhanced cross attention and multi-dimensional loss

    CN119671934A