A Method and System for Detecting Photovoltaic Module Electrode Defects Based on Cross-Scale Feature Interaction
By improving the YOLO11n target detection network and combining multi-scale feature enhancement and cross-scale feature interaction, the accuracy and real-time issues in photovoltaic module defect detection are solved, achieving efficient photovoltaic module EL defect detection and localization, which is suitable for industrial deployment.
Patent Information
- Application Number
- CN202611473607.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-21
- Publication Date
- 2026-11-17
AI Technical Summary
Existing photovoltaic module defect detection methods suffer from low accuracy in detecting small targets, insufficient cross-scale feature interaction capabilities, and high false detection rates in complex backgrounds. Furthermore, traditional detection systems lack real-time video stream processing capabilities and graphical interactive functions, making it difficult to meet the needs of industrial deployment.
An improved YOLO11n target detection network was adopted, and the ECA-FPSConv multi-scale feature enhancement module, C2MSLA multi-scale feature extraction module, CSI-FDPN cross-scale feature interaction dynamic pyramid network, and DSHead lightweight decoupled detection head were introduced to achieve high-precision detection and positioning of EL defects in photovoltaic modules.
It improves the detection accuracy of small target defects in complex backgrounds, reduces the false detection rate and false negative rate, and has good engineering application capabilities, supporting real-time video stream processing and graphical interaction.
Smart Images

