Multi-terrain and multi-category photovoltaic panel detection method
By constructing a U-Net attention network model based on CBAM attention mechanism and spatial pyramid pooled SPP layer, the existing photovoltaic panel detection technology is solved inadequate identification efficiency and accuracy in multi-terrain and multi-category environments, and efficient and automatic photovoltaic panel detection is achieved.
Patent Information
- Application Number
- CN202411664651.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-28
AI Technical Summary
Existing photovoltaic panel detection technology is difficult to achieve efficient identification in multiple terrain and multi-category environments, and requires manual real-time monitoring, and insufficient efficiency and accuracy.
The multi-terrain and multi-category photovoltaic panel detection method is adopted. By acquiring photovoltaic panel stitching image data, image processing and annotation, a U-Net attention network model based on the CBAM attention mechanism and the spatial pyramid pooled SPP layer is constructed, and the model training and verification is carried out to realize automatic detection of multi-category photovoltaic panels on multiple surfaces.
The detection and identification accuracy of different surface types and multi-category photovoltaic panels is improved, efficient identification in multi-terrain and multi-category environments is achieved, human resource costs are reduced, and photovoltaic panel identification efficiency and accuracy are improved.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic panel detection, and in particular to a multi-terrain and multi-category photovoltaic panel detection method. Background Art
[0002] With the growing global demand for renewable energy and the urgency of addressing climate change and reducing greenhouse gas emissions, energy transformation has become a global consensus. Photovoltaic power generation, as a clean and renewable form of energy, has huge development potential. In recent years, driven by technological progress, cost reduction and policy support, the photovoltaic industry has developed rapidly and has become an important part of the global energy structure. With the continuous advancement of remote sensing technology and the rapid development of the photovoltaic industry, remote sensing photovoltaic identification technology has gradually emerged and has been widely used. This technology uses high-resolution satellite remote sensing images, drone remote sensing images and other data sources, combined with advanced image processing and recognition algorithms, to achieve automatic identification, positioning and monitoring of photovoltaic power stations.
[0003] However, with the vigorous development of the photovoltaic industry, photovoltaic installation areas have become significantly more extensive, and the continuous advancement of photovoltaic technology has also led to the diversification of photovoltaic system types. This combination of photovoltaic types and surface environments poses a significant challenge to the accuracy and efficiency of photovoltaic identification. In addition, existing detection technologies require manual and real-time communication with major photovoltaic fields to obtain photovoltaic panel data, and cannot detect and obtain multi-surface multi-category photovoltaic panel data in real time based on a small amount of early photovoltaic panel data, thereby effectively solving the above problems. In view of this, the present invention proposes a multi-terrain multi-category photovoltaic panel detection method, which aims to effectively solve the current problems. Summary of the invention
[0004] The present invention provides a multi-terrain and multi-category photovoltaic panel detection method to overcome the above technical problems.
[0005] In order to achieve the above object, the technical solution of the present invention is:
[0006] A multi-terrain and multi-category photovoltaic panel detection method comprises the following steps:
[0007] S1: Acquire photovoltaic panel stitching image data;
[0008] The photovoltaic panel stitching image data includes photovoltaic field coordinates and photovoltaic panel contour features;
[0009] S2: Perform image processing on the photovoltaic panel stitching image data to obtain a multi-terrain and multi-category photovoltaic panel dataset, and divide the photovoltaic panel dataset into a data training set and a data verification set according to a preset ratio;
[0010] The image processing includes labeling the photovoltaic panels with bounding boxes and labeling the categories based on the photovoltaic panel installation method and image color features;
[0011] S3: Construct a U-Net attention network model for photovoltaic panel detection based on the CBAM attention mechanism and spatial pyramid pooling SPP layer;
[0012] S4: Perform model training and model verification on the U-Net attention network model based on the data training set and the data verification set to obtain the optimal U-Net attention network model;
[0013] S5: Obtain a remote sensing image of the photovoltaic panel to be detected, and perform segmentation processing on it to obtain several remote sensing sub-images. Perform photovoltaic panel feature detection on each remote sensing sub-image based on the optimal U-Net attention network model to obtain an output detection image.
[0014] Furthermore, the S1 specifically includes the following steps:
[0015] S11: Obtaining coordinate information of photovoltaic panels of multiple categories on multiple surfaces;
[0016] The photovoltaic panel coordinate information includes coordinate information of multiple types of surfaces and multiple categories;
[0017] And perform Mercator coordinate conversion on it to obtain Google map photovoltaic field tile coordinate information, and set the map level of Google map tile coordinate information;
[0018] S12: calling Google API to obtain a photovoltaic field tile data map according to the photovoltaic field tile coordinate information and the map level;
[0019] S13: Based on the image stitching strategy, the photovoltaic field tile data map is stitched to obtain photovoltaic panel stitching image data;
[0020] And the image stitching strategy is specifically:
[0021] Set the image stitching range m×n, where m represents the number of rows in the image stitching range; n represents the number of columns in the image stitching range;
[0022] The obtained photovoltaic field tile data maps are m×n in number, and the photovoltaic field tile data maps are divided into n groups, and each group includes m photovoltaic field tile data maps;
[0023] Vertically splicing the m photovoltaic field tile data images to obtain n groups of vertically spliced images;
[0024] The photovoltaic field tile data images are grouped in a method of arranging the photovoltaic field tile data images in each group in descending order according to the image length with the same image width; if the image lengths are the same, the photovoltaic field tile data images with the same image lengths are randomly sorted;
[0025] Then, the n groups of longitudinal stitching images are stitched horizontally to obtain the photovoltaic panel stitching image.
[0026] Furthermore, the photovoltaic panel mosaic image data described in S2 is processed to obtain a multi-terrain and multi-category photovoltaic panel dataset, which specifically includes the following steps:
[0027] S21: Based on the labelme annotation tool, the photovoltaic panel splicing image is manually identified and annotated according to the annotation rules to obtain the annotated image;
[0028] The labeling rule is to use a polygonal frame to label the photovoltaic panel body in the photovoltaic panel splicing image with a boundary box, and to label the category based on the installation method of the photovoltaic panel and the image color features;
[0029] The photovoltaic panel categories include at least oblique-laid monocrystalline silicon photovoltaic panel labels, oblique-laid polycrystalline silicon photovoltaic panel labels, flat-laid monocrystalline silicon photovoltaic panel labels, and flat-laid polycrystalline silicon photovoltaic panel labels;
[0030] S22: performing data cutting, data screening and data expansion on the annotated image in sequence to obtain data maps of photovoltaic panels of multiple categories on multiple surfaces;
[0031] Data cutting: Cutting is performed based on the center point of the polygonal box marked by the bounding box to obtain several cut sub-graphs of preset resolution size;
[0032] Data filtering: Based on the pre-created data filter, the cut sub-images that are confirmed to not have photovoltaic panels or have incomplete photovoltaic panel images will be deleted;
[0033] The cut sub-maps after data screening are divided into surface types according to the surface environment to obtain multiple types of surface sub-maps;
[0034] The surface environment at least includes forest land, mountain land, grassland and wasteland;
[0035] Then we obtain a multi-surface and multi-category photovoltaic panel dataset.
[0036] Furthermore, the U-Net attention network model constructed in S3 includes an input layer, a feature extraction network layer for obtaining feature maps of different scales, a spatial pyramid pooling SPP layer, a splicing layer module, an upsampling network layer, and an output classification layer connected in sequence;
[0037] The feature extraction network layer includes a first CBAM attention unit, a second CBAM attention unit, and a third CBAM attention unit connected in sequence; the upsampling network layer includes a first upsampling layer, a second upsampling layer, a third upsampling layer, a fourth upsampling layer, and a fifth upsampling layer;
[0038] The input layer is used to input the image data of the multi-surface multi-category photovoltaic panel dataset into the first CBAM attention unit;
[0039] The first CBAM attention unit is used to extract photovoltaic panel features from the output of the input layer to obtain a first scale feature map, and the photovoltaic panel features include photovoltaic panel contour features and photovoltaic panel image color features;
[0040] The second CBAM attention unit is used to extract photovoltaic panel features from the first-scale feature map to obtain a second-scale feature map;
[0041] The third CBAM attention unit is used to extract photovoltaic panel features from the second scale feature map to obtain a third scale feature map;
[0042] The spatial pyramid pooling SPP layer is provided with three pooling layers with different pooling cores, so as to respectively extract features of different scales from the third scale feature map, and perform feature fusion on the outputs of each pooling layer to obtain a fused feature map;
[0043] The first upsampling layer is used to perform an upsampling operation on the fused feature map to obtain a first sampling feature map;
[0044] The second upsampling layer is used to perform an upsampling operation on the first concatenated feature map to obtain a second sampling feature map;
[0045] And the first spliced feature map is a feature map obtained by splicing the fusion feature map and the first sampling feature map through the splicing layer module;
[0046] The third upsampling layer is used to perform an upsampling operation on the second concatenated feature map to obtain a third sampling feature map;
[0047] The second splicing feature map is a feature map obtained by splicing the second sampling feature map and the third scale feature map through a splicing layer module;
[0048] The fourth upsampling layer is used to perform an upsampling operation on the third concatenated feature map to obtain a fourth sampling feature map;
[0049] The third splicing feature map is a feature map obtained by splicing the third sampling feature map and the second scale feature map through the splicing layer module;
[0050] The fifth upsampling layer is used to perform an upsampling operation on the fourth concatenated feature map to obtain a fifth sampling feature map;
[0051] The fourth splicing feature map is a feature map obtained by splicing the fourth sampling feature map and the first scale feature map through the splicing layer module;
[0052] The output classification layer is used to perform classification prediction of multi-terrain and multi-category photovoltaic panels on the fifth sampling feature map.
[0053] Furthermore, the step of obtaining the optimal U-Net attention network model in S4 specifically includes the following steps:
[0054] S41: Inputting the data training set into the optimal U-Net attention network model for model training, and obtaining the trained optimal U-Net attention network model;
[0055] S42: Verify the optimal U-Net attention network model after training through the data test set;
[0056] That is, determine whether the output of the optimal U-Net attention network model after training converges;
[0057] And the loss function for judging whether the output of the optimal U-Net attention network model after training converges includes at least one of the cross entropy loss function, the mean square error function or the huber_loss loss function;
[0058] If the output of the optimal U-Net attention network model after training converges, it is confirmed that the optimal U-Net attention network model after training is the optimal U-Net attention network model;
[0059] Otherwise, based on the back propagation algorithm, the weight parameters of the trained optimal U-Net attention network model are adaptively adjusted, and step S41 is repeated until it is confirmed that the weight parameters of the trained optimal U-Net attention network model that have converged output are the optimal weight parameters and the optimal U-Net attention network model is reconstructed to obtain the optimal U-Net attention network model.
[0060] Beneficial effects: The present invention provides a multi-terrain and multi-category photovoltaic panel detection method, which obtains a multi-terrain and multi-category photovoltaic panel data set by performing image processing on photovoltaic panel splicing image data, so as to obtain photovoltaic panel data of different surface types and multiple categories by labeling the photovoltaic panels with bounding boxes and labeling categories based on the installation method of the photovoltaic panels and the image color features, and train the constructed U-Net attention network model to obtain the optimal U-Net attention network model, thereby greatly improving the diversity detection and recognition accuracy of photovoltaic panels of different surface types and multiple categories; the present invention solves the problem that with the vigorous development of the photovoltaic industry, photovoltaic installation areas have shown significant extensiveness, and the continuous advancement of photovoltaic technology has led to a diverse combination of photovoltaic types and surface environments, thereby causing low accuracy and efficiency in photovoltaic panel recognition. The present invention can detect and obtain multi-surface and multi-category photovoltaic panel data in real time based on a small amount of photovoltaic panel data in the early stage, which greatly reduces the waste of human resource costs and significantly improves the efficiency and accuracy of photovoltaic panel recognition while ensuring efficient recognition of photovoltaic areas. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0062] Figure 1 It is a flow chart of the photovoltaic panel detection method for multiple terrains and multiple categories of the present invention;
[0063] Figure 2 This is the core block diagram of the multi-terrain and multi-category photovoltaic panel detection method in this embodiment;
[0064] Figure 3 Schematic diagram of the U-Net attention network model constructed in this embodiment;
[0065] Figure 4 is the remote sensing image of the photovoltaic panel to be detected in this embodiment;
[0066] Figure 5 This is an output detection image obtained by photovoltaic panel feature detection in this embodiment;
[0067] Figure 6 It is the mask image corresponding to the photovoltaic detection image in this embodiment. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments 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.
[0069] This embodiment provides a multi-terrain and multi-category photovoltaic panel detection method, such as Figure 1 to Figure 2 As shown, the following steps are included:
[0070] S1: Acquire photovoltaic panel stitching image data; the photovoltaic panel stitching image data includes photovoltaic field coordinates and photovoltaic panel contour features, specifically including the following steps:
[0071] S11: Obtaining coordinate information of photovoltaic panels of multiple categories on multiple surfaces;
[0072] The photovoltaic panel coordinate information includes coordinate information of multiple types of surfaces and multiple categories;
[0073] And perform Mercator coordinate conversion on it to obtain Google map photovoltaic field tile coordinate information, and set the map level of Google map tile coordinate information; define the photovoltaic field tile coordinate information name as "x_y_z";
[0074] Among them, the formula for Mercator coordinate transformation is
[0075] n=2^zoom
[0076] x = n * ((lon + 180) / 360)
[0077] y=n*(1-(log(tan(lat)+sec(lat)) / π)) / 2
[0078] Where: x, y represent the horizontal and vertical coordinates of the Google map tile; z represents the tile level; lon, lat represent the longitude and latitude of the photovoltaic field coordinates respectively;
[0079] S12: calling Google API to obtain a photovoltaic field tile data map according to the photovoltaic field tile coordinate information and the map level;
[0080] S13: Based on the image stitching strategy, the photovoltaic field tile data map is stitched to obtain photovoltaic panel stitching image data;
[0081] And the image stitching strategy is specifically:
[0082] Set the image stitching range m×n, where m represents the number of rows in the image stitching range; n represents the number of columns in the image stitching range;
[0083] The obtained photovoltaic field tile data maps are m×n in number, and the photovoltaic field tile data maps are divided into n groups, and each group includes m photovoltaic field tile data maps;
[0084] Vertically splicing the m photovoltaic field tile data images to obtain n groups of vertically spliced images;
[0085] The photovoltaic field tile data images are grouped in a method of arranging the photovoltaic field tile data images in each group in descending order according to the image length with the same image width; if the image lengths are the same, the photovoltaic field tile data images with the same image lengths are randomly sorted;
[0086] Then, the n groups of longitudinal stitching images are stitched horizontally to obtain a photovoltaic panel stitching image;
[0087] The longitudinal stitching and the transverse stitching are to stitch pictures according to the preset transverse and longitudinal directions, which are well-known technical means and will not be described in detail here;
[0088] S2: Perform image processing on the photovoltaic panel stitching image data to obtain a multi-terrain and multi-category photovoltaic panel dataset, and divide the photovoltaic panel dataset into a data training set and a data verification set according to a preset ratio;
[0089] The image processing includes labeling the photovoltaic panel with a bounding box, and labeling the photovoltaic panel with a category based on the installation method of the photovoltaic panel and the image color features of different types of photovoltaic panel cells;
[0090] Specifically, the photovoltaic panel mosaic image data is processed in S2 to obtain a multi-terrain and multi-category photovoltaic panel data set, which specifically includes the following steps:
[0091] S21: Based on the labelme annotation tool, the photovoltaic panel splicing image is manually identified and annotated according to the annotation rules to obtain the annotated image;
[0092] The labeling rule is to use a polygonal frame to label the photovoltaic panel body in the photovoltaic panel splicing image with a boundary box, and to label the category based on the installation method of the photovoltaic panel and the image color characteristics, and the photovoltaic panel category includes at least a tilted monocrystalline silicon photovoltaic panel label, a tilted polycrystalline silicon photovoltaic panel label, a flat monocrystalline silicon photovoltaic panel label, and a flat polycrystalline silicon photovoltaic panel label;
[0093] Among them, photovoltaic installation methods are mainly divided into oblique laying and flat laying, photovoltaic categories are mainly divided into monocrystalline silicon photovoltaic panels and polycrystalline silicon photovoltaic panels, the color characteristics of monocrystalline silicon cell images are dark blue and black; the color characteristics of polycrystalline silicon cell images are light blue; therefore, the background label is 0, the oblique laying monocrystalline silicon photovoltaic panel label is 1, the oblique laying polycrystalline silicon photovoltaic panel label is 2, the flat laying monocrystalline silicon photovoltaic panel label is 3, and the flat laying polycrystalline silicon photovoltaic panel label is 4, and different photovoltaic panels are labeled, as shown in Table 1;
[0094] Table 1. Photovoltaic panel category labeling table
[0095]
[0096] S22: performing data cutting, data screening and data expansion on the annotated images in sequence to obtain data maps of photovoltaic panels of multiple categories on multiple surfaces;
[0097] Data cutting: Cutting is performed at the center point of the polygonal box marked by the bounding box to obtain several cut sub-images of preset resolution size, and the preferred preset resolution is 1024×1024;
[0098] Data screening: Based on the pre-created data filter, the cut sub-images that are confirmed to not exist or have incomplete photovoltaic panels are deleted; the pre-created data filter is a unit module set according to the existing data screening technology, which is only used to implement data screening according to the existing data screening function, and the data screening technology itself is not the invention of this application, and will not be described in detail here;
[0099] The cut sub-maps after data screening are divided into surface types according to the surface environment to obtain multiple types of surface sub-maps;
[0100] The surface environment at least includes forest, mountain, grassland and wasteland; and the classification of the multi-class surface sub-map is forest surface class: mountain surface class: grassland surface class: wasteland surface class in a ratio of 1:1:1:1;
[0101] Then, a multi-surface and multi-category photovoltaic panel dataset is obtained;
[0102] S3: Construct a U-Net attention network model for photovoltaic panel detection based on the CBAM attention mechanism and spatial pyramid pooling SPP layer;
[0103] Specifically, Figure 3 As shown, the constructed U-Net attention network model includes an input layer connected in sequence, a feature extraction network layer for obtaining feature maps of different scales, a spatial pyramid pooling SPP layer, a splicing layer module, an upsampling network layer, and an output classification layer;
[0104] The feature extraction network layer includes a first CBAM attention unit, a second CBAM attention unit, and a third CBAM attention unit connected in sequence; the upsampling network layer includes a first upsampling layer, a second upsampling layer, a third upsampling layer, a fourth upsampling layer, and a fifth upsampling layer;
[0105] The input layer is used to input the image data of the multi-surface multi-category photovoltaic panel dataset into the first CBAM attention unit;
[0106] The first CBAM attention unit is used to extract photovoltaic panel features from the output of the input layer to obtain a first scale feature map, and the photovoltaic panel features include photovoltaic panel contour features and photovoltaic panel image color features;
[0107] The second CBAM attention unit is used to extract photovoltaic panel features from the first-scale feature map to obtain a second-scale feature map;
[0108] The third CBAM attention unit is used to extract photovoltaic panel features from the second scale feature map to obtain a third scale feature map;
[0109] The spatial pyramid pooling SPP layer is provided with three pooling layers with different pooling cores, so as to respectively extract features of different scales from the third scale feature map, and perform feature fusion on the outputs of each pooling layer to obtain a fused feature map;
[0110] The first upsampling layer is used to perform an upsampling operation on the fused feature map to obtain a first sampling feature map;
[0111] The second upsampling layer is used to perform an upsampling operation on the first concatenated feature map to obtain a second sampling feature map;
[0112] And the first spliced feature map is a feature map obtained by splicing the fusion feature map and the first sampling feature map through the splicing layer module;
[0113] The third upsampling layer is used to perform an upsampling operation on the second concatenated feature map to obtain a third sampling feature map;
[0114] The second splicing feature map is a feature map obtained by splicing the second sampling feature map and the third scale feature map through a splicing layer module;
[0115] The fourth upsampling layer is used to perform an upsampling operation on the third concatenated feature map to obtain a fourth sampling feature map;
[0116] The third splicing feature map is a feature map obtained by splicing the third sampling feature map and the second scale feature map through the splicing layer module;
[0117] The fifth upsampling layer is used to perform an upsampling operation on the fourth concatenated feature map to obtain a fifth sampling feature map;
[0118] The fourth splicing feature map is a feature map obtained by splicing the fourth sampling feature map and the first scale feature map through the splicing layer module;
[0119] The output classification layer is used to perform classification prediction of multi-terrain and multi-category photovoltaic panels on the fifth sampling feature map.
[0120] In a specific embodiment, the U-Net attention network model is constructed by adding a CBAM attention mechanism in the downsampling end of the original U-Net framework, and each CBAM attention unit in the feature extraction network layer enhances the performance of the convolutional neural network by combining a channel attention module and a spatial attention module;
[0121] The calculation formula of the channel attention module is:
[0122] M c (F)=σ(MLP(AvgPool(F)+MLP(MaxPool(F)))
[0123] Where: F represents the input feature map; AvgPool(F) and MaxPool(F) represent global average pooling and maximum pooling operations respectively; MLP represents a multi-layer perceptron (a simple neural network with two fully connected layers), which is used to learn attention weights from the pooled features; σ represents the Sigmoid activation function, which is used to limit the output between 0 and 1 to generate channel attention weights;
[0124] The calculation formula of the spatial attention module is:
[0125] M s (F) = σ(f 7×7 ([AvgPool(F),MaxPool(F)]))
[0126] Where: f 7×7 Represents a 7×7 convolution operation; [AvgPool(F), MaxPool(F)] means concatenating the average pooling and maximum pooling results through channels;
[0127] By adding the CBAM attention mechanism, the background information interference can be reduced, so that the model can further capture global and contextual information and reduce the false detection rate of photovoltaic segmentation. After the last convolution layer of the original U-Net framework, the SPP layer is added before upsampling, and three pooling kernels of different sizes, 5×5, 9×9 and 13×13, are set to extract spatial information of different scales. These pooling kernels are executed in parallel, and then the results are spliced together to fuse multi-scale information features, which helps the model to segment different types of photovoltaics and reduce the interference of background information.
[0128] S4: Perform model training and model verification on the U-Net attention network model based on the data training set and the data verification set to obtain the optimal U-Net attention network model;
[0129] Specifically include the following steps:
[0130] S41: Inputting the data training set into the optimal U-Net attention network model for model training, and obtaining the trained optimal U-Net attention network model;
[0131] S42: Verify the optimal U-Net attention network model after training through the data test set;
[0132] That is, determine whether the output of the optimal U-Net attention network model after training converges;
[0133] And the loss function for judging whether the output of the optimal U-Net attention network model after training converges includes at least one of the cross entropy loss function, the mean square error function or the huber_loss loss function;
[0134] If the output of the optimal U-Net attention network model after training converges, it is confirmed that the optimal U-Net attention network model after training is the optimal U-Net attention network model;
[0135] Otherwise, based on the back propagation algorithm, the weight parameters of the trained optimal U-Net attention network model are adaptively adjusted, and step S41 is repeatedly performed until it is confirmed that the weight parameters of the trained optimal U-Net attention network model that have converged are the optimal weight parameters and the optimal U-Net attention network model is reconstructed to obtain the optimal U-Net attention network model;
[0136] S5: Obtain the remote sensing image of the photovoltaic panel to be detected, and perform segmentation processing on it to obtain several remote sensing sub-images. Perform photovoltaic panel feature detection on each remote sensing sub-image based on the optimal U-Net attention network model to obtain an output detection image. Figures 4 to 6As shown in FIG. 1 , the photovoltaic field image to be detected is cut into 1024×1024 small images and sequentially input into the optimal weight model of the photovoltaic recognition model for derivation. The model sequentially outputs the detection images and splices them to generate the photovoltaic detection image and the corresponding mask image.
[0137] This embodiment obtains a multi-terrain and multi-category photovoltaic panel data set by performing image processing on the spliced image data of the photovoltaic panel, so as to obtain different surface types and multi-category photovoltaic panel data by labeling the photovoltaic panel with a bounding box, and labeling the category based on the installation method of the photovoltaic panel and the image color characteristics, and train the constructed U-Net attention network model to obtain the optimal U-Net attention network model, which greatly improves the diversity detection and recognition accuracy of different surface types and multi-category photovoltaic panels; the present invention solves the problem that with the vigorous development of the photovoltaic industry, the photovoltaic installation area shows a significant wide range, and the continuous advancement of photovoltaic technology leads to the multi-dimensional combination of photovoltaic types and surface environment, thereby making the accuracy and efficiency of photovoltaic panel recognition low. The present invention can detect and obtain multi-surface multi-category photovoltaic panel data in real time based on a small amount of photovoltaic panel data in the early stage, which greatly reduces the waste of human resource costs and ensures efficient recognition of photovoltaic areas while significantly improving the efficiency and accuracy of photovoltaic panel recognition. With the continuous advancement of remote sensing technology and the reduction of costs, the application scope of remote sensing photovoltaic recognition technology will continue to expand, providing more powerful support for the sustainable development of the photovoltaic industry.
[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-terrain and multi-category photovoltaic panel detection method, characterized in that: The following steps are involved: S1: Acquire photovoltaic panel stitching image data; The photovoltaic panel stitching image data includes photovoltaic field coordinates and photovoltaic panel contour features; S2: Perform image processing on the photovoltaic panel stitching image data to obtain a multi-terrain and multi-category photovoltaic panel dataset, and divide the photovoltaic panel dataset into a data training set and a data verification set according to a preset ratio; The image processing includes labeling the photovoltaic panels with bounding boxes and labeling the categories based on the photovoltaic panel installation method and image color features; S3: Construct a U-Net attention network model for photovoltaic panel detection based on the CBAM attention mechanism and spatial pyramid pooling SPP layer; S4: Perform model training and model verification on the U-Net attention network model based on the data training set and the data verification set to obtain the optimal U-Net attention network model; S5: Obtain a remote sensing image of the photovoltaic panel to be detected, and perform segmentation processing on it to obtain several remote sensing sub-images. Perform photovoltaic panel feature detection on each remote sensing sub-image based on the optimal U-Net attention network model to obtain an output detection image.
2. The multi-terrain and multi-category photovoltaic panel detection method according to claim 1, characterized in that: The S1 specifically includes the following steps: S11: Obtaining coordinate information of photovoltaic panels of multiple categories on multiple surfaces; The photovoltaic panel coordinate information includes coordinate information of multiple types of surfaces and multiple categories; And perform Mercator coordinate conversion on it to obtain Google map photovoltaic field tile coordinate information, and set the map level of Google map tile coordinate information; S12: calling Google API to obtain a photovoltaic field tile data map according to the photovoltaic field tile coordinate information and the map level; S13: Based on the image stitching strategy, the photovoltaic field tile data map is stitched to obtain photovoltaic panel stitching image data; And the image stitching strategy is specifically: Set the image stitching range m×n, where m represents the number of rows in the image stitching range; n represents the number of columns in the image stitching range; The obtained photovoltaic field tile data maps are m×n in number, and the photovoltaic field tile data maps are divided into n groups, and each group includes m photovoltaic field tile data maps; Vertically splicing the m photovoltaic field tile data images to obtain n groups of vertically spliced images; The photovoltaic field tile data images are grouped in a method of arranging the photovoltaic field tile data images in each group in descending order according to the image length with the same image width; if the image lengths are the same, the photovoltaic field tile data images with the same image lengths are randomly sorted; Then, the n groups of longitudinal stitching images are stitched horizontally to obtain the photovoltaic panel stitching image.
3. The multi-terrain and multi-category photovoltaic panel detection method according to claim 2, characterized in that: The photovoltaic panel mosaic image data is processed as described in S2 to obtain a multi-terrain and multi-category photovoltaic panel dataset, which specifically includes the following steps S21: Based on the labelme annotation tool, the photovoltaic panel splicing image is manually identified and annotated according to the annotation rules to obtain the annotated image; The labeling rule is to use a polygonal frame to label the photovoltaic panel body in the photovoltaic panel splicing image with a boundary box, and to label the category based on the installation method of the photovoltaic panel and the image color features; The photovoltaic panel categories include at least oblique-laid monocrystalline silicon photovoltaic panel labels, oblique-laid polycrystalline silicon photovoltaic panel labels, flat-laid monocrystalline silicon photovoltaic panel labels, and flat-laid polycrystalline silicon photovoltaic panel labels; S22: performing data cutting, data screening and data expansion on the annotated images in sequence to obtain data maps of photovoltaic panels of multiple categories on multiple surfaces; Data cutting: Cutting is performed based on the center point of the polygonal box marked by the bounding box to obtain several cut sub-graphs of preset resolution size; Data filtering: Based on the pre-created data filter, the cut sub-images that are confirmed to not have photovoltaic panels or have incomplete photovoltaic panel images will be deleted; The cut sub-maps after data screening are divided into surface types according to the surface environment to obtain multiple types of surface sub-maps; The surface environment at least includes forest land, mountain land, grassland and wasteland; Then we obtain a multi-surface and multi-category photovoltaic panel dataset.
4. The multi-terrain and multi-category photovoltaic panel detection method according to claim 1, characterized in that: The U-Net attention network model constructed in S3 includes an input layer, a feature extraction network layer for obtaining feature maps of different scales, a spatial pyramid pooling SPP layer, a splicing layer module, an upsampling network layer, and an output classification layer connected in sequence; And the feature extraction network layer includes a first CBAM attention unit, a second CBAM attention unit, and a third CBAM attention unit connected in sequence; The upsampling network layer includes a first upsampling layer, a second upsampling layer, a third upsampling layer, a fourth upsampling layer and a fifth upsampling layer; The input layer is used to input the image data of the multi-surface multi-category photovoltaic panel dataset into the first CBAM attention unit; The first CBAM attention unit is used to extract photovoltaic panel features from the output of the input layer to obtain a first scale feature map, and the photovoltaic panel features include photovoltaic panel contour features and photovoltaic panel image color features; The second CBAM attention unit is used to extract photovoltaic panel features from the first scale feature map to obtain a second scale feature map; The third CBAM attention unit is used to extract photovoltaic panel features from the second scale feature map to obtain a third scale feature map; The spatial pyramid pooling SPP layer is provided with three pooling layers with different pooling cores, so as to respectively extract features of different scales from the third scale feature map, and perform feature fusion on the outputs of each pooling layer to obtain a fused feature map; The first upsampling layer is used to perform an upsampling operation on the fused feature map to obtain a first sampling feature map; The second upsampling layer is used to perform an upsampling operation on the first concatenated feature map to obtain a second sampling feature map; And the first spliced feature map is a feature map obtained by splicing the fusion feature map and the first sampling feature map through the splicing layer module; The third upsampling layer is used to perform an upsampling operation on the second concatenated feature map to obtain a third sampling feature map; The second splicing feature map is a feature map obtained by splicing the second sampling feature map and the third scale feature map through a splicing layer module; The fourth upsampling layer is used to perform an upsampling operation on the third concatenated feature map to obtain a fourth sampling feature map; The third splicing feature map is a feature map obtained by splicing the third sampling feature map and the second scale feature map through the splicing layer module; The fifth upsampling layer is used to perform an upsampling operation on the fourth concatenated feature map to obtain a fifth sampling feature map; The fourth splicing feature map is a feature map obtained by splicing the fourth sampling feature map and the first scale feature map through the splicing layer module; The output classification layer is used to perform classification prediction of multi-terrain and multi-category photovoltaic panels on the fifth sampling feature map.
5. The multi-terrain and multi-category photovoltaic panel detection method according to claim 4, characterized in that: The obtaining of the optimal U-Net attention network model in S4 specifically includes the following steps: S41: Inputting the data training set into the optimal U-Net attention network model for model training, and obtaining the trained optimal U-Net attention network model; S42: Verify the optimal U-Net attention network model after training through the data test set; That is, determine whether the output of the optimal U-Net attention network model after training converges; And the loss function for judging whether the output of the optimal U-Net attention network model after training converges includes at least one of the cross entropy loss function, the mean square error function or the huber_loss loss function; If the output of the optimal U-Net attention network model after training converges, it is confirmed that the optimal U-Net attention network model after training is the optimal U-Net attention network model; Otherwise, based on the back propagation algorithm, the weight parameters of the trained optimal U-Net attention network model are adaptively adjusted, and step S41 is repeated until it is confirmed that the weight parameters of the trained optimal U-Net attention network model that have converged output are the optimal weight parameters and the optimal U-Net attention network model is reconstructed to obtain the optimal U-Net attention network model.