A YOLOv5 photovoltaic module hot spot detection method based on feature map cross fusion

The YOLOv5 photovoltaic module hot spot detection method, which uses feature map cross-fusion, solves the problem of insufficient small target detection capability in existing technologies, and achieves more efficient feature fusion and accurate hot spot detection.

CN119991549BActive Publication Date: 2026-06-05CYG SUNRI CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CYG SUNRI CO LTD
Filing Date
2024-12-12
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing deep learning-based methods for detecting hot spots in photovoltaic modules have insufficient ability to detect small targets, limited feature integration effects, and high computational complexity.

Method used

A YOLOv5 photovoltaic module hot spot detection method using feature map cross-fusion is proposed. By constructing a feature map cross-computation model, feature maps x1 and x2 are cross-attention tensor calculated. Combined with layer normalization and residual connections, the fusion of shallow and deep features is achieved and introduced into the Neck feature fusion network of the YOLOv5 model.

Benefits of technology

It improves the accuracy and comprehensiveness of hot spot detection for small targets, reduces the false negative rate, enhances the model's ability to detect small targets, and maintains computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991549B_ABST
    Figure CN119991549B_ABST
Patent Text Reader

Abstract

The application discloses a YOLOv5 photovoltaic module hot spot detection method based on feature map cross fusion, relates to the technical field of photovoltaic module hot spot detection, and comprises the following steps: acquiring an unmanned aerial vehicle infrared image of a photovoltaic module and performing data set construction; a feature map cross calculation model is constructed; and the feature map cross calculation model is introduced into a YOLOv5 model. The YOLOv5 photovoltaic module hot spot detection method based on feature map cross fusion can effectively identify hot spot defects of the photovoltaic module. In order to compensate for the lost rich shallow features when extracting deep features of the position of small target hot spot defects, the application cross calculates the shallow features and the deep features extracted at different stages of a backbone network, realizes feature fusion between feature maps, and thus more rich feature semantic information is obtained. This makes the position of the hot spot defects be more accurately and comprehensively detected, and is particularly suitable for detecting many small target hot spot defects in the photovoltaic module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of photovoltaic module hot spot detection technology, specifically a YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion. Background Technology

[0002] Photovoltaic power generation converts solar energy into electricity, reducing dependence on traditional fossil fuels and providing a sustainable energy supply for humanity, thus helping to alleviate the energy crisis and ensure national energy security. However, during the process of receiving solar energy and converting it into electricity, photovoltaic modules are easily blocked by objects such as leaves, dust, and bird droppings, or suffer from problems such as cell defects and poor connections, resulting in hot spot effects. This can cause localized temperature increases in photovoltaic modules, affecting overall power generation efficiency. Therefore, regular inspection of photovoltaic modules is crucial.

[0003] Currently, infrared thermal imaging technology combined with deep learning algorithms is widely used for hot spot detection in photovoltaic modules. The following are several deep learning-based methods for photovoltaic module hot spot detection: Patent CN 114037918B introduces a photovoltaic hot spot detection method based on UAV inspection and image processing, directly calling the YOLOv5 target detection algorithm for hot spot detection, but without model improvement tailored to hot spot characteristics. Patent CN 114973032B provides a photovoltaic panel hot spot detection method and device based on a deep convolutional neural network. By replacing the YOLOv4 feature extraction network, it achieves rapid identification of photovoltaic panels in aerial infrared images and introduces the MobileNetV2 network into the DeeplabV3+ model for hot spot segmentation. Patent CN 117315350B proposes a UAV-based photovoltaic solar panel hot spot detection method and device. By segmenting the UAV photovoltaic module image, performing distance transformation based on the segmentation results, and determining the pixel mean of the battery region corresponding to the center of each cell, abnormal battery regions are identified. Invention patent CN 118644447 A proposes a photovoltaic panel hot spot detection method based on an improved YOLOv8 model. It replaces the C2f module feature extraction backbone network of the YOLOv8 backbone network with the Visual RetNet architecture, and introduces the Retention self-attention mechanism ReSA, which is related to distance-related spatial prior knowledge, into the Visual RetNet network to reduce computational complexity.

