Photovoltaic region segmentation method and device, storage medium and computer device
The photovoltaic region segmentation method based on multi-layer feature extraction and feature fusion solves the problem of remote sensing technology being affected by environmental factors, improves the accuracy and generalization ability of photovoltaic region segmentation, and enhances the model's adaptability to different environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
- Filing Date
- 2024-09-05
- Publication Date
- 2026-05-26
AI Technical Summary
In existing technologies, images acquired by remote sensing technology are greatly affected by factors such as season, lighting conditions, and geographical location, resulting in poor generalization ability of photovoltaic region segmentation models, which in turn affects the accuracy of photovoltaic region segmentation.
A multi-layer feature extraction method is adopted, including a first feature extraction layer, a second feature extraction layer, and a point rendering layer. Deep feature extraction and photovoltaic region edge refinement are performed using a separate attention module, an average pooling module, a multi-scale feature extraction module, and a dual attention module. Transfer learning is combined to optimize model parameters and improve the accuracy of photovoltaic region segmentation.
By employing multi-layer feature extraction and feature fusion, the generalization ability and predictive performance of the photovoltaic region segmentation model are enhanced, the impact of complex backgrounds and object shapes on segmentation accuracy is reduced, and the accuracy of photovoltaic region edge detection is improved.
Smart Images