Figure CN123118599A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of intelligent inspection and computer vision technology for photovoltaic modules, specifically to a method and system for detecting EL defects in photovoltaic modules based on cross-scale feature interaction. Background Technology
[0002] Photovoltaic power generation, as an important form of clean energy, has been widely used. However, during long-term operation, photovoltaic modules are susceptible to defects such as microcracks, grid breaks, black spots, hot spots, and module damage due to factors such as temperature changes, mechanical stress, material aging, environmental pollution, and external impacts. These defects can lead to a decrease in the power generation efficiency of photovoltaic modules and, in severe cases, can cause localized overheating and safety hazards. Therefore, efficient and accurate defect detection of photovoltaic modules is necessary.
[0003] Currently, the main methods for detecting defects in photovoltaic modules include manual inspection, infrared thermal imaging, and traditional image processing methods. Manual inspection relies on the experience of staff and suffers from low efficiency, high subjectivity, and high labor costs. Infrared thermal imaging equipment is expensive, and the results are easily affected by environmental factors. Traditional image processing methods mainly rely on manually designed features, which have poor robustness in complex backgrounds, small targets, and low-contrast scenes, making it difficult to meet the needs of actual industrial inspection.
[0004] In recent years, with the development of deep learning technology, object detection methods based on convolutional neural networks have been gradually applied to the field of industrial vision inspection. Among them, the YOLO series of algorithms are widely used in industrial defect detection tasks due to their characteristics such as fast detection speed, end-to-end structure, and excellent real-time performance. However, existing object detection algorithms still have the following problems in photovoltaic module (EL) defect detection tasks: the target size of photovoltaic panel defects is small and the edges are blurred, making it difficult to achieve accurate positioning; different types of defects have large scale differences, and traditional networks are difficult to achieve effective multi-scale feature fusion; the background texture of photovoltaic module EL (Electroluminescence, EL) images is complex, which easily leads to false detections and false negatives; the classification task and localization task of traditional detection heads are seriously coupled, affecting detection accuracy; existing detection systems lack real-time video stream processing capabilities and graphical interactive functions, making it difficult to meet the needs of industrial deployment.
[0005] Therefore, there is an urgent need for a method and system for detecting electroluminescence defects in photovoltaic modules that takes into account detection accuracy, real-time performance, lightweight deployment capability, and engineering application capability. Summary of the Invention
[0006] The technical problem to be solved by this invention is: how to solve the problems of low detection accuracy of small target defects, insufficient cross-scale feature interaction capability, and high false detection rate in the existing photovoltaic module defect detection process. This invention provides a photovoltaic module EL defect detection method based on cross-scale feature interaction. This method is based on the improved YOLO11n target detection network and introduces the ECA-FPSConv feature enhancement module, the C2MSLA multi-scale feature extraction module, the CSI-FDPN cross-scale feature interaction dynamic pyramid network, and the DSHead lightweight decoupled detection head to achieve high-precision detection and localization of photovoltaic module EL defects.
[0007] The present invention solves the above-mentioned technical problems through the following technical solution, and the present invention includes the following steps:
[0008] S1: Acquire EL images and video stream data of photovoltaic modules. The video stream data includes multiple frames of EL images. Preprocess the EL images.
[0009] S2: Based on the original YOLO11n target detection network, the ECA-FPSConv multi-scale feature enhancement module, the C2MSLA feature extraction module, the CSI-FDPN cross-scale feature interaction dynamic pyramid network and the DSHead lightweight decoupling detection head are introduced to construct an improved YOLO11n target detection network.
[0010] S3: Input the preprocessed EL image into the improved YOLO11n target detection network and output the detection results;
[0011] S4: Analyze and filter the output detection results, and output the category, location and confidence level information of the defects.
[0012] Furthermore, in step S1, the preprocessing includes image size scaling, normalization, data format conversion, and tensor quantization.
[0013] Furthermore, in step S2, the improved YOLO11n target detection network includes a Backbone part, a Neck part, and a DSHead part; after the input EL image undergoes multi-layer feature extraction in the Backbone part, it outputs P3, P4, and P5 multi-scale feature layers, where P3, P4, and P5 represent shallow, medium, and deep feature layers, respectively; the ECA-FPSConv multi-scale feature enhancement module and the C2MSLA feature extraction module are set in the deep feature extraction stage of the Backbone part; the P3, P4, and P5 multi-scale feature layers are input into the CSI-FDPN cross-scale feature interaction dynamic pyramid network, and after feature fusion, they output an enhanced multi-scale feature map, which is then transmitted to the DSHead lightweight decoupled detection head.
[0014] Furthermore, the processing procedure of the ECA-FPSConv multi-scale feature enhancement module is as follows:
[0015] S211: Compress the input channel using 1×1 convolution;
[0016] S212: Cascaded feature extraction is performed using multiple 3×3 dilated convolution branches with shared weights. The dilation rates of the dilated convolutions are set to 1, 3 and 5 respectively to extract multi-scale contextual semantic information.
[0017] S213: At the output of each dilated convolution branch, an ECA channel attention mechanism is introduced. The local interaction relationship between channels is established through global average pooling and one-dimensional convolution. The importance weights of different channels are calculated to enhance the key defect features. The key defect features include the local texture, edges, grayscale changes of the defect area, and the structural difference features between the defect area and the surrounding normal area.
[0018] S214: The outputs of each dilated convolution branch are fused to obtain the enhanced feature map.
[0019] Furthermore, the processing procedure of the C2MSLA feature extraction module is as follows:
[0020] S221: The input features are divided into two parts along the channel dimension. One part is directly output through residual connection, retaining the original feature information; the other part enters the feature extraction branch for deep feature learning.
[0021] S222: In the feature extraction branch, 3×3, 5×5, 7×7 and 9×9 deep convolutional kernels are used to model local regions at different scales in parallel to obtain local context information under different receptive fields;
[0022] S223: The correlation between features at different scales is modeled through a linear attention mechanism to achieve long-distance dependent information exchange, and feature enhancement is performed on the corresponding defective regions to obtain multi-scale attention features;
[0023] S224: Multi-scale attention features are concatenated and fused, and channel integration is achieved through 1×1 convolution to generate an enhanced output feature map.
[0024] Furthermore, the processing procedure of the CSI-FDPN cross-scale feature interaction dynamic pyramid network is as follows:
[0025] S231: Dynamically fuse the P3, P4 and P5 multi-scale feature layers through the CSAI dynamic aggregation module;
[0026] S232: Construct a bidirectional feature diffusion path. The upsampling path propagates deep semantic information to shallow features, while the downsampling path feeds back shallow edge and texture information to deep features, achieving cross-scale feature interaction.
[0027] S233: After bidirectional diffusion, the diffused features are dynamically fused and refined again through the CSAI dynamic aggregation module;
[0028] S234: The final output is the enhanced P3, P4 and P5 multi-scale feature maps.
[0029] Furthermore, in the CSAI dynamic aggregation module, the traditional channel grouping strategy is eliminated, and cross-scale semantic interaction is directly performed on the complete feature representation within a unified feature space. The contribution relationship between shallow detail information and deep semantic information is adjusted through a mid-level semantic guidance mechanism, thereby realizing adaptive cross-scale aggregation and semantic communication between features at different levels.
[0030] Furthermore, the DSHear lightweight decoupled detection head includes a classification branch and a regression branch. The classification branch outputs the defect category probability, and the regression branch outputs the defect bounding box coordinates. The regression branch uses depthwise separable convolution for feature extraction, splitting the standard convolution into channel-wise convolution and point-wise convolution, and combines DistributionFocal Loss to model the discrete probability distribution of the bounding box position. The classification branch uses a 1×1 convolution structure for category prediction. The outputs of the classification branch and the regression branch together constitute the detection result.
[0031] Furthermore, in step S4, the duplicate bounding boxes are filtered by the non-maximum suppression algorithm, and the defect category, bounding box coordinates, defect center point location, defect area, and defect confidence information are output.
[0032] The present invention also provides a photovoltaic module EL defect detection system based on cross-scale feature interaction to implement the above detection method, including an input acquisition module, a defect detection module, a local GUI interaction module, a remote interface module, a video stream management module and a data storage module;
[0033] The input acquisition module is used to acquire photovoltaic module EL images or video stream data;
[0034] The defect detection module, based on the improved YOLO11n target detection network, enables the detection of electroluminescence defects in photovoltaic modules.
[0035] The local GUI interaction module is used to display detection results, configure parameters, control detection and monitor operating status, and to acquire and display GPU utilization, video memory utilization and model inference FPS to reflect the computing resource usage and model inference performance during the operation of the detection system.
[0036] The remote interface module is used to implement HTTP interface communication and MJPEG video stream push;
[0037] The video stream management module is used to implement video stream reading, video frame caching, multi-threaded detection, and video stream lifecycle management.
[0038] The data storage module is used to store the detection result images, defect category information, detection logs, and video source information.
[0039] The present invention also provides a computer program product, including a computer program or computer instructions, which, when executed by a processor, implement the steps of the above-described detection method.
[0040] The present invention has the following advantages over the prior art:
[0041] (1) Based on the improved YOLO11n target detection network, this invention enhances the model’s ability to express the features of microcracks, broken gates and low-contrast defects by introducing the ECA-FPSConv multi-scale feature enhancement module, C2MSLA feature extraction module, CSI-FDPN feature fusion structure and DSHead lightweight decoupling detection head, thereby improving the detection accuracy of small target defects in complex backgrounds.
[0042] (2) This invention achieves cross-level interaction between shallow detail information and deep semantic information through multi-scale dynamic feature fusion and bidirectional feature diffusion mechanism, effectively reducing the false detection rate and false negative rate in complex EL images and improving the robustness of the model.
[0043] (3) The present invention adopts a lightweight decoupled detection head and a depth-separable convolutional structure, which reduces the number of model parameters and computational complexity while ensuring detection accuracy, and improves the model inference speed and edge device deployment capability.
[0044] (4) This invention combines the PySide6 graphical interactive platform with the Flask remote service module to realize real-time display of test results, video stream push, remote access and test log management, and has good engineering application capabilities and industrial deployment value. Attached Figure Description
[0045] Figure 1 This is a schematic diagram of the overall system architecture in an embodiment of the present invention;
[0046] Figure 2 This is a schematic diagram of the photovoltaic module EL defect detection process in an embodiment of the present invention;
[0047] Figure 3 This is a schematic diagram of the overall structure of the improved YOLO11n network in an embodiment of the present invention;
[0048] Figure 4 This is a schematic diagram of the ECA-FPSConv multi-scale feature enhancement module structure in an embodiment of the present invention;
[0049] Figure 5 This is a schematic diagram of the C2MSLA feature extraction module structure in an embodiment of the present invention;
[0050] Figure 6 This is a schematic diagram of the CSI-FDPN feature fusion structure in an embodiment of the present invention;
[0051] Figure 7 This is a schematic diagram of the CSAI cross-scale fusion module structure in an embodiment of the present invention;
[0052] Figure 8 This is a schematic diagram of the DSHead lightweight decoupling detection head structure in an embodiment of the present invention;
[0053] Figure 9 This is a schematic diagram of the GUI (Graphical User Interface) in an embodiment of the present invention;
[0054] Figure 10 This is a schematic diagram of the Flask remote video streaming service architecture in an embodiment of the present invention;
[0055] Figure 11 This is a schematic diagram of the multi-threaded video stream management process in an embodiment of the present invention;
[0056] Figure 12 This is a schematic diagram of the defect detection results in an embodiment of the present invention. Detailed Implementation
[0057] The embodiments of the present invention are described in detail below. These embodiments are implemented based on the technical solution of the present invention, and provide detailed implementation methods and specific operation processes. However, the scope of protection of the present invention is not limited to the following embodiments.
[0058] Example 1
[0059] like Figures 1-9 As shown, this embodiment provides a graphical interactive system for electroluminescence defects in photovoltaic modules based on cross-scale feature interaction, including an input acquisition module, a defect detection module, a local GUI interaction module, a remote interface module, a video stream management module, and a data storage module.
[0060] The system includes an input acquisition module for acquiring electroluminescence (EL) images or video stream data of photovoltaic modules; a defect detection module for detecting and locating defects in photovoltaic modules; a local GUI interaction module for displaying detection results and configuring parameters; a remote interface module for HTTP interface communication and video stream push; a data storage module for storing detection results and managing logs; and a hardware resource monitoring module for real-time monitoring of system operation status.
[0061] like Figure 2 As shown, the photovoltaic module EL defect detection method of this embodiment includes the following steps:
[0062] S1: EL Image and Video Stream Acquisition
[0063] The photovoltaic module EL image and video stream are acquired in real time using drone inspection terminals, industrial camera terminals, USB camera terminals, network video stream terminals, or local image input terminals, and the acquired image data is input into the defect detection module.
[0064] In this embodiment, the system supports multiple input methods, including local video files, RTSP video streams, RTMP video streams, USB cameras, industrial cameras, and drone inspection videos. Video stream reading is implemented using OpenCV, and video frame buffering and real-time reading are completed through multi-threading.
[0065] S2: Image Preprocessing
[0066] The acquired EL images are preprocessed, including image scaling, normalization, data format conversion, and tensor quantization, to meet the input requirements of the improved YOLO11n target detection network.
[0067] In this embodiment, the input image is uniformly adjusted to a size of 640×640, and normalization processing is used to improve the stability of model inference and detection accuracy.
[0068] S3: Construct an improved YOLO11n defect detection algorithm
[0069] like Figure 3 As shown, this embodiment is an improvement on the YOLO11n target detection network. The improved network includes a Backbone part, a Neck part, and a DSHead part.
[0070] The Backbone section includes a Conv convolution module, a C3k2 feature extraction module, an ECA-FPSConv multi-scale feature enhancement module, and a C2MSLA feature extraction module; the Neck section includes a CSI-FDPN cross-scale feature interaction dynamic pyramid network; and the detection head section uses the DSHead lightweight decoupled detection head.
[0071] The input image is first processed by convolution and feature extraction to generate P3, P4 and P5 multi-scale feature layers, which are used for subsequent multi-scale defect detection.
[0072] S4: Defect Detection Reasoning
[0073] Real-time inference detection of input EL images is performed by improving the YOLO11n defect detection algorithm.
[0074] In this embodiment, the input image first undergoes multi-layer convolutional feature extraction in the backbone. In the early stages, the network progressively reduces the feature map resolution and increases the channel dimension through the Conv convolution module and the C3k2 module, thereby extracting basic texture information and edge features. Subsequently, in the deep feature extraction stage, the ECA-FPSConv multi-scale feature enhancement module and the C2MSLA feature extraction module are introduced to enhance the network's ability to express complex EL defect features.
[0075] Among them, such as Figure 4 As shown, the ECA-FPSConv module first compresses the input channels using 1×1 convolutions to reduce model computational complexity. Then, it employs multiple 3×3 dilated convolutions with shared weights for cascaded feature extraction, with dilation rates set to 1, 3, and 5, respectively, to progressively expand the receptive field. Specifically, the dilated convolution with a rate of 1 is primarily used to extract local fine-grained texture, edge, and defect structure information; the dilated convolution with a rate of 3 is used to preserve local spatial details while expanding the receptive field, enhancing the mesoscale contextual association between defect regions and the surrounding background; and the dilated convolution with a rate of 5 further expands the effective receptive field to obtain a larger range of contextual semantic information. Compared to traditional parallel multi-scale convolutional structures, cascaded dilated convolutions can achieve progressive feature enhancement across layers, thereby improving feature representation capabilities.
[0076] An ECA channel attention mechanism is introduced at the output of each dilated convolution. The local interaction relationship between channels is established through global average pooling and one-dimensional convolution. The importance weights of different channels are adaptively calculated, and key features related to the defect target are enhanced. Key defect features include local texture, edges, grayscale changes in the defect area, and structural differences between the defect area and the surrounding normal area. At the same time, background noise and invalid texture information are suppressed, thereby improving the model's ability to represent weak texture defects such as microcracks and broken gates.
[0077] like Figure 5 As shown, the C2MSLA feature extraction module improves upon the C2PSA structure by replacing the PSA feature processing unit with the MSLA multi-scale linear attention feature processing unit, thus forming the C2MSLA feature extraction module. The input features are first processed by the CBS module for feature mapping, resulting in a feature map of size √M×√M×C, where M represents the number of spatial locations in the feature map and C represents the number of feature channels. Subsequently, a Split operation divides the input features into two parts along the channel dimension. One part serves as the feature preservation branch, directly participating in subsequent feature concatenation to retain some original feature information. The other part serves as the feature extraction branch, inputting into the MSLA feature processing unit for deep feature learning.
[0078] In the MSLA feature processing unit, the input features of the feature extraction branch are first further divided into multiple scale features, and local feature extraction is performed using 3×3, 5×5, 7×7, and 9×9 depth convolutions, respectively. Specifically, the 3×3 depth convolution is used to extract local details, edges, and texture features within a smaller receptive field; the 5×5 depth convolution is used to expand the receptive range and obtain medium-scale local contextual information; the 7×7 depth convolution further expands the effective receptive field and is used to establish contextual relationships between the defect region and its surrounding neighborhood; and the 9×9 depth convolution is used to obtain local contextual information within a larger receptive field, thus forming feature representations at different scales. The output of each scale depth convolution is element-wise added to the corresponding input features to form residual features, which are then processed through a ReLU activation function to obtain local features at the corresponding scale.
[0079] Subsequently, the local features at each scale are input into the multi-scale linear attention computation process. For each scale's local features, query features are generated through linear mapping. Key features Sum value characteristics ,in, , and All represent the number of spatial locations. Feature dimension is The characteristic matrix, i.e. Furthermore, through the feature mapping function... To each and Perform feature mapping to obtain and This reduces the computational complexity of the attention calculation process.
[0080] In the process of linear attention calculation, according to Figure 5The matrix operation relationship shown first involves performing matrix multiplication between the key features and value features after feature mapping, resulting in a matrix with dimension [missing information]. The feature relevance matrix is then used; subsequently, the query features after feature mapping are multiplied by the feature relevance matrix to obtain a matrix with dimension [missing information]. The attention characteristics of [the system / entity]. Its linear attention calculation process is expressed as:
[0081]
[0082] in, The result of the matrix operation between key features and value features has a dimension of d×d; This represents the attention feature obtained through linear attention calculation, with a dimension of M×d. Through the above calculation, long-distance dependency modeling and feature information exchange between different spatial locations are achieved without directly constructing an M×M spatial location correlation matrix.
[0083] After completing the linear attention calculations at each scale, the attention features corresponding to different scales are concatenated to form a fused multi-scale feature representation. Then, a 1×1 convolution is used for channel integration, readjusting the channel dimension of the fused features to the target number of channels C, while maintaining the spatial size of the feature map. The final result is a feature representation with the following dimensions: The MSLA output features are then concatenated with the output of the aforementioned feature-preserving branch using a concat function, and further feature fusion and channel integration are performed through the CBS module to obtain the final output features of the C2MSLA module.
[0084] Through the above processing, the C2MSLA module uses 3×3, 5×5, 7×7 and 9×9 different scale depth convolutions to obtain local features under different receptive fields, and establishes long-distance dependencies between different spatial locations through a linear attention mechanism. While retaining some original feature information, it achieves the fusion of multi-scale local features and long-distance dependency information, thereby enhancing the network's ability to express complex EL backgrounds and low-contrast, small-scale defect features.
[0085] In the Neck section, such as Figure 6 As shown, this embodiment proposes a CSI-FDPN multi-scale dynamic aggregation and feature diffusion structure. First, the P3, P4, and P5 multi-scale feature layers are dynamically fused using the CSAI dynamic aggregation module. Specifically, as... Figure 7 As shown, the CSAI module abandons the traditional channel grouping strategy, performs cross-scale semantic interaction on the complete feature representation within a unified feature space, and uses mid-level features as a guide for cross-scale information aggregation. Specifically, the input shallow features, mid-level features, and deep features are denoted as follows: , ,and Where L represents shallow features containing relatively rich local edge and texture information, M represents medium-level features with moderate semantic information, and H represents deep features with strong semantic representation capabilities.
[0086] First, for shallow features 3×3 convolution is used for feature transformation to obtain the processed shallow features; for the middle features... The Sigmoid function is used for mapping to obtain dynamic weights with values ranging from 0 to 1. This is used to characterize the relative contributions of shallow and deep features at different spatial locations; simultaneously, it is used to characterize deep features. Channel adjustment is performed using 1×1 convolution, and its spatial dimensions are adjusted to match those of shallow features using bilinear interpolation. Consistency is achieved, resulting in the transformed deep features. .
[0087] Subsequently, dynamic weights are generated based on the mid-layer features. Adaptive weighting is applied to both shallow and deep features. The shallow features are weighted using... Weighting is applied, and deep features are used (·) Weighting is applied to dynamically adjust the contribution relationship between shallow detail information and deep semantic information based on the mid-level semantic information at different spatial locations. The feature aggregation process can be represented as:
[0088]
[0089] Furthermore, the fusion features The feature transformation is performed through a 1×1 CBS module, and then added element-wise with the mid-layer feature M, so that the mid-layer semantic information participates in the fusion of shallow detail features and deep semantic features. Subsequently, the feature is extracted and non-linearly mapped by a 3×3 depthwise separable convolution, BatchNorm normalization and SiLU activation function, to obtain the output feature of the CSAI dynamic aggregation module.
[0090] Through the above processing, the CSAI module utilizes the dynamic weights generated from the mid-level features M to perform complementary adaptive aggregation of shallow and deep features: when the weights at a specific spatial location... When the weight is large, it increases the contribution of shallow local detail information; when the weight is large, it increases the contribution of shallow local detail information. When the size is small, the contribution of deep semantic information is increased, thereby achieving cross-scale dynamic feature fusion guided by mid-level semantics. Compared with feature fusion methods that use fixed fusion ratios or traditional channel grouping, this structure performs cross-scale interaction on complete feature representations within a unified feature space, and adaptively adjusts the contribution relationship of features at different levels according to the semantic information at different spatial locations, thereby enhancing the semantic communication capability and feature expression capability between different scales.
[0091] Subsequently, the network constructs a bidirectional feature diffusion path: the upsampling path propagates deep semantic information to shallow features to enhance the context awareness of small targets; the downsampling path feeds back shallow edge and texture information to deep features, thereby improving the defect localization accuracy in complex scenes. After bidirectional diffusion, the diffused features are dynamically fused and refined again through the CSAI module, thereby enhancing the model's robustness to complex backgrounds and multi-scale defect targets.
[0092] Finally, CSI-FDPN outputs enhanced feature maps at three scales: P3, P4, and P5, which are then input into the DSHead lightweight decoupled detection head. DSHead predicts the defect category in the features at different scales through a classification branch and predicts the bounding box position of the defect target through a regression branch, thereby obtaining the defect category and bounding box prediction results for each scale.
[0093] like Figure 8 As shown, the DSHear lightweight decoupled detection head includes a classification branch and a regression branch. The classification branch outputs the defect category probability, while the regression branch outputs the defect bounding box coordinates. The regression branch uses depthwise separable convolutions for feature extraction, splitting the standard convolution into channel-wise and pointwise convolutions, thereby reducing the number of model parameters and computational complexity. Meanwhile, the classification branch uses a lightweight 1×1 convolution structure for category prediction to reduce computation and improve real-time inference capabilities.
[0094] In the bounding box regression stage, this embodiment combines Distribution Focal Loss (DFL) to model the discrete probability distribution of the bounding box position, so as to enhance the model's accuracy in locating fuzzy boundaries and small defect targets.
[0095] After the above multi-scale feature extraction, dynamic aggregation and lightweight decoupling detection, the model finally outputs the defect category, defect bounding box coordinates and defect confidence information, realizing high-precision real-time detection of microcracks, broken grids, black spots and low-contrast defects in photovoltaic module EL images.
[0096] S5: Analysis of Detection Results
[0097] The model output results are analyzed.
[0098] In this embodiment, the system uses a non-maximum suppression algorithm to filter duplicate bounding boxes and outputs the defect category, bounding box coordinates, defect center point location, defect area, and defect confidence information.
[0099] S6: Visual display of test results
[0100] like Figure 9 As shown, this embodiment uses a local GUI interaction module built on PySide6 to realize local human-computer interaction and operational status monitoring of the detection system. The local GUI interaction module is used to implement functions such as displaying detection results, controlling video streams, configuring detection parameters, counting defects, querying logs, and monitoring hardware resources.
[0101] During system operation, the local GUI interactive module displays the detection video in real time and draws the bounding box, category name, and confidence information of the defect target on the detection image. At the same time, it displays information such as model inference FPS, GPU utilization, video memory utilization, and system running status, so that operators can keep abreast of the detection process and system operation in real time.
[0102] Among them, video stream control is used to realize the real-time display of detection video and control the detection process; detection parameter configuration is used to set relevant parameters in the detection process; defect number statistics is used to count the number of different types of defects in the current detection process; log query is used to query log information generated during system operation and detection process; hardware resource monitoring is used to obtain and display GPU computing resources and system operating status.
[0103] Furthermore, the local GUI interaction module has hardware resource monitoring capabilities, used to monitor the computing resource usage and model inference performance of the detection system in real time. During detection, it acquires runtime status information such as GPU utilization, video memory utilization, and model inference FPS, and displays the acquired monitoring information on the GUI interface in real time. Specifically, GPU utilization reflects the degree of GPU computing resource usage during model operation, video memory utilization reflects the usage of GPU video memory resources during model inference and video processing, and model inference FPS reflects the speed at which the model completes image inference processing per unit time. By updating the above monitoring information in real time, operators can understand the current computing resource usage and model inference performance of the detection system.
[0104] S7: Remote Interface and Data Storage
[0105] like Figure 10As shown, this embodiment builds a remote interface module based on the Flask framework. The remote interface module corresponds to the remote interface module in the above system and is used to provide remote access and data interaction services based on the HTTP protocol for external terminals or remote systems.
[0106] The remote interface module includes an HTTP interface, a detection start interface, a system status interface, an MJPEG video stream interface, and a remote detection access interface. The HTTP interface is used to enable data communication between the external terminal and the detection system; the detection start interface is used to receive detection start requests sent by the remote terminal; the system status interface is used to return the current operating status of the detection system to the remote terminal; the MJPEG video stream interface is used to provide the remote terminal with a real-time detection video stream; and the remote detection access interface is used to enable the external terminal to remotely access the detection service and detection results.
[0107] The detection result images, defect category information, detection logs, and video stream data generated during the detection process can be stored and managed according to data management needs. The data storage module adopts multiple storage methods, including local file storage, MySQL database storage, and MinIO object storage. Local file storage is used to save images, videos, and logs generated during the detection process; the MySQL database is used to store detection results, system logs, alarm logs, video recordings, and related structured data; and MinIO object storage is used for unified storage and management of detection images, videos, and other object data.
[0108] This embodiment is deployed on a computer terminal device, running on the Windows operating system, using Python as the development language, and implementing model training and inference based on the PyTorch deep learning framework and the Ultralytics YOLO framework. The system supports GPU-accelerated inference, multi-threaded real-time detection, and ONNX model export, and can be widely used in photovoltaic module production testing, laboratory testing, and intelligent operation and maintenance scenarios.
[0109] Performance test results
[0110] In this embodiment, the improved YOLO11n defect detection algorithm of the present invention was trained and tested using the PVEL-AD (EL2021) photovoltaic module electroluminescence defect dataset, and its performance was compared with that of the base model before the improvement. The test results are shown in Table 1.
[0111] Table 1 Test Results
[0112]
[0113] Experimental results show that the improved YOLO11n defect detection algorithm proposed in this invention can effectively improve the detection accuracy of photovoltaic module EL defects while maintaining a low number of parameters and computational complexity. It has good detection performance and engineering application value, especially in complex background, small-scale defect and low-contrast defect scenarios.
[0114] Example 2
[0115] This embodiment is basically the same as Embodiment 1, except that this embodiment adopts a multi-video stream concurrent detection mode.
[0116] In this embodiment, the system simultaneously accesses multiple industrial cameras, RTSP network video streams, or drone inspection video streams through a video stream management module, and performs unified management of each accessed video stream. The video stream management module is used to implement functions such as video stream creation and reading, video frame buffering, video stream status management, video stream stopping, and resource release, thereby performing unified lifecycle management of video streams from different sources.
[0117] Specifically, upon receiving a video stream access request, the video stream management module establishes an independent video stream processing task for the corresponding video stream and establishes a corresponding video reading channel. When the video stream is running normally, it continuously reads video frames and temporarily stores the read video frames in the corresponding frame buffer queue. When the video stream stops, the connection is abnormal, or a stop detection command is received, the corresponding video reading task and related resources are stopped and released, thereby realizing the full-process management of each video stream from access, reading, caching, processing to stopping.
[0118] like Figure 11 As shown, the system first creates an independent video reading thread for each video stream and uses a frame buffer queue to achieve asynchronous reading and caching of video frames, thereby avoiding video reading blocking from affecting model inference efficiency. Subsequently, the defect detection module adopts a multi-threaded inference approach to perform parallel real-time detection of EL images in different video streams.
[0119] During the detection process, each thread independently completes image preprocessing, model inference, detection result parsing, and result visualization, and synchronously transmits the detection results to the GUI interactive interface and remote interface module.
[0120] To improve the real-time detection performance of multiple video streams, this embodiment adopts a GPU shared inference approach and combines it with a dynamic frame rate adjustment strategy to automatically adjust the video stream reading speed according to the GPU utilization rate, thereby improving the overall operational stability of the system.
[0121] This embodiment is applicable to scenarios such as multi-station inspection, multi-area inspection, and centralized monitoring of multiple cameras in photovoltaic module production lines, and can realize synchronous real-time detection and unified management of multiple EL video streams.
[0122] Example 3
[0123] This embodiment is basically the same as Embodiment 1, except that this embodiment adopts the Web remote detection mode.
[0124] In this embodiment, the system builds a remote web service module based on the Flask framework and realizes remote access functionality through an HTTP interface and an MJPEG video stream interface.
[0125] After the system starts, the defect detection module first performs real-time inference detection on the input video stream and renders the detection results in the video frames in real time. Then, the processed video frames are encoded into an MJPEG format video stream by the Flask server and pushed to the client browser in real time via the web interface.
[0126] The client can remotely access system status information, detection result information, hardware resource usage information, and video stream data through the HTTP interface to achieve remote online detection and monitoring.
[0127] Meanwhile, the system uploads the detection result images, defect categories, bounding box coordinates, detection time, video source, and detection log information to the database server for unified storage and management. The database supports MySQL relational database storage and also supports MinIO object storage for large-scale detection image management.
[0128] This embodiment supports functions such as remote video stream access, detection log query, remote detection control, and historical record playback, and can be widely used in scenarios such as remote inspection of photovoltaic power plants, centralized intelligent operation and maintenance, and online monitoring platforms.
[0129] As a preferred implementation, the graphical interaction module can be implemented using graphical interface development frameworks such as PySide6 and Qt, the remote service module can be implemented using service frameworks such as Flask and FastAPI, and the data storage module can be implemented using MySQL database, PostgreSQL database, and object storage system.
[0130] Example 4
[0131] This embodiment uses online EL defect detection in a photovoltaic module production line as a specific application scenario to illustrate the practical application of the photovoltaic module EL defect detection method and system based on cross-scale feature interaction of the present invention.
[0132] During the photovoltaic module manufacturing process, EL images are acquired by EL inspection equipment and transmitted to the defect detection system of this invention. EL images are used to reflect potential defect features inside the photovoltaic cells and modules, including cracks, broken grids, black spots, fragments, and other abnormal areas.
[0133] The production line is equipped with industrial cameras as EL image acquisition devices. The industrial cameras acquire images of the photovoltaic modules passing through the inspection station according to preset acquisition positions, and input the acquired EL images into the acquisition module. When continuous video streaming is used for acquisition, the video stream management module reads the video stream output by the industrial camera and sequentially buffers multiple frames of EL images in the video stream into the corresponding video frame buffer queue.
[0134] The defect detection module obtains the EL image to be detected from the video frame buffer queue, and performs size scaling, normalization, data format conversion and tensor quantization on the obtained EL image to obtain feature data suitable for improving the input of the YOLO11n target detection network.
[0135] Subsequently, the preprocessed EL image is input into the improved YOLO11n object detection network. The backbone performs multi-layer feature extraction on the input EL image and enhances the deep features through the ECA-FPSConv multi-scale feature enhancement module and the C2MSLA feature extraction module to obtain P3, P4 and P5 multi-scale features.
[0136] The P3, P4, and P5 multi-scale features are further input into the CSI-FDPN cross-scale feature interaction dynamic pyramid network. Through the CSAI dynamic aggregation module and the bidirectional feature diffusion process, information interaction and feature fusion between features of different scales are realized, and enhanced P3, P4, and P5 multi-scale features are output.
[0137] The enhanced multi-scale features are input into the DSHear lightweight decoupled detection head, and the classification branch and regression branch respectively complete the defect category prediction and defect bounding box location prediction to obtain the corresponding defect detection results.
[0138] Subsequently, the detection results are analyzed, and a non-maximum suppression algorithm is used to filter out candidate bounding boxes with overlap. Finally, information such as defect category, bounding box coordinates, defect center point location, defect area, and defect confidence level in the EL image of the photovoltaic module are output.
[0139] In this embodiment, when the detection system detects an EL defect in the photovoltaic module, it can display the corresponding EL image, defect bounding box, defect category and confidence information in real time through the local GUI interaction module, and perform statistics on the detection results. At the same time, the detection results and detection video stream can be provided to the remote terminal through the remote interface module, and the detection result image, detection log and video recording can be saved through the data storage module.
[0140] Through the above methods, the present invention can be applied to online detection of EL defects in photovoltaic module production lines, continuously detecting photovoltaic modules during the production process, locating, classifying and recording the detected defects, thereby realizing automated detection and result management of EL defects in photovoltaic modules.
[0141] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A photovoltaic module EL defect detection method based on cross-scale feature interaction, characterized in that, Includes the following steps: S1: Acquire EL images and video stream data of photovoltaic modules. The video stream data includes multiple frames of EL images. Preprocess the EL images. S2: Based on the original YOLO11n target detection network, the ECA-FPSConv multi-scale feature enhancement module, the C2MSLA feature extraction module, the CSI-FDPN cross-scale feature interaction dynamic pyramid network and the DSHead lightweight decoupling detection head are introduced to construct an improved YOLO11n target detection network. S3: Input the preprocessed EL image into the improved YOLO11n target detection network and output the detection results; S4: Analyze and filter the output detection results, and output the category, location and confidence level information of the defects.
2. The photovoltaic module EL defect detection method based on cross-scale feature interaction according to claim 1, characterized in that, In step S1, preprocessing includes image size scaling, normalization, data format conversion, and tensor quantization.
3. The photovoltaic module EL defect detection method based on cross-scale feature interaction according to claim 1, characterized in that, In step S2, the improved YOLO11n target detection network includes a Backbone part, a Neck part, and a DSHear part. After the input EL image undergoes multi-layer feature extraction in the Backbone part, it outputs P3, P4, and P5 multi-scale feature layers, where P3, P4, and P5 represent shallow, medium, and deep feature layers, respectively. The ECA-FPSConv multi-scale feature enhancement module and the C2MSLA feature extraction module are set in the deep feature extraction stage of the Backbone part. The P3, P4, and P5 multi-scale feature layers are input into the CSI-FDPN cross-scale feature interaction dynamic pyramid network, and after feature fusion, they output an enhanced multi-scale feature map, which is then transmitted to the DSHear lightweight decoupled detection head.
4. The photovoltaic module EL defect detection method based on cross-scale feature interaction according to claim 3, characterized in that, The processing procedure of the ECA-FPSConv multi-scale feature enhancement module is as follows: S211: Compress the input channels using 1×1 convolution; S212: Cascaded feature extraction is performed using multiple 3×3 dilated convolution branches with shared weights. The dilation rates of the dilated convolutions are set to 1, 3 and 5 respectively to extract multi-scale contextual semantic information. S213: At the output of each dilated convolution branch, an ECA channel attention mechanism is introduced. The local interaction relationship between channels is established through global average pooling and one-dimensional convolution. The importance weights of different channels are calculated to enhance the key defect features. The key defect features include the local texture, edges, grayscale changes of the defect area, and the structural difference features between the defect area and the surrounding normal area. S214: The outputs of each dilated convolution branch are fused to obtain the enhanced feature map.
5. The photovoltaic module EL defect detection method based on cross-scale feature interaction according to claim 3, characterized in that, The processing procedure of the C2MSLA feature extraction module is as follows: S221: The input features are divided into two parts along the channel dimension. One part is directly output through residual connection, retaining the original feature information; the other part enters the feature extraction branch for deep feature learning. S222: In the feature extraction branch, 3×3, 5×5, 7×7 and 9×9 deep convolutional kernels are used to model local regions at different scales in parallel to obtain local context information under different receptive fields; S223: The correlation between features at different scales is modeled through a linear attention mechanism to achieve long-distance dependent information exchange, and feature enhancement is performed on the corresponding defective regions to obtain multi-scale attention features; S224: Multi-scale attention features are concatenated and fused, and channel integration is achieved through 1×1 convolution to generate an enhanced output feature map.
6. The photovoltaic module EL defect detection method based on cross-scale feature interaction according to claim 3, characterized in that, The processing procedure of the CSI-FDPN cross-scale feature interaction dynamic pyramid network is as follows: S231: Dynamically fuse the P3, P4 and P5 multi-scale feature layers through the CSAI dynamic aggregation module; S232: Construct a bidirectional feature diffusion path. The upsampling path propagates deep semantic information to shallow features, while the downsampling path feeds back shallow edge and texture information to deep features, achieving cross-scale feature interaction. S233: After bidirectional diffusion, the diffused features are dynamically fused and refined again through the CSAI dynamic aggregation module; S234: The final output is the enhanced P3, P4 and P5 multi-scale feature maps.
7. The photovoltaic module EL defect detection method based on cross-scale feature interaction according to claim 6, characterized in that, In the CSAI dynamic aggregation module, the traditional channel grouping strategy is eliminated, and cross-scale semantic interaction is directly performed on the complete feature representation within a unified feature space. The contribution relationship between shallow detail information and deep semantic information is adjusted through a mid-level semantic guidance mechanism to achieve adaptive cross-scale aggregation and semantic communication between features at different levels.
8. The photovoltaic module EL defect detection method based on cross-scale feature interaction according to claim 3, characterized in that, The DSHear lightweight decoupled detection head includes a classification branch and a regression branch. The classification branch outputs the defect category probability, and the regression branch outputs the defect bounding box coordinates. The regression branch uses depthwise separable convolution for feature extraction, splitting the standard convolution into channel-wise convolution and point-wise convolution, and combines Distribution Focal Loss to model the discrete probability distribution of the bounding box position. The classification branch uses a 1×1 convolution structure for category prediction. The outputs of the classification branch and the regression branch together constitute the detection result.
9. The photovoltaic module EL defect detection method based on cross-scale feature interaction according to claim 1, characterized in that, In step S4, the duplicate bounding boxes are filtered by the nonmaximum suppression algorithm, and the defect category, bounding box coordinates, defect center point location, defect area and defect confidence information are output.
10. A photovoltaic module EL defect detection system based on cross-scale feature interaction, characterized in that, The method for implementing the detection method as described in any one of claims 1 to 9 includes an input acquisition module, a defect detection module, a local GUI interaction module, a remote interface module, a video stream management module, and a data storage module. The input acquisition module is used to acquire photovoltaic module EL images or video stream data; The defect detection module, based on the improved YOLO11n target detection network, enables the detection of electroluminescence defects in photovoltaic modules. The local GUI interaction module is used to display detection results, configure parameters, control detection and monitor operating status, and to acquire and display GPU utilization, video memory utilization and model inference FPS to reflect the computing resource usage and model inference performance during the operation of the detection system. The remote interface module is used to implement HTTP interface communication and MJPEG video stream push; The video stream management module is used to implement video stream reading, video frame caching, multi-threaded detection, and video stream lifecycle management. The data storage module is used to store the detection result images, defect category information, detection logs, and video source information.