[0004] Most existing photovoltaic module hotspot detection methods improve the model by enhancing feature extraction. However, in practical applications, the hotspot area is small in the early stages and accounts for a small proportion in images captured by drones. Existing deep learning models suffer from insufficient feature representation information due to multiple downsampling operations, resulting in weak detection capabilities for small targets and a tendency to miss detections. Therefore, the current challenge is how to leverage the rich shallow features extracted by neural networks in the shallow layers to guide the learning of deep features, so that the deep features simultaneously possess shallow information about small targets. Summary of the Invention

[0005] In view of the above-mentioned problems, the present invention is proposed.

[0006] Therefore, the technical problem solved by this invention is that existing deep learning-based photovoltaic module hot spot detection methods have insufficient small target detection capabilities, limited feature integration effects, and high computational complexity.

[0007] To address the aforementioned technical problems, this invention provides the following technical solution: a YOLOv5 photovoltaic module hotspot detection method based on feature map cross-fusion, comprising acquiring UAV infrared images of the photovoltaic module and constructing a dataset; constructing a feature map cross-calculation model; and introducing the feature map cross-calculation model into the YOLOv5 model.

[0008] As a preferred embodiment of the YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion described in this invention, the step of acquiring UAV infrared images of photovoltaic modules and constructing a dataset includes using a UAV equipped with a dual-light camera to inspect the photovoltaic modules and acquire UAV infrared images of the photovoltaic modules.

[0009] As a preferred embodiment of the YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion described in this invention, the acquisition of UAV infrared images of photovoltaic modules and the construction of datasets further include data annotation of the acquired photovoltaic module infrared images, and dividing the images containing hot spot defects into training set and validation set in an 8:2 ratio, while adding normal samples accounting for about 10% of the total dataset as background images to the training set.

[0010] As a preferred embodiment of the YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion described in this invention, the construction of the feature map cross-computation model includes obtaining cross-attention tensors x1' and x2' between feature maps x1 and x2 through Cross-Computation cross-computation.

[0011] Tensors x1' and x2' are concatenated along the channel dimension to obtain tensor x', with dimensions (W×H,B,2C).

[0012] Where B represents the number of input images, C represents the number of channels in the feature map extracted from each image, and W and H represent the width and height of the feature map, respectively.

[0013] Perform Layer Norm normalization on tensor x' to obtain tensor x. LN1 .

[0014] Tensors x' and x LN1 Perform an Additional residual join to obtain the tensor x Add1 .

[0015] Tensor x Add1 Tensor x is obtained through FFN feedforward neural network. FFN .

[0016] For tensor x FFN Perform Layer Norm normalization to obtain tensor x LN2 .

[0017] Tensor x LN2 and x Add1 Perform an Additional residual join to obtain the tensor x Add2 .

[0018] For tensor x Add2 Perform a dimensionality transformation to obtain the feature map x, with dimensions (B, 2C, W, H).

[0019] As a preferred embodiment of the YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion described in this invention, wherein: the feature maps x1 and x2 obtain the cross-attention tensors x1' and x2' between the feature maps through Cross-Computation cross-calculation, which includes flattening the dimensions (B,C,W,H) of the feature map tensors x1 and x2 in the channel dimension to (B,C,W×H), and then swapping the dimensions to generate tensors T1 and T2 with dimensions (W×H,B,C).

[0020] Embed the corresponding positional encoding PE(·) into tensors T1 and T2 respectively, generating the corresponding tensors T1' and T2' as follows:

[0021] T1'=T1+PE(T1=T1+(W1) Pos T1+b1 Pos )

[0022] T2'=T2+PE(T2)=T2+(W2 Pos T2+b2 Pos )

[0023] Among them, W1Pos and W2 Pos b1 represents the weight term. Pos and b1 Pos These represent bias terms, all of which are learnable parameters.

[0024] Calculate the qkv tensors corresponding to tensors T1' and T2' respectively, and express them as follows:

[0025] q1 = W1 Q T1'

[0026] k1 = W1 K T1'

[0027] v1 = W1 V T1'

[0028] q2 = W2 Q T2'

[0029] k2 = W2 K T2'

[0030] v2 = W2 V T2'

[0031] Among them, W i Q W i K W i V i = 1, 2 represents the weight terms.

[0032] Calculate the cosine similarity between tensor q1 and tensor k2, and the cosine similarity between tensor q2 and tensor k1, respectively, as follows:

[0033]

[0034] Where τ1 and τ2 are both learnable scalars, b 1,2 and b 2,1 These are learnable bias parameters.

