Rooftop Photovoltaic Potential Assessment Method Based on Semi-Supervised Segmentation Model

Through the semi-supervised segmentation model and Fourier transform technology, the rooftop photovoltaic potential assessment method is extracted, which solves the problems of difficulty in labeling and low identification accuracy in rooftop photovoltaic assessment, and achieves more efficient rooftop photovoltaic potential assessment and installed capacity measurement.

CN118470438BInactive Publication Date: 2024-09-24GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410912606.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-09-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing technology, rooftop photovoltaic potential assessment methods rely on fully supervised learning models, which require a large amount of labeled data, and traditional methods fail to effectively consider the proportion of photovoltaic available area of ​​different types of roofs, resulting in low identification accuracy.

Method used

A rooftop photovoltaic potential assessment method based on a semi-supervised segmentation model is adopted to generate high-quality pseudo-labels through a training dataset and a pseudo-label filter. Combined with the encoder and decoder architecture, Fourier transform and convolutional attention modules are used to extract features. Segment the roof and calculate its photovoltaic usable area.

Benefits of technology

It reduces the difficulty of data annotation, improves the identification accuracy and generalizability of rooftop photovoltaic potential assessment, obtains a more accurate available rooftop photovoltaic area, and supports more accurate installed capacity calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118470438B
    Figure CN118470438B
Patent Text Reader

Abstract

The present invention discloses a method for evaluating the potential of rooftop photovoltaics based on a semi-supervised segmentation model, which belongs to the field of photovoltaic potential evaluation, and includes selecting training samples for annotation to construct a training data set; using the training data set to train the semi-supervised rooftop segmentation model; inputting a remote sensing image to be detected into the semi-supervised rooftop segmentation model, segmenting all rooftop parts in the study area and outputting a prediction map; extracting image blocks containing only a single roof through contour detection and image reconstruction algorithms, and inputting them into a rooftop classification model to obtain a rooftop classification result; setting available area ratios for various roofs to obtain the total available area of ​​rooftop photovoltaics; and calculating the installed capacity of rooftop photovoltaics to evaluate the potential of rooftop photovoltaics. The method of the present invention reduces the difficulties caused by data annotation, so that the photovoltaic potential evaluation method based on computer vision has better generalizability, divides roofs into different types, obtains more accurate available area of ​​rooftop photovoltaics, and lays a foundation for subsequent installed capacity measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of photovoltaic potential assessment, and in particular to a rooftop photovoltaic potential assessment method based on a semi-supervised segmentation model. Background Art

[0002] Photovoltaic power generation, as one of the main technologies for utilizing solar energy, has become an important focus in the energy field and has opened up new prospects for sustainable energy development. Rooftop photovoltaics, as a type of photovoltaic power generation, reduces energy loss during energy transmission, improves energy utilization efficiency, and reduces the load pressure on the power grid. This distributed energy architecture can enhance the resilience and stability of the power grid. Cities, as densely populated areas on building roofs, are the main locations for installing photovoltaic power generation systems. However, photovoltaic power generation, as a type of new energy power generation, is unstable and intermittent. Therefore, it is of great significance to evaluate the potential of rooftop photovoltaics.

[0003] With the rapid development of computer vision and remote sensing image technology, using computer vision to extract roof information has become an ideal means. In computer vision, a common method is to segment the roofs of buildings based on a semantic segmentation model based on a fully supervised learning model, and then evaluate the rooftop photovoltaic potential of the study area. However, the fully supervised learning model relies on a large amount of accurate labeled data, and the annotation of remote sensing datasets is a labor-intensive task that requires a lot of effort.

[0004] If a semi-supervised learning model is used, it usually only focuses on how to design a pseudo-label filter to obtain high-quality pseudo-labels. However, in essence, the generation of pseudo-labels is due to the insufficient feature extraction capability of the model. At the same time, the roof of the building is usually equipped with obstacles such as water heaters and air-conditioning outdoor units, which means that the roof of the building cannot be fully used to install photovoltaic modules. And the proportion of available area of ​​photovoltaic modules for each type of roof is quite different. In the traditional rooftop photovoltaic potential assessment method, few people pay attention to the proportion of available area of ​​rooftop photovoltaics of different types of roofs. Usually, only a macro ratio is set and applied to all roofs. However, the proportions of different types of roofs are quite different. In addition, existing studies have divided roofs into multiple categories during the roof recognition process, but the accuracy of pixel-based classification is often low. Summary of the invention

[0005] The present invention aims to provide an improved semi-supervised segmentation model rooftop photovoltaic potential assessment method, the purpose of which is to alleviate the difficulties caused by remote sensing data annotation, increase the generalizability of the rooftop photovoltaic potential assessment method based on computer vision, and improve the recognition accuracy of the segmentation model. At the same time, the method improves the roof classification method based on roof image blocks at a microscopic level to obtain a more accurate rooftop photovoltaic available area.

