Photovoltaic panel damage detection method based on unmanned aerial vehicle offshore photovoltaic panel image
This method for detecting marine photovoltaic panels using UAV images through multi-level feature extraction and enhancement solves the problems of accuracy and efficiency in photovoltaic panel damage detection in existing technologies, and achieves accurate quantitative assessment of damage to marine photovoltaic panels.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-27
AI Technical Summary
Existing drone inspection technology lacks dynamic perception capabilities in detecting damage to marine photovoltaic panels, making it difficult to conduct accurate quantitative assessments of photovoltaic damage, especially under extreme weather conditions where the detection of structural damage to photovoltaic panels is inaccurate.
A photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels is adopted. Through multi-level feature extraction, counting feature enhancement and segmentation feature enhancement, combined with damage point detection and photovoltaic panel detection, damage point prediction and photovoltaic panel probability data are combined using multi-level feature fusion maps to achieve accurate detection.
It improves the accuracy and efficiency of quantitative assessment of photovoltaic damage, enabling precise detection of photovoltaic panel damage under extreme weather conditions.
Smart Images

Figure CN121746963A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus, computer equipment, and storage medium for detecting damage to photovoltaic panels based on images of marine photovoltaic panels taken by unmanned aerial vehicles (UAVs). Background Technology
[0002] During the operation and maintenance of offshore photovoltaic systems, extreme weather such as hail can easily cause structural damage to the photovoltaic panels, leading to a decrease in power generation efficiency and economic losses. Existing drone inspection technology, due to its reliance on single-modal information, lack of dynamic perception capabilities of the marine environment, and gradient conflicts when handling heterogeneous tasks of segmentation and counting, makes it difficult to accurately quantify photovoltaic damage. Summary of the Invention
[0003] Based on this, the purpose of this invention is to provide a method, apparatus, computer equipment, and storage medium for photovoltaic panel damage detection based on images of marine photovoltaic panels from unmanned aerial vehicles (UAVs). The method involves enhancing counting and segmentation features based on extracted feature maps at multiple levels, using the obtained enhanced counting feature maps at multiple levels for damage point detection, and using the obtained enhanced segmentation feature maps for photovoltaic panel detection. This yields damage point prediction data and photovoltaic panel prediction probability data. Combining the damage point prediction data and photovoltaic panel prediction probability data for photovoltaic panel damage detection improves the accuracy and efficiency of quantitative assessment of photovoltaic damage.
[0004] In a first aspect, embodiments of this application provide a method for detecting damage to photovoltaic panels based on images of marine photovoltaic panels taken by unmanned aerial vehicles (UAVs), comprising the following steps: The system obtains images of the unmanned aerial vehicle (UAV) solar panels to be detected and a pre-defined target detection model. The target detection model includes a backbone network, a neck network, and a head network. The neck network includes a frequency fusion module, a counting enhancement module, and a segmentation enhancement module. The head network includes a damage point detection module and a solar panel detection module. The image of the marine photovoltaic panel of the UAV to be detected is input into the backbone network for multi-level feature extraction to obtain several levels of feature extraction maps; The feature extraction maps of each level are input into the frequency fusion module to perform feature fusion between levels, thereby obtaining the feature fusion maps of each level; The feature fusion maps of each level are input into the counting enhancement module for channel enhancement and spatial enhancement to obtain the counting feature enhancement maps of each level; The feature fusion map of the last level is input into the segmentation enhancement module for channel splitting, self-attention extraction and feature concatenation to obtain the segmentation feature enhancement map; The enhanced feature maps of each level are input into the damage point detection module to detect damage points and obtain damage point prediction data. The segmentation feature enhancement map is input into the photovoltaic panel detection module to detect photovoltaic panels and obtain photovoltaic panel prediction probability data. Based on the damage point prediction data and the photovoltaic panel prediction probability data, photovoltaic panel damage detection is performed to obtain photovoltaic panel damage detection results.
[0005] Secondly, embodiments of this application provide a photovoltaic panel damage detection device based on UAV images of marine photovoltaic panels, comprising: The signal acquisition module is used to obtain a set of signal sequences collected by the monitoring user within a preset time period and a preset risk warning model. The set of signal sequences includes heart rate sequences and respiratory rate sequences, and the risk warning model includes a feature extraction module, a feature matrix modeling module, a feature fusion module, and a risk warning module. A multi-scale feature extraction module is used to input the heart rate sequence and respiratory rate sequence into the feature extraction module for multi-scale feature extraction to obtain multi-scale feature extraction data of the heart rate sequence and respiratory rate sequence, wherein the multi-scale feature extraction data includes minute-level feature extraction data, hour-level feature extraction data and day-level feature extraction data; The multi-scale feature matrix construction module is used to construct matrices based on the minute-level feature extraction data, hour-level feature extraction data, and day-level feature extraction data in the multi-scale feature extraction data of the heart rate sequence and respiratory rate sequence, respectively, to obtain minute-level feature matrices, hour-level feature matrices, and day-level feature matrices; The multi-scale feature matrix modeling module is used to input the minute-level feature matrix, hour-level feature matrix and daily-level feature matrix into the feature matrix modeling module to perform feature modeling, and obtain minute-level change feature representation, hour-level change feature representation and daily change feature representation; The cross-scale feature fusion module is used to input the minute-level change feature representation, hour-level change feature representation and daily-level change feature representation into the feature fusion module for feature fusion to obtain the cross-scale fused feature representation; The photovoltaic panel damage detection module based on UAV images of marine photovoltaic panels is used to input the cross-scale fusion feature representation into the risk warning module to calculate the risk prediction probability and obtain the predicted risk probability data; and to conduct risk warning based on the predicted risk probability data to obtain the photovoltaic panel damage detection results of the monitoring user based on UAV images of marine photovoltaic panels.
[0006] Thirdly, embodiments of this application provide a computer device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels as described in the first aspect.
[0007] Fourthly, embodiments of this application provide a storage medium storing a computer program that, when executed by a processor, implements the steps of the photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels as described in the first aspect.
[0008] In this application embodiment, a method, apparatus, computer equipment, and storage medium for photovoltaic panel damage detection based on UAV images of marine photovoltaic panels are provided. The method enhances counting features and segmentation features based on extracted feature maps at multiple levels. Damage points are detected using the obtained multi-level enhanced counting feature maps, and photovoltaic panels are detected using the obtained enhanced segmentation feature maps. Damage point prediction data and photovoltaic panel prediction probability data are obtained. The photovoltaic panel damage detection is performed by combining the damage point prediction data and the photovoltaic panel prediction probability data, thereby improving the accuracy and efficiency of photovoltaic damage quantitative assessment.
[0009] To better understand and implement this invention, the following detailed description is provided in conjunction with the accompanying drawings. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels, provided in one embodiment of this application. Figure 2 This is a schematic diagram of step S3 in the flowchart of a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in one embodiment of this application; Figure 3 This is a schematic diagram of step S4 in the process of a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in one embodiment of this application. Figure 4 This is a schematic diagram of step S5 in the flowchart of a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in one embodiment of this application; Figure 5 This is a schematic diagram of step S6 in the flowchart of a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in one embodiment of this application; Figure 6 This is a schematic diagram of step S7 in the flowchart of a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in one embodiment of this application; Figure 7This is a schematic diagram of step S8 in the flowchart of a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in one embodiment of this application; Figure 8 A schematic diagram of step S9 in the flowchart of a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in another embodiment of this application; Figure 9 A schematic diagram of a photovoltaic panel damage detection device based on UAV images of marine photovoltaic panels provided in one embodiment of this application; Figure 10 This is a schematic diagram of the structure of a computer device provided in one embodiment of this application. Detailed Implementation
[0011] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0012] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0013] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0014] Please see Figure 1 , Figure 1 This is a flowchart illustrating a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels, provided in one embodiment of this application. The method includes the following steps: S1: Obtain images of the drone's marine photovoltaic panels to be detected, as well as a preset target detection model.
[0015] The photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels is implemented by a detection device (hereinafter referred to as the detection device). In an optional embodiment, the detection device may be a computer device, a server, or a server cluster composed of multiple computer devices.
[0016] In an optional embodiment, the detection device can obtain images of the drone-mounted solar panels to be detected by querying a preset database.
[0017] The detection equipment obtains a target detection model, wherein the target detection model includes a backbone network, a neck network, and a head network; the neck network includes a frequency fusion module, a counting enhancement module, and a segmentation enhancement module; the head network includes a damage point detection module and a photovoltaic panel detection module.
[0018] S2: Input the image of the drone's marine photovoltaic panel to be detected into the backbone network for multi-level feature extraction to obtain several levels of feature extraction maps.
[0019] The backbone network adopts a Task-Agnostic Feature Network (TAFNet).
[0020] In this embodiment, the detection device inputs the image of the unmanned aerial vehicle (UAV) and its marine photovoltaic panels to be detected into the backbone network for multi-level feature extraction, thereby obtaining feature extraction maps at several levels.
[0021] S3: Input the feature extraction maps of each level into the frequency fusion module to perform feature fusion between levels and obtain the feature fusion map of each level.
[0022] In this embodiment, the detection device inputs the feature extraction maps of each level into the frequency fusion module to perform feature fusion between levels and obtain the feature fusion maps of each level.
[0023] The frequency fusion module includes several stacked frequency fusion units; each frequency fusion unit includes an offset generator, a high-pass filter, and a low-pass filter; please refer to... Figure 2 , Figure 2 The schematic diagram of step S3 in the photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in one embodiment of this application includes steps S31 to S35, as follows: S31: Use the feature extraction map of the current level as the feature fusion map of the current level, input the feature fusion map of the current level and the corresponding feature extraction map of the previous level into the first frequency fusion unit, perform convolution processing on the feature extraction map of the previous level, and obtain the convolution feature map of the previous level. In this embodiment, the detection device uses the feature extraction map of the current level as the feature fusion map of the current level, and inputs the feature fusion map of the current level and the corresponding feature extraction map of the previous level into the first frequency fusion unit. The feature extraction map of the previous level is then subjected to convolution processing to obtain the convolutional feature map of the previous level. Specifically, the detection device uses an application... Convolution is applied to the feature extraction map of the previous layer to reduce complexity.
[0024] S32: Calculate local similarity based on the feature fusion map of the current layer, the convolutional feature map of the previous layer, and the offset generator to obtain a local similarity matrix; concatenate the local similarity matrix with the convolutional feature map of the previous layer, and perform a convolution operation on the concatenated result to obtain the offset of the current layer.
[0025] In this embodiment, the detection device performs local similarity calculation based on the feature extraction map of the current layer, the convolutional feature map of the previous layer, and the offset generator to obtain a local similarity matrix. The detection device concatenates the local similarity matrix with the convolutional feature map of the previous layer, and performs a convolution operation on the concatenated result to obtain the offset of the current layer. The offset predicts the pixel displacement required to spatially align high-level features with low-level features, thereby ensuring spatial consistency during the fusion process.
[0026] S33: Smooth the feature fusion map of the current level and the low-pass filter to obtain the first feature processing map of the current level; perform upsampling on the first feature processing map of the current level to obtain the upsampled feature map of the current level; align the position of the upsampled feature map of the current level by resampling according to the offset of the current level to obtain the resampled feature map of the current level.
[0027] In this embodiment, the detection device performs smoothing processing based on the feature fusion map of the current level and the low-pass filter to obtain the first feature processing map of the current level, so as to suppress high-frequency noise.
[0028] The detection device performs upsampling processing on the first feature image of the current level to obtain the upsampled feature image of the current level; according to the offset of the current level, a resampling operation is used to align the position of the upsampled feature image of the current level to obtain the resampled feature image of the current level.
[0029] S34: Perform detail enhancement based on the feature extraction map of the previous level and the high-pass filter to obtain the detail enhancement map of the previous level; perform residual connection between the detail enhancement map of the previous level and the feature extraction map of the previous level to obtain the residual connection feature map of the previous level; add the resampled feature map of the current level to the residual connection feature map of the previous level to obtain the feature fusion map output by the first frequency fusion unit.
[0030] In this embodiment, the detection device performs detail enhancement based on the feature extraction map of the previous level and the high-pass filter to obtain a detail enhancement map of the previous level; the detection device performs residual connection between the detail enhancement map of the previous level and the feature extraction map of the previous level to obtain a residual connection feature map of the previous level, thereby enhancing edge information while preserving the complete original features.
[0031] The detection device adds the resampled feature map of the current level to the residual connection feature map of the previous level to obtain the feature fusion map output by the first frequency fusion unit. The aligned high-level features are then added to the enhanced low-level features to complete feature fusion.
[0032] S35: Input the feature fusion map output by the first frequency fusion unit and the corresponding feature extraction map of the previous level into the next frequency fusion unit, and repeat the feature fusion until the feature fusion map output by the last frequency fusion unit is obtained, thus obtaining the feature fusion maps of each level.
[0033] In this embodiment, the detection device inputs the feature fusion map output by the first frequency fusion unit and the corresponding feature extraction map of the previous level into the next frequency fusion unit, and repeats the feature fusion until the feature fusion map output by the last frequency fusion unit is obtained, thus obtaining the feature fusion maps of each level.
[0034] S4: Input the feature fusion maps of each level into the counting enhancement module for channel enhancement and spatial enhancement to obtain the counting feature enhancement maps of each level.
[0035] To address the issue of densely distributed targets in counting tasks, in this embodiment, the detection device inputs the feature fusion maps of each level into the counting enhancement module for channel enhancement and spatial enhancement, thereby obtaining counting feature enhancement maps of each level to distinguish the counting area from the background and enhance attention to small targets.
[0036] Please see Figure 3 , Figure 3The schematic diagram of step S4 in the photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in one embodiment of this application includes steps S41 to S44, as follows: S41: Using a multilayer perceptron, a channel attention weight map for each level is obtained based on the feature fusion map of each level and a preset channel attention weight calculation algorithm; channel attention is enhanced based on the feature fusion map of each level and the corresponding channel attention weight map to obtain a channel attention enhancement map for each level.
[0037] In this embodiment, the detection device employs a multilayer perceptron (MLP). Based on the feature fusion maps of each layer and a preset channel attention weight calculation algorithm, average pooling and max pooling are performed in the spatial dimension to generate two global channel descriptors. These two global channel descriptors are then processed through a shared MLP, and their outputs are summed element-wise. Finally, the final channel attention weights are generated using a sigmoid activation function, resulting in channel attention weight maps for each layer. The channel attention weight calculation algorithm is as follows:
[0038] In the formula, For the first i Channel attention weight map at each level, For activation function, For multilayer perceptron functions, To obtain the average function, For the first i Feature fusion maps at each level This is the function for finding the maximum value.
[0039] The detection device enhances channel attention based on the feature fusion maps of each level and the corresponding channel attention weight maps of each level, obtaining channel attention enhancement maps for each level. It strengthens the channels with the richest information through channel attention and then focuses on densely populated target areas through spatial attention. These two mechanisms work together to generate channel attention enhancement maps, thereby improving the model's ability to capture small and dense targets for counting tasks.
[0040] S42: Perform dilated convolution processing on the channel attention enhancement maps of each level to obtain the preliminary count density feature maps of each level; perform average pooling and max pooling on the preliminary count density feature maps of each level to obtain the average pooling feature maps and max pooling feature maps of each level.
[0041] To effectively capture a wide range of contextual information, in this embodiment, the detection device performs dilated convolution processing on the channel attention enhancement maps of each level to obtain preliminary count density feature maps of each level.
[0042] The detection equipment performs average pooling and max pooling on the preliminary count density feature maps of each level to obtain average pooling feature maps and max pooling feature maps of each level.
[0043] S43: The average pooling feature map and the max pooling feature map of the same level are concatenated to obtain the first feature concatenation map of each level; spatial attention weights are calculated on the first feature concatenation map of each level to obtain the spatial attention weight map of each level.
[0044] In this embodiment, the detection device stitches together the average pooling feature map and the max pooling feature map of the same level to obtain the first feature stitching map of each level; spatial attention weights are calculated on the first feature stitching map of each level to obtain the spatial attention weight map of each level.
[0045] S44: Based on the feature fusion map of each level, the channel attention weight map of the corresponding level, the spatial attention weight map, and the preset counting feature calculation algorithm, obtain the counting feature enhancement map of each level.
[0046] In this embodiment, the detection device obtains enhanced counting feature maps for each level based on the feature fusion maps of each level, the corresponding channel attention weight maps, the spatial attention weight maps, and a preset counting feature calculation algorithm. This integrates both channel and spatial attention mechanisms, effectively improving the representation ability for small and dense targets. The counting feature calculation algorithm is as follows:
[0047] In the formula, For the first i Count feature enhancement maps at each level, For the first i Spatial attention weight map at each level, The symbol for element-wise product.
[0048] S5: Input the feature fusion map of the last level into the segmentation enhancement module for channel splitting, self-attention extraction and feature concatenation to obtain the segmentation feature enhancement map.
[0049] To resolve the contradiction between capturing global relationships and limited computing resources in segmentation tasks, in this embodiment, the detection device inputs the feature fusion map of the last level into the segmentation enhancement module for channel splitting, self-attention extraction, and feature stitching to obtain a segmentation feature enhancement map.
[0050] Please see Figure 4 , Figure 4A schematic diagram of step S5 in the flowchart of a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in an embodiment of this application, including steps S51 to S55, as follows: S51: Perform channel splitting on the feature fusion map to obtain a first channel split feature map and a second channel split feature map.
[0051] In this embodiment, the detection device performs channel splitting on the feature fusion map to reduce the number of channels used for attention calculation, thereby reducing computational costs while retaining key information, and obtaining a first channel splitting feature map and a second channel splitting feature map. The first channel splitting feature map is a sub-feature map used for attention calculation, and the second channel splitting feature map is the remaining sub-feature map retaining the original information, as described below:
[0052] In the formula, The first channel is split into feature maps. The second channel is split into feature maps. This represents the total number of channels. This is the splitting ratio coefficient.
[0053] S52: Generate a first query matrix by querying the feature map split from the first channel; calculate a dynamic offset based on the first query matrix to obtain a dynamic offset; and perform offset processing on the feature fusion map based on the dynamic offset to obtain an offset feature map.
[0054] In this embodiment, the detection device generates a first query matrix by querying the first channel split feature map. The detection device then calculates a dynamic offset based on the first query matrix to obtain a dynamic offset. Based on the dynamic offset, the detection device performs offset processing on the feature fusion map to obtain an offset feature map.
[0055] Specifically, the detection device performs a large kernel convolution operation based on the first query matrix. Dynamic offset prediction is performed to obtain the dynamic offset. Based on the feature fusion maps of each level, the detection device generates initial reference points in their spatial dimension with a fixed step size. These initial reference points are used as initial candidate attention positions for the deformable attention mechanism. Based on the initial candidate attention positions and the dynamic offset, the dynamic offset is added to the initial candidate attention positions to generate adjusted reference points. Bilinear interpolation is then performed on the feature fusion map based on these adjusted reference points. The operation is performed to obtain the offset feature map.
[0056] S53: Based on the preset linear projection matrix, perform a linear transformation on the offset feature map to obtain a second query matrix, a first key matrix, and a first value matrix; using a single-head self-attention mechanism, obtain a key region index based on the first query matrix, the first key matrix, and a preset key region index extraction algorithm.
[0057] In this embodiment, the detection device performs a linear transformation on the offset feature map according to a preset linear projection matrix to obtain a second query matrix, a first key matrix, and a first value matrix; using a single-head self-attention mechanism, a key region index is obtained based on the first query matrix, the first key matrix, and a preset key region index extraction algorithm, wherein the key region index extraction algorithm is as follows:
[0058] In the formula, Indexing for key regions. This is a routing mechanism function. This is the first query matrix. This is the first bond matrix. This is the transpose symbol.
[0059] S54: Based on the first key matrix, the first value matrix, the key region index, and the preset key-value collection function, refine the key matrix and the value matrix to obtain the second key matrix and the second value matrix; adopt a single-head self-attention mechanism to extract attention based on the second query matrix, the second key matrix, and the second value matrix to obtain an attention feature map.
[0060] In this embodiment, the detection device refines the key matrix and value matrix according to the first key matrix, the first value matrix, the key region index, and the preset key-value collection function to obtain the second key matrix and the second value matrix; a single-head self-attention mechanism is adopted to extract attention according to the second query matrix, the second key matrix, and the second value matrix to obtain an attention feature map.
[0061] S55: The attention feature map is concatenated with the second channel splitting feature map to obtain a second feature concatenation map; the second feature concatenation map is linearly projected to obtain a segmentation feature enhancement map.
[0062] In this embodiment, the detection device stitches the attention feature map with the second channel splitting feature map to obtain a second feature stitching map; the detection device performs linear projection on the second feature stitching map to obtain a segmentation feature enhancement map, thereby ensuring that the attention effect can cover all channels.
[0063] By introducing a dynamic offset mechanism inspired by deformable attention, it can flexibly focus on key spatial regions of the input feature map, thereby enhancing feature representation capabilities while avoiding redundant global attention computation.
[0064] S6: Input the enhanced feature maps of each level into the damage point detection module to detect damage points and obtain damage point prediction data.
[0065] In this embodiment, the detection device inputs the enhanced feature maps of each level to the damage point detection module to detect damage points and obtain damage point prediction data, wherein the damage point prediction data includes the coordinate prediction data of several damage points.
[0066] Please see Figure 5 , Figure 5 The schematic diagram of step S6 in the photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in one embodiment of this application includes steps S61 to S63, as follows: S61: Using a bilinear interpolation upsampling method, the resolutions of the counting feature enhancement maps at each level are spatially aligned to obtain the resolutions of the counting feature enhancement maps at each level after spatial alignment; the resolutions of the counting feature enhancement maps at each level after spatial alignment are stitched together to obtain a stitched counting feature map and the initial abscissa and ordinate values of several anchor points of several pixels in the stitched counting feature map.
[0067] In this embodiment, the detection device uses a bilinear interpolation upsampling method to spatially align the resolutions of the counting feature enhancement maps at each level, thereby obtaining the resolutions of the counting feature enhancement maps at each level after spatial alignment, thus achieving spatial alignment.
[0068] The detection device stitches together the resolutions of the spatially aligned enhanced counting feature maps at each level to obtain a stitched counting feature map, thereby obtaining a uniformly enhanced counting feature. The device also obtains the initial horizontal and vertical coordinate values of several anchor points for several pixels in the stitched counting feature map; wherein, the anchor points are preset based on the center of the corresponding pixels.
[0069] Specifically, each pixel corresponds to four anchor points. The detection device considers the side length of a single pixel in the stitched image of the counting features as one relative unit. At this time, the distance from the pixel center to each side is 0.5 units. To achieve equal division of the four quadrants, the horizontal and vertical side lengths of each quadrant need to be 1 ÷ 4 = 0.25 units. Therefore, with the pixel center (xc, yc) as the reference, the initial coordinates of the anchor points in the four quadrants are as follows: , , , .
[0070] S62: Based on the initial coordinate data of the anchor points, determine the position of each anchor point of each pixel in the counting feature stitching image, and obtain the feature value of each anchor point of each pixel in the counting feature stitching image; calculate the confidence score based on the feature value of each anchor point of each pixel in the counting feature stitching image, and obtain the confidence score of each anchor point; based on the confidence score, extract the target point as the damage point from each anchor point, and obtain several damage points.
[0071] In this embodiment, the detection device determines the position of each anchor point of each pixel in the counting feature stitching image based on the initial coordinate data of the anchor points, and obtains the feature value of each anchor point of each pixel on the counting feature stitching image.
[0072] The detection device calculates a confidence score based on the feature values of each anchor point of each pixel on the count feature stitched image and a preset confidence score calculation algorithm to obtain the confidence score of each anchor point. Based on the confidence score, target points are extracted from each anchor point as damage points, resulting in several damage points. The confidence score calculation algorithm is as follows:
[0073] In the formula, For the first j Confidence level of each anchor point The convolution weight matrix is... For the first j The feature values of each anchor point on the count feature mosaic map This is the bias parameter.
[0074] S63: Perform position offset prediction on each damage point in the count feature stitching image to obtain the predicted horizontal axis offset and the predicted vertical axis offset of each damage point; add the initial horizontal coordinate value of each damage point to the corresponding predicted horizontal axis offset value, and add the initial vertical coordinate value of each damage point to the corresponding predicted vertical axis offset value to obtain the coordinate prediction data of each damage point.
[0075] The offset represents the deviation of the target's true position from the initial coordinates of the anchor point. In this embodiment, the detection device predicts the position offset of each damage point in the counting feature stitching image to obtain the predicted horizontal and vertical offset values of each damage point.
[0076] The initial x-coordinate value of each damage point is added to the corresponding predicted x-axis offset value, and the initial y-coordinate value of each damage point is added to the corresponding predicted y-axis offset value to obtain the coordinate prediction data of each damage point, so as to achieve accurate positioning of dense small targets.
[0077] S7: Input the segmentation feature enhancement map into the photovoltaic panel detection module to detect photovoltaic panels and obtain photovoltaic panel prediction probability data.
[0078] In this embodiment, the detection device inputs the segmentation feature enhancement map into the photovoltaic panel detection module to perform photovoltaic panel detection and obtain photovoltaic panel prediction probability data.
[0079] Please see Figure 6 , Figure 6 A schematic diagram of step S7 in the flowchart of a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in an embodiment of this application, including step S71, as follows: S71: Based on the feature values of each pixel in the segmentation feature enhancement image and the preset photovoltaic panel probability calculation algorithm, obtain the photovoltaic panel prediction probability vector of each pixel.
[0080] The photovoltaic panel probability calculation algorithm:
[0081] In the formula, For position The photovoltaic panel prediction probability vector of a pixel. For weight parameters, For bias parameters, For the location in the segmentation feature enhancement map The feature value of a pixel.
[0082] In this embodiment, the detection device obtains the photovoltaic panel prediction probability vector of each pixel based on the feature values of each pixel in the segmentation feature enhancement map and the preset photovoltaic panel probability calculation algorithm.
[0083] S8: Perform photovoltaic panel damage detection based on the damage point prediction data and photovoltaic panel prediction probability data to obtain photovoltaic panel damage detection results.
[0084] In this embodiment, the detection device performs photovoltaic panel damage detection based on the damage point prediction data and photovoltaic panel prediction probability data to obtain photovoltaic panel damage detection results.
[0085] Based on the extracted feature maps at multiple levels, count feature enhancement and segmentation feature enhancement are performed. Damage point detection is performed using the obtained multi-level count feature enhancement maps, and photovoltaic panel detection is performed using the obtained segmentation feature enhancement maps. Damage point prediction data and photovoltaic panel prediction probability data are obtained. Combining the damage point prediction data and photovoltaic panel prediction probability data, photovoltaic panel damage detection is performed, which improves the accuracy and efficiency of photovoltaic damage quantitative assessment.
[0086] Please see Figure 7 ,Figure 7 The schematic diagram of step S8 in the photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in one embodiment of this application includes steps S81 to S84, as follows: S81: Perform pixel classification based on the photovoltaic panel prediction probability vector of each pixel in the photovoltaic panel prediction probability data and the preset threshold vector to obtain the prediction classification result of each pixel.
[0087] In this embodiment, the detection device performs pixel classification based on the photovoltaic panel prediction probability vector of each pixel in the photovoltaic panel prediction probability data and a preset threshold vector. Pixels exceeding the threshold vector are classified as photovoltaic panel pixels, and other pixels are classified as non-photovoltaic panel pixels, thereby obtaining the prediction classification result of each pixel. The prediction classification result includes photovoltaic panel pixels and non-photovoltaic panel pixels.
[0088] S82: Perform binary masking based on the predicted classification results of each pixel to obtain an initial binary mask image; fill holes and smooth boundaries of the initial binary mask image through morphological closing operations, identify interconnected pixel clusters through connected component analysis, extract the minimum bounding polygon contour of each pixel cluster as the photovoltaic panel recognition area, and obtain several photovoltaic panel recognition areas.
[0089] In this embodiment, the detection device performs binary masking based on the predicted classification results of each pixel to obtain an initial binary mask image. After filling holes and smoothing boundaries through morphological closing operations on the initial binary mask image, interconnected pixel clusters are identified through connected component analysis. The minimum bounding polygon contour of each pixel cluster is extracted as the photovoltaic panel recognition area, thus obtaining several photovoltaic panel recognition areas.
[0090] S83: Perform contour extraction and vertex processing on each of the photovoltaic panel identification regions to construct a set of contour vertices for each photovoltaic panel identification region; based on the set of contour vertices for each of the photovoltaic panel identification regions, use a polygon filling algorithm to calculate the positions of all pixels covered by the photovoltaic panel to obtain a binary mask image corresponding to each of the photovoltaic panel identification regions.
[0091] In this embodiment, the detection device performs contour extraction and vertex representation processing on each of the photovoltaic panel identification regions to construct a set of contour vertices for each photovoltaic panel identification region. Based on the vector representation method of vertex sequence, it can accurately describe the irregular geometric shape of the solar panel in the actual scene, providing an accurate geometric basis for subsequent regional statistical analysis. The set of contour vertices is as follows:
[0092] In the formula, For the first iThe set of contour vertices of the photovoltaic panel identification region For the first i The first photovoltaic panel identification area The position parameters of each vertex This represents the number of areas identified by the photovoltaic panel.
[0093] The detection device uses a polygon filling algorithm to calculate the positions of all pixels covered by the photovoltaic panel based on the set of contour vertices of each photovoltaic panel identification area, and obtains the binary mask image corresponding to each photovoltaic panel identification area.
[0094] S84: Based on the binary mask image corresponding to each photovoltaic panel identification area and the coordinate prediction data of each damage point in the damage point prediction data, determine the attribution relationship between each damage point and each photovoltaic panel identification area, obtain the statistical number of damage points in each photovoltaic panel identification area and the position coordinate data of the damage points falling into each photovoltaic panel identification area, and use them as the photovoltaic panel damage detection result.
[0095] In this embodiment, the detection device determines the attribution relationship between each damage point and each photovoltaic panel identification area based on the binary mask image corresponding to each photovoltaic panel identification area, the coordinate prediction data of each damage point in the damage point prediction data, and a preset indicator function. The indicator function is:
[0096] In the formula, For the coordinate prediction data of the damage point, For the first i Binary mask image corresponding to each photovoltaic panel identification area This is an indicator function.
[0097] The detection equipment obtains the statistical number of damage points in each of the photovoltaic panel identification areas and the location coordinate data of the damage points falling into each of the photovoltaic panel identification areas, which serves as the photovoltaic panel damage detection result. This achieves a natural transition from spatial attribution to quantitative statistics, providing reliable technical support for the refined analysis of UAV remote sensing in the field of disaster assessment.
[0098] In an optional embodiment, step S9 is further included: training the target detection model; see [link to relevant documentation]. Figure 8 , Figure 8 A schematic diagram of step S9 in the flowchart of a photovoltaic panel damage detection method based on UAV images of marine photovoltaic panels provided in another embodiment of this application, including steps S91 to S97, as follows: S91: Obtain several sample images of marine photovoltaic panels from UAVs, damage point label data for each of the sample images of marine photovoltaic panels from UAVs, and label classification results for each pixel.
[0099] In this embodiment, the detection device obtains several sample images of marine photovoltaic panels from unmanned aerial vehicles (UAVs), damage point label data for each of the sample images of marine photovoltaic panels from unmanned aerial vehicles (UAVs), and label classification results for each pixel. The damage point label data includes coordinate label data for several damage points.
[0100] S92: Input the images of marine photovoltaic panels from each sample UAV into the target detection model to be trained for damage point detection, and obtain the coordinate prediction data of each damage point, the photovoltaic panel prediction probability vector of each pixel, and the confidence of several anchor points in the images of marine photovoltaic panels from each sample UAV.
[0101] In this embodiment, the detection device inputs the images of marine photovoltaic panels from each sample UAV into the target detection model to be trained for damage point detection, and obtains the coordinate prediction data of each damage point in the marine photovoltaic panel images of each sample UAV, the photovoltaic panel prediction probability vector of each pixel, and the confidence of several anchor points.
[0102] S93: Based on the coordinate prediction data, coordinate label data, and preset counting loss algorithm of each damage point in the sample UAV marine photovoltaic panel image, obtain the counting loss value.
[0103] The counting loss algorithm is as follows:
[0104] In the formula, For count loss value, The number of damage points. For the first i Coordinate label data of each damage point, For the first i Coordinate prediction data for each damage point.
[0105] In this embodiment, the detection device obtains the count loss value based on the coordinate prediction data and coordinate label data of each damage point in the sample UAV marine photovoltaic panel image, as well as the preset count loss algorithm.
[0106] S94: Obtain the segmentation loss value based on the photovoltaic panel prediction probability vector of each pixel in the sample UAV marine photovoltaic panel image and the preset segmentation loss algorithm.
[0107] The segmentation loss algorithm is as follows:
[0108] In the formula, To segment the loss value, For the first t Weighting factors for each category For the first pixel t The probability vector of photovoltaic panel labels for each category. For focusing parameters.
[0109] In this embodiment, the detection device obtains a segmentation loss value based on the photovoltaic panel prediction probability vector of each pixel in the sample UAV marine photovoltaic panel image and a preset segmentation loss algorithm.
[0110] S95: Based on the confidence level, divide each anchor point into positive and negative samples of damage points, and construct a set of positive damage points and a set of negative damage points; based on the confidence level of each anchor point, the set of positive damage points, the set of negative damage points, and the preset confidence level loss algorithm, obtain the confidence level loss value.
[0111] In this embodiment, the detection device divides each anchor point into positive and negative samples of damage points according to the confidence level, and constructs a set of positive damage points and a set of negative damage points.
[0112] Based on the confidence level of each anchor point, the set of positive samples of the damage points, the set of negative samples of the damage points, and a preset confidence loss algorithm, a confidence loss value is obtained, wherein the confidence loss algorithm is as follows:
[0113] In the formula, This represents the confidence loss value. For the number of anchor points, The set of positive samples of damage points. For the first i Confidence level of each anchor point.
[0114] S96: Perform pixel classification based on the photovoltaic panel prediction probability vector of each pixel to obtain the prediction classification result of each pixel. Based on the prediction classification result and label classification result of each pixel in the same sample UAV marine photovoltaic panel image, obtain the number of true positive pixels, the number of false negative pixels, and the number of false positive pixels. Based on the number of true positive pixels, the number of false negative pixels, the number of false positive pixels, and the preset Tversky loss algorithm, obtain the Tversky loss value.
[0115] In this embodiment, the detection device performs pixel classification based on the photovoltaic panel prediction probability vector of each pixel to obtain the prediction classification result of each pixel. Based on the prediction classification result and label classification result of each pixel in the same sample UAV marine photovoltaic panel image, the device obtains the number of true positive pixels, the number of false negative pixels, and the number of false positive pixels. The detection device obtains a Tversky loss value based on the number of true positive pixels, the number of false negative pixels, the number of false positive pixels, and a preset Tversky loss algorithm. The Tversky loss algorithm is as follows:
[0116] In the formula, This represents the confidence loss value. This represents the number of true positive pixels. The number of false negative pixels. This represents the number of false positive pixels. These are the weighting coefficients.
[0117] S97: Obtain the total loss value based on the count loss value, segmentation loss value, confidence loss value, Tversky loss value, and the preset total loss value algorithm; train the target detection model to be trained based on the total loss value.
[0118] In this embodiment, the detection device obtains a total loss value based on the counting loss value, segmentation loss value, confidence loss value, Tversky loss value, and a preset total loss value algorithm; based on the total loss value, the target detection model to be trained is trained to achieve end-to-end joint training of target counting and segmentation tasks, wherein the total loss value algorithm is as follows:
[0119] In the formula, This is the total loss value. , , , , , These are the first weighting factor, the second weighting factor, the third weighting factor, the fourth weighting factor, the fifth weighting factor, and the sixth weighting factor.
[0120] Please refer to Figure 9 , Figure 9 This is a schematic diagram of a photovoltaic panel damage detection device based on UAV images of marine photovoltaic panels, provided in one embodiment of this application. This device can be implemented in whole or in part through software, hardware, or a combination of both. The photovoltaic panel damage detection device 9 based on UAV images of marine photovoltaic panels includes: The data acquisition module 91 is used to acquire images of the marine photovoltaic panels of the UAV to be detected and a preset target detection model. The target detection model includes a backbone network, a neck network, and a head network. The neck network includes a frequency fusion module, a counting enhancement module, and a segmentation enhancement module. The head network includes a damage point detection module and a photovoltaic panel detection module. The feature extraction module 92 is used to input the image of the UAV's marine photovoltaic panel to be detected into the backbone network for multi-level feature extraction to obtain several levels of feature extraction maps. The feature fusion module 93 is used to input the feature extraction maps of each level into the frequency fusion module to perform feature fusion between levels and obtain the feature fusion map of each level; The counting feature enhancement module 94 is used to input the feature fusion map of each level into the counting enhancement module for channel enhancement and spatial enhancement to obtain the counting feature enhancement map of each level; The segmentation feature enhancement module 95 is used to input the feature fusion map of the last level into the segmentation enhancement module for channel splitting, self-attention extraction and feature concatenation to obtain the segmentation feature enhancement map; The damage point prediction module 96 is used to input the enhanced counting feature maps of each level into the damage point detection module to detect damage points and obtain damage point prediction data. The photovoltaic panel prediction module 97 is used to input the segmentation feature enhancement map into the photovoltaic panel detection module to detect photovoltaic panels and obtain photovoltaic panel prediction probability data. The photovoltaic panel damage detection module 98 is used to perform photovoltaic panel damage detection based on the damage point prediction data and photovoltaic panel prediction probability data, and obtain photovoltaic panel damage detection results.
[0121] In this embodiment, a data acquisition module obtains an image of the UAV-based marine photovoltaic panel to be detected and a preset target detection model. The target detection model includes a backbone network, a neck network, and a head network. The neck network includes a frequency fusion module, a counting enhancement module, and a segmentation enhancement module. The head network includes a damage point detection module and a photovoltaic panel detection module. A feature extraction module inputs the image of the UAV-based marine photovoltaic panel to be detected into the backbone network for multi-level feature extraction, obtaining several levels of feature extraction maps. A feature fusion module inputs the feature extraction maps of each level into the frequency fusion module for inter-level feature fusion, obtaining feature fusion maps of each level. A counting feature enhancement module fuses the features of each level. The input image is fed into the counting enhancement module for channel enhancement and spatial enhancement, obtaining counting feature enhancement maps at each level. The last level feature fusion map is then input into the segmentation enhancement module for channel splitting, self-attention extraction, and feature concatenation, resulting in a segmentation feature enhancement map. The damage point prediction module inputs the counting feature enhancement maps at each level into the damage point detection module for damage point detection, obtaining damage point prediction data. The photovoltaic panel prediction module inputs the segmentation feature enhancement map into the photovoltaic panel detection module for photovoltaic panel detection, obtaining photovoltaic panel prediction probability data. Finally, the photovoltaic panel damage detection module performs photovoltaic panel damage detection based on the damage point prediction data and the photovoltaic panel prediction probability data, obtaining photovoltaic panel damage detection results. By performing counting feature enhancement and segmentation feature enhancement based on the extracted feature maps at multiple levels, and using the obtained multi-level counting feature enhancement maps for damage point detection and the obtained segmentation feature enhancement maps for photovoltaic panel detection, damage point prediction data and photovoltaic panel prediction probability data are obtained. Combining the damage point prediction data and photovoltaic panel prediction probability data for photovoltaic panel damage detection improves the accuracy and efficiency of photovoltaic damage quantitative assessment.
[0122] Please refer to Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device provided in one embodiment of this application. The computer device 10 includes: a processor 101, a memory 102, and a computer program 103 stored in the memory 102 and executable on the processor 101. The computer device can store multiple instructions, which are adapted to be loaded and executed by the processor 101. Figures 1 to 8 The method steps of the illustrated embodiment can be found in the following documentation for detailed execution. Figures 1 to 8 The specific details of the illustrated embodiments will not be elaborated here.
[0123] The processor 101 may include one or more processing cores. The processor 101 connects to various parts of the server using various interfaces and lines. It executes instructions, programs, code sets, or instruction sets stored in the memory 102, and retrieves data from the memory 102 to perform various functions and process data for the photovoltaic panel damage detection device 9 based on UAV images of marine photovoltaic panels. Optionally, the processor 101 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 101 may integrate one or more of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content displayed on the touch screen; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the processor 101.
[0124] The memory 102 may include random access memory (RAM) or read-only memory. Optionally, the memory 102 may include a non-transitory computer-readable storage medium. The memory 102 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 102 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch instructions), instructions for implementing the various method embodiments described above, etc.; the data storage area may store data involved in the various method embodiments described above, etc. Optionally, the memory 102 may also be at least one storage device located remotely from the aforementioned processor 101.
[0125] This application embodiment also provides a storage medium that can store multiple instructions, which are adapted to be loaded and executed by a processor as described above. Figures 1 to 8 For details of the method steps described in the embodiment, please refer to [link / reference]. Figures 1 to 8 The specific details of the embodiments will not be elaborated here.
[0126] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0127] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0128] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the algorithm. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0129] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / terminal devices and methods can be implemented in other ways. For example, the apparatus / terminal device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0130] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0131] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0132] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms.
[0133] This invention is not limited to the above-described embodiments. If any modifications or variations to this invention do not depart from the spirit and scope of this invention, and if such modifications and variations fall within the scope of the claims and equivalent technologies of this invention, then this invention also intends to include such modifications and variations.
Claims
1. A method for detecting damage of photovoltaic panels based on images of photovoltaic panels at sea by using unmanned aerial vehicles, characterized in that, The method comprises the following steps: obtaining an unmanned aerial vehicle offshore photovoltaic panel image to be detected and a preset target detection model, wherein the target detection model comprises a backbone network, a neck network and a head network; the neck network comprises a frequency fusion module, a counting enhancement module and a segmentation enhancement module; the head network comprises a damage point detection module and a photovoltaic panel detection module; inputting the unmanned aerial vehicle offshore photovoltaic panel image to be detected into the backbone network to perform multi-level feature extraction, and obtaining feature extraction images of several levels; inputting the feature extraction images of each level into the frequency fusion module to perform feature fusion between levels, and obtaining feature fusion images of each level; inputting the feature fusion images of each level into the counting enhancement module to perform channel enhancement and spatial enhancement, and obtaining counting feature enhancement images of each level; inputting the feature fusion image of the last level into the segmentation enhancement module to perform channel splitting, self-attention extraction and feature splicing, and obtaining a segmentation feature enhancement image; inputting the counting feature enhancement images of each level into the damage point detection module to perform damage point detection, and obtaining damage point prediction data; inputting the segmentation feature enhancement image into the photovoltaic panel detection module to perform photovoltaic panel detection, and obtaining photovoltaic panel prediction probability data; performing photovoltaic panel damage detection according to the damage point prediction data and the photovoltaic panel prediction probability data, and obtaining a photovoltaic panel damage detection result. 2.The method of claim 1, wherein the method further comprises: The frequency fusion module comprises a plurality of stacked frequency fusion units; the frequency fusion unit comprises a shift generator, a high-pass filter and a low-pass filter; the step of inputting the feature extraction images of each level into the frequency fusion module to perform feature fusion between levels, and obtaining feature fusion images of each level, comprises the steps of: taking the feature extraction image of the current level as the feature fusion image of the current level, inputting the feature fusion image of the current level and the feature extraction image of the corresponding previous level into the first frequency fusion unit, and performing convolution processing on the feature extraction image of the previous level to obtain a convolution feature image of the previous level; performing local similarity calculation according to the feature fusion image of the current level, the convolution feature image of the previous level and the shift generator, and obtaining a local similarity matrix; splicing the local similarity matrix and the convolution feature image of the previous level, and performing convolution operation on the result obtained after splicing to obtain a shift of the current level; performing smoothing processing on the feature fusion image of the current level according to the low-pass filter to obtain a first feature processing image of the current level; performing up-sampling processing on the first feature processing image of the current level to obtain an up-sampled feature image of the current level; performing position alignment on the up-sampled feature image of the current level by using a resampling operation according to the shift of the current level to obtain a resampled feature image of the current level; According to the feature extraction map of the last level and a high-pass filter, a detail feature enhancement map of the last level is obtained; the detail feature enhancement map of the last level and the feature extraction map of the last level are connected in residual, to obtain a residual connection feature map of the last level; the resampling feature map of the current level and the residual connection feature map of the last level are added, to obtain a feature fusion map output by a first frequency fusion unit; The feature fusion map output by the first frequency fusion unit and the corresponding feature extraction map of the last level are input into a next frequency fusion unit, and feature fusion is repeatedly performed until a feature fusion map output by a last frequency fusion unit is obtained, to obtain the feature fusion map of each level. 3.The method of claim 2, wherein, The feature fusion map of each level is input into the count enhancement module to perform channel enhancement and spatial enhancement, to obtain a count feature enhancement map of each level, including the steps of: A multi-layer perception is adopted, and a channel attention weight map of each level is obtained according to the feature fusion map of each level and a preset channel attention weight calculation algorithm; Channel attention enhancement is performed on the feature fusion map of each level and the channel attention weight map of the corresponding level, to obtain a channel attention enhancement map of each level, wherein the channel attention weight calculation algorithm is: wherein is a channel attention weight map of the i th level, is an activation function, is a multi-layer perceptron function, is an average function, is a feature fusion map of the i th level, is a max function. The channel attention enhancement map of each level is subjected to a hole convolution processing, to obtain a preliminary count density feature map of each level; the preliminary count density feature map of each level is subjected to average pooling and maximum pooling respectively, to obtain an average pooling feature map and a maximum pooling feature map of each level; the average pooling feature map and the maximum pooling feature map of the same level are spliced, to obtain a first feature splicing map of each level; spatial attention weight calculation is performed on the first feature splicing map of each level, to obtain a spatial attention weight map of each level; According to the feature fusion map of each level, the channel attention weight map and the spatial attention weight map of the corresponding level, and a preset count feature calculation algorithm, a count feature enhancement map of each level is obtained, wherein the count feature calculation algorithm is: wherein is a count feature enhancement map of the i th level, is a spatial attention weight map of the i th level, is an element-wise multiplication symbol. 4.The method for photovoltaic panel damage detection based on UAV offshore photovoltaic panel image according to claim 3, characterized in that, The feature fusion map of the last level is input into the segmentation enhancement module to perform channel splitting, self-attention extraction and feature splicing, to obtain a segmentation feature enhancement map, including the steps of: The feature fusion map is subjected to channel splitting, to obtain a first channel split feature map and a second channel split feature map, wherein the first channel split feature map is a sub-feature map for attention calculation, and the second channel split feature map is a remaining sub-feature map for retaining original information; According to the first channel split feature map, a first query matrix is generated, a dynamic offset is calculated according to the first query matrix, and an offset feature map is obtained by offset processing the feature fusion map according to the dynamic offset. Based on a preset linear projection matrix, the offset feature map is linearly transformed to obtain a second query matrix, a first key matrix, and a first value matrix. Using a single-head self-attention mechanism, a key region index is obtained based on the first query matrix, the first key matrix, and a preset key region index extraction algorithm. The key region index extraction algorithm is as follows: wherein is a key region index, is a routing mechanism function, is a first query matrix, is a first key matrix, is a transpose symbol; Based on the first key matrix, the first value matrix, the key region index, and the preset key-value collection function, the key matrix and the value matrix are refined to obtain the second key matrix and the second value matrix; a single-head self-attention mechanism is used to extract attention based on the second query matrix, the second key matrix, and the second value matrix to obtain an attention feature map; The attention feature map is concatenated with the second channel splitting feature map to obtain a second feature concatenation map; the second feature concatenation map is linearly projected to obtain a segmentation feature enhancement map. 5.The method for photovoltaic panel damage detection based on UAV offshore photovoltaic panel image according to claim 3, characterized in that: in, The damage point prediction data includes the coordinate prediction data of several damage points; The step of inputting the enhanced feature maps of each level into the damage point detection module for damage point detection to obtain damage point prediction data includes the following steps: A bilinear interpolation upsampling method is used to spatially align the resolutions of the counting feature enhancement maps at each level, obtaining the spatially aligned resolutions of the counting feature enhancement maps at each level. The spatially aligned resolutions of the counting feature enhancement maps at each level are then stitched together to obtain a stitched counting feature map, along with the initial abscissa and ordinate values of several anchor points for several pixels in the stitched counting feature map. The anchor points are preset based on the center of the corresponding pixels. Based on the initial coordinate data of the anchor points, the position of each anchor point of each pixel in the counting feature stitching image is determined, and the feature value of each anchor point of each pixel in the counting feature stitching image is obtained; a confidence score is calculated based on the feature value of each anchor point of each pixel in the counting feature stitching image to obtain the confidence score of each anchor point; based on the confidence score, target points are extracted from each anchor point as damage points to obtain several damage points; Position offset prediction is performed on each damage point in the count feature stitching image to obtain the predicted horizontal axis offset and the predicted vertical axis offset of each damage point; the initial horizontal coordinate value of each damage point is added to the corresponding predicted horizontal axis offset value, and the initial vertical coordinate value of each damage point is added to the corresponding predicted vertical axis offset value to obtain the coordinate prediction data of each damage point.
6. The method for photovoltaic panel damage detection based on UAV offshore photovoltaic panel image according to claim 5, characterized in that: The photovoltaic panel prediction probability data includes a photovoltaic panel prediction probability vector of several pixels. The step of inputting the segmentation feature enhancement map into the photovoltaic panel detection module for photovoltaic panel detection to obtain photovoltaic panel prediction probability data includes the following steps: Based on the feature values of each pixel in the segmentation feature enhancement image and the preset photovoltaic panel probability calculation algorithm, the photovoltaic panel prediction probability vector of each pixel is obtained, wherein the photovoltaic panel probability calculation algorithm is as follows: wherein is a position a photovoltaic panel predicted probability vector for a pixel, is a weight parameter, is a bias parameter, is a feature value for the position in the segmentation feature enhanced map for a pixel.
7. The method for photovoltaic panel damage detection based on UAV offshore photovoltaic panel images according to claim 6, characterized in that, The photovoltaic panel damage detection is performed according to the damage point prediction data and photovoltaic panel prediction probability data, and a photovoltaic panel damage detection result is obtained, including the steps of: performing pixel classification according to the photovoltaic panel prediction probability vector of each pixel in the photovoltaic panel prediction probability data and a preset threshold vector, to obtain a prediction classification result of each pixel, wherein the prediction classification result includes a photovoltaic panel pixel and a non-photovoltaic panel pixel; performing binary mask processing according to the prediction classification result of each pixel to obtain an initial binary mask image; after filling holes and smoothing boundaries of the initial binary mask image through a morphological closing operation, mutually connected pixel clusters are identified through connected domain analysis, and a minimum circumscribed polygon contour of each pixel cluster is extracted as a photovoltaic panel recognition area, to obtain a plurality of photovoltaic panel recognition areas; performing contour extraction and vertex processing on each photovoltaic panel recognition area to construct a contour vertex set of each photovoltaic panel recognition area; and calculating all pixel positions covered by a photovoltaic panel by using a polygon filling algorithm according to the contour vertex set of each photovoltaic panel recognition area, to obtain a binary mask image corresponding to each photovoltaic panel recognition area; judging the attribution relationship between each damage point and each photovoltaic panel recognition area according to the binary mask image corresponding to each photovoltaic panel recognition area and the coordinate prediction data of each damage point in the damage point prediction data, to obtain the number of damage points of each photovoltaic panel recognition area and the position coordinate data of the damage points falling into each photovoltaic panel recognition area as the photovoltaic panel damage detection result. 8.The method for photovoltaic panel damage detection based on UAV offshore photovoltaic panel image according to claim 7, characterized in that, The method further includes the step of training the target detection model. The training of the target detection model includes the steps of: obtaining a plurality of sample unmanned aerial vehicle offshore photovoltaic panel images, damage point label data of each sample unmanned aerial vehicle offshore photovoltaic panel image, and label classification results of each pixel, wherein the damage point label data includes coordinate label data of a plurality of damage points; inputting each sample unmanned aerial vehicle offshore photovoltaic panel image into the target detection model to be trained to perform damage point detection, to obtain coordinate prediction data of each damage point, a photovoltaic panel prediction probability vector of each pixel, and a confidence of a plurality of anchor points of each sample unmanned aerial vehicle offshore photovoltaic panel image; obtaining a counting loss value according to the coordinate prediction data of each damage point, the coordinate label data, and a preset counting loss algorithm of each sample unmanned aerial vehicle offshore photovoltaic panel image, wherein the counting loss algorithm is: In the formula, is a count loss value, is a number of damage points, is a coordinate label data of the i th damage point, is a coordinate prediction data of the i th damage point; obtaining a segmentation loss value according to the photovoltaic panel prediction probability vector of each pixel and a preset segmentation loss algorithm of each sample unmanned aerial vehicle offshore photovoltaic panel image, wherein the segmentation loss algorithm is: wherein is a segmentation loss value, is a weight factor for the t th class, is a photovoltaic panel label probability vector for the t th class of pixels, is a focus parameter; dividing each anchor point into damage point positive and negative samples according to the confidence, to construct a damage point positive sample set and a damage point negative sample set; and obtaining a confidence loss value according to the confidence of each anchor point, the damage point positive sample set, the damage point negative sample set, and a preset confidence loss algorithm, wherein the confidence loss algorithm is: In the formula, is a confidence loss value, is the number of anchor points, is a positive sample set of damage points, is the confidence of the i th anchor point. According to the photovoltaic panel prediction probability vector of each pixel, pixel classification is performed to obtain a prediction classification result of each pixel, and according to the prediction classification result and the label classification result of each pixel of the same sample unmanned aerial vehicle offshore photovoltaic panel image, a true positive pixel number, a false negative pixel number and a false positive pixel number are obtained; according to the true positive pixel number, the false negative pixel number, the false positive pixel number and a preset Tversky loss algorithm, a Tversky loss value is obtained, wherein the Tversky loss algorithm is: In the formula, is a confidence loss value, is a true positive pixel number, is a false negative pixel number, is a false positive pixel number, is a weight coefficient; According to the counting loss value, the segmentation loss value, the confidence loss value, the Tversky loss value and a preset total loss value algorithm, a total loss value is obtained; and according to the total loss value, the target detection model to be trained is trained, wherein the total loss value algorithm is: wherein is the total loss value, , , , , , are a first weight factor, a second weight factor, a third weight factor, a fourth weight factor, a fifth weight factor, and a sixth weight factor, respectively. 9.A device for detecting damage of photovoltaic panels based on images of photovoltaic panels at sea by using unmanned aerial vehicles, characterized in that, Comprising: A data acquisition module is configured to obtain an unmanned aerial vehicle offshore photovoltaic panel image to be detected and a preset target detection model, wherein the target detection model comprises a backbone network, a neck network and a head network; the neck network comprises a frequency fusion module, a counting enhancement module and a segmentation enhancement module; and the head network comprises a damage point detection module and a photovoltaic panel detection module; A feature extraction module is configured to input the unmanned aerial vehicle offshore photovoltaic panel image to be detected into the backbone network to perform multi-level feature extraction, and obtain feature extraction images of several levels; A feature fusion module is configured to input the feature extraction images of each level into the frequency fusion module to perform feature fusion between levels, and obtain feature fusion images of each level; A counting feature enhancement module is configured to input the feature fusion images of each level into the counting enhancement module to perform channel enhancement and spatial enhancement, and obtain counting feature enhancement images of each level; A segmentation feature enhancement module is configured to input the feature fusion image of the last level into the segmentation enhancement module to perform channel splitting, self-attention extraction and feature splicing, and obtain a segmentation feature enhancement image; A damage point prediction module is configured to input the counting feature enhancement images of each level into the damage point detection module to perform damage point detection, and obtain damage point prediction data; A photovoltaic panel prediction module is configured to input the segmentation feature enhancement image into the photovoltaic panel detection module to perform photovoltaic panel detection, and obtain photovoltaic panel prediction probability data; A photovoltaic panel damage detection module is configured to perform photovoltaic panel damage detection according to the damage point prediction data and the photovoltaic panel prediction probability data, and obtain a photovoltaic panel damage detection result.
10. A computer device, comprising: A processor, a memory and a computer program stored in the memory and executable on the processor are included, and the processor implements the steps of the photovoltaic panel damage detection method based on an unmanned aerial vehicle offshore photovoltaic panel image according to any one of claims 1 to 8 when executing the computer program.