[0035] Calculate the cross-attention score between tensor q1 and tensors k2,v2 to obtain tensor x1'. Calculate the cross-attention score between tensor q2 and tensors k1,v1 to obtain tensor x2', expressed as:

[0036] x1'=Attention(q1,k2,v2)=SoftMax(Sim(q1,k2))v2

[0037] x2'=Attention(q2,k1,v1)=SoftMax(Sim(q2,k1))v1.

[0038] As a preferred embodiment of the YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion described in this invention, the feature map cross-calculation model further includes constructing a tensor x' of dimension (W×H,B,2C), with a total of B samples and 2C channels. For each sample j, the mean μj on each channel c is calculated. c and variance σj c , is represented as:

[0039]

[0040] Normalize each channel of each sample:

[0041]

[0042] Where δ represents a very small positive number, γ c and β c These represent the weight and bias terms of each sample j in the B samples on channel c, respectively.

[0043] For tensors x' and x of the same dimension LN1 The values ​​are added together along the corresponding dimensions, and the result is expressed as:

[0044] x Add1 =x'+x LN1

[0045] A feedforward neural network consists of two consecutive linear layers, meaning it undergoes two consecutive linear transformations, as follows:

[0046]

[0047] Among them, W1 FFN and Represents the weighted item. and This represents the bias term.

[0048] Tensor x Add2 The dimensional representation (W×H,B,2C) is transformed to be consistent with the dimensional representation (B,C,W,H) of the input feature map, and the tensor x is transformed. Add2 The dimensions are changed to (B, 2C, W×H), and the third dimension W×H is folded into (W, H), finally forming a feature map x with dimensions (B, 2C, W, H).

[0049] As a preferred embodiment of the YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion described in this invention, the feature map cross-computation model is introduced into the YOLOv5 model and wrapped in the Neck feature fusion network. All Concate modules are replaced with feature map cross-computation modules. The shallow feature map output by the backbone network is cross-computed with the current deep feature map to obtain shallow feature semantic information.

[0050] An improved YOLOv5 hotspot detection model is obtained. The improved YOLOv5 hotspot detection model is trained and output using a predefined training set and validation set. The trained hotspot detection model is then called to perform hotspot detection on the image to be detected, and the hotspot detection results are output.

[0051] Another objective of this invention is to provide a YOLOv5 photovoltaic module hot spot detection system based on feature map cross-fusion. This system can achieve feature fusion between feature maps by cross-calculating shallow and deep features extracted from different stages of the backbone network, thereby obtaining richer feature semantic information. This solves the problem of insufficient small target detection capability in current deep learning-based photovoltaic module hot spot detection methods.

[0052] As a preferred embodiment of the YOLOv5 photovoltaic module hot spot detection system based on feature map cross-fusion described in this invention, it includes a data acquisition module, a model building module, and a model fusion module. The data acquisition module is used to acquire UAV infrared images of the photovoltaic module and construct a dataset. The model building module is used to construct a feature map cross-calculation model. The model fusion module is used to introduce the feature map cross-calculation model into the YOLOv5 model.

[0053] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement a YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion.

[0054] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion.

[0055] The beneficial effects of this invention are as follows: The YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion provided by this invention can effectively identify hot spot defects in photovoltaic modules. To compensate for the loss of rich shallow features when extracting deep features of small target hot spot defect locations, this invention performs cross-calculation between shallow and deep features extracted from different stages of the backbone network, achieving feature fusion between feature maps and thus obtaining richer feature semantic information. This allows the location of hot spot defects to be detected more accurately and comprehensively, and is particularly suitable for detecting many small target hot spot defects in photovoltaic modules. This invention achieves better results in terms of accuracy and applicability. Attached Figure Description

[0056] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1 The first embodiment of the present invention provides an overall flowchart of a YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion.

[0058] Figure 2 The first embodiment of the present invention provides a calculation flowchart of a YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion.

[0059] Figure 3 The updated YOLOv5 model framework diagram is provided for the first embodiment of the present invention, which is a YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion.

[0060] Figure 4 The original YOLOv5 model framework diagram is provided for the first embodiment of the present invention, which is a YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion. Detailed Implementation

[0061] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0062] Example 1, referring to Figures 1-4As an embodiment of the present invention, a method for detecting hot spots in YOLOv5 photovoltaic modules based on feature map cross-fusion is provided, comprising:

[0063] S1: Acquire drone infrared images of photovoltaic modules and construct a dataset.