[0006] To achieve the above object, the technical solution of the present invention is:

[0007] The rooftop photovoltaic potential assessment method based on a semi-supervised segmentation model of the present invention comprises the following steps: step S1, selecting a part of an original remote sensing image as a training sample, annotating the training sample, and constructing a rooftop segmentation training data set; step S2, using the rooftop segmentation training data set to train the semi-supervised rooftop segmentation model; step S3, after the training is completed, inputting the remote sensing image to be detected into the semi-supervised rooftop segmentation model, segmenting all rooftop parts in a study area, and outputting a prediction map containing only rooftops and backgrounds; step S4, according to the prediction map output by the semi-supervised rooftop segmentation model, extracting an image block containing only a single roof through contour detection and image reconstruction algorithms, inputting the single rooftop image block into a rooftop classification model, and obtaining a rooftop classification result; step S5, based on the rooftop classification result, empirically setting a rooftop photovoltaic available area ratio for each type of roof, and then obtaining the total rooftop photovoltaic available area of ​​the entire study area; step S6, evaluating the rooftop photovoltaic potential of the study area by calculating the total rooftop photovoltaic installed capacity.

[0008] In step S2 of the above-mentioned rooftop photovoltaic potential assessment method based on a semi-supervised segmentation model, the training of the semi-supervised roof segmentation model includes the following steps: step S21, using labeled data to train the teacher model; step S22, after the teacher model training is completed, the unlabeled data is input into the teacher model, and the generated pseudo labels are filtered to retain high-quality pseudo labels to form a pseudo label map as a label map of the unlabeled data; step S23, the parameters in the teacher model after training are transferred to the student model, and the teacher model and the student model share the same segmentation model architecture; step S24, the labeled data and the unlabeled data are input into the student model together to perform semi-supervised training on the student model, and the trained student model is obtained for roof segmentation.

[0009] In step S23 of the above-mentioned rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model, the segmentation model architecture adopts an encoder and a decoder, the original remote sensing image is input into the encoder, and the result output by the encoder is decoded by the decoder to output a prediction image; the encoder is a layered representation, each layer is formed by stacking SSFEM modules, the first layer and the second layer are respectively composed of 3 SSFEM modules, the third layer is composed of 12 SSFEM modules, and the last layer is composed of 3 SSFEM modules, and a downsampling module is set between each layer.

[0010] In the above-mentioned rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model, the SSFEM module includes a convolution branch with local detailed information and a Transformer branch with global information; for a given input X, the convolution branch with local detailed information and the Transformer branch with global information respectively extract local features x_CNN and global features x_Trans, input them into the feature interaction module, and output value Y.

[0011] In the above-mentioned rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model, the feature interaction module includes: performing Fourier transform on the local features x_CNN and the global features x_Trans in the spatial domain to convert them into Fourier domain features F_CNN and Fourier domain features F_Trans; inputting the transformed Fourier domain features F_CNN and Fourier domain features F_Trans into the convolution layer, the normalization layer, and the parallel spatial attention module and the channel attention module respectively, to obtain the attention weights W_Trans based on the global features and the attention weights W_CNN based on the local features in the frequency domain; by multiplying the obtained attention weights W_Trans based on the global features and the attention weights W_CNN based on the local features in the frequency domain by the Fourier domain features F_CNN and the Fourier domain features F_Trans respectively, the local representation and the global clues in the Fourier domain are fused, and residual connections are added; and the Fourier domain features with global-local information are inversely transformed back to the spatial domain features; the calculation formula is:

[0012]

[0013]

[0014]

[0015]

[0016]

[0017] Where x_CNN represents the local features of the spatial domain extracted by the convolution branch with local detailed information, x_Trans represents the global features of the spatial domain extracted by the Transformer branch with global information, f represents Fourier transform, conv represents convolution operation, bn represents normalization operation, SAM represents channel attention operation, CAM represents spatial attention operation, W_Trans is the attention weight based on global features in the frequency domain, W_CNN is the attention weight based on local features, and f represents the global attention weight based on local features. -1 represents the inverse Fourier transform, and y represents the spatial domain features of the final output of the module.

[0018] In the above-mentioned rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model, the convolution branch with local detailed information includes: the input feature map first passes through a 1×1 convolution layer to adjust the number of feature map channels; then it is input into the activation function to increase the nonlinearity of the model; the feature map output by the activation function is input into three parallel convolution attention modules, so that the network can pay attention to different levels and different aspects of information, and each attention module can learn different feature representations in the data, thereby enhancing the representation ability of the model; the weights output by the three convolution attention modules are superimposed by channel, and then input into the 1×1 convolution to fuse the feature information and output.

[0019] In the above-mentioned rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model, the convolution attention module includes: the input feature map first passes through a 5×5 convolution, and then passes through 3 parallel void strip convolution channels, and the output is fused with multi-scale information to extract multi-scale feature information; the first void strip convolution channel first passes through a 1×4 void strip convolution, and then passes through a 4×1 void strip convolution; the second void strip convolution channel first passes through a 1×6 void strip convolution, and then passes through a 6×1 void strip convolution; the third void strip convolution channel first passes through a 1×11 void strip convolution, and then passes through a 11×1 void strip convolution; after fusing the information at multiple scales, the spatial attention weight is output through a 3×3 convolution; after obtaining the spatial attention weight, it is multiplied with the input feature map to output a feature map with attention distribution; and then residual connection is performed with the module input; the specific calculation formula is:

[0020]

[0021] In the formula, represents the input feature map, represents an element-by-element matrix multiplication operation, represents the convolution operation, Indicates the first branches, represents the residual connection, Represents the output of the convolutional attention module.

[0022] In the above-mentioned rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model, the downsampling module includes two branches, which are merged and output; one branch uses convolution for downsampling, and sequentially undergoes 3×3 convolution, standardization operation, and activation function; the other branch introduces soft pooling, and sequentially undergoes soft pooling, 3×3 convolution, and activation function; the calculation formula is:

[0023]

[0024] Where x represents the downsampling module input, conv represents the convolution operation, bn represents the normalization operation, gelu represents the activation function, R represents the selected local area, a represents the feature value, i represents the number of rows in the selected area where a is located, and y represents the number of columns in the selected area where a is located.

[0025] In the above-mentioned rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model, the decoder uses the Deeplabv3+ decoder as the decoder of the segmentation model architecture.

[0026] Step S4 of the above-mentioned rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model includes the following steps: step S41, inputting a remote sensing image and a corresponding prediction map containing only roofs and backgrounds based on the output of the semi-supervised roof segmentation model, and using a contour detection algorithm to find the contour line coordinates of all roofs in the prediction map; step S42, according to the contour line coordinates, cropping each roof image block containing the roof from the remote sensing image; step S43, creating a blank image of the same size as the roof image block, and drawing an area of ​​the specified contour on the blank image; step S44, through the OpenCV library, performing a bitwise AND operation on the blank image and the roof image block to obtain a separate image block containing only a single roof, wherein only a single roof is displayed in the separate image block, and the rest is a black mask; step S45, introducing ResNet-50 pre-trained on ImageNet as a roof classification model; step S46, inputting all separate image blocks into the roof classification model, classifying the roofs into different categories, and obtaining a roof classification result.

[0027] In step S6 of the above-mentioned method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model, the calculation of the total rooftop photovoltaic installed capacity includes the following steps: step S61, based on the roof classification results and the ratio of the rooftop photovoltaic available area of ​​each type of roof, the rooftop photovoltaic available area of ​​the entire area is calculated, and the calculation formula is:

[0028]

[0029]

[0030] In the formula, represents the total area of ​​rooftop photovoltaics available in the study area, Table roof type, Indicates The area of ​​the roof, represents the number of roof categories, Indicates The ratio of available area of ​​the roof type, represents the remote sensing image resolution, Indicates The number of roof-like pixels;

[0031] Step S62, based on the available rooftop photovoltaic area, the user defines and selects photovoltaic modules, and calculates the installed capacity of the rooftop photovoltaic according to the specifications and parameters of the photovoltaic modules. The calculation formula is:

[0032]

[0033]

[0034] In the formula, represents the total installed capacity of photovoltaic power generation, Indicates the rated power of a single photovoltaic module. Indicates the number of photovoltaic modules, represents the total rooftop photovoltaic area available, Indicates the front and rear photovoltaic spacing, Indicates the width of a single PV module.

[0035] In step S1 of the above-mentioned rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model, the training samples are labeled using Labelme software.

[0036] Beneficial effect: The rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model proposed in the present invention greatly reduces the difficulties caused by data labeling, making the rooftop photovoltaic potential assessment method based on computer vision more generalizable. The new roof segmentation model structure involved in the present invention enables the model to utilize Fourier transform to transform local and global features in the spatial domain to the Fourier domain, fully integrate the advantages of convolution and transformer, and focus on key areas in the image, thereby enhancing the representation ability of the model and improving the accuracy of roof segmentation. The roof classification method involved in the present invention divides roofs into different types based on roof image blocks to obtain more accurate rooftop photovoltaic available area, laying a solid foundation for subsequent installed capacity calculations.

[0037] In order to make the above features and advantages of the invention more obvious and easy to understand, embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a schematic diagram of the flow of the rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model of the present invention.

[0039] Figure 2 It is a schematic diagram of the framework of the semi-supervised roof segmentation model involved in the present invention.

[0040] Figure 3 It is a schematic diagram of the segmentation model architecture involved in the present invention.

[0041] Figure 4 It is a schematic diagram of the SSFEM module involved in the present invention.

[0042] Figure 5 It is a schematic diagram of the principle of the Conv Block involved in the present invention.

[0043] Figure 6 This is a schematic diagram of the principle of the convolutional attention module involved in the present invention.

[0044] Figure 7 It is a schematic diagram of the principle of the downsampling module in the SSFEM module involved in the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose and technical solution of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] Figure 1 FIG. 4 is a flow chart of a method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model of the present invention. Figure 1 As shown, the rooftop photovoltaic potential assessment method proposed in the present invention specifically includes the following steps.

[0047] Step S1, select a part of the original remote sensing image as a training sample, and annotate the training sample to construct a roof segmentation training data set.

[0048] Step S2: Use the roof segmentation training dataset to train the semi-supervised roof segmentation model.

[0049] Step S3, after the training is completed, the remote sensing image to be detected is input into the semi-supervised roof segmentation model to segment all roof parts in the study area and output a prediction map containing only the roof and background.

[0050] Step S4, according to the prediction image output by the semi-supervised roof segmentation model, extract the image block containing only a single roof through contour detection and image reconstruction algorithm, input the single roof image block into the roof classification model, and obtain the roof classification result.

[0051] Step S5, based on the roof classification results, empirically set a rooftop photovoltaic available area ratio for each type of roof, and then obtain the total rooftop photovoltaic available area of ​​the entire study area.

[0052] Step S6, evaluating the rooftop photovoltaic potential of the study area by calculating the total rooftop photovoltaic installed capacity.

[0053] In the above step S1, the original remote sensing image can be trained using free open source high-definition remote sensing images or commercial remote sensing images. The training sample is a part selected from the original remote sensing image based on experience. In order to enhance the generalization of the segmentation model, this part of the training sample needs to basically include all styles of building roof types in the study area to train a more complete segmentation model. "Labeling the training samples" can use Labelme software to label the training samples.

[0054] Figure 2 FIG. 5 is a schematic diagram of the framework of the semi-supervised roof segmentation model according to the present invention. In the above step S2, the framework of the semi-supervised roof segmentation model is as follows: Figure 2 As shown in Figure 2, the entire framework is divided into two parts: supervised training and semi-supervised training. Figure 2 The black solid arrows in the figure represent the supervised training process, and the black dotted arrows represent the unsupervised training process. The roof segmentation training dataset is Figure 2 The labeled data in the training sample is Figure 2 Unlabeled data in .

[0055] In the above step S2, the semi-supervised roof segmentation model is trained, which specifically includes the following steps.

[0056] Step S21, training the teacher model using labeled data.

[0057] Step S22, after the teacher model training is completed, the unlabeled data is input into the teacher model, and the generated pseudo label A is filtered to retain the high-quality pseudo label B to form a pseudo label map as the label map of the unlabeled data.

[0058] Step S23, migrating the parameters in the trained teacher model to the student model, and the teacher model and the student model share the same segmentation model architecture.

[0059] Step S24, inputting the labeled data and the unlabeled data into the student model together to perform semi-supervised training on the student model, and obtaining a trained student model for roof segmentation.

[0060] Figure 3 Schematic diagram of the segmentation model architecture of the present invention. The encoder-decoder structure adopted by the segmentation model architecture in the above step S23 is as follows Figure 3 The original remote sensing image is input into the encoder, and the output of the encoder is decoded by the decoder to output the predicted image.

[0061] In order to enhance the feature extraction capability and obtain more accurate pseudo labels, the present invention proposes a new space-frequency feature extraction module, namely, the SSFEM module. Among them, the encoder adopts a hierarchical representation, and each layer is composed of stacked SSFEM modules. The first and second layers are respectively composed of 3 SSFEM modules, the third layer is composed of 12 SSFEM modules, and the last layer is composed of 3 SSFEM modules. The first to fourth layers are sequentially provided with 3, 3, 12, and 3 feature extraction modules, which is based on the traditional encoder design architecture rules. In principle, the first layer mainly extracts basic low-level features, such as edges, textures, etc., or extracts more complex features such as simple shapes or edge combinations. These features are relatively simple, so it is usually not necessary to stack too many feature extraction modules. The second layer is usually designed to extract higher-level features, which contain more complex combinations and patterns, so more feature extraction modules are required to gradually extract and abstract. The third layer is usually designed to extract higher-level features, which contain more complex combinations and patterns, so more feature extraction modules are required to gradually extract and abstract. When reaching the fourth layer, after multiple layers of feature extraction and downsampling, the features have been highly abstracted. These high-level feature representations are usually more stable and discriminative, so they do not require too many additional feature extraction modules for further processing.

[0062] At the same time, a new dual-branch downsampling module is designed between each layer. The input remote sensing image first passes through the encoder part to gradually extract multi-scale features. Each time the image passes through a layer of encoder, the size is downsampled to half of the original image size, and the number of channels is doubled. Finally, the extracted multi-scale features are input into the decoder, gradually upsampled to the original image size, and the predicted image is output. The decoder preferably uses the Deeplabv3+ decoder as the decoder of the segmentation model architecture. Its decoder part maintains the high-resolution characteristics while enhancing the semantic segmentation performance.

[0063] Figure 4 is a schematic diagram of the SSFEM module of the present invention. Preferably, the above-mentioned SSFEM module is as follows Figure 4As shown, it consists of two branches, namely a convolution branch with local detailed information (denoted as Conv Block), and a Transformer branch with global information (denoted as Trans Block). For a given input X, Conv Block and Trans Block extract local features x_CNN and global features x_Trans, respectively. In order to learn the complementary information between the two branches, a feature interaction module is added at each stage, and the final output value Y. According to the spectral convolution theorem in Fourier theory, point-by-point updates in the Fourier domain globally affect all input features. Therefore, spectral learning can guide all frequencies to capture long-term and short-term interactions. The present invention explores interactions in the Fourier domain, which is different from previous efforts to interact in the spatial domain.

[0064] The feature interaction module first performs Fourier transformation on the local features x_CNN and global features x_Trans in the spatial domain, and converts them into Fourier domain features F_CNN and Fourier domain features F_Trans. Then, the transformed Fourier domain features F_CNN and Fourier domain features F_Trans are respectively input into the convolution layer, the normalization layer, and the parallel spatial attention module and the channel attention module to obtain the attention weights W_Trans based on global features and the attention weights W_CNN based on local features in the frequency domain. Secondly, by multiplying the obtained attention weights W_Trans based on global features and the attention weights W_CNN based on local features in the frequency domain by the Fourier domain features F_CNN and the Fourier domain features F_Trans, the local representation and global clues in the Fourier domain are fully integrated. In order to prevent the problem caused by the vanishing gradient, a residual connection is also added. Finally, the Fourier domain features with global-local information are inversely transformed back to the spatial domain features. The specific calculation formula is:

[0065]

[0066]

[0067]

[0068]

[0069]

[0070] In the formula, x_CNN represents the local features of the spatial domain extracted by Conv Block, x_Trans represents the global features of the spatial domain extracted by TransBlock, f represents Fourier transform, conv represents convolution operation, bn represents normalization operation, SAM represents channel attention operation, CAM represents spatial attention operation, W_Trans is the attention weight based on global features in the frequency domain, W_CNN is the attention weight based on local features, and f represents the ... -1 represents the inverse Fourier transform, and y represents the spatial domain features of the final output of the module.

[0071] Figure 5 Schematic diagram of the principle of the Conv Block involved in the present invention. Preferably, the above-mentioned Conv Block (i.e., the convolution branch with local detailed information) is as follows Figure 5 As shown in the figure, the feature map input by Conv Block first passes through a 1×1 convolution layer to adjust the number of feature map channels; then it is input into the activation function to increase the nonlinearity of the model; then, the feature map output by the activation function is input into three parallel convolutional attention modules, so that the network can pay attention to information at different levels and in different aspects. Each attention module can learn different feature representations in the data, thereby enhancing the representation ability of the model; finally, the weights output by the three convolutional attention modules are superimposed by channel, and then input into the 1×1 convolution to fuse the feature information and output it.

[0072] Figure 6 FIG. 1 is a schematic diagram of the principle of the convolutional attention module of the present invention. The convolutional attention module is as follows: Figure 6 As shown in the figure, three parallel atrous strip convolution channels are used to extract the multi-scale spatial attention weight distribution, and then the multi-scale attention weights are further fused through 3×3 convolution. Finally, considering that directly multiplying the input features with the attention weights generated by 3×3 convolution will cause some features to be lost due to zero weights. Therefore, an additional residual connection is used to add the input features of the convolutional attention module to the output features again to retain the original semantic information.

[0073] Specifically, the working principle of the convolutional attention module is that the input feature map first passes through a 5×5 convolution, and then passes through 3 parallel dilated strip convolution channels, and the output fuses the information at multiple scales to extract feature information at multiple scales. Preferably, the first dilated strip convolution channel first passes through a 1×4 dilated strip convolution, and then a 4×1 dilated strip convolution; the second dilated strip convolution channel first passes through a 1×6 dilated strip convolution, and then a 6×1 dilated strip convolution; the third dilated strip convolution channel first passes through a 1×11 dilated strip convolution, and then a 11×1 dilated strip convolution. After fusing the information at multiple scales, the spatial attention weight is output through a 3×3 convolution. After obtaining the spatial attention weight, it is multiplied with the input feature map to output a feature map with attention distribution. Finally, a residual connection is performed with the module input. The specific calculation formula is:

[0074]

[0075] In the formula, represents the input feature map, represents an element-by-element matrix multiplication operation, represents the convolution operation, Indicates the first branches, represents the residual connection, Represents the output of the convolutional attention module.

[0076] Figure 7 FIG. 1 is a schematic diagram of the principle of the down-sampling module in the SSFEM module of the present invention. The down-sampling module in the SSFEM module (i.e., the space-frequency feature extraction module) is as follows: Figure 7 As shown in the figure. Previous semantic segmentation models usually use convolution or maximum pooling for downsampling. However, these methods easily lead to the loss of some detail information, which is not conducive to the segmentation of remote sensing images. Soft pooling can accumulate activations in an exponentially weighted manner. Compared with a series of other pooling methods, soft pooling retains more information in the downsampled activation map. Finer downsampling leads to better classification accuracy.

[0077] Therefore, the present invention designs a new dual-branch downsampling module. Figure 7In it, H and W represent the length and width of the input feature map respectively, and C represents the number of channels of the input feature map. The downsampling module of the present invention is composed of two branches, one of which uses convolution for downsampling, specifically, it sequentially undergoes 3×3 convolution, standardization operation, and activation function; the other branch introduces soft pooling, specifically, it sequentially undergoes soft pooling, 3×3 convolution, and activation function; the two branches are merged and output. Among them, the function of one branch is to obtain small-scale features, and the function of the other branch is to retain details. Both are equally important and indispensable. The specific calculation formula is:

[0078]

[0079] Where x represents the downsampling module input, conv represents the convolution operation, bn represents the normalization operation, gelu represents the activation function, R represents the selected local area, a represents the feature value, i represents the number of rows in the selected area where a is located, and y represents the number of columns in the selected area where a is located.

[0080] The above step S4 specifically includes the following steps:

[0081] Step S41, input the remote sensing image and the corresponding prediction map containing only the roof and the background based on the output of the semi-supervised roof segmentation model, and use the contour detection algorithm to find the contour line coordinates of all the roofs in the prediction map.

[0082] Step S42, cutting out each roof image block including the roof from the remote sensing image according to the contour line coordinates.

[0083] Step S43, creating a blank image with the same size as the roof image block, and drawing a region with a specified contour on the blank image.

[0084] Step S44, through the OpenCV library, a bitwise AND operation is performed on the blank image and the roof image block to obtain a separate image block containing only a single roof, in which only the single roof is displayed, and the rest is a black mask.

[0085] Step S45, introduce ResNet-50 pre-trained on ImageNet as the roof classification model.

[0086] Step S46, input all individual image blocks into the roof classification model, classify the roofs into different categories, and obtain roof classification results.

[0087] The roof classification method proposed in the present invention divides roofs into different categories at a microscopic level, thereby more accurately calculating the available photovoltaic area of ​​the roof. Compared with dividing roofs into different categories for segmentation, the roof classification based on image blocks proposed in the present invention can achieve better results. The reason is that the essence of semantic segmentation is to classify pixels, and the model needs to predict a category label for each pixel in the image, not just classify the entire image.

[0088] In the above step S6, the total rooftop photovoltaic installed capacity is calculated, which specifically includes the following steps:

[0089] Step S61, based on the roof classification results and the ratio of the roof photovoltaic available area of ​​each type of roof, calculate the roof photovoltaic available area of ​​the entire area, and the calculation formula is:

[0090]

[0091]

[0092] In the formula, represents the total area of ​​rooftop photovoltaics available in the study area, Table roof type, Indicates The area of ​​the roof, represents the number of roof categories, Indicates The ratio of available area of ​​the roof type, represents the remote sensing image resolution, Indicates The number of roof-like pixels.

[0093] Step S62, based on the available rooftop photovoltaic area, the user defines and selects photovoltaic modules, and calculates the installed capacity of the rooftop photovoltaic according to the specifications and parameters of the photovoltaic modules. The calculation formula is:

[0094]

[0095]

