A power line building change detection method and device, a terminal device and a storage medium
By introducing cross-modal spatial enhancement and cross-channel attention interaction between building maps and real-time remote sensing imagery, the problem of distinguishing between illegal buildings and vegetation replacement in existing technologies has been solved, achieving higher-precision detection of power line building changes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ELECTRIC POWER RES INST OF GUANGDONG POWER GRID CO LTD
- Filing Date
- 2026-03-26
- Publication Date
- 2026-06-09
AI Technical Summary
Existing power line change detection methods based on convolutional networks rely on pixel-level differences between images, making it difficult to effectively distinguish between illegal buildings and seasonal vegetation changes, leading to frequent false alarms.
By introducing building maps as stable prior information about buildings, and through cross-modal spatial enhancement and cross-channel attention interaction, and combining building maps with real-time remote sensing image features, spatial and channel information of map and image features is extracted and enhanced to identify changing buildings.
It improves the accuracy of building change detection, reduces false detections, and can better distinguish between illegal buildings and seasonal vegetation changes.
Smart Images

Figure CN122176524A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target change detection, and in particular to a method, apparatus, terminal equipment, and storage medium for detecting changes in power line structures. Background Technology
[0002] In the management of power transmission lines, distribution lines, and substations, changes in the external environment, especially the increase in the height of illegal buildings, unauthorized additions, and the storage of construction equipment, can directly threaten line safety. Encroachment on line safety distances may cause accidents such as discharge, arcing, and short circuits; illegal construction and changes in building height may become potential fire hazards; and newly built or expanded facilities may encroach on the protection range of transformers or towers.
[0003] Existing dual-temporal image change detection based on convolutional networks (CNN) extracts visually changing areas by comparing raster images of historical and current times, thereby identifying environmental anomalies around transmission lines, distribution lines, and substations.
[0004] However, CNN-based change detection relies solely on pixel-level differences in images and lacks geospatial constraints, making it difficult to effectively distinguish between illegal buildings and seasonal vegetation changes. This results in a large number of invalid false alarms during actual detection. Summary of the Invention
[0005] This invention provides a method, apparatus, terminal equipment, and storage medium for detecting changes in power line structures. It can solve the problem that existing technologies rely solely on pixel-level visual differences between images, making it difficult to effectively distinguish between illegal buildings and seasonal vegetation changes, thereby improving the accuracy of building change detection.
[0006] An embodiment of the present invention provides a method for detecting changes in power line structures, comprising: Acquire building maps and real-time remote sensing images of the area to be detected; Building maps and real-time remote sensing images are input into a trained building change detection model so that the building change detection model can extract scale-enhanced map features from the building maps and scale-enhanced image features from the real-time remote sensing images. Linear mapping of spatial dimensions is performed on scale-enhanced map features and scale-enhanced image features respectively to obtain the first spatial query vector, the first spatial key vector, and the first spatial value vector corresponding to the scale-enhanced map features, and the second spatial query vector, the second spatial key vector, and the second spatial value vector corresponding to the scale-enhanced image features. Based on the second spatial query vector, the first spatial key vector, and the first spatial value vector, cross-modal spatial enhancement is performed on the scale-enhanced map features to obtain spatially enhanced map features. Based on the first spatial query vector, the second spatial key vector, and the second spatial value vector, cross-modal spatial enhancement is performed on the scale-enhanced image features to obtain spatially enhanced image features. Cross-channel attention interaction is performed on spatial augmented map features and spatial augmented image features to obtain channel augmented map features and channel augmented image features; Based on the features of the channel-enhanced map and the channel-enhanced image, identify buildings that have changed within the area to be detected.
[0007] Furthermore, scale-enhanced map features of building maps and scale-enhanced image features of real-time remote sensing imagery are extracted, including: The built-in encoder encodes the building map to obtain multi-scale map features. Each map scale feature in the multi-scale map features is linearly projected to map each map scale feature to the same space, resulting in cross-modal aligned multi-scale map features. The multi-scale features of the cross-modal aligned map are stitched together, layer normalized, and multi-layered sensing processed to obtain scale-enhanced map features. The built-in encoder encodes real-time remote sensing images to obtain multi-scale features of the images. Each image scale feature in the multi-scale image features is linearly projected to map each image scale feature to the same space, resulting in cross-modal aligned multi-scale image features. Multi-scale features of cross-modal aligned images are stitched together, layer normalized, and multi-layer sensing processed to obtain scale-enhanced image features.
[0008] Furthermore, cross-channel attention interaction is performed on the spatially augmented map features and spatially augmented image features to obtain channel-enhanced map features and channel-enhanced image features, including: Linear mapping of the channel dimension is performed on the spatial augmented map features and the spatial augmented image features respectively to obtain the first channel query vector, the first channel key vector and the first channel value vector corresponding to the spatial augmented map features, and the second channel query vector, the second channel key vector and the second channel value vector corresponding to the spatial augmented image features. Based on the second channel key vector, the first channel query vector, and the first channel value vector, cross-modal channel enhancement is performed on the spatial augmented map features to obtain channel-enhanced map features. Based on the first channel query vector, the second channel key vector, and the second channel value vector, cross-modal channel enhancement is performed on the spatially enhanced image features to obtain channel-enhanced image features.
[0009] Furthermore, based on channel-enhanced map features and channel-enhanced image features, buildings that have changed within the detection area are identified, including: After performing layer normalization and multi-layer sensing processing on the channel-enhanced map features, residual connection is performed with the scale-enhanced map features to obtain cross-modal enhanced map features. After performing layer normalization and multi-layer sensing processing on the channel-enhanced image features, residual connection is performed with the scale-enhanced image features to obtain cross-modal enhanced image features. The cross-modal enhanced map features and the cross-modal enhanced image features are fused to obtain fused enhanced features; Decode the fused and enhanced features to generate a pixel change map; Based on the pixel change map, identify buildings that have changed within the detection area.
[0010] Furthermore, the building change detection model is determined in the following way: Acquire several first training samples; each first training sample includes: a first building training map, a first remote sensing training image, and a corresponding first pixel actual change map; Several first training samples are input into the building change detection model to be trained, so that the building change detection model takes the first building training map and the first remote sensing training image as input and the first pixel predicted change map as output for iterative training. In each training process, the corresponding multi-scale map training features and multi-scale image training features are extracted from the first building training map and the first remote sensing training image. Based on the actual change map of the first pixel, a change state mask is generated for the training features of multi-scale map and multi-scale image. Based on the change state mask of multi-scale map training features and multi-scale image training features, determine the unchanged regions corresponding to the multi-scale map training features and multi-scale image training features. The mask alignment loss is calculated based on the unchanged regions corresponding to the multi-scale map training features and the multi-scale image training features; the cross-entropy loss is calculated based on the predicted change map and the actual change map of the first pixel; and the focus loss is calculated based on the predicted change map, the actual change map of the first pixel, and the preset modulation factor. The total loss is obtained by weighted summation of the mask alignment loss, cross-entropy loss, and focus loss. The model parameters of the building change detection model are adjusted based on the total loss until the total loss converges, resulting in a well-trained building change detection model.
[0011] Furthermore, before inputting several initial training samples into the building change detection model to be trained, the process also includes: The training images are divided into several non-overlapping image patches; the training images include: the first building training map and the first remote sensing training image. Initialize the mask autoencoder model; the mask autoencoder model includes: encoder structure and decoder structure; Several non-overlapping image blocks are input into the mask autoencoder model so that the mask autoencoder model performs random masking on each non-overlapping image block to obtain the corresponding mask image block. The mask feature vector is obtained by extracting features from the mask image blocks using the encoder structure. The mask feature vector is decoded using a decoder structure to obtain the predicted image patch; Calculate the mean squared error loss based on the predicted image patch and its corresponding non-overlapping image patch; Based on the mean squared error loss, adjust the parameters of the mask autoencoder model until the mean squared error loss converges, and obtain the trained mask autoencoder model. Based on the encoder structure in the trained mask autoencoder model, determine the encoder parameters built into the building change detection model to be trained.
[0012] Furthermore, after obtaining the trained building change detection model, the following steps are also included: In the encoder built into the building change detection model, network parameters at several scales from low to high are frozen to obtain the building change detection model to be updated. Acquire several second training samples; the second training samples include: a second building training map, a second remote sensing training image, and the corresponding second pixel actual change map; Several second training samples are input into the building change detection model to be updated for iterative training to obtain the updated building change detection model.
[0013] Based on the above method embodiments, the present invention provides corresponding device embodiments, including: an image acquisition module, a scale enhancement module, a spatial feature mapping module, a first cross-modal space enhancement module, a second cross-modal space enhancement module, a cross-channel attention interaction module, and a change map generation module; The image acquisition module is used to acquire building maps and real-time remote sensing images of the area to be detected; The scale enhancement module is used to input building maps and real-time remote sensing images into the trained building change detection model, so that the building change detection model can extract scale-enhanced map features of the building map and scale-enhanced image features of the real-time remote sensing images. The spatial feature mapping module is used to perform linear spatial dimension mapping on scale-enhanced map features and scale-enhanced image features respectively, to obtain the first spatial query vector, the first spatial key vector and the first spatial value vector corresponding to the scale-enhanced map features, and the second spatial query vector, the second spatial key vector and the second spatial value vector corresponding to the scale-enhanced image features. The first cross-modal spatial enhancement module is used to perform cross-modal spatial enhancement on the scale-enhanced map features based on the second spatial query vector, the first spatial key vector, and the first spatial value vector to obtain spatially enhanced map features; The second cross-modal spatial enhancement module is used to perform cross-modal spatial enhancement on scale-enhanced image features based on the first spatial query vector, the second spatial key vector, and the second spatial value vector to obtain spatially enhanced image features. The cross-channel attention interaction module is used to perform cross-channel attention interaction on spatially augmented map features and spatially augmented image features to obtain channel-enhanced map features and channel-enhanced image features. The change map generation module is used to identify buildings that have changed within the detection area based on channel-enhanced map features and channel-enhanced image features.
[0014] Based on the above method embodiments, the present invention provides a corresponding terminal device embodiment, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the steps of the power line building change detection method as described in the present invention.
[0015] Based on the above method embodiments, the present invention provides a corresponding computer-readable storage medium embodiment, including: a stored computer program that, when the computer program is running, controls the device where the computer-readable storage medium is located to execute the steps of the power line building change detection method as described in the present invention.
[0016] Compared with the prior art, the beneficial effects of this embodiment are as follows: This invention introduces building maps as stable prior information for buildings, overcoming the limitations of relying solely on single-source imagery. The acquired building maps and real-time remote sensing images are input into a building change detection model. The model extracts scale-enhanced map features from the building maps and scale-enhanced image features from the real-time remote sensing images, fully exploring feature information at different scales and enhancing the model's ability to perceive targets of different sizes. Then, linear spatial mapping is performed on the scale-enhanced map features and scale-enhanced image features respectively, obtaining the first spatial query vector, first spatial key vector, and first spatial value vector corresponding to the scale-enhanced map features, and the second spatial query vector, second spatial key vector, and second spatial value vector corresponding to the scale-enhanced image features. Based on the second spatial query vector, the first spatial key vector, and the first spatial value vector, the scale-enhanced map features are further processed... Cross-modal spatial enhancement allows map features to fully absorb spatial detail information from image features, resulting in spatially enhanced map features. Similarly, based on the first spatial query vector, the second spatial key vector, and the second spatial value vector, scale-enhanced image features are enhanced cross-modal spatially, enabling image features to leverage the stable spatial structure and prior information in map features to obtain spatially enhanced image features. Through the fusion and mutual enhancement of the two modalities in the spatial dimension, the model can better combine the spatial information of maps and remote sensing images. Next, cross-channel attention interaction is performed on spatially enhanced map features and spatially enhanced image features to obtain channel-enhanced map features and channel-enhanced image features, further strengthening the expressive power of features in different channels. Finally, based on channel-enhanced map features and channel-enhanced image features, buildings that have changed within the detection area are identified.
[0017] In summary, this invention introduces building maps as stable prior building information and integrates maps and remote sensing images through cross-modal spatial enhancement and cross-channel interactive integration. This solves the problem that existing technologies rely solely on pixel-level visual differences between images, making it difficult to effectively distinguish between illegal buildings and seasonal vegetation changes, thus improving the accuracy of building change detection. Attached Figure Description
[0018] Figure 1 This is a schematic flowchart of a method for detecting changes in power line structures according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the feature semantic alignment process provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the processing flow of the Transformer attention module provided in an embodiment of the present invention; Figure 4 This is a vector distribution map of buildings in 2025 provided by an embodiment of the present invention; Figure 5This is a high-resolution remote sensing image of 2023 provided in an embodiment of the present invention; Figure 6 This is a diagram showing the results of building change detection according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the internal processing of a building change detection model provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of a power line building change detection device provided in an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0021] like Figure 1 As shown, in order to address the problem that existing technologies, which rely solely on pixel-level visual differences between images, struggle to effectively distinguish between illegal structures and seasonal vegetation changes, an embodiment of the present invention provides a method for detecting changes in power line structures. This method includes at least the following steps: Step S101: Obtain building maps and real-time remote sensing images of the area to be detected; For step S101, taking Guangdong Power Grid Company as the application scenario, the changes of illegal buildings within 50 meters on both sides of the transmission line channel are monitored. The goal is to automatically determine whether the fire point is located on a building when comparing the data of 2023 and 2025, thereby identifying buildings in the transformer area where no fire point has appeared, and finding the abnormal situation where the fire point falls in a non-building area, so as to assist the operation and maintenance personnel in carrying out accurate inspections.
[0022] Acquire building maps and real-time remote sensing imagery of the area to be detected. The building maps are early building vector data, typically building outline files in Shapefile format, covering the roadways of the area to be detected, and containing attributes such as building ID, purpose, and height. To facilitate subsequent spatial matching and processing with the remote sensing imagery, they need to be converted to raster format. During the conversion process, a uniform resolution of 1 meter is used, the pixel value of the building area is set to 255, and the pixel value of the background area is set to 0, generating the processed building map. Real-time remote sensing imagery refers to high-resolution remote sensing images covering the same area. In this embodiment, images captured by the Gaofen-2 satellite are acquired and standardized. This includes resampling the real-time remote sensing imagery to a spatial resolution of 1 meter to maintain consistency with the rasterized map, normalizing the pixel values of the real-time remote sensing imagery to the range of 0-255, and ensuring accurate spatial registration between the imagery and vector data through geometric correction, resulting in the processed real-time remote sensing imagery. In this embodiment, the size of the real-time remote sensing imagery is 512×512 pixels.
[0023] Step S201: Input the building map and real-time remote sensing image into the trained building change detection model so that the building change detection model can extract the scale-enhanced map features of the building map and the scale-enhanced image features of the real-time remote sensing image. In a preferred embodiment, the extraction of scale-enhanced map features from the building map and scale-enhanced image features from the real-time remote sensing image includes: The built-in encoder encodes the building map to obtain multi-scale map features. Each map scale feature in the multi-scale map features is linearly projected to map each map scale feature to the same space, resulting in cross-modal aligned multi-scale map features. The multi-scale features of the cross-modal aligned map are stitched together, layer normalized, and multi-layered sensing processed to obtain scale-enhanced map features. The built-in encoder encodes real-time remote sensing images to obtain multi-scale features of the images. Each image scale feature in the multi-scale image features is linearly projected to map each image scale feature to the same space, resulting in cross-modal aligned multi-scale image features. Multi-scale features of cross-modal aligned images are stitched together, layer normalized, and multi-layer sensing processed to obtain scale-enhanced image features.
[0024] For step S201, the building map and real-time remote sensing image are input into the trained building change detection model. In the building change detection task, in order to effectively utilize the information of the building map and real-time remote sensing image and to achieve semantic alignment and enhancement of the features of the two, the building map and real-time remote sensing image are input into a dual-branch coding structure.
[0025] For image encoding, a pre-trained Swin-Tiny encoder (denoted as α) is used. This encoder is based on a hierarchical window attention mechanism and gradually reduces the feature map resolution and increases the number of channels through four stages. In Stage 1, the input real-time remote sensing image with a resolution of 512×512 is first processed through a Patch Embedding layer (patch size = 4). This step divides the image into non-overlapping image patches and performs embedding operations. The output feature map size becomes 128×128 and the number of channels is 96. Entering Stage 2, the input is 128×128×96 feature data, which is processed by two Swing Transformer Blocks. Each Swing Transformer Block has unique characteristics during runtime, alternately using Windowed Multi-Head Self-Attention (W-MSA) and Sliding Window Multi-Head Self-Attention (SW-MSA). W-MSA can calculate self-attention within a local window, effectively capturing local detail information; while SW-MSA expands the receptive field through a sliding window, enabling the establishment of long-range global dependencies. This alternating strategy ensures computational efficiency while well adapting to the variable target scale characteristics in remote sensing images. After processing by Stage 2, the output feature map size is 64×64×192. Stage 3 receives 64×64×192 input features, which are also processed by two Swing Blocks, and the output feature map size becomes 32×32×384. Stage 4 takes 32×32×384 features as input, and after processing by six Swin Blocks, the output feature map size is 16×16×768. After progressively reducing the feature map resolution and increasing the number of channels through the four stages described above, three intermediate-level feature maps are finally output: Stage-2 (64×64×192), Stage-3 (32×32×384), and Stage-4 (16×16×768). These feature maps are then flattened into a token sequence to obtain the multi-scale features of the image. .
[0026] For map encoding, a lightweight Swin-Tiny encoder (denoted as β) with the same structure but trainable characteristics is used. After inputting the map, it outputs multi-scale map features at the same level as the image. Its dimensions are completely consistent with the image features.
[0027] like Figure 2As shown, to achieve semantic alignment between map and image features, the model independently performs linear projection on features at each level, mapping them to a unified 768-dimensional latent space. Specifically, for each scale feature in the multi-scale map features... Through learnable linear transformations Projection yields multi-scale map features after cross-modal alignment. For each scale feature in the multi-scale features of the image Through frozen linear layers Projection yields multi-scale features of the image after cross-modal alignment. This ensures that the two features are interactive in a unified semantic space, providing a reliable cross-modal matching basis for subsequent change detection.
[0028] Next, the multi-scale features of the cross-modal aligned map are stitched together, layer normalized, and processed by multi-layer perception to obtain scale-enhanced map features. The specific formulas are as follows: ; in, These represent different levels of features in the multi-scale features of the map after cross-modal alignment, with superscript indicating different levels of features. Representing different levels, the subscript 1 indicates that it belongs to map features. This indicates splicing / joining. Presentation layer normalization processing, This refers to a multilayer perceptron that performs multilayer sensing processing on map features. This indicates scale-enhanced map features.
[0029] Similarly, the multi-scale features of the cross-modal aligned image are stitched together, layer normalized, and processed by multi-layer sensing to obtain scale-enhanced image features. The specific formula is as follows: ; in, These represent different levels of features in the multi-scale features of the image after cross-modal alignment, with superscript indicating different levels. Representing different levels, the subscript 2 indicates that it belongs to image features. This refers to a multilayer perceptron that performs multilayer sensing processing on image features. This indicates scale-enhanced image features.
[0030] It should be noted that, and Both are multilayer perceptrons, used to perform nonlinear transformations on stitched and normalized features. Since map features and image features differ in data distribution and representation content, they learn different parameters during training to adapt to the characteristics of their respective input features, thereby better completing feature enhancement.
[0031] Through the complete encoding, feature alignment, and enhancement process described above, information in building maps and real-time remote sensing imagery can be fully extracted, which helps to improve the accuracy and reliability of change detection.
[0032] Step S202: Perform linear spatial dimension mapping on the scale-enhanced map features and the scale-enhanced image features respectively to obtain the first spatial query vector, the first spatial key vector and the first spatial value vector corresponding to the scale-enhanced map features, and the second spatial query vector, the second spatial key vector and the second spatial value vector corresponding to the scale-enhanced image features. In step S202, linear spatial mapping is performed on the scale-enhanced map features and scale-enhanced image features respectively to generate scale-enhanced map features. The corresponding first space query vector First space key vector and the first space value vector and scale-enhanced image features The corresponding second space query vector Second space key vector Second space value vector .
[0033] Step S203: Based on the second spatial query vector, the first spatial key vector, and the first spatial value vector, perform cross-modal spatial enhancement on the scale-enhanced map features to obtain spatially enhanced map features; For step S203, based on the second spatial query vector corresponding to the scale-enhanced image features... Combined with the first spatial key vector corresponding to the scale-enhanced map features and the first space value vector The computation is performed through the cross-modal interaction mechanism (CMT) in the dual cross-attention module. In this process, As a query, go to Calculate similarity, and then apply similarity weights to... Aggregation is performed to fuse semantically relevant information from image features into map features, resulting in spatially enhanced map features. The specific formula is as follows: ; in, Representing spatially enhanced map features, also using express, This represents the activation function. This represents the second spatial query vector corresponding to the scale-enhanced image features, with dimension . Used to enhance image features at scale Query regions whose spatial location is related to map semantics. Indicates the number of feature dimensions. This represents the first spatial key vector corresponding to the scale-enhanced map features, with dimension . Semantic representations used to characterize spatial locations on a map. This represents the first spatial value vector corresponding to the scale-enhanced map features, with dimension . The actual content that carries the map's features Indicates the total number of pixels. This represents the dimension of the first spatial key vector corresponding to the scale-enhanced map feature.
[0034] Step S204: Based on the first spatial query vector, the second spatial key vector, and the second spatial value vector, perform cross-modal spatial enhancement on the scale-enhanced image features to obtain spatially enhanced image features; For step S204, based on the first spatial query vector corresponding to the scale-enhanced map features... Combined with the second spatial key vector corresponding to the scale-enhanced image features Second space value vector The computation is performed through the cross-modal interaction mechanism (CMT) in the dual cross-attention module. In this process, As a query, go to Calculate similarity, and then apply similarity weights to... The spatially enhanced image features are obtained by aggregation, as shown in the following formula: ; in, Representing spatially enhanced image features, also in express, This represents the first spatial query vector corresponding to the scale-enhanced map features, with dimension [dimensional value missing]. Used to enhance map features at scale Search for regions semantically related to the image within the spatial location. The second spatial key vector represents the feature of the scale-enhanced image, with dimension . Semantic representations used to characterize the spatial locations of images. This represents the second spatial value vector corresponding to the scale-enhanced image features, with dimension . The actual content that carries the characteristics of the image. This represents the dimension of the second spatial key vector corresponding to the scale-enhanced image features.
[0035] Through this step, the image features are further interacted with and semantically aligned with the map features in the spatial dimension, making full use of the information in the map features, so that the image features can more comprehensively and accurately represent the content related to building change detection.
[0036] This invention generates interaction vectors through linear mapping and utilizes a cross-modal spatial interaction mechanism to achieve mutual enhancement of scale-enhanced map features and image features in spatial dimensions, thereby improving the expressive power and semantic alignment of features and providing stronger support for subsequent accurate building change detection.
[0037] Step S205: Perform cross-channel attention interaction on spatial augmented map features and spatial augmented image features to obtain channel augmented map features and channel augmented image features; In a preferred embodiment, cross-channel attention interaction is performed on spatially enhanced map features and spatially enhanced image features to obtain channel-enhanced map features and channel-enhanced image features, including: Linear mapping of the channel dimension is performed on the spatial augmented map features and the spatial augmented image features respectively to obtain the first channel query vector, the first channel key vector and the first channel value vector corresponding to the spatial augmented map features, and the second channel query vector, the second channel key vector and the second channel value vector corresponding to the spatial augmented image features. Based on the second channel key vector, the first channel query vector, and the first channel value vector, cross-modal channel enhancement is performed on the spatial augmented map features to obtain channel-enhanced map features. Based on the first channel query vector, the second channel key vector, and the second channel value vector, cross-modal channel enhancement is performed on the spatially enhanced image features to obtain channel-enhanced image features.
[0038] For step S205, in order to further enhance the information fusion and representation capabilities of spatially augmented map features and spatially augmented image features in the channel dimension, and to fully explore the correlation information between different channels related to building change detection, thereby obtaining more discriminative feature representations, cross-channel attention interaction is performed on spatially augmented map features and spatially augmented image features in the feature processing flow of building change detection. Specifically: First, spatially enhanced map features Spatial Enhancement Image Features Perform linear mapping operations along the channel dimension to spatially enhance map features. In the process, the first channel query vector is generated through independent linear transformations. First channel key vector and the first channel value vector Spatial enhancement of image features In this process, the second channel query vector is generated through independent linear transformations. Second channel key vector Second channel value vector .
[0039] Next, cross-channel attention enhancement is performed on the spatially augmented map features. In the CCT1 (Cross-modal Channel Interaction, CCT) process, [the following steps are taken]. and Perform a dot product of the transpose of the product, then divide by . The channel attention weights are obtained by softmax normalization, and then these weights are used to adjust the first channel value vector of the map. A weighted update is performed to obtain the channel-enhanced map features, using the following formula: ; in, This indicates that the channel enhances map features. This represents the first channel query vector corresponding to the spatially augmented map feature. This represents the second channel key vector corresponding to the spatially enhanced image features. This represents the first channel value vector corresponding to the spatially augmented map features. This represents the dimension of the second channel key vector corresponding to the spatially enhanced image features.
[0040] Cross-channel attention enhancement is performed on the spatially enhanced image features. In the CCT2 workflow, the same channel attention weights as in CCT1 are used for the second channel value vector of the image. A weighted update is performed to obtain the channel-enhanced image features, using the following formula: ; in, This indicates channel-enhanced image features. This represents the second channel value vector corresponding to the spatially enhanced image features.
[0041] In the aforementioned cross-modal channel interaction, CCT1 and CCT2 share the same set of channel attention weights, but act on the channel value vectors of different modalities, thereby achieving cross-modal channel-level collaborative enhancement and ultimately outputting channel-enhanced map features and channel-enhanced image features.
[0042] Step S206: Identify buildings that have changed within the detection area based on the channel-enhanced map features and the channel-enhanced image features.
[0043] In a preferred embodiment, a pixel change map is generated based on channel-enhanced map features and channel-enhanced image features, including: After performing layer normalization and multi-layer sensing processing on the channel-enhanced map features, residual connection is performed with the scale-enhanced map features to obtain cross-modal enhanced map features. After performing layer normalization and multi-layer sensing processing on the channel-enhanced image features, residual connection is performed with the scale-enhanced image features to obtain cross-modal enhanced image features. The cross-modal enhanced map features and the cross-modal enhanced image features are fused to obtain fused enhanced features; Decode the fused and enhanced features to generate a pixel change map; Based on the pixel change map, identify buildings that have changed within the detection area.
[0044] For step S206, enhance the map features of the channel. After layer normalization and multi-layer sensing processing, it is combined with scale-enhanced map features. Perform residual connections to obtain cross-modal augmented map features. The specific formula is as follows: ; Enhanced image features of channels After layer normalization and multilayer sensing processing, it is combined with scale-enhanced image features. Perform residual connections to obtain cross-modal enhanced image features. The specific formula is as follows: ; in, This represents the map features after cross-modal enhancement. , This represents the image features after cross-modal enhancement. .
[0045] Layer normalization stabilizes feature distribution, accelerates model training convergence, and enhances generalization ability, ensuring good representation across different data distributions. Multilayer perceptron processing further performs nonlinear transformations on features, uncovering complex relationships and improving abstraction and discriminative power. Residual connections effectively address gradient vanishing and degradation issues caused by increased network depth, enabling the model to better learn incremental feature information and retain useful components from the original features, thus enhancing the cross-modal augmented map features. and image features after cross-modal enhancement It contains both deeply mined and enhanced cross-modal interaction information and retains the basic information of the original scale features.
[0046] Next, the built-in Transformer Attention Module (TBAM) is used to enhance the cross-modal map features. and image features after cross-modal enhancement By performing fusion, fusion-enhanced features are obtained. This further enhances the ability to perceive regions of cross-modal change.
[0047] like Figure 3 The diagram shows the processing flow of the Transformer attention module, which enhances map features across modalities. and image features after cross-modal enhancement After concatenation, dimensionality reduction is performed using a layer normalization (LN) and GELU-activated MLP layer to map the feature dimensions back from 2D to D, resulting in fused features. This method retains key information while reducing computational overhead. The specific formula is as follows: ; Fusion features Input to self-channel attention module This module models the dependencies between different feature channels using independent query vectors, key vectors, and value vectors. It calculates attention weights along the channel dimension and performs weighted aggregation of channel features to obtain more compact channel-enhanced features. The specific formula is as follows: ; in, Indicates fusion features Output features after self-channel attention enhancement This represents the input features of the self-channel attention module. and Indicates fusion features The query vector and key vector at the channel level are used to calculate the similarity between channels and generate attention weights using softmax. Indicates fusion features The value vectors in the channel dimension represent the actual feature content of each channel, used to enhance semantic interaction between channels and allow the model to focus more on channel information that is key to change detection. Indicates fusion features The dimension of the key vector in the channel dimension.
[0048] Self-channel attention module The output is then fed into the self-attention module. Self-attention module The attention map generated by modeling long-distance dependencies between patches at different locations in the spatial dimension is shown in the following formula: ; in, This represents the output feature after the self-channel attention output feature has been enhanced by spatial self-attention, and includes global spatial context information. This represents the input features of the self-attention module. and This represents the query vector and key vector of the input features of the self-attention module in the spatial dimension. It is used to calculate the similarity between patches at different spatial locations and generate spatial attention weights. This represents a value vector of input features in the spatial dimension, indicating the actual feature content at each spatial location. It is used to aggregate global spatial information through spatial attention weights. The dimension of the key vector represents the spatial dimension of the input features of the self-attention module.
[0049] Finally, the self-attention module Output and fusion features Residual connections are performed to ultimately obtain fused enhanced features. : ; Fusion Enhancement Features It possesses both cross-channel semantic dependencies and global spatial context information, preserving key information from the original fused features while achieving context enhancement through dual-path attention, thus providing a more robust feature representation for the subsequent decoder to generate pixel-level change maps.
[0050] This invention replaces traditional pooling fusion methods (such as CBAM) that are prone to information loss with a Transformer Attention Module (TBAM). Utilizing its pure attention mechanism without pooling, TBAM can simultaneously and comprehensively capture global spatial relationships and cross-channel dependencies, significantly reducing information loss. In building change detection tasks, this greatly enhances the ability to perceive cross-modal change regions, enabling the model to more accurately identify building change areas. This provides a reliable feature base for subsequently generating accurate pixel-level change maps, effectively improving the accuracy and reliability of building change detection.
[0051] Obtaining fusion enhancement features after TBAM fusion Then, it is decoded using the UpperNet decoder, specifically: First, integrate and enhance features Reconstructed into multi-scale feature maps The process involves extracting feature information at different scales from a single fused feature; then, using different upsampling and downsampling operations (such as transposed convolution and max pooling), pyramid-level features are generated. This allows for adjustments to the size and resolution of feature maps, enabling feature maps at different levels to focus on information at different granularities. For example, lower-level feature maps may focus more on detailed information, while higher-level feature maps may focus more on semantic information.
[0052] Subsequently, the generated pyramid hierarchy features The inputs are fed into the Pyramid Pooling Module (PPM) and Feature Pyramid Network (FPN) of the UpperNet decoder. The Pyramid Pooling Module can perform pooling operations on features at different scales, extract feature information from different receptive fields, and enhance the expressive power of features. The Feature Pyramid Network, on the other hand, fuses features at different levels through cross-scale context aggregation, so that features at each level can complement each other, integrate information of different granularities, and further improve the quality and richness of features.
[0053] Finally, the fused features are passed through a classifier. In this embodiment, the classifier is a 1x1 convolutional layer. This convolutional layer performs a linear combination of the channel dimensions of the fused features, mapping the features to a binary classification space, thereby outputting a binary pixel change map. This pixel change map can clearly identify the pixel areas where the building has changed and where it has not changed, thus achieving the goal of identifying buildings that have changed within the detection area and providing intuitive and accurate results for the building change detection task.
[0054] Preferably, to further improve the quality of the results, considering the characteristics of buildings, morphological operations can be used to fill any possible voids inside the building using closing operations and remove minor noise using opening operations. Connectivity analysis can be performed to filter out small change areas, such as areas less than 20 square meters, eliminating interference from small areas caused by false detections or noise. A polygon simplification algorithm (Douglas-Peucker, tolerance set to 1.5m) can be applied to smooth the boundaries of the change areas, outputting vectorized change areas. Finally, the fused features are linearly combined in channel dimension by a classifier composed of 1x1 convolutional layers and mapped to a binary classification space, resulting in a binary pixel change map that clearly identifies the changed and unchanged pixel areas of the building, providing intuitive and accurate results for building change detection tasks.
[0055] In this embodiment, the 2025 building vector distribution map (such as...) Figure 4 (as shown) and the 2023 high-resolution remote sensing image (as shown) Figure 5 As shown, slice the building in the same way, input the trained building change detection model, and output the building change detection result map corresponding to each slice (e.g., ...). Figure 6As shown, the pixel change map is presented in binary classification. Then, morphological closing operation is performed, and 3×3 convolution is used to fill the voids inside the building. Connectivity analysis is performed to remove noise areas with an area of less than 20 square meters. Douglas-Peucker polygon simplification (tolerance 1.5 meters) is performed on the boundary of the remaining change area to generate vectorized change patches. Finally, the change features in shapefile format are output.
[0056] It should be noted that steps S201 to S206 above are all within the building change detection model, such as... Figure 7 As shown, the model first inputs the raster map and remote sensing image into the Swin-Tiny encoders of the map branch and image branch, respectively, to simultaneously extract multi-scale map and image features. Then, the bimodal features enter the alignment module IMAM, which constrains the feature consistency of unchanged areas at multiple scales, establishing a reliable benchmark for cross-modal alignment. The aligned features then enter the projection layer, where they are mapped to a unified feature space through a combination of stitching, layer normalization, and multilayer perceptron operations. Next, the features are fed into the cross-modal cross-channel attention module CCMAT, which contains two core units: bidirectional spatial attention and cross-channel attention. Bidirectional spatial attention allows the map and image features to be aligned. Features are queried against each other in the spatial dimension to enhance semantic association, while cross-channel attention filters key feature channels in the channel dimension to strengthen cross-modal channel collaboration. Finally, the enhanced features are fused with the original features through residual connections. The fused features enter the Transformer Attention Module (TBAM) to further capture global context information and generate fused features with global awareness. Finally, the fused features are input into the UpperNet decoder, which restores the original image resolution through multi-scale upsampling and outputs a pixel-level change prediction map. The entire process, from dual-modal input to change map output, is completed entirely within the model, enabling end-to-end automated processing.
[0057] Next, the training process of the building change detection model will be explained in detail: In a preferred embodiment, the building change detection model is determined in the following manner: Acquire several first training samples; each first training sample includes: a first building training map, a first remote sensing training image, and a corresponding first pixel actual change map; Several first training samples are input into the building change detection model to be trained, so that the building change detection model takes the first building training map and the first remote sensing training image as input and the first pixel predicted change map as output for iterative training. In each training process, the corresponding multi-scale map training features and multi-scale image training features are extracted from the first building training map and the first remote sensing training image. Based on the actual change map of the first pixel, a change state mask is generated for the training features of multi-scale map and multi-scale image. Based on the change state mask of multi-scale map training features and multi-scale image training features, determine the unchanged regions corresponding to the multi-scale map training features and multi-scale image training features. The mask alignment loss is calculated based on the unchanged regions corresponding to the multi-scale map training features and the multi-scale image training features; the cross-entropy loss is calculated based on the predicted change map and the actual change map of the first pixel; and the focus loss is calculated based on the predicted change map, the actual change map of the first pixel, and the preset modulation factor. The total loss is obtained by weighted summation of the mask alignment loss, cross-entropy loss, and focus loss. The model parameters of the building change detection model are adjusted based on the total loss until the total loss converges, resulting in a well-trained building change detection model.
[0058] In a preferred embodiment, before inputting a plurality of first training samples into the building change detection model to be trained, the method further includes: The training images are divided into several non-overlapping image patches; the training images include: the first building training map and the first remote sensing training image. Initialize the mask autoencoder model; the mask autoencoder model includes: encoder structure and decoder structure; Several non-overlapping image blocks are input into the mask autoencoder model so that the mask autoencoder model performs random masking on each non-overlapping image block to obtain the corresponding mask image block. The mask feature vector is obtained by extracting features from the mask image blocks using the encoder structure. The mask feature vector is decoded using a decoder structure to obtain the predicted image patch; Calculate the mean squared error loss based on the predicted image patch and its corresponding non-overlapping image patch; Based on the mean squared error loss, adjust the parameters of the mask autoencoder model until the mean squared error loss converges, and obtain the trained mask autoencoder model. Based on the encoder structure in the trained mask autoencoder model, determine the encoder parameters built into the building change detection model to be trained.
[0059] In one embodiment of the present invention, a pre-training dataset is first constructed by collecting high-resolution remote sensing images with a resolution of 1 meter covering urban and rural scenes, cropping them into 512×512 pixel slices, and finally constructing an unlabeled image library of about 50,000 images containing typical features such as buildings, roads, vegetation, and water bodies.
[0060] The Masked Autoencoder (MAE) is then initialized, consisting of a Swin-Tiny encoder and a lightweight Transformer decoder, with 6 layers and a hidden dimension of 512. During training, the 512×512 input image is first divided into 16×16 non-overlapping patches, totaling 1024 patches. These patches are randomly masked at a high ratio of 75%, and only 256 visible patches are retained as input to the Swin-Tiny encoder to extract the corresponding patch-level feature vectors. The decoder then concatenates the visible features with learnable mask tokens to restore the complete spatial layout and reconstruct the original image. Training only calculates the pixel-level mean squared error (MSE) loss for the masked patches, thereby forcing the model to learn the semantic reasoning ability for missing content. Once the MSE loss converges, the trained Swin-Tiny encoder is retained, the decoder is removed, and its parameters are used as the initialization parameters for the image branch encoder in the subsequent building change detection model, allowing the encoder to learn the local texture and global semantic features of the remote sensing image in advance.
[0061] When constructing the first training samples, each sample contains an early building vector map, a late remote sensing image, and a corresponding pixel-level change label map. The early building vector map is converted into a 1-meter resolution raster map. After rasterization, the pixel value of the building area is set to 255, and the pixel value of the background area is 0. This standardized raster map is denoted as M. The late remote sensing image is first geometrically corrected to ensure spatial location accuracy, and then resampled to 1-meter resolution. At the same time, the pixel values are normalized to the range of 0-255. The processed remote sensing image is denoted as image I. The pixel-level change label map serves as the supervision label for model training. It maintains complete spatial registration and resolution consistency with map M and image I. The pixel value of 0 indicates that there is no building change in the corresponding area, and the pixel value of 1 indicates that there is a building change in the corresponding area.
[0062] The standardized raster map M and the remote sensing image I were uniformly adjusted to a resolution of 512×512 and divided into 1024 input patches of 16×16 pixels each. The change label map was also segmented in the same way. Subsequently, a sliding window was used to crop the data into 512×512 slices, with a step size of 256 pixels to achieve 50% region overlap. Finally, the data was divided into training, validation, and test sets at a ratio of 70%, 15%, and 15%, respectively. To enhance model robustness, data augmentation operations such as random horizontal flipping, rotation, and color jitter (e.g., brightness, contrast, or saturation perturbations) were applied to the remote sensing image.
[0063] The preprocessed first training sample is input into the building change detection model to be trained. The model uses the first building training map (i.e., the standardized raster map M) and the first remote sensing training image (i.e., the remote sensing image I) in the sample as dual input sources and aims to output the first pixel predicted change map. The model performs an iterative training process, maintaining the spatial registration consistency between the input and the supervision label throughout the process. The model adopts a dual Swin-Tiny encoder structure, corresponding to the map branch and the image branch respectively, which can simultaneously extract multi-scale features and adapt to the change detection needs of different levels.
[0064] In each round of iterative training, the map branch encoder extracts features from the standardized raster map M, and the image branch encoder extracts features from the remote sensing image I. The parameters of the image branch encoder are initialized by the pre-trained MAE encoder. Finally, it outputs multi-scale map training features and multi-scale image training features at three scales: 1 / 8, 1 / 16, and 1 / 32, respectively. These features cover multi-level information from local texture to global semantics, providing a foundation for subsequent cross-modal alignment and change judgment.
[0065] Subsequently, by combining the actual change map of the first pixel, a corresponding change state mask is generated for the multi-scale map training features and multi-scale image training features at each level. If the corresponding real label is 0 (no change), the mask is marked as 0; if the corresponding real label is 1 (change), the mask is marked as 1, so as to accurately distinguish the changed and unchanged areas in the feature map.
[0066] Based on the generated change state mask, the model further filters out the regions marked as 0 in the multi-scale map training features and multi-scale image training features, that is, it determines the unchanged regions corresponding to the bimodal features, thereby focusing on the unchanged regions and constructing a feature alignment benchmark.
[0067] For the identified unchanged areas, the mask alignment loss is calculated. Specifically, a weighted Euclidean distance is used to calculate the difference between map features and image features at the same scale in the unchanged areas. The specific formula is as follows: ; in, Indicates the first Mask alignment loss at different scales Indicates an unchanged mask. This represents the map features at each scale. It represents the image features at each scale.
[0068] In this embodiment, three scales are provided, k=1,2,3, corresponding to 1 / 8, 1 / 16, and 1 / 32 respectively. Different scale features correspond to different weights, and the final summation yields the overall mask alignment loss, ensuring that the bimodal features maintain consistency in the unchanged regions and improving feature reliability. The specific formula is as follows: ; in, Indicates the mask alignment loss. , and These represent the weight coefficients for alignment loss at different scales; the default values can be set. , , .
[0069] Simultaneously, after the model outputs the predicted change map of the first pixel through the decoder, it calculates the cross-entropy loss and focal loss respectively. The cross-entropy loss directly measures the pixel-level classification difference between the predicted change map and the actual change map of the first pixel, reflecting the accuracy of the model's judgment of the overall change region. In the calculation, the pixel predicted change map output by the model is first activated by Sigmoid to obtain the probability value of each pixel belonging to the change category. Then, the true label and the predicted probability are compared pixel by pixel, and the loss of a single pixel is calculated by substituting into the binary classification cross-entropy formula. Finally, the average of the losses of all pixels is taken to obtain the cross-entropy loss. The focal loss is an improvement on the cross-entropy loss. It introduces a modulation factor and applies a modulation weight to the predicted probability of each pixel. The loss weight of easily classified samples is significantly reduced, while the weight of difficult samples is retained. This effectively alleviates the common class imbalance problem in building change detection, allowing the model to focus on the optimization of difficult-to-classify regions and improve the detection accuracy of small targets and edge changes.
[0070] Then, based on the preset loss weight coefficients, the mask alignment loss, cross-entropy loss, and focus loss are weighted and summed to obtain the total loss for this iteration. The specific formula is as follows: ; in, Indicates the total loss. Represents cross-entropy loss, Indicates focal loss. , and This represents the loss weight coefficient corresponding to each loss; the default value can be set. , , The loss weight coefficients can be fine-tuned based on the training results, balancing the optimization priorities of feature alignment and classification accuracy.
[0071] Finally, based on the total loss, all trainable parameters of the model are adjusted using the backpropagation algorithm, including the map branch encoder parameters, cross-modal interaction module parameters, and decoder parameters. Simultaneously, the AdamW optimizer and cosine annealing learning rate strategy defined in the diagram are used to update the parameters. This iterative process continues until the total loss stabilizes, at which point the total loss is considered converged. At this point, the model's feature extraction, cross-modal alignment, and change prediction capabilities reach their optimal levels, resulting in a successfully trained building change detection model.
[0072] In a preferred embodiment, after obtaining the trained building change detection model, the method further includes: In the encoder built into the building change detection model, network parameters at several scales from low to high are frozen to obtain the building change detection model to be updated. Acquire several second training samples; the second training samples include: a second building training map, a second remote sensing training image, and the corresponding second pixel actual change map; Several second training samples are input into the building change detection model to be updated for iterative training to obtain the updated building change detection model.
[0073] In one embodiment of the present invention, after obtaining the trained building change detection model, a layered freezing and fine-tuning strategy is performed on the built-in Swin-Tiny encoder to further optimize the model performance. Specifically, parameter selection is performed from the low-scale to high-scale stages of the encoder. The parameters of the first two low-scale stages with output resolutions of 1 / 4 and 1 / 8 are completely frozen, retaining their ability to extract low-level general visual features such as edges and textures. Only the parameters of the last two high-scale stages with output resolutions of 1 / 16 and 1 / 32 are allowed to participate in subsequent updates, thereby obtaining the building change detection model to be updated.
[0074] Prepare several second training samples. The second training samples follow the same preprocessing rules as the first training samples. They include a second building training map, a second remote sensing training image, and a corresponding second pixel actual change map to ensure that the spatial registration and resolution of the samples are consistent.
[0075] After inputting the second training sample into the building change detection model to be updated, iterative fine-tuning training is performed. During the training process, in the last two stages of the encoder, all Swing Transformer Blocks in Stage 3 and Stage 4, including the window attention module, multilayer perceptron, layer normalization, and other components, are enabled for gradient backpropagation to update parameters. To balance the effective transfer of pre-trained knowledge with task-specific optimization, a hierarchical learning rate scheduling strategy is adopted, setting the initial learning rate of Stage 3 to 1.0 × 10⁻⁶. -5 Stage 4 is set to 5.0×10-5 The learning rate is significantly lower than that of other modules in the model. The optimizer still uses AdamW with a weight decay of 0.05, and the parameters are gradually adjusted throughout the total training cycle using cosine annealing learning rate scheduling. Through this iterative training process, the model can retain the general features learned in the pre-training stage, while optimizing the high-level semantic understanding ability for the building change detection task. Finally, an updated building change detection model is obtained, which effectively improves the adaptability to specific remote sensing scenarios and the feature alignment effect between images and maps while reducing the risk of overfitting.
[0076] like Figure 8 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided; An embodiment of the present invention provides a power line structure change detection device, comprising: an image acquisition module, a scale enhancement module, a spatial feature mapping module, a first cross-modal spatial enhancement module, a second cross-modal spatial enhancement module, a cross-channel attention interaction module, and a change map generation module; The image acquisition module is used to acquire building maps and real-time remote sensing images of the area to be detected; The scale enhancement module is used to input building maps and real-time remote sensing images into the trained building change detection model, so that the building change detection model can extract scale-enhanced map features of the building map and scale-enhanced image features of the real-time remote sensing images. The spatial feature mapping module is used to perform linear spatial dimension mapping on scale-enhanced map features and scale-enhanced image features respectively, to obtain the first spatial query vector, the first spatial key vector and the first spatial value vector corresponding to the scale-enhanced map features, and the second spatial query vector, the second spatial key vector and the second spatial value vector corresponding to the scale-enhanced image features. The first cross-modal spatial enhancement module is used to perform cross-modal spatial enhancement on the scale-enhanced map features based on the second spatial query vector, the first spatial key vector, and the first spatial value vector to obtain spatially enhanced map features; The second cross-modal spatial enhancement module is used to perform cross-modal spatial enhancement on scale-enhanced image features based on the first spatial query vector, the second spatial key vector, and the second spatial value vector to obtain spatially enhanced image features. The cross-channel attention interaction module is used to perform cross-channel attention interaction on spatially augmented map features and spatially augmented image features to obtain channel-enhanced map features and channel-enhanced image features. The change map generation module is used to identify buildings that have changed within the detection area based on channel-enhanced map features and channel-enhanced image features.
[0077] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement the power line building change detection method provided by any of the above-described method embodiments of the present invention.
[0078] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0079] Based on the above embodiments of the power line building change detection method, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the power line building change detection method of any embodiment of the present invention.
[0080] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0081] The terminal device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and memory.
[0082] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0083] Based on the above-described method embodiments, another embodiment is provided: another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the power line building change detection method described in any of the above-described method embodiments of the present invention.
[0084] The modules / units integrated into the power line building change detection device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0085] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for detecting changes in power line structures, characterized in that, include: Acquire building maps and real-time remote sensing images of the area to be detected; Building maps and real-time remote sensing images are input into a trained building change detection model so that the building change detection model can extract scale-enhanced map features of the building maps and scale-enhanced image features of the real-time remote sensing images. Linear mapping of spatial dimensions is performed on scale-enhanced map features and scale-enhanced image features respectively to obtain the first spatial query vector, the first spatial key vector, and the first spatial value vector corresponding to the scale-enhanced map features, and the second spatial query vector, the second spatial key vector, and the second spatial value vector corresponding to the scale-enhanced image features. Based on the second spatial query vector, the first spatial key vector, and the first spatial value vector, cross-modal spatial enhancement is performed on the scale-enhanced map features to obtain spatially enhanced map features. Based on the first spatial query vector, the second spatial key vector, and the second spatial value vector, cross-modal spatial enhancement is performed on the scale-enhanced image features to obtain spatially enhanced image features. Cross-channel attention interaction is performed on spatial augmented map features and spatial augmented image features to obtain channel augmented map features and channel augmented image features; Based on the features of the channel-enhanced map and the channel-enhanced image, identify buildings that have changed within the area to be detected.
2. The method for detecting changes in power line structures according to claim 1, characterized in that, Extract scale-enhanced map features from building maps and scale-enhanced image features from real-time remote sensing imagery, including: The built-in encoder encodes the building map to obtain multi-scale map features. Each map scale feature in the multi-scale map features is linearly projected to map each map scale feature to the same space, resulting in cross-modal aligned multi-scale map features. The multi-scale features of the cross-modal aligned map are respectively stitched, layer normalized and multi-layered sensing to obtain scale-enhanced map features; The built-in encoder encodes real-time remote sensing images to obtain multi-scale features of the images. Each image scale feature in the multi-scale image features is linearly projected to map each image scale feature to the same space, resulting in cross-modal aligned multi-scale image features. The multi-scale features of the cross-modal aligned image are stitched together, layer normalized, and multi-layer sensing processed to obtain scale-enhanced image features.
3. The method for detecting changes in power line structures according to claim 1, characterized in that, Cross-channel attention interaction is performed on spatially augmented map features and spatially augmented image features to obtain channel-enhanced map features and channel-enhanced image features, including: Linear mapping of the channel dimension is performed on the spatial augmented map features and the spatial augmented image features respectively to obtain the first channel query vector, the first channel key vector and the first channel value vector corresponding to the spatial augmented map features, and the second channel query vector, the second channel key vector and the second channel value vector corresponding to the spatial augmented image features. Based on the second channel key vector, the first channel query vector, and the first channel value vector, cross-modal channel enhancement is performed on the spatial augmented map features to obtain channel-enhanced map features. Based on the first channel query vector, the second channel key vector, and the second channel value vector, cross-modal channel enhancement is performed on the spatially enhanced image features to obtain channel-enhanced image features.
4. The method for detecting changes in power line structures according to claim 1, characterized in that, Based on the features of the channel-enhanced map and the channel-enhanced image, identify the buildings that have changed within the detection area, including: After performing layer normalization and multi-layer sensing processing on the channel-enhanced map features, a residual connection is made with the scale-enhanced map features to obtain cross-modal enhanced map features. After performing layer normalization and multi-layer sensing processing on the channel-enhanced image features, residual connection is performed with the scale-enhanced image features to obtain cross-modal enhanced image features. The cross-modal enhanced map features and the cross-modal enhanced image features are fused to obtain fused enhanced features; The fused and enhanced features are decoded to generate a pixel change map; Based on the pixel change map, identify buildings that have changed within the detection area.
5. The method for detecting changes in power line structures according to claim 1, characterized in that, The building change detection model was determined in the following way: Obtain several initial training samples; Each first training sample includes: a first building training map, a first remote sensing training image, and a corresponding first pixel actual change map; Several first training samples are input into the building change detection model to be trained, so that the building change detection model takes the first building training map and the first remote sensing training image as input and the first pixel predicted change map as output for iterative training. In each training process, the corresponding multi-scale map training features and multi-scale image training features are extracted from the first building training map and the first remote sensing training image. Based on the actual change map of the first pixel, a change state mask is generated for the training features of multi-scale map and multi-scale image. Based on the change state mask of multi-scale map training features and multi-scale image training features, determine the unchanged regions corresponding to the multi-scale map training features and multi-scale image training features. The mask alignment loss is calculated based on the unchanged regions corresponding to the multi-scale map training features and the multi-scale image training features; the cross-entropy loss is calculated based on the predicted change map and the actual change map of the first pixel; and the focus loss is calculated based on the predicted change map, the actual change map of the first pixel, and the preset modulation factor. The total loss is obtained by weighted summation of the mask alignment loss, cross-entropy loss, and focus loss. The model parameters of the building change detection model are adjusted based on the total loss until the total loss converges, resulting in a well-trained building change detection model.
6. The method for detecting changes in power line structures according to claim 5, characterized in that, Before inputting a number of initial training samples into the building change detection model to be trained, the process also includes: The training images are divided into several non-overlapping image blocks; the training images include: a first building training map and a first remote sensing training image. Initialize the mask autoencoder model; the mask autoencoder model includes: an encoder structure and a decoder structure; Several non-overlapping image blocks are input into the mask autoencoder model so that the mask autoencoder model performs random masking on each non-overlapping image block to obtain the corresponding mask image block. The mask feature vector is obtained by extracting features from the mask image blocks using the encoder structure. The mask feature vector is decoded using a decoder structure to obtain the predicted image patch; Calculate the mean squared error loss based on the predicted image patch and its corresponding non-overlapping image patch; Based on the mean squared error loss, adjust the parameters of the mask autoencoder model until the mean squared error loss converges, and obtain the trained mask autoencoder model. Based on the encoder structure in the trained mask autoencoder model, determine the encoder parameters built into the building change detection model to be trained.
7. The method for detecting changes in power line structures according to claim 6, characterized in that, After obtaining the trained building change detection model, the following is also included: In the encoder built into the building change detection model, network parameters at several scales from low to high are selected and frozen to obtain the building change detection model to be updated. Acquire several second training samples; the second training samples include: a second building training map, a second remote sensing training image, and a corresponding second pixel actual change map; Several second training samples are input into the building change detection model to be updated for iterative training to obtain the updated building change detection model.
8. A power line structure change detection device, characterized in that, include: The system includes an image acquisition module, a scale enhancement module, a spatial feature mapping module, a first cross-modal space enhancement module, a second cross-modal space enhancement module, a cross-channel attention interaction module, and a change map generation module. The image acquisition module is used to acquire building maps and real-time remote sensing images of the area to be detected; The scale enhancement module is used to input building maps and real-time remote sensing images into a trained building change detection model, so that the building change detection model can extract scale-enhanced map features of the building maps and scale-enhanced image features of the real-time remote sensing images. The spatial feature mapping module is used to perform linear spatial dimension mapping on the scale-enhanced map features and the scale-enhanced image features respectively, to obtain the first spatial query vector, the first spatial key vector and the first spatial value vector corresponding to the scale-enhanced map features, and the second spatial query vector, the second spatial key vector and the second spatial value vector corresponding to the scale-enhanced image features. The first cross-modal spatial enhancement module is used to perform cross-modal spatial enhancement on the scale-enhanced map features based on the second spatial query vector, the first spatial key vector, and the first spatial value vector to obtain spatially enhanced map features; The second cross-modal spatial enhancement module is used to perform cross-modal spatial enhancement on the scale-enhanced image features based on the first spatial query vector, the second spatial key vector, and the second spatial value vector to obtain spatially enhanced image features; The cross-channel attention interaction module is used to perform cross-channel attention interaction on spatial augmented map features and spatial augmented image features to obtain channel augmented map features and channel augmented image features. The change map generation module is used to identify buildings that have changed within the detection area based on channel-enhanced map features and channel-enhanced image features.
9. A terminal device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the power line structure change detection method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform the power line building change detection method as described in any one of claims 1-7.