[0064] Furthermore, drones equipped with dual-light cameras are used to inspect photovoltaic modules from high altitudes at different angles and shooting distances, acquiring drone infrared images of the photovoltaic modules.

[0065] It should be noted that the acquired infrared images of photovoltaic modules were screened and labeled, and images containing hot spot defects were divided into training and validation sets in an 8:2 ratio. At the same time, normal samples, which account for about 10% of the total dataset, were added to the training set as background images.

[0066] S2: Construct a feature map cross-computation model.

[0067] Furthermore, such as Figure 2 The diagram shows the feature map cross-computation process. The feature map cross-computation model is constructed by using feature maps x1 and x2 to obtain cross-attention tensors x1' and x2' between feature maps through Cross-Computation.

[0068] Tensors x1' and x2' are concatenated along the channel dimension to obtain tensor x', with dimensions (W×H,B,2C).

[0069] Where B represents the number of input images, C represents the number of channels in the feature map extracted from each image, and W and H represent the width and height of the feature map, respectively.

[0070] Perform Layer Norm normalization on tensor x' to obtain tensor x. LN1 .

[0071] Tensors x' and x LN1 Perform an Additional residual join to obtain the tensor x Add1 .

[0072] Tensor x Add1 Tensor x is obtained through FFN feedforward neural network. FFN .

[0073] For tensor x FFN Perform Layer Norm normalization to obtain tensor x LN2 .

[0074] Tensor x LN2 and x Add1 Perform an Additional residual join to obtain the tensor xAdd2 .

[0075] For tensor x Add2 Perform a dimensionality transformation to obtain the feature map x, with dimensions (B, 2C, W, H).

[0076] It should be noted that the feature maps x1 and x2 are obtained through cross-computation to obtain the cross-attention tensors x1' and x2' between the feature maps. This involves flattening the dimensions (B,C,W,H) of the feature map tensors x1 and x2 in the channel dimension to (B,C,W×H), and then swapping the dimensions to generate tensors T1 and T2 in the dimension (W×H,B,C).

[0077] Embed the corresponding positional encoding PE(·) into tensors T1 and T2 respectively, generating the corresponding tensors T1' and T2' as follows:

[0078] T1'=T1+PE(T1=T1+(W1) Pos T1+b1 Pos )

[0079] T2'=T2+PE(T2)=T2+(W2 Pos T2+b2 Pos )

[0080] Among them, W1 Pos and W2 Pos b1 represents the weight term. Pos and b1 Pos These represent bias terms, all of which are learnable parameters.

[0081] Calculate the qkv tensors corresponding to tensors T1' and T2' respectively, and express them as follows:

[0082] q1 = W1 Q T1'

[0083] k1 = W1 K T1'

[0084] v1 = W1 V T1'

[0085] q2 = W2 Q T2'

[0086] k2 = W2 K T2'

[0087] v2 = W2 V T2'

[0088] Among them, W i Q W i K Wi V i = 1, 2 represent weight terms.

[0089] Calculate the cosine similarity between tensor q1 and tensor k2, and the cosine similarity between tensor q2 and tensor k1, respectively, as follows:

[0090]

[0091] Where τ1 and τ2 are both learnable scalars, b 1,2 and b 2,1 These are learnable bias parameters.

[0092] Calculate the cross-attention score between tensor q1 and tensors k2,v2 to obtain tensor x1'. Calculate the cross-attention score between tensor q2 and tensors k1,v1 to obtain tensor x2', expressed as:

[0093] x1'=Attention(q1,k2,v2)=SoftMax(Sim(q1,k2))v2

[0094] x2'=Attention(q2,k1,v1)=SoftMax(Sim(q2,k1))v1.

[0095] It should also be noted that constructing the feature map cross-computation model also includes calculating the mean μj for each channel c of a tensor x' with dimensions (W×H,B,2C), where there are a total of B samples and 2C channels. c and variance σj c , is represented as:

[0096]

[0097] Normalize each channel of each sample:

[0098]

[0099] Where δ represents a very small positive number, γ c and β c These represent the weight and bias terms of each sample j in the B samples on channel c, respectively.

[0100] For tensors x' and x' of the same dimension LN1 The values ​​are added together along the corresponding dimensions, and the result is expressed as:

[0101] x Add1 =x'+x LN1

[0102] A feedforward neural network consists of two consecutive linear layers, meaning it undergoes two consecutive linear transformations, as follows:

[0103]

[0104] Among them, W1 FFN and Represents the weighted item. and This represents the bias term.

[0105] Tensor x Add2 The dimensional representation (W×H,B,2C) is transformed to be consistent with the dimensional representation (B,C,W,H) of the input feature map, and the tensor x is transformed. Add2 The dimensions are changed to (B, 2C, W×H), and the third dimension W×H is folded into (W, H), finally forming a feature map x with dimensions (B, 2C, W, H).

[0106] S3: Introduce the feature map cross-computation model into the YOLOv5 model.

[0107] Furthermore, the feature map cross-computation model is introduced into the YOLOv5 model and wrapped in the Neck feature fusion network. All Concate modules are replaced with feature map cross-computation modules. The shallow feature maps output by the backbone network are cross-computed with the current deep feature maps to obtain shallow feature semantic information.

[0108] An improved YOLOv5 hotspot detection model is obtained. This model is trained using a pre-defined training and validation set, and the trained model is then used to detect hotspots in the image to be detected, outputting the detection results. After introduction, as follows... Figure 3 The image shown is a diagram of the updated YOLOv5 model framework.

[0109] It should be noted that, in comparison Figure 4 In the original YOLOv5 model framework, all Concate modules in the Neck feature fusion network are replaced with Cross Computation Module (CCM), which performs cross-computation between the shallow feature maps output by the backbone network and the current deep feature maps to obtain richer semantic information of shallow features of small targets.

[0110] Example 2, one embodiment of the present invention, provides a YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiment.

[0111] First, a drone equipped with a dual-light camera was used to inspect photovoltaic modules at multiple angles and heights within a photovoltaic power station setting, collecting infrared images. After image acquisition, the data was filtered based on scene information, removing noisy and blurry images, and the locations of hot spot defects were manually labeled. Finally, a dataset was constructed with a ratio of 8:2 between hot spot defect images and normal images. Approximately 10% of normal samples were added to the training set as background images to improve the model's ability to distinguish small targets.

[0112] A feature map cross-computation model (CCM) is constructed to fuse shallow and deep features through a cross-attention mechanism. Features from different channels of the feature map are expanded and re-encoded, and cross-attention scores are calculated using cosine similarity to achieve information complementarity between features. Layer normalization and residual connections are employed to further optimize feature representation.

[0113] The CCM module is embedded into the Neck feature fusion network of YOLOv5, and the Concate module is replaced with the CCM module, which allows small object information in shallow features to be more effectively transferred to deep features. Based on this, the model is trained using the dataset constructed above. The model training parameters include a learning rate of 0.01, a batch size of 16, and 100 training iterations.

[0114] The hotspot detection performance of the improved model was evaluated using a test set and compared with the original YOLOv5 model. Evaluation metrics included mean accuracy (mAP), false negative rate, and computational efficiency.

[0115] Table 1 Comparison of Experimental Data

[0116]

[0117] The improved YOLOv5 model achieved a mean accuracy (mAP) of 93.2%, a 7.8 percentage point improvement over the original YOLOv5 model's 85.4%. This demonstrates that by introducing a feature map cross-computation module, the model can more efficiently fuse shallow and deep feature information, performing particularly well in complex scenarios.

[0118] In terms of the false negative rate, the improved YOLOv5 model decreased from 12.8% in the original model to 5.1%. This improvement is attributed to the feature map cross-computation module, which effectively enhances the model's ability to detect small target hotspots, thereby reducing the risk of false negatives.

[0119] In terms of small target detection accuracy, the improved model achieved 90.5%, a significant improvement compared to the original model's 78.6%. This indicates that the full utilization of shallow features and the cross-computation mechanism effectively address the problem of insufficient small target recognition capability in existing methods.

[0120] The improved YOLOv5 model maintains a detection speed of 42 frames per second, slightly lower than the original model's 45 frames per second, but still meets the real-time requirements of practical applications. Meanwhile, although the number of model parameters and computational resource consumption have increased, the increase is within a reasonable range and does not constitute a bottleneck for practical use.

[0121] Example 3, an embodiment of the present invention, provides a YOLOv5 photovoltaic module hot spot detection system based on feature map cross-fusion, including a data acquisition module, a model building module, and a model fusion module.

[0122] The data acquisition module is used to acquire UAV infrared images of photovoltaic modules and construct a dataset. The model building module is used to construct a feature map cross-computation model. The model fusion module is used to introduce the feature map cross-computation model into the YOLOv5 model.

