Near-infrared defect detection method for photovoltaic panels based on the FBCT-YOLOv8 algorithm Authors: Zhongxing Zhang, Shaotong Pei, Chenlong Hu, Yunpeng Liu, Jie Liu, Guiting Na, Pengda Wang, Jie Mei, Chang Liu, Peizhe Zeng, Lianghui Li Published: 2026 ABSTRACT In near-infrared defect detection of photovoltaic panels, challenges such as significant variations in defect scales, diversity and ambiguity in defect morphology, and difficulty in identifying small defect targets are often encountered. To address these issues, this paper proposes a photovoltaic panel near-infrared defect detection method based on the FBCT-YOLOv8 algorithm.Built upon YOLOv8, the proposed method first introduces omni-dimensional dynamic convolution (ODConv), which adaptively adjusts convolutional characteristics across all dimensions, enabling more precise alignment with input feature distributions and enhancing the extraction of critical information. Subsequently, a lightweight cross-scale feature fusion module (CCFM) is employed to efficiently integrate features at different scales, compensating for the limitations of single-scale features, significantly improving the network’s adaptability to scale variations, and enhancing the detection accuracy of small defects.Furthermore, the dynamic head (DyHead) is adopted to unify attention-based detection heads, thereby improving detection performance. Finally, the InnerWIoU loss function is utilized to adapt to scenarios requiring dynamic adjustment of the loss focus.Experimental results demonstrate that the proposed FBCT-YOLOv8 algorithm reduces GFLOPs to 7.0 while achieving an mAP@50 of 0.91, meeting the real-time performance requirements for near-infrared defect detection of photovoltaic panels. In addition, ablation and comparative experiments further validate the effectiveness and superiority of the proposed method. Introduction With the accelerated global energy transition, photovoltaic (PV) power generation has become a core pillar of clean energy, and its industrial scale continues to expand1. Solar cells, as the key components of PV systems, have a decisive impact on the overall power generation efficiency and service life of modules. During manufacturing, transportation, and installation, solar cells are highly susceptible to various defects, such as microcracks, broken grid lines, and black cores2. These defects not only lead to power losses in modules but may also accelerate their aging and even pose potential fire hazards. Therefore, implementing efficient and precise defect detection is a critical step in ensuring the high-quality development of the PV industry and reducing operation and maintenance costs3. In recent years, automatic inspection technologies based on machine vision have become a mainstream research direction4,5. Electroluminescence (EL) inspection technology analyzes the near-infrared light emitted by solar cells under electrical excitation, enabling intuitive visualization of internal microscopic defects such as cracks, sintering issues, and non-uniform efficiency distribution. As a result, EL inspection has become an indispensable tool for quality control in production lines6–8. Defect detection methods based on EL images have also been widely studied in recent years9–11. Zhang Meng12 proposed the ME-YOLOv5s algorithm as a defect detection method for solar cells. This approach enhances feature extraction through the Jaccard attention mechanism and a bidirectional feature pyramid, optimizes anchor boxes using K-means++, and integrates deformable convolution and Ada-Pool pooling layers into the CSP and SPP modules, enabling real-time and accurate detection of multiple defect types and improving mAP. However, its robustness in complex industrial scenarios—such as varying illumination, contamination, and occlusion—has not been fully validated, and extremely small, faint, or blurred defects may still be missed. Zhang Shuai et al.13 proposed an improved YOLOv5 model that combines a deformable convolutional network (DCNv2) with the Minimum Point Distance Intersection over Union (MPDIoU) loss function. By replacing the original standard convolution C3 module with DCNv2 and substituting the CIoU loss with MPDIoU, the model enhances accuracy and real-time performance in detecting small-sized defects. However, ultra-micro defects may still be overlooked, and complex interferences in electroluminescence (EL) environments are not fully addressed. With the continuous advancement of deep learning and the application of electroluminescence (EL) inspection technology in solar panel defect detection, practical implementations have encountered issues such as varying background complexity among samples and imbalanced label distributions across different defect categories. These challenges have attracted widespread attention from researchers worldwide, leading to numerous related studies. Hong Xiaoxuan14 investigated visual defect detection of polycrystalline silicon photovoltaic cells based on deep learning, proposing the SD-CP framework to generate minority samples and alleviate dataset imbalance. An improved YOLOv8 model (incorporating ODConv and enhanced small-object detection structures) was developed to detect five types of defects. Yang Li et al.15 proposed a re-parameterization-based photovoltaic cell defect detection algorithm, OM-Detector. By designing the OREPANCSPELAN4 module, introducing a multi-scale convolutional attention mechanism, and constructing a re-parameterized feature extraction and fusion module, the method effectively improves detection accuracy while reducing model parameters. However, these studies still have certain limitations. For instance, Hong Xiaoxuan did not specifically enhance weak-feature or low-contrast defects, while Yang Li did not sufficiently address robustness and generalization. For small defects with subtle features, models are prone to false detections and missed detections, and the robust extraction of defect features remains to be further improved. To address the above issues, this paper proposes the FBCT-YOLOv8(Finger, Black core, Crack and Thick line YOLOv8) algorithm. The proposed method is developed based on the YOLOv8 algorithm16 with several improvements. First, ODConv17 is introduced to enhance feature extraction accuracy, thereby improving the network’s learning and representation capabilities and increasing the model’s robustness in detecting photovoltaic module defects. Next, a CCFM18 module is employed in the neck to fuse defect features of solar cells at different scales, enhancing the model’s adaptability to scale variations and its ability to detect small-scale objects. Subsequently, the DyHead19 detection head is adopted to unify scale awareness, spatial awareness, and task awareness, thereby improving detection accuracy and enabling the model to adapt to diverse detection tasks. Finally, the Inner-WIoU20,21 loss function is introduced. This IoU variant incorporates a dynamic focusing mechanism to improve bounding box regression loss, making it suitable for targets with uneven distributions or varying scales, and further enhancing the model’s robustness in detecting photovoltaic defects of different sizes. Experimental results demonstrate that the proposed method effectively improves the recognition performance for various types of photovoltaic module defects. FBCT-YOLOv8 algorithm YOLO22(You Only Look Once) is a single-stage algorithm. YOLOv8, developed by Ultralytics, is part of the YOLO series of object detection algorithms and can be applied to tasks such as image classification, object detection, and instance segmentation. YOLOv8 consists of three main components: the backbone, neck, and head. The backbone is responsible for feature extraction, while the neck, located between the backbone and the head, performs feature fusion and enhancement. The head is a critical component in object detection, as it determines the final detection results. However, YOLOv8 still suffers from insufficient performance in small object detection and poor adaptability to imbalanced samples. Therefore, this paper proposes a novel FBCT-YOLOv8 algorithm based on YOLOv8. The structure of the proposed algorithm is illustrated in Fig. 1. Fig. 1The structure of FBCT-YOLOv8. The structure of FBCT-YOLOv8. This paper introduces several improvements to YOLOv8. First, ODConv, a full-dimensional dynamic convolution, is incorporated into the backbone, which reduces computational cost while enhancing feature extraction. Next, the CCFM module is introduced in the neck to fuse multi-scale features, thereby improving the model’s adaptability to scale variations and its ability to detect small-scale targets. Then, DyHead is adopted to integrate scale awareness, spatial awareness, and task awareness, while incorporating an attention mechanism into the detection head to enhance detection accuracy and efficiency. Finally, the Inner-WIoU loss function is employed to accommodate scenarios requiring dynamic adjustment of the loss focus. CCFM PANet, as the core architecture of the neck in the YOLO series, achieves bidirectional feature fusion. However, in practical scenarios such as photovoltaic module defect detection, it suffers from several limitations: the lack of selective feature fusion allows effective defect features to be easily overwhelmed by noise, and the disconnection in cross-scale feature interaction leads to poor adaptability to multi-scale defects. The CCFM module processes multi-scale features through alignment, attention-based enhancement, and fusion. Specifically, features from different levels are first aligned, then refined to emphasize informative regions, and finally integrated to combine low-level details with high-level semantics. This design improves cross-scale interaction and enhances the representation of small and weak defects. Unlike PANet, the CCFM structure introduces a fusion module containing convolutional layers during the fusion process to integrate features from adjacent scales. CCFM ultimately achieves “precise fusion of effective defect features, suppression of background noise, and a balance between accuracy and efficiency,” making it well-suited for detecting small defects in photovoltaic modules under complex backgrounds. To further improve the detection accuracy of photovoltaic module defects, this paper introduces a lightweight cross-scale feature fusion module—CCFM—into the neck. The proposed feature fusion network is implemented as the CCFM module, which enhances cross-scale feature interaction by integrating low-level details with high-level semantics. It employs attention-based selection and multi-scale fusion to improve the representation of small and weak targets, leading to better detection performance in complex scenarios.The function of the Cross-Scale Feature Fusion Module (CCFM) is to fuse multi-scale features, thereby enhancing the model’s adaptability to scale variations and its ability to detect small-scale objects. This method effectively combines fine-grained image details with contextual information, improving the overall performance of the model. The module was originally proposed in RT-DETR, and its structure is illustrated in Fig. 2. Fig. 2The structure of CCFM. The structure of CCFM. CCFM incorporates multiple fusion blocks with convolutional layers into the fusion pathway. During the feature fusion process, these blocks fuse adjacent features to generate new representations. Each fusion block consists of N RepBlocks, and the outputs from the two paths are fused using element-wise addition. RepBlocks (re-parameterization blocks) are structural modules that use multi-branch architectures during training and convert them into a single equivalent branch during inference. This design improves training flexibility while reducing computational cost and increasing inference efficiency. The RepBlock (re-parameterization module) enhances both the training flexibility and inference efficiency of deep learning models. Through multi-scale feature input and preprocessing, attention-based selection, cross-scale feature interaction, and feature refinement, CCFM improves both the accuracy and efficiency of feature fusion in photovoltaic defect detection. DyHead unified attention mechanism-based detection head Dynamic Head integrates scale awareness, spatial awareness, and task awareness in a unified manner, incorporating an attention mechanism into the object detection head to improve detection performance and efficiency. DyHead is designed as a dynamic detection head that enhances feature representation through multi-dimensional attention. It models interactions across different feature levels, spatial locations, and tasks, allowing the network to adaptively focus on more informative features and improve detection performance in complex scenarios. The structure of DyHead is illustrated in Fig. 3.It consists of scale-aware attention\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\pi _{\mathrm{L}}}$$\end{document}, spatial-aware attention\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\pi _{\mathrm{S}}}$$\end{document}, and task-aware attention\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\pi _{\mathrm{C}}}$$\end{document}. Fig. 3The structure of DyHead. The structure of DyHead. The scale-aware attention module focuses on the feature level (L). It first rescales the feature pyramid to a unified scale to form a three-dimensional tensor F∈RL×S×C, which is then used as the input to the dynamic head. The module employs average pooling, a 1 × 1 convolution, a ReLU activation function, and a hard Sigmoid function. The implementation process of scale-aware attention \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\pi _{\mathrm{L}}}$$\end{document}is as follows:1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\pi _{L} (F) \cdot F = \sigma \left( {f\left( {\frac{1}{{SC}}\sum\limits_{{S,C}} F } \right)} \right) \cdot F$$\end{document} Where\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{f}}\left( \cdot \right)$$\end{document} is a linear function approximated by a 1 × 1 convolution layer, and\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma \left( {\mathrm{x}} \right)$$\end{document} is a hard sigmoid function. F represents the input, while H, W, and C denote the height, width, and number of channels of the intermediate feature map, S = H × W. The spatial-aware attention module focuses on spatial positions (S), emphasizing discriminative regions in the image by aggregating features. It consists of offset learning and a 3 × 3 convolution. The implementation process of spatial-aware attention \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\pi _{\mathrm{S}}}$$\end{document}is as follows:2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\pi _S}\left( F \right) \cdot F=\frac{1}{L}\sum\limits_{{l=1}}^{L} {\sum\limits_{{k=1}}^{K} {{\omega _{l,k}} \cdot F\left( {l;{p_k}+\Delta {p_k};c} \right) \cdot \Delta {m_k}} }$$\end{document} Where K denotes the number of sparse sampling points; pₖ + Δpₖ represents the position after applying the learned spatial offset Δpₖ, which is used to focus on discriminative regions; Δmₖ is the learned importance scalar at the sampling point pₖ. Both parameters are learned from the input features of the intermediate layer F. The task-aware attention module focuses on the channel dimension (C), dynamically enabling or suppressing feature channels to support different tasks. It is implemented using fully connected layers, ReLU activation, and normalization operations. The implementation process of task-aware attention \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\pi _{\mathrm{C}}}$$\end{document} is as follows:3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\pi _C}\left( F \right) \cdot F=\hbox{max} \left( {{\alpha ^1}\left( F \right) \cdot {F_c}+{\beta ^1}\left( F \right),{\alpha ^2}\left( F \right) \cdot {F_c}+{\beta ^2}\left( F \right)} \right)$$\end{document} Where Fc denotes the feature slice of the c-th channel. [α1,α2,β1,β2]T = \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\theta \left( \cdot \right)$$\end{document}is a hyperfunction that learns to control the activation threshold. In this paper, DyHead is adopted. The dynamic head not only improves the accuracy of the detector but also adapts to various detection tasks. ODConv omni-dimensional dynamic convolution To achieve a lightweight design, this paper introduces ODConv into the backbone. The core idea of the ODConv algorithm is to improve the design of convolutional layers in convolutional neural networks (CNNs). In traditional CNNs, convolutional layers typically use fixed and static kernels for feature extraction. In contrast, ODConv proposes a dynamic multi-dimensional attention mechanism in the design of convolutional kernels. ODConv is designed to enhance convolutional feature extraction through multi-dimensional attention. It adaptively adjusts the convolution operation from the spatial, input-channel, output-channel, and kernel dimensions, enabling the network to focus on more informative features. This improves feature representation and helps the model better detect small and complex defects. The most significant innovation of ODConv lies in its multi-dimensional dynamic attention mechanism. Traditional dynamic convolution23 typically introduces dynamism only along a single dimension—the number of convolution kernels—by adaptively combining multiple kernels to match different input features, as illustrated in Fig. 4. ODConv further extends this concept, as shown in Fig. 5. It not only dynamically adjusts the number of convolution kernels, but also takes into account the spatial size of the kernels, as well as the number of input and output channels. In this way, ODConv performs more fine-grained adaptation to the characteristics of the input data, resulting in improved feature extraction capability. Moreover, ODConv adopts a parallel strategy to learn attention across multiple dimensions simultaneously. This approach enhances the network’s efficiency in handling features across different dimensions, while ensuring complementarity and collaboration among them. Fig. 4Traditional dynamic convolution. Traditional dynamic convolution. Fig. 5ODConv. ODConv. ODConv introduces a novel multi-dimensional attention mechanism. Instead of computing a single attention scalar for each convolution kernel, it calculates four types of attention along all four dimensions of the convolution kernel space, respectively:\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha _{si}},{\alpha _{ci}},{\alpha _{fi}},{\alpha _{wi}}$$\end{document} Benefiting from this multi-dimensional design, ODConv is capable of dynamic adjustment across four dimensions: spatial size, number of input channels, number of filters (output channels), and the number of convolution kernels. Through stepwise multiplicative operations, ODConv jointly considers spatial location, input channels, output channels, and kernel quantity during convolution, thereby achieving comprehensive and dynamic modulation of convolution kernels. This fine-grained adjustment enables ODConv to extract key features more accurately and effectively enhances the network’s learning and representation capabilities. InnerWIou loss function YOLOv8 employs a loss function that combines Distribution Focal Loss with CIoU. Although CIoU Loss considers overlap area, center distance, and aspect ratio, its aspect ratio penalty term may over-optimize the bounding box shape. This is particularly problematic for objects with unusual aspect ratios (e.g., extremely slender objects), potentially leading to unstable convergence or regression bias. To address these limitations of CIoU, this paper adopts the Inner-WIoU loss function. The Inner-IoU loss computes IoU using auxiliary bounding boxes. Based on Inner-IoU, WIoU is further incorporated to form Inner-WIoU, which is suitable for scenarios requiring dynamic adjustment of the loss focus, such as detecting targets with uneven distributions or varying scales. A schematic illustration of Inner-IoU is shown in Fig. 6. Fig. 6Inner-Iou schematic. Inner-Iou schematic. Inner-IoU introduces auxiliary bounding boxes, generating boxes of different sizes through scaling factors to compute the loss. The scaling factor ratio is a coefficient used to adjust the magnitude of feature maps, controlling the relative scale of feature responses. It helps enhance important features while suppressing less relevant information, thereby improving feature representation. WIoU proposes an IoU variant with a dynamic focusing mechanism to optimize bounding box regression loss. By applying Inner-IoU within WIoU, the InnerWIoU is formed. Accordingly, the definitions related to InnerWIoU are as follows:4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$b_{l}^{{gt}} = x_{c}^{{gt}} - \frac{{w^{{gt}} *r}}{2},\,b_{r}^{{gt}} = x_{c}^{{gt}} + \frac{{w^{{gt}} *r}}{2}$$\end{document}5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$b_{t}^{{gt}} = y_{c}^{{gt}} - \frac{{h^{{gt}} *r}}{2},\,b_{b}^{{gt}} = y_{c}^{{gt}} + \frac{{h^{{gt}} *r}}{2}$$\end{document}6\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${b_l}={x_c} - \frac{{w*r}}{2},{b_r}={x_c}+\frac{{w*r}}{2}$$\end{document}7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${b_t}={y_c} - \frac{{h*r}}{2},{b_b}={y_c}+\frac{{h*r}}{2}$$\end{document}8\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{gathered} \operatorname{int} er=\left( {\hbox{min} \left( {b_{r}^{{gt}},{b_r}} \right) - \hbox{max} \left( {b_{l}^{{gt}},{b_l}} \right)} \right)* \hfill \\ \left( {\hbox{min} \left( {b_{b}^{{gt}},{b_b}} \right) - \hbox{max} \left( {b_{t}^{{gt}},{b_t}} \right)} \right) \hfill \\ \end{gathered}$$\end{document}9\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$union=\left( {{w^{gt}}*{h^{gt}}} \right)*{r^2}+\left( {w*h} \right)*{r^2} - \operatorname{int} er$$\end{document}10\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Io{U^{inner}}=\frac{{\operatorname{int} er}}{{union}}$$\end{document}11\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{gathered} WIoU=IoU{\mathrm{foundation}} \hfill \\ +{\mathrm{d}}ynamic{\text{ }}focusing{\text{ }}mechanism \hfill \\ \end{gathered}$$\end{document} The definitions of the variables can be found in reference20. Experiments Dataset generation This experiment uses the PVEL-AD dataset24 jointly released by Hebei University of Technology and Beihang University, also known as the EL2021 dataset, which is designed for benchmarking photovoltaic module defect detection methods. The PVEL-AD dataset contains 36,543 near-infrared images with various internal defects and heterogeneous backgrounds, including one class of normal images and 12 categories of abnormal defects, such as cracks (linear and star-shaped), broken grid lines, black cores, vertical dislocation, horizontal misalignment, thick lines, scratches, fragments, corner breakage, short circuits, and printing errors. Based on the data distribution characteristics and the specific requirements of this study, four types of defects—finger (broken grid lines), black core, crack, and thick line—were selected from the original dataset. The selected defects were chosen due to their relatively larger number of samples in the dataset, which ensures sufficient data for reliable training and evaluation. Including defect types with very limited samples may lead to data imbalance and affect the stability and objectivity of the results.A total of 4,500 images were used, which were divided into training, validation, and test sets in a ratio of 8:1:1, corresponding to 3,600 training images, 450 validation images, and 450 test images. The dataset details are shown in Table 1. Table 1The types of dataset.ClassNumber of imagesfinger1506black core1011crack969thick line775defect-free843 Table 1The types of dataset.ClassNumber of imagesfinger1506black core1011crack969thick line775defect-free843 The types of dataset. Performance evaluation metrics The experiment adopts mean Average Precision (mAP), GFLOPs, number of parameters, model size and FPS as evaluation metrics for assessing detection performance. The specific formula for mAP is as follows:12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Precision=TP/\left( {TP+FP} \right)$$\end{document}13Recall=TP/(TP+FN)14\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left\{ \begin{gathered} {\mathrm{AP}}=\sum\limits_{{{\mathrm{k}}=0}}^{{k=n - 1}} {[\operatorname{Re} calls(k)} - \operatorname{Re} calls(k+1)]*\Pr ecisions(k) \hfill \\ \operatorname{Re} calls(n)=0,\Pr ecisions(n)=1 \hfill \\ \end{gathered} \right.$$\end{document} n=threshold quantity15\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$mAP=\frac{1}{n}\sum\limits_{{k=1}}^{{k=n}} {A{P_k}}$$\end{document} In the formula, TP represents the number of correctly identified positive samples. FP denotes the number of negative samples incorrectly classified as positive (false positives). FN refers to the number of positive samples that are missed (false negatives). APₖ is the average precision for class k, and n represents the total number of classes. Experimental environment setup and network training Experimental environment setup The experimental environment is configured as follows: the operating system is Windows Server 2019 Datacenter; the CPU is an Intel® Xeon® CPU E5-2697 v2 @ 2.70 GHz; the GPU is an NVIDIA GeForce GTX 1080 Ti; the programming language is Python 3.9.23; the deep learning framework is PyTorch 2.0.1; and the CUDA parallel computing platform version is 11.8. The training parameters are set to epochs = 100 and batch size = 32. Network training Ablation study To verify the effectiveness of each improvement in the FBCT-YOLOv8 algorithm, this paper uses YOLOv8 as the baseline. Under the same training procedures, hyperparameters, and experimental environment, CCFM, DyHead, ODConv, and InnerWIoU are added sequentially. The experimental results are shown in Table 2. Table 2FBCT-YOLOv8 Ablation Experiment Results.numberYOLOv8CCFMDyHeadODConvInnerWIoumAP50(all)GFLOPsNumber of parametersModel size/MBFPS (frames per second)1√0.8888.13,006,4286.35002√√0.8966.61,965,2764.2555.563√√√0.917.42,362,6565.058.484√√√√0.9087.03,481,5627.256.505√√√√√0.917.03,481,5627.257.47 Table 2FBCT-YOLOv8 Ablation Experiment Results.numberYOLOv8CCFMDyHeadODConvInnerWIoumAP50(all)GFLOPsNumber of parametersModel size/MBFPS (frames per second)1√0.8888.13,006,4286.35002√√0.8966.61,965,2764.2555.563√√√0.917.42,362,6565.058.484√√√√0.9087.03,481,5627.256.505√√√√√0.917.03,481,5627.257.47 FBCT-YOLOv8 Ablation Experiment Results. As shown in Table 2, the three improvements proposed in this paper lead to an overall increase in mAP. The GFLOPs of the FBCT-YOLOv8 algorithm are lower than those of YOLOv8, achieving model lightweighting. Specifically, mAP increases from 0.888 to 0.91, an improvement of 0.022, while GFLOPs decrease from 8.1 to 7.0. In the ablation study, CCFM is first introduced, raising mAP to 0.896, significantly improving detection accuracy while substantially reducing model size and parameter count. Next, DyHead is applied. Since its output channels are consistent with those of CCFM, combining the two enables effective feature fusion, further improving accuracy and enhancing model efficiency. Subsequently, ODConv is introduced, which slightly reduces mAP but significantly lowers GFLOPs, contributing to a more lightweight model. Finally, InnerWIoU is incorporated, resulting in an increase in mAP. Ultimately, mAP reaches 0.91 (an improvement of approximately 2.48%), while GFLOPs decrease to 7.0, demonstrating the effectiveness of the FBCT-YOLOv8 algorithm in photovoltaic defect detection. Detection algorithm comparison experiment To comprehensively validate the effectiveness of the proposed method, this paper conducts comparative experiments with several mainstream defect detection algorithms. Under the same training settings, the proposed FBCT-YOLOv8 algorithm and other object detection algorithms are trained and evaluated. The comparison results are shown in Table 3. Table 3Results of the comparative experiment.AlgorithmmAP50(all)GFLOPsNumber of parametersModel size/MBFPS (frames per second)YOLOv8160.8888.13,006,4286.3500YOLOv50.8867.12,503,7245.3454.55YOLOv6250.89211.84,234,1408.7434.78YOLOv9c0.903102.325,322,33251.660.24YOLOv10n260.8666.52,265,9485.8400YOLOv110.8836.32,582,9325.5454.55YOLOv120.8796.32,557,5085.5238.10Faster-RCNN270.594579.241,390,53165.14BCS-YOLOv8280.8956.232,213,00012.30270YOLO-SCD290.89711.32,670,0005.790.03FBCT-YOLOv80.917.03,481,5627.257.47 Table 3Results of the comparative experiment.AlgorithmmAP50(all)GFLOPsNumber of parametersModel size/MBFPS (frames per second)YOLOv8160.8888.13,006,4286.3500YOLOv50.8867.12,503,7245.3454.55YOLOv6250.89211.84,234,1408.7434.78YOLOv9c0.903102.325,322,33251.660.24YOLOv10n260.8666.52,265,9485.8400YOLOv110.8836.32,582,9325.5454.55YOLOv120.8796.32,557,5085.5238.10Faster-RCNN270.594579.241,390,53165.14BCS-YOLOv8280.8956.232,213,00012.30270YOLO-SCD290.89711.32,670,0005.790.03FBCT-YOLOv80.917.03,481,5627.257.47 Results of the comparative experiment. As shown in Table 3, the FBCT-YOLOv8 algorithm achieves the highest detection accuracy while maintaining sufficient lightweight characteristics. In the comparison experiments, YOLOv9c attains relatively high accuracy but with significantly higher GFLOPs; YOLOv11 and YOLOv12 have lower GFLOPs but much lower accuracy. Therefore, FBCT-YOLOv8 effectively balances real-time performance and accuracy, demonstrating strong recognition capability and meeting the requirements of near-infrared image-based photovoltaic defect detection. Heatmap experiment To evaluate the application of the FBCT-YOLOv8 algorithm in fault detection, heatmaps are employed. Different color intensities in the heatmap represent the weight of each region—the higher the weight, the greater the region’s contribution and response to the network. The image selected for heatmap comparison are shown in Fig. 7. Fig. 7Image selected for the heat map comparison experiment. Image selected for the heat map comparison experiment. The heatmaps generated by different networks are shown in Fig. 8. Figure 8a presents the heatmap produced by the YOLOv8 algorithm, where the network’s attention is relatively scattered, and some local regions have excessively high weights that are not focused on the defects. Figure 8b shows the YOLOv8 algorithm after introducing CCFM, where attention begins to become more focused, but is still not concentrated on the defects. Figure 8c illustrates the result after adding DyHead, where part of the attention is concentrated on cracks, but non-defective regions still have relatively high weights. Figure 8d shows the result after further introducing ODConv, while Fig. 8e presents the heatmap of the proposed method. In this case, most of the attention is concentrated on the crack regions, demonstrating the effectiveness of the improved algorithm. Fig. 8Heat maps output by different networks.(a) YOLOv8, (b)CCFM, (c)CCFM+DyHead, (d)CCFM+DyHead+ODConv(2ge), (e)FBCT-YOLOv8 Heat maps output by different networks.(a) YOLOv8, (b)CCFM, (c)CCFM+DyHead, (d)CCFM+DyHead+ODConv(2ge), (e)FBCT-YOLOv8 Visualization of detection results To further evaluate the effectiveness of the proposed method, a detection result visualization experiment is conducted. By presenting qualitative detection results, the model’s ability to accurately locate and identify defects in complex scenarios can be intuitively demonstrated. This experiment highlights the model’s performance in detecting small and weak defects, as well as its robustness. The detection results are shown in Fig. 9. Fig. 9detection effect diagrams of FBCT-YOLOv8 algorithm. (a)finger, (b)black core, (c)crack, (d)thick line. detection effect diagrams of FBCT-YOLOv8 algorithm. (a)finger, (b)black core, (c)crack, (d)thick line. As shown in Fig. 9, the proposed FBCT-YOLOv8 algorithm achieves excellent detection performance. It can effectively detect photovoltaic panel defects even when the target size is small, demonstrating the practical effectiveness of the proposed method. Conclusion To address the requirements of near-infrared image-based photovoltaic defect detection and improve robustness under different conditions, this paper proposes the FBCT-YOLOv8 algorithm based on YOLOv8 and validates it through experiments on a defect dataset. A photovoltaic defect detection method based on the FBCT-YOLOv8 algorithm is proposed. Compared with the original YOLOv8, it achieves an average mAP improvement of 2.48%, demonstrating the effectiveness of the method. The PVEL-AD dataset is adopted, and four types of defects are selected through statistical analysis to construct a near-infrared photovoltaic defect dataset. And then ablation experiments, comparative experiments, and heatmap analyses are conducted. The results show that the proposed FBCT-YOLOv8 algorithm achieves superior accuracy while reducing GFLOPs, effectively enabling accurate detection of photovoltaic defects in near-infrared images.