Figure CN119027433B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of photovoltaic region identification technology, and in particular to a photovoltaic region segmentation method, apparatus, storage medium and computer equipment. Background Technology
[0002] A photovoltaic (PV) area refers to a ground-mounted region where photovoltaic (PV) power generation equipment is installed, converting solar energy into electricity. With the increasing global demand for renewable energy, PV power generation has been widely adopted as a major method of utilizing solar energy. Therefore, accurate identification of PV areas can help relevant organizations understand the distribution of PV resources, enabling them to make more informed decisions when planning PV power generation projects and further promote the development of renewable energy.
[0003] In recent years, remote sensing technology has developed rapidly and has become one of the basic image data acquisition methods for photovoltaic region segmentation. Currently, photovoltaic region segmentation can be accomplished by training a model for the corresponding task using deep learning. However, because images acquired by remote sensing technology are greatly affected by factors such as season, lighting conditions, and geographical location, the generalization ability of the model is poor, resulting in low accuracy in photovoltaic region segmentation. Summary of the Invention
[0004] The purpose of this application is to at least address one of the aforementioned technical deficiencies, particularly the technical deficiency in the prior art where images acquired by remote sensing technology are greatly affected by factors such as season, lighting conditions, and geographical location, resulting in poor generalization ability of the model and consequently low accuracy in photovoltaic region segmentation.
[0005] In a first aspect, this application provides a photovoltaic region segmentation method, the method comprising:
[0006] Determine satellite imagery;
[0007] Obtain a pre-trained region segmentation model; the region segmentation model includes a first feature extraction layer, a second feature extraction layer, and a point rendering layer;
[0008] The satellite image is input into the first feature extraction layer for preliminary feature extraction;
[0009] The feature map output by the first feature extraction layer is input into the second feature extraction layer, and the multi-scale feature extraction module and dual attention module of the second feature extraction layer perform deep feature extraction to obtain the region feature map corresponding to the satellite image.
[0010] The region feature map is input into the point rendering layer to obtain a photovoltaic region segmentation image.
[0011] In one embodiment, the first feature extraction layer includes a separation attention module and an average pooling module;
[0012] The step of inputting the satellite image into the first feature extraction layer includes:
[0013] The satellite image is input into the separation attention module to obtain a first feature map, and the spatial dimension of the first feature map is adjusted using the separation attention module.
[0014] The first feature map, after spatial dimension adjustment, is input into the average pooling module to reduce the spatial dimension of the first feature map, thereby obtaining a second feature map, which is then used as the feature map output by the first feature extraction layer.
[0015] In one embodiment, the step of inputting the feature map output by the first feature extraction layer into the second feature extraction layer, and performing deep feature extraction by the multi-scale feature extraction module and the dual attention module of the second feature extraction layer, includes:
[0016] The feature map output by the first feature extraction layer is input into the multi-scale feature extraction module to extract a multi-scale feature map based on the feature map.
[0017] The multi-scale features are input into the dual attention module to determine the channel weight and spatial weight at each location in the multi-scale feature map;
[0018] Based on the channel weight and spatial weight of each position in the multi-scale feature map, the multi-scale feature map is weighted to obtain a multi-scale weighted feature map.
[0019] Feature fusion is performed on the multi-scale weighted feature map to obtain a region feature map.
[0020] In one embodiment, the step of inputting the feature map output by the first feature extraction layer into the second feature extraction layer, and performing deep feature extraction by the multi-scale feature extraction module and the dual attention module of the second feature extraction layer, includes:
[0021] The feature maps output by the first feature extraction layer are respectively input into the multi-scale feature extraction module and the dual attention module to determine the third feature map output by the multi-scale feature extraction module and the fourth feature map output by the dual attention module.
[0022] The third feature map and the fourth feature map are fused to obtain a region feature map.
[0023] In one embodiment, inputting the region feature map into the point rendering layer to obtain a photovoltaic region segmentation image includes:
[0024] Multiple key points are identified in the region feature map;
[0025] For each key point, local refinement is performed on that key point to obtain its refined features.
[0026] When the refined features of each key point are determined, the refined features of each key point are rendered into the region feature map to obtain the photovoltaic region feature map;
[0027] The satellite image is annotated based on the photovoltaic region feature map to obtain a photovoltaic region segmentation image.
[0028] In one embodiment, the training process of the region segmentation model includes:
[0029] Obtain the training sample set and its corresponding labeled sample set;
[0030] Determine the initial model; the initial model includes a first feature extraction layer, a second feature extraction layer, and a point rendering layer to be trained;
[0031] The initial model is iteratively trained based on the training sample set until a preset training stopping condition is met, at which point the trained initial model is determined as a region segmentation model.
[0032] In each iteration of the iterative training, the predicted photovoltaic region of each training sample is determined based on the output results for the training sample set in this iteration. The loss function for this iteration is determined based on the predicted photovoltaic region of each training sample and the labeled photovoltaic region of each labeled sample in the labeled sample set, so as to adjust the parameters of the initial model.
[0033] In one embodiment, the loss function is determined according to the following expression:
[0034]
[0035] In the formula, Represents the loss function. Indicates the height of the image. Represents the weights of the image. Represents pixels Predictive classification, Represents pixels The labeling and classification, This represents a smoothing factor to prevent letters from being zero.
[0036] Secondly, this application provides a photovoltaic area segmentation device, the device comprising:
[0037] The image acquisition module is used to determine satellite images;
[0038] The model determination module is used to obtain a pre-trained region segmentation model; the region segmentation model includes a first feature extraction layer, a second feature extraction layer, and a point rendering layer.
[0039] The preliminary feature extraction module is used to input the satellite image into the first feature extraction layer for preliminary feature extraction;
[0040] The deep feature extraction module is used to input the feature map output by the first feature extraction layer into the second feature extraction layer, and the multi-scale feature extraction module and dual attention module of the second feature extraction layer perform deep feature extraction to obtain the region feature map corresponding to the satellite image.
[0041] The region segmentation module is used to input the region feature map into the point rendering layer to obtain a photovoltaic region segmentation image.
[0042] Thirdly, this application provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the photovoltaic region segmentation method as described in any of the above embodiments.
[0043] Fourthly, this application provides a computer device, including: one or more processors, and a memory;
[0044] The memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, they perform the steps of the photovoltaic region segmentation method as described in any of the above embodiments.
[0045] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0046] This application provides a photovoltaic region segmentation method, apparatus, storage medium, and computer equipment. The method includes: determining a satellite image and acquiring a pre-trained region segmentation model; then inputting the satellite image into the first feature extraction layer of the region segmentation model for preliminary feature extraction; next, inputting the feature map output from the first feature extraction layer into the second feature extraction layer of the region segmentation model; and finally, performing deep feature extraction using a multi-scale feature extraction module and a dual attention module in the second feature extraction layer to obtain a region feature map. Finally, the region feature map is input into the point rendering layer of the region segmentation model to obtain a photovoltaic region segmentation image. Multi-layer feature extraction provides richer data representations of the photovoltaic region, capturing more feature information from different dimensions to improve the generalization ability and prediction performance of the photovoltaic region segmentation model. Furthermore, combining the multi-scale feature extraction module and the dual attention module for further feature extraction adaptively fuses local features with global contextual information, improving the accuracy of photovoltaic region segmentation. The dual attention module can also dynamically adjust the channel dimension and spatial dimension to adapt to images of different scales and complexities, thereby reducing the impact of easily confused backgrounds and complex object shapes on the accuracy of photovoltaic region segmentation. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 A flowchart illustrating a photovoltaic region segmentation method provided in an embodiment of this application;
[0049] Figure 2 This is a flowchart illustrating the steps of inputting satellite images into the first feature extraction layer for preliminary feature extraction, as provided in an embodiment of this application.
[0050] Figure 3 A flowchart illustrating the steps of inputting the feature map output by the first feature extraction layer into the second feature extraction layer for deep feature extraction, as provided in an embodiment of this application;
[0051] Figure 4 This is a flowchart illustrating the steps of inputting a region feature map into a point rendering layer to obtain a photovoltaic region segmentation image, as provided in an embodiment of this application.
[0052] Figure 5 A schematic diagram illustrating the construction of the region segmentation model provided in this application embodiment;
[0053] Figure 6 This is a schematic diagram of the structure of a photovoltaic area segmentation device provided in an embodiment of this application;
[0054] Figure 7 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0056] In one embodiment, this application provides a photovoltaic region segmentation method, which is illustrated in the following embodiments using a server as an example. It is understood that the photovoltaic region segmentation method can be implemented using a single server or a server cluster consisting of multiple servers; this application does not impose any specific limitations on this.
[0057] like Figure 1 As shown, this application provides a photovoltaic region segmentation method, the method comprising:
[0058] Step S101: Determine the satellite image.
[0059] Satellite imagery refers to images of the Earth's surface taken by artificial satellites. Types of satellite imagery include, but are not limited to, optical satellite imagery, radar satellite imagery, infrared satellite imagery, and synthetic aperture radar (SAR) imagery. It is understood that the type of satellite imagery determined in this embodiment can be any one of the aforementioned types, and the satellite imagery determined in this embodiment can also be an image obtained by fusing two or more of the aforementioned types of satellite imagery. Therefore, the former can be referred to as a single-modal image, and the latter as a multi-modal image; that is, a satellite imagery can be either a single-modal image or a multi-modal image.
[0060] In this step, when it is necessary to segment and identify photovoltaic areas in a certain region, one type of satellite imagery of that region is acquired, or multiple types of satellite imagery of that region are acquired, and the multiple types of satellite imagery are fused to obtain the final satellite image. When determining which satellite imagery to use, photovoltaic area segmentation is performed based on that satellite imagery.
[0061] Step S102: Obtain a pre-trained region segmentation model.
[0062] The region segmentation model includes a first feature extraction layer, a second feature extraction layer, and a point rendering layer.
[0063] Specifically, the first feature extraction layer includes a separate attention module and an average pooling module for preliminary feature extraction. The separate attention module is used to better capture key features in the image through a separate attention mechanism, improving classification accuracy. The average pooling module is used to reduce the spatial dimensionality of the data. The second feature extraction layer includes a multi-scale feature extraction module and a dual attention module. The multi-scale feature extraction module is used to extract features at different scales from the image. The dual attention module is used to combine channel attention and spatial attention to capture the semantic information of the image. The point rendering layer is used to refine the edges of the photovoltaic region.
[0064] Understandably, based on the region segmentation model described above, multi-layer feature extraction is implemented to capture more feature information from different dimensions. Furthermore, the specific structural components within each feature extraction layer maximize the acquisition of feature information, thereby improving the accuracy of photovoltaic region segmentation. Additionally, using a point rendering layer to refine the edges of the photovoltaic region in the feature map can improve the accuracy of photovoltaic region edge detection.
[0065] Step S103: Input the satellite image into the first feature extraction layer for preliminary feature extraction.
[0066] In this step, the separation attention module and average pooling module in the first feature extraction layer are used to extract features from the satellite image to obtain the feature map output by the first feature extraction layer corresponding to the satellite image.
[0067] Step S104: Input the feature map output by the first feature extraction layer into the second feature extraction layer. The multi-scale feature extraction module and dual attention module of the second feature extraction layer perform deep feature extraction to obtain the region feature map corresponding to the satellite image.
[0068] Among them, the regional feature map refers to the feature representation of the photovoltaic region in the satellite image, which is used to identify and segment the photovoltaic region.
[0069] In this step, since the photovoltaic region in the satellite image is small and the segmentation of the photovoltaic region is easily affected by the complex environment, the extraction of photovoltaic region features is strengthened. When the feature map corresponding to the satellite image is obtained from the output of the first feature extraction layer, the feature map is input to the second feature extraction layer. The multi-scale feature extraction module and the dual attention module of the second feature extraction layer perform further feature extraction. Since the dual attention module includes two types of attention modules, which describe the semantic interdependencies in the spatial dimension and the channel dimension respectively, it enhances semantic consistency and can maintain the segmentation accuracy when segmenting the photovoltaic region of complex images.
[0070] Step S105: Input the region feature map into the point rendering layer to obtain the photovoltaic region segmentation image.
[0071] Among them, the photovoltaic region delineation image refers to the image corresponding to the satellite image that marks the photovoltaic region.
[0072] In this step, the regional feature map is refined through a point rendering layer to improve the clarity of the photovoltaic region boundary. The point rendering layer is also used to annotate the satellite image to generate a photovoltaic region segmentation image.
[0073] This application provides a photovoltaic region segmentation method, apparatus, storage medium, and computer equipment. The method includes: determining a satellite image and acquiring a pre-trained region segmentation model; then inputting the satellite image into the first feature extraction layer of the region segmentation model for preliminary feature extraction; next, inputting the feature map output from the first feature extraction layer into the second feature extraction layer of the region segmentation model; and finally, performing deep feature extraction using a multi-scale feature extraction module and a dual attention module in the second feature extraction layer to obtain a region feature map. Finally, the region feature map is input into the point rendering layer of the region segmentation model to obtain a photovoltaic region segmentation image. Multi-layer feature extraction provides richer data representations of the photovoltaic region, capturing more feature information from different dimensions to improve the generalization ability and prediction performance of the photovoltaic region segmentation model. Furthermore, combining the multi-scale feature extraction module and the dual attention module for further feature extraction adaptively fuses local features with global contextual information, improving the accuracy of photovoltaic region segmentation. The dual attention module can also dynamically adjust the channel dimension and spatial dimension to adapt to images of different scales and complexities, thereby reducing the impact of easily confused backgrounds and complex object shapes on the accuracy of photovoltaic region segmentation.
[0074] like Figure 2 As shown, in one embodiment, the first feature extraction layer includes a separation attention module and an average pooling module; inputting satellite images into the first feature extraction layer includes:
[0075] Step S201: Input the satellite image into the separation attention module to obtain the first feature map, and use the separation attention module to adjust the spatial dimension of the first feature map.
[0076] In this step, the spatial dimensions of the first feature map are adjusted using a separate attention module. This adjustment enhances the resolution of the feature map and improves the discriminability of features, thereby making image analysis more accurate. By adjusting the spatial dimensions, redundant information in the first feature map can be effectively reduced, retaining the most valuable features. Furthermore, adjusting the spatial dimensions can also reduce computational resource consumption and improve processing speed.
[0077] Step S202: Input the first feature map after spatial dimension adjustment into the average pooling module to reduce the spatial dimension of the first feature map after spatial dimension adjustment, obtain the second feature map, and use the second feature map as the feature map output by the first feature extraction layer.
[0078] In this step, by calculating the average value of each local region on the first feature map, the spatial dimension of the first feature map is effectively reduced while retaining important feature information. Specifically, the average pooling module sets a preset window, slides the preset window on the first feature map, calculates the average value of all pixel values within the window, and then uses this average value as a new pixel value for the output feature map. In this way, the spatial resolution of the first feature map is reduced, but key visual information is preserved.
[0079] Understandably, by adjusting and reducing the spatial dimension, the region segmentation model can focus more on global features, which helps capture the overall structure and patterns in satellite images. This improves the model's generalization ability and reduces its sensitivity to noise and details in satellite images, thereby enhancing the accuracy of photovoltaic region segmentation.
[0080] like Figure 3 As shown, in one embodiment, the feature map output by the first feature extraction layer is input into the second feature extraction layer, where the multi-scale feature extraction module and the dual attention module of the second feature extraction layer perform deep feature extraction, including:
[0081] Step S301: Input the feature map output by the first feature extraction layer into the multi-scale feature extraction module to extract a multi-scale feature map based on the feature map.
[0082] In this step, a multi-scale feature extraction module is used to analyze the input feature map to extract feature information at different scales. For example, scale-space theory or multi-scale filters are used to capture the details and structural information of the image at different resolution levels. In this way, the multi-scale feature extraction module can more comprehensively understand the image content, enhance the model's sensitivity to features at different scales, and improve the richness and accuracy of feature representation.
[0083] Step S302: Input the multi-scale features into the dual attention module to determine the channel weights and spatial weights at each location in the multi-scale feature map.
[0084] Spatial weights refer to the weights applied to each pixel of an image, used to emphasize or de-emphasize features in certain regions. Channel weights refer to the weights applied to each color channel (e.g., RGB) of an image, used to adjust the contribution of different color channels to the model.
[0085] Step S303: Based on the channel weight and spatial weight of each position in the multi-scale feature map, perform weighted processing on the multi-scale feature map to obtain a multi-scale weighted feature map.
[0086] In this step, spatial weights and channel weights are applied to the feature map at each scale. This is achieved through element-wise multiplication (Hadamard product). Specifically, for each scale of the feature map, the pixel value at each location is multiplied by the corresponding spatial weight, and then the pixel value at each channel is multiplied by the corresponding channel weight. The final result is a multi-scale weighted feature map.
[0087] Step S304: Perform feature fusion on the multi-scale weighted feature map to obtain the region feature map.
[0088] In this step, the multi-scale weighted feature maps are fused to obtain the final region feature map. Feature fusion methods can be simple stacking, weighted averaging, or other more complex fusion strategies, such as using attention mechanisms to dynamically adjust the contributions of features at different scales.
[0089] As can be understood from the above steps, the connection structure between the multi-scale feature extraction module and the dual attention module is as follows: Through the cascaded connection between the multi-scale feature extraction module and the dual attention module, multi-scale feature maps are first extracted, and then channel weights and spatial weights are determined to weight the multi-scale feature maps, thereby effectively improving the expressive power of the features and enhancing the model's understanding of image details and contextual information. Furthermore, the cascaded processing of the feature maps by the multi-scale feature extraction module and the dual attention module helps to avoid potential information loss during feature fusion. The multi-scale feature extraction module is responsible for multi-scale feature extraction, while the dual attention module is responsible for dynamically adjusting the region of interest for the features. Their cascaded connection can better optimize feature fusion and expression.
[0090] In one embodiment, the feature map output by the first feature extraction layer is input to the second feature extraction layer, where the multi-scale feature extraction module and the dual attention module of the second feature extraction layer perform deep feature extraction, including:
[0091] The feature maps output from the first feature extraction layer are input into the multi-scale feature extraction module and the dual attention module, respectively, to determine the third feature map output by the multi-scale feature extraction module and the fourth feature map output by the dual attention module.
[0092] The third and fourth feature maps are fused to obtain the region feature map.
[0093] The scheme described in this embodiment is based on the parallel connection of a multi-scale feature extraction module and a dual attention module. Furthermore, the feature fusion process in this embodiment can be referred to the description of step S304.
[0094] It is understandable that parallel connectivity means that the multi-scale feature extraction module and the dual attention module can run simultaneously to improve computational efficiency.
[0095] In addition, it can be achieved by structurally connecting the dual attention module and the multi-scale feature extraction module in parallel, or by structurally connecting the dual attention module and the multi-scale feature extraction module in series. The module processing order of these two schemes is different from the two schemes mentioned above. This application does not impose specific restrictions on the choice of connection structure.
[0096] like Figure 4 As shown, in one embodiment, the region feature map is input into the point rendering layer to obtain a photovoltaic region segmentation image, including:
[0097] Step S401: Identify multiple key points in the region feature map.
[0098] In this step, the boundaries of each photovoltaic region are determined by the regional feature map, and key points are selected on the boundaries of each photovoltaic region according to a preset step size.
[0099] Step S402: For each key point, perform local refinement on the key point to obtain the refined features of the key point.
[0100] In this step, for each keypoint, the local context information surrounding the keypoint is learned to refine the keypoint locally and obtain its refined features.
[0101] Step S403: When the refined features of each key point are determined, the refined features of each key point are rendered into the region feature map to obtain the photovoltaic region feature map.
[0102] Understandably, when determining the refined features of each key point, the refined features of each key point are rendered onto the region feature map to obtain a photovoltaic region feature map with clear edges for each photovoltaic region.
[0103] Step S404: Annotate the satellite image according to the photovoltaic region feature map to obtain a photovoltaic region division image.
[0104] It is understandable that by identifying key points to obtain local contextual information, and then refining the surrounding area of each key point, the boundary of the photovoltaic area can be refined, thereby improving the accuracy of edge detection in the photovoltaic area.
[0105] In one embodiment, the training process of the region segmentation model includes:
[0106] Obtain the training sample set and its corresponding labeled sample set;
[0107] Determine the initial model; the initial model includes a first feature extraction layer, a second feature extraction layer, and a point rendering layer to be trained;
[0108] The initial model is iteratively trained based on the training sample set until the preset training stopping condition is met. The trained initial model is then determined as the region segmentation model.
[0109] In each iteration of the iterative training, the predicted photovoltaic region of each training sample is determined based on the output results for the training sample set in this iteration. The loss function for this iteration is determined based on the predicted photovoltaic region of each training sample and the labeled photovoltaic region of each labeled sample in the labeled sample set, so as to adjust the parameters of the initial model.
[0110] Specifically, the loss function describes the difference between the predicted photovoltaic region for each sample and the labeled photovoltaic region for each labeled sample. The parameters of the initial model include the training parameters for the first feature extraction layer, the second feature extraction layer, and the point rendering layer.
[0111] In another embodiment, when determining the initial model, transfer learning is used to fine-tune the parameters of the initial model to obtain a new initial model. Subsequent iterative training is then performed based on the new initial model. In this embodiment, fine-tuning the parameters of the initial model in advance can improve the training efficiency of the initial model.
[0112] It is understandable that by iteratively training an initial model that includes a first feature extraction layer, a second feature extraction layer, and a point rendering layer, and using the difference between the predicted photovoltaic region and the labeled photovoltaic region as the loss function, the initial model can be trained in the direction of narrowing the difference between the predicted photovoltaic region and the labeled photovoltaic region. Furthermore, by updating the training parameters of the first feature extraction layer, the second feature extraction layer, and the point rendering layer, the feature extraction capability of the initial model can be improved, thereby enhancing the generalization capability of the finally trained model.
[0113] In one example, such as Figure 5 As shown, Figure 5 This is a schematic diagram illustrating the construction of the region segmentation model provided in this application embodiment. "Backbone" refers to the backbone network; "upgrade" refers to advancing the separate attention module into the backbone network; "DAM" refers to the dual attention module; and "integration" refers to combining the dual attention module with the multi-scale feature extraction module in the encoder layer. Optimization learning can be used to fine-tune the parameters of the initial model and optimize the loss function during model training.
[0114] In one embodiment, the loss function is determined according to the following expression:
[0115]
[0116] In the formula, Represents the loss function. Indicates the height of the image. Represents the weights of the image. Represents pixels Predictive classification, Represents pixels The labeling and classification, This represents a smoothing factor to prevent letters from being zero.
[0117] In this embodiment, the overlap between the predicted and labeled classifications is effectively measured by calculating the similarity between the two sets. Compared with the traditional cross-entropy loss function, determining the loss function using this expression can solve the class imbalance problem, reduce the model's neglect of minority classes, and thus improve the model's performance in photovoltaic region segmentation tasks.
[0118] In one embodiment, the focus loss function, the IoU loss function, and a hybrid loss function may also be considered. A hybrid loss function refers to a function obtained by combining two or more types of loss functions. In selecting the loss function, an appropriate loss function can be chosen based on actual needs; this application does not impose specific restrictions in this regard.
[0119] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0120] The photovoltaic region segmentation device provided in the embodiments of this application is described below. The photovoltaic region segmentation device described below can be referred to in correspondence with the photovoltaic region segmentation method described above.
[0121] like Figure 6As shown, this application provides a photovoltaic area segmentation device 500, the device comprising:
[0122] Image acquisition module 501 is used to determine satellite images;
[0123] The model determination module 502 is used to obtain a pre-trained region segmentation model; the region segmentation model includes a first feature extraction layer, a second feature extraction layer, and a point rendering layer.
[0124] The preliminary feature extraction module 503 is used to input satellite images into the first feature extraction layer for preliminary feature extraction;
[0125] The deep feature extraction module 504 is used to input the feature map output by the first feature extraction layer into the second feature extraction layer, and the multi-scale feature extraction module and dual attention module of the second feature extraction layer perform deep feature extraction to obtain the region feature map corresponding to the satellite image.
[0126] The region segmentation module 505 is used to input the region feature map into the point rendering layer to obtain the photovoltaic region segmentation image.
[0127] In one embodiment, the first feature extraction layer includes a separation attention module and an average pooling module; the preliminary feature extraction module includes:
[0128] The dimension adjustment submodule is used to input satellite images into the separation attention module to obtain a first feature map, and then use the separation attention module to adjust the spatial dimension of the first feature map;
[0129] The pooling submodule is used to input the first feature map after spatial dimension adjustment into the average pooling module to reduce the spatial dimension of the first feature map after spatial dimension adjustment, so as to obtain the second feature map, and use the second feature map as the feature map output by the first feature extraction layer.
[0130] In one embodiment, the deep feature extraction module includes:
[0131] The feature extraction submodule is used to input the feature map output by the first feature extraction layer into the multi-scale feature extraction module, so as to extract a multi-scale feature map based on the feature map;
[0132] The weight determination submodule is used to input multi-scale features into the dual attention module to determine the channel weight and spatial weight at each location in the multi-scale feature map;
[0133] The feature weighting submodule is used to perform weighting processing on the multi-scale feature map based on the channel weight and spatial weight of each position in the multi-scale feature map, so as to obtain a multi-scale weighted feature map.
[0134] The first feature fusion submodule is used to perform feature fusion on multi-scale weighted feature maps to obtain regional feature maps.
[0135] In one embodiment, the deep feature extraction module includes:
[0136] The feature determination submodule is used to input the feature map output by the first feature extraction layer into the multi-scale feature extraction module and the dual attention module, respectively, so as to determine the third feature map output by the multi-scale feature extraction module and the fourth feature map output by the dual attention module, respectively.
[0137] The second feature fusion submodule is used to fuse the third and fourth feature maps to obtain a region feature map.
[0138] In one embodiment, the region partitioning module includes:
[0139] The point determination submodule is used to determine multiple key points in the region feature map;
[0140] The local refinement submodule is used to refine each key point locally to obtain the refined features of that key point.
[0141] The rendering submodule is used to render the refined features of each key point to the region feature map when the refined features of each key point are determined, so as to obtain the photovoltaic region feature map.
[0142] The annotation submodule is used to annotate satellite images based on photovoltaic region feature maps to obtain photovoltaic region segmentation images.
[0143] In one embodiment, the photovoltaic region segmentation device further includes:
[0144] The sample acquisition module is used to acquire the training sample set and its corresponding labeled sample set;
[0145] The initial model determination module is used to determine the initial model; the initial model includes a first feature extraction layer, a second feature extraction layer, and a point rendering layer to be trained;
[0146] The iterative training module is used to iteratively train the initial model based on the training sample set until the preset training stopping condition is met, and then the trained initial model is determined as the region segmentation model.
[0147] In each iteration of the iterative training, the predicted photovoltaic region of each training sample is determined based on the output results for the training sample set in this iteration. The loss function for this iteration is determined based on the predicted photovoltaic region of each training sample and the labeled photovoltaic region of each labeled sample in the labeled sample set, so as to adjust the parameters of the initial model.
[0148] The division of modules in the above-described photovoltaic area segmentation device is merely illustrative. In other embodiments, the photovoltaic area segmentation device can be divided into different modules as needed to complete all or part of its functions. Each module in the above-described photovoltaic area segmentation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0149] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the photovoltaic region segmentation method as described in any of the above embodiments.
[0150] In one embodiment, this application also provides a computer device storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the photovoltaic region segmentation method as described in any of the above embodiments.
[0151] Indicatively, such as Figure 7 As shown, Figure 7 This is a schematic diagram of the internal structure of a computer device 600 provided in an embodiment of this application. The computer device 600 can be provided as a server. (Refer to...) Figure 7 The computer device 600 includes a processing component 602, which further includes one or more processors, and memory resources represented by memory 601 for storing instructions, such as application programs, that can be executed by the processing component 602. The application programs stored in memory 601 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 602 is configured to execute instructions to perform the photovoltaic region segmentation method of any of the above embodiments.
[0152] The computer device 600 may also include a power supply component 603 configured to perform power management of the computer device 600, a wired or wireless network interface 604 configured to connect the computer device 600 to a network, and an input / output (I / O) interface 605. The computer device 600 may operate on an operating system stored in memory 601, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0153] Those skilled in the art will understand that Figure 7The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0154] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a…" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. In this document, the singular forms "a," "an," and "the" may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “comprising / including” or “having” specify the presence of the stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof. Meanwhile, the term “and / or” as used in this specification includes any and all combinations of the associated listed items.
[0155] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0156] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for photovoltaic region segmentation, characterized in that, The method includes: Determine satellite imagery; Obtain a pre-trained region segmentation model; the region segmentation model includes a first feature extraction layer, a second feature extraction layer, and a point rendering layer; The satellite image is input into the first feature extraction layer for preliminary feature extraction; The feature map output by the first feature extraction layer is input into the second feature extraction layer, and the multi-scale feature extraction module and dual attention module of the second feature extraction layer perform deep feature extraction to obtain the region feature map corresponding to the satellite image. The region feature map is input into the point rendering layer to obtain a photovoltaic region segmentation image; The first feature extraction layer includes a separation attention module and an average pooling module; inputting the satellite image into the first feature extraction layer includes: The satellite image is input into the separation attention module to obtain a first feature map, and the spatial dimension of the first feature map is adjusted using the separation attention module. The first feature map, after spatial dimension adjustment, is input into the average pooling module to reduce the spatial dimension of the first feature map, thereby obtaining the second feature map, and the second feature map is used as the feature map output by the first feature extraction layer. The step of inputting the region feature map into the point rendering layer to obtain a photovoltaic region segmentation image includes: Multiple key points are identified in the region feature map; For each key point, local refinement is performed on that key point to obtain its refined features. When the refined features of each key point are determined, the refined features of each key point are rendered into the region feature map to obtain the photovoltaic region feature map; The satellite image is annotated based on the photovoltaic region feature map to obtain a photovoltaic region segmentation image.
2. The photovoltaic region segmentation method according to claim 1, characterized in that, The step of inputting the feature map output by the first feature extraction layer into the second feature extraction layer, and performing deep feature extraction by the multi-scale feature extraction module and dual attention module of the second feature extraction layer, includes: The feature map output by the first feature extraction layer is input into the multi-scale feature extraction module to extract a multi-scale feature map based on the feature map. The multi-scale features are input into the dual attention module to determine the channel weight and spatial weight at each location in the multi-scale feature map; Based on the channel weight and spatial weight of each position in the multi-scale feature map, the multi-scale feature map is weighted to obtain a multi-scale weighted feature map. Feature fusion is performed on the multi-scale weighted feature map to obtain a region feature map.
3. The photovoltaic region segmentation method according to claim 1, characterized in that, The step of inputting the feature map output by the first feature extraction layer into the second feature extraction layer, and performing deep feature extraction by the multi-scale feature extraction module and dual attention module of the second feature extraction layer, includes: The feature maps output by the first feature extraction layer are respectively input into the multi-scale feature extraction module and the dual attention module to determine the third feature map output by the multi-scale feature extraction module and the fourth feature map output by the dual attention module. The third feature map and the fourth feature map are fused to obtain a region feature map.
4. The photovoltaic region segmentation method according to any one of claims 1 to 3, characterized in that, The training process of the region segmentation model includes: Obtain the training sample set and its corresponding labeled sample set; Determine the initial model; the initial model includes a first feature extraction layer, a second feature extraction layer, and a point rendering layer to be trained; The initial model is iteratively trained based on the training sample set until a preset training stopping condition is met, at which point the trained initial model is determined as a region segmentation model. In each iteration of the iterative training, the predicted photovoltaic region of each training sample is determined based on the output results for the training sample set in this iteration. The loss function for this iteration is determined based on the predicted photovoltaic region of each training sample and the labeled photovoltaic region of each labeled sample in the labeled sample set, so as to adjust the parameters of the initial model.
5. The photovoltaic region segmentation method according to claim 4, characterized in that, The loss function is determined based on the following expression: In the formula, Represents the loss function. Indicates the height of the image. Represents the weights of the image. Represents pixels Predictive classification, Represents pixels The labeling and classification, This represents a smoothing factor to prevent letters from being zero.
6. A photovoltaic area segmentation device, characterized in that, The device includes: The image acquisition module is used to determine satellite images; The model determination module is used to obtain a pre-trained region segmentation model; the region segmentation model includes a first feature extraction layer, a second feature extraction layer, and a point rendering layer. The preliminary feature extraction module is used to input the satellite image into the first feature extraction layer for preliminary feature extraction; The deep feature extraction module is used to input the feature map output by the first feature extraction layer into the second feature extraction layer, and the multi-scale feature extraction module and dual attention module of the second feature extraction layer perform deep feature extraction to obtain the region feature map corresponding to the satellite image. The region segmentation module is used to input the region feature map into the point rendering layer to obtain a photovoltaic region segmentation image; The first feature extraction layer includes a separation attention module and an average pooling module; the preliminary feature extraction module includes: The satellite image is input into the separation attention module to obtain a first feature map, and the spatial dimension of the first feature map is adjusted using the separation attention module. The first feature map, after spatial dimension adjustment, is input into the average pooling module to reduce the spatial dimension of the first feature map, thereby obtaining the second feature map, and the second feature map is used as the feature map output by the first feature extraction layer. The region division module includes: Multiple key points are identified in the region feature map; For each key point, local refinement is performed on that key point to obtain its refined features. When the refined features of each key point are determined, the refined features of each key point are rendered into the region feature map to obtain the photovoltaic region feature map; The satellite image is annotated based on the photovoltaic region feature map to obtain a photovoltaic region segmentation image.
7. A storage medium, characterized in that: The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the photovoltaic region segmentation method as described in any one of claims 1 to 5.
8. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the photovoltaic region segmentation method as described in any one of claims 1 to 5.