[0123] If a function 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, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0124] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0125] More specific examples (a non-exhaustive list) of computer-readable media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0126] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc. It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

[0127] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for detecting hot spots in YOLOv5 photovoltaic modules based on feature map cross-fusion, characterized in that, include: Acquire drone infrared images of photovoltaic modules and construct a dataset; Construct a feature map cross-computation model; The construction of the feature map cross-computation model includes feature maps. and pass Cross-computation yields the cross-attention tensor between feature maps. and ; tensor and Perform at the channel dimension splicing to obtain tensors , dimension ; in, Represents the number of input images. This represents the number of channels in the feature map extracted for each image. and These represent the width and height of the feature map, respectively. tensor conduct Layer normalization operation to obtain tensors ; tensor and conduct Residual connection to obtain tensor ; tensor go through Feedforward neural network obtains tensor ; tensor conduct Layer normalization operation to obtain tensors ; tensor and conduct Residual connection to obtain tensor ; tensor Dimension transformation is performed to obtain feature maps , dimension ; The feature map and pass Cross-computation yields the cross-attention tensor between feature maps. and This includes converting the feature map tensors separately. and Dimensions Flattened in the channel dimension And the dimensions are swapped to generate dimensions. tensor and ; tensor and Embed the corresponding position codes respectively Generate the corresponding tensor and Represented as: in, and Represents the weighted item. and These represent bias terms, all of which are learnable parameters. Calculate the tensors separately and corresponding Tensor, represented as: in, Represents the weighted items; Calculate the tensors separately With tensor cosine similarity and tensor With tensor The cosine similarity is expressed as: in, and All are learnable scalars. and These are learnable bias parameters; Computing tensors With tensor The cross-attention score is used to obtain the tensor. ; Calculate tensors With tensor The cross-attention score is used to obtain the tensor. , is represented as: The construction of the feature map cross-computation model also includes targeting dimensions of... tensor There are a total of There are 1 sample, Each channel, for each sample Calculate each channel mean and variance , is represented as: Normalize each channel of each sample: in, It represents a very small positive number. and Represent Each sample in the sample In the passage Weights and biases on the surface; For tensors of the same dimension and The values ​​are added together along the corresponding dimensions, and the result is expressed as: A feedforward neural network consists of two consecutive linear layers, meaning it undergoes two consecutive linear transformations, as follows: in, and Represents the weighted item. and Represents the bias term; tensor Dimensional representation Transformed into a dimensional representation of the input feature map Consistency, tensor Dimensions changed to The third dimension Fold into The final dimension is Feature map ; The feature map cross-computation model is introduced into the YOLOv5 model.

2. The YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion as described in claim 1, characterized in that: The process of acquiring UAV infrared images of photovoltaic modules and constructing a dataset includes using a UAV equipped with a dual-light camera to inspect the photovoltaic modules and acquire UAV infrared images of the photovoltaic modules.

3. The YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion as described in claim 2, characterized in that: The process of acquiring UAV infrared images of photovoltaic modules and constructing a dataset also includes data annotation of the acquired photovoltaic module infrared images, dividing images containing hot spot defects into training and validation sets in an 8:2 ratio, and adding normal samples, which account for 10% of the total dataset, as background images to the training set.

4. The YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion as described in claim 3, characterized in that: The feature map cross-computation model is introduced into the YOLOv5 model and wrapped in the Neck feature fusion network. All Concate modules are replaced with feature map cross-computation modules. The shallow feature maps output by the backbone network are cross-computed with the current deep feature maps to obtain shallow feature semantic information. An improved YOLOv5 hotspot detection model is obtained. The improved YOLOv5 hotspot detection model is trained and output using a predefined training set and validation set. The trained hotspot detection model is then called to perform hotspot detection on the image to be detected, and the hotspot detection results are output.

5. A system employing the YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion as described in any one of claims 1 to 4, characterized in that: It includes a data acquisition module, a model building module, and a model fusion module; The data acquisition module is used to acquire UAV infrared images of photovoltaic modules and construct a dataset; The model building module is used to build a feature map cross-computation model; The model fusion module is used to introduce the feature map cross-computation model into the YOLOv5 model.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion as described in any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the YOLOv5 photovoltaic module hot spot detection method based on feature map cross-fusion as described in any one of claims 1 to 4.