[0096] In the formula, represents the total installed capacity of photovoltaic power generation, Indicates the rated power of a single photovoltaic module. Indicates the number of photovoltaic modules, represents the total rooftop photovoltaic area available, Indicates the front and rear photovoltaic spacing, Indicates the width of a single PV module.

[0097] In summary, the rooftop photovoltaic potential assessment method based on the semi-supervised segmentation model proposed in the present invention greatly reduces the difficulties caused by data labeling, making the rooftop photovoltaic potential assessment method based on computer vision more generalizable. The new roof segmentation model structure involved in the present invention enables the model to utilize Fourier transform to transform local and global features in the spatial domain to the Fourier domain, fully integrate the advantages of convolution and transformer, and focus on key areas in the image, thereby enhancing the representation ability of the model and improving the accuracy of roof segmentation. The roof classification method involved in the present invention divides roofs into different types based on roof image blocks to obtain more accurate rooftop photovoltaic available area, laying a solid foundation for subsequent installed capacity calculations.

[0098] Although the present invention has been disclosed as above by way of embodiments, it is not intended to limit the present invention. Any person having ordinary knowledge in the technical field may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the scope of the attached patent application.

Claims

1. Rooftop photovoltaic potential assessment method based on semi-supervised segmentation model, It is characterized in that The following steps are included: Step S1, selecting a part of the original remote sensing image as a training sample, and annotating the training sample to construct a roof segmentation training data set; Step S2, training the semi-supervised roof segmentation model using the roof segmentation training dataset; Step S3, after the training is completed, the remote sensing image to be detected is input into the semi-supervised roof segmentation model, all roof parts in the study area are segmented, and a prediction map containing only the roof and the background is output; Step S4, according to the prediction image output by the semi-supervised roof segmentation model, extracting an image block containing only a single roof through contour detection and image reconstruction algorithm, inputting the single roof image block into the roof classification model, and obtaining a roof classification result; Step S5, based on the roof classification results, empirically set a rooftop photovoltaic available area ratio for each type of roof, and then obtain the total rooftop photovoltaic available area of ​​the entire study area; Step S6, evaluating the rooftop photovoltaic potential of the study area by calculating the total rooftop photovoltaic installed capacity; In the above step S2, the training of the semi-supervised roof segmentation model includes the following steps: Step S21, training the teacher model using labeled data; Step S22, after the teacher model training is completed, the unlabeled data is input into the teacher model, and the generated pseudo label A is filtered to retain the high-quality pseudo label B, forming a pseudo label map as the label map of the unlabeled data; Step S23, migrating the parameters in the trained teacher model to the student model, so that the teacher model and the student model share the same segmentation model architecture; Step S24, inputting the labeled data and the unlabeled data into the student model together to perform semi-supervised training on the student model, and obtaining a trained student model for roof segmentation.

2. The method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model as claimed in claim 1, It is characterized in that The segmentation model architecture in step S23 uses an encoder and a decoder, the original remote sensing image is input into the encoder, and the result output by the encoder is decoded by the decoder to output a predicted image; The encoder is a layered representation. Each layer is formed by stacking SSFEM modules. The first and second layers are composed of 3 SSFEM modules respectively. The third layer is composed of 12 SSFEM modules. The last layer is composed of 3 SSFEM modules. A downsampling module is set between each layer.

3. The method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model as claimed in claim 2, It is characterized in that The SSFEM module includes a convolution branch with local detailed information and a Transformer branch with global information; For a given input X, the convolution branch with local detailed information and the Transformer branch with global information respectively extract local features x_CNN and global features x_Trans, input them into the feature interaction module, and output value Y.

4. The method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model as claimed in claim 3, It is characterized in that The feature interaction module includes: Perform Fourier transformation on the local features x_CNN and global features x_Trans in the spatial domain and convert them into Fourier domain features F_CNN and Fourier domain features F_Trans; The transformed Fourier domain features F_CNN and Fourier domain features F_Trans are input into the convolution layer, the normalization layer, and the parallel spatial attention module and channel attention module respectively, to obtain the attention weights W_Trans based on global features and the attention weights W_CNN based on local features in the frequency domain; By multiplying the obtained attention weights W_Trans based on global features and the attention weights W_CNN based on local features in the frequency domain by the Fourier domain features F_CNN and the Fourier domain features F_Trans, respectively, the local representation and global clues in the Fourier domain are fused, and residual connections are added; and, The Fourier domain features with global-local information are then inversely transformed back to spatial domain features; The calculation formula is: Where x_CNN represents the local features of the spatial domain extracted by the convolution branch with local detailed information, x_Trans represents the global features of the spatial domain extracted by the Transformer branch with global information, f represents Fourier transform, conv represents convolution operation, bn represents normalization operation, SAM represents channel attention operation, CAM represents spatial attention operation, W_Trans is the attention weight based on global features in the frequency domain, W_CNN is the attention weight based on local features, and f represents the ... -1 represents the inverse Fourier transform, and y represents the spatial domain features of the final output of the module.

5. The method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model as claimed in claim 3, It is characterized in that The convolution branch with local detailed information includes, The input feature map first passes through a 1×1 convolution layer to adjust the number of feature map channels; Then input it into the activation function to increase the nonlinearity of the model; The feature map output by the activation function is input into three parallel convolutional attention modules, so that the network can pay attention to information at different levels and in different aspects. Each attention module can learn different feature representations in the data, thereby enhancing the representation ability of the model. The weights output by the three convolutional attention modules are superimposed by channel, and then input into the 1×1 convolution to fuse the feature information and output it.

6. The method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model as claimed in claim 5, It is characterized in that The convolutional attention module includes: The input feature map first passes through a 5×5 convolution, and then passes through three parallel dilated strip convolution channels. The output is fused with multi-scale information to extract multi-scale feature information. The first dilated strip convolution channel first passes through a 1×4 dilated strip convolution, and then passes through a 4×1 dilated strip convolution; the second dilated strip convolution channel first passes through a 1×6 dilated strip convolution, and then passes through a 6×1 dilated strip convolution; the third dilated strip convolution channel first passes through a 1×11 dilated strip convolution, and then passes through a 11×1 dilated strip convolution; After fusing information at multiple scales, the spatial attention weight is output through 3×3 convolution; After obtaining the spatial attention weight, multiply it with the input feature map and output a feature map with attention distribution; Then make a residual connection with the module input; The specific calculation formula is: In the formula, represents the input feature map, represents an element-by-element matrix multiplication operation, represents the convolution operation, Indicates the first branches, represents the residual connection, Represents the output of the convolutional attention module.

7. The method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model as claimed in claim 2, It is characterized in that The downsampling module includes two branches, which are combined and outputted; One of the branches uses convolution for downsampling, and goes through 3×3 convolution, standardization, and activation function in sequence; The other branch introduces soft pooling, which is followed by soft pooling, 3×3 convolution, and activation function. The calculation formula is: Where x represents the downsampling module input, conv represents the convolution operation, bn represents the normalization operation, gelu represents the activation function, R represents the selected local area, a represents the feature value, i represents the number of rows in the selected area where a is located, and y represents the number of columns in the selected area where a is located.

8. The method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model as claimed in claim 2, It is characterized in that The decoder uses the Deeplabv3+ decoder as the decoder of the segmentation model architecture.

9. The method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model as claimed in claim 1, It is characterized in that Step S4 includes the following steps: Step S41, inputting a remote sensing image and a corresponding prediction map containing only roofs and backgrounds output by a semi-supervised roof segmentation model, and finding the contour line coordinates of all roofs in the prediction map using a contour detection algorithm; Step S42, cutting out each roof image block including the roof from the remote sensing image according to the contour line coordinates; Step S43, creating a blank image with the same size as the roof image block, and drawing a region of a specified contour on the blank image; Step S44, using the OpenCV library, performing a bitwise AND operation on the blank image and the roof image block to obtain a separate image block containing only a single roof, wherein only the single roof is displayed in the separate image block, and the rest is a black mask; Step S45, introducing ResNet-50 pre-trained on ImageNet as a roof classification model; Step S46, input all individual image blocks into the roof classification model, classify the roofs into different categories, and obtain roof classification results.

10. The method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model according to claim 1, It is characterized in that In step S6, the calculation of the total rooftop photovoltaic installed capacity includes the following steps: Step S61, based on the roof classification results and the ratio of the roof photovoltaic available area of ​​each type of roof, calculate the roof photovoltaic available area of ​​the entire area, and the calculation formula is: In the formula, represents the total area of ​​rooftop photovoltaics available in the study area, Table roof type, Indicates The area of ​​the roof, represents the number of roof categories, Indicates The ratio of available area of ​​the roof type, represents the remote sensing image resolution, Indicates The number of roof-like pixels; Step S62, based on the available rooftop photovoltaic area, the user defines and selects photovoltaic modules, and calculates the installed capacity of the rooftop photovoltaic according to the specifications and parameters of the photovoltaic modules. The calculation formula is: In the formula, represents the total installed capacity of photovoltaic power generation, Indicates the rated power of a single photovoltaic module. Indicates the number of photovoltaic modules, represents the total rooftop photovoltaic area available, Indicates the front and rear photovoltaic spacing, Indicates the width of a single PV module.

11. The method for evaluating rooftop photovoltaic potential based on a semi-supervised segmentation model according to claim 1, It is characterized in that In step S1, the training samples are labeled using Labelme software.