Skip to main content
PLOS One logoLink to PLOS One
. 2024 Dec 12;19(12):e0315424. doi: 10.1371/journal.pone.0315424

PCB defect detection based on pseudo-inverse transformation and YOLOv5

Xiaoli Wang 1,2,*, Siti Sarah Maidin 2, Malathy Batumalay 2
Editor: Azim Uddin3
PMCID: PMC11637289  PMID: 39666652

Abstract

With the development of integrated circuit packaging technology, the layout of printed circuit boards has become complicated. Moreover, the traditional defect detection methods have been difficult to meet the requirements of high precision. Therefore, in order to solve the problem of low efficiency in defect detection of printed circuit boards, a defect detection method based on pseudo-inverse transform and improved YOLOv5 is proposed. Firstly, a defect image restoration model is constructed to improve image clarity. Secondly, Transformer is introduced to improve YOLOv5, and the batch normalization and network loss function are optimized. These methods improve the speed and accuracy of PCB defect detection. Experimental verification showed that the restoration speed of the image restoration model was 37.60%-42.38% higher than other methods. Compared with other models, the proposed PCB defect detection model had an average increase of 10.90% in recall and 12.87% in average detection accuracy. The average detection accuracy of six types of defects in the self-made PCB data set was over 98.52%, and the average detection accuracy was as high as 99.1%. The results demonstrate that the proposed method can enhance the quality of image processing and optimize YOLOv5 to improve the accuracy of detecting defects in printed circuit boards. This method is demonstrably more effective than existing technology, offering significant value and potential for application in industrial contexts. Its promotion could facilitate the advancement of industrial automation manufacturing.

1. Introduction

With the continuous development of industrial automation manufacturing, integrated circuit packaging technology (ICPT) has gradually become the core of global economic development. Among them, printed circuit board (PCB), as an important electronic component in ICPT, undertakes the support and line connection of electronic components [1,2]. However, the rapid development of ICPT has resulted in more complex and dense PCB circuit design. Traditional PCB defect detection (PCB-DD) methods have been difficult to meet the fine PCB layout and high precision requirements of manufacturing companies. Automated PCB-DD has new possibilities due to the development of intelligent technologies such as deep learning (DL) [3].

To solve the low effectiveness of PCB object detection (OD) based on deep neural networks (DNN), C. J. Li et al. developed a PCB-DD approach based on extended feature pyramid network model. The results revealed that the average accuracy (AP) of the publicly available PCB dataset was 96.2% [4]. To overcome the problem of defects caused by pins in PCBs being fixtured, M. Jeon et al. proposed a non-contact inspection method based on thermal image comparison and DL analysis. Real-time detection and localization of high-precision PCB defective parts was achieved by using structural similarity index maps for regular OD and feature regions of convolutional neural network (CNN) and autoencoder for analysis [5]. A DNN-based PCB detection model was presented by M. A. Alghassab et al. to increase the effectiveness of image processing methods in PCB-DD. In a publicly available PCB dataset, feature extraction and classification were carried out by pre-training CNNs, yielding an accuracy of 94.11% for annoyance [6]. An Atlas spatial pyramid pooling-balanced feature pyramid network was proposed by N. Zeng et al. to enhance tiny target identification performance. Through contextual information linkage, the study enhanced the detection efficiency of tiny surface defects on PCBs by employing Atrus convolution operators with varying expansion rates [7]. M. Yuan et al. proposed an improved you only look once version 5 (YOLOv5) network for the challenge of accurately identifying tiny defects on the surface of PCBs in complex contexts. To achieve an AP of 98.6% in the PCB public dataset, the study enhanced the network’s feature extraction capability by using HorNet and improved the attention module and sampling layer of YOLOv5 by using multiple convolutional block attention module and content-aware feature reorganization [8].

YOLOv5, a computer vision target detection DL model, is one of the you only look once (YOLO) series that can achieve accurate and efficient real-time target detection [9]. Scholars in related fields have examined OD research from a variety of angles. Z. Liu et al. proposed an enhanced OD method for the YOLOv5 UAV shooting scene, aiming to address the issues of a large number of dense small objects in high-altitude shooting and the complicated background noise interference in the shooting scene. The network’s detection effectiveness for medium- and long-range objects was increased by convolutionally generating adaptive weights for various sensory field features and improving spatial pyramid pooling for feature augmentation [10]. A millimeter-wave radar and vision fusion method was proposed by Y. Song et al. for OD in response to the low efficacy of multi-sensor fusion. To maximize the utilization of sensor information and improve detection accuracy (DA), the radar data was processed using a mapping transform neural network based on YOLOv5, bringing the radar and visual data to the same scale [11]. M. Sadiq et al. proposed a combined region-based CNN and YOLOv5 for safety helmet detection for construction site workers. A robust model was constructed by fusing YOLOv5 and fuzzy image enhancement, which led to separate detection of safety helmets from other types of helmets and was applied in real-world scenarios [12]. The training procedure is hampered by the common branching of the YOLOv5 head’s classification and regression tasks, as well as by flaws like the poor association between the classification score and localization accuracy. To address this problem, H. Wan et al. proposed the intersection over union (IoU) perceptually decoupled head for improving YOLOv5. The study significantly improved the model’s localization accuracy for real-time OD [13].

Combined with the above, it can be concluded that related scholars have conducted various researches on PCB-DD, and the DL-based defect detection (DD) method has also been widely applied in PCB-DD. Nevertheless, PCB introduces some noise during the picture capture process, which results in lost feature information when combining features based on anchor frames. Moreover, YOLOv5 is prone to ignore the C5 feature map (size: 20×20, channel: 1024) in the feature map generation process of tiny target detection. To improve the PCB-DD performance, the study suggests a pseudo-inverse transform (PIT) and a PCB-DD approach based on YOLOv5 in order to overcome the aforementioned issues and challenges. The study first innovatively proposes a PIT-based image restoration (IR) model for PCB defective images and improves YOLOv5 using Transformer. At the same time, the normalization processing layer and loss function of YOLOv5 are improved to enhance the DA of the PCB-DD model.

An IR model based on PIT is developed to improve the clarity of PCB defect images. By combining total variation (TV) and shear transformation (ST), this model effectively removes image noise and preserves important details. At the same time, Transformer is introduced to improve YOLOv5, which enhances the ability to extract model features, thus improving the ability to identify PCB defects. By optimizing the batch normalization (BN) and loss function in YOLOv5, the DA of the model is improved. The PCB-DD method proposed in this study has important application value and significance in the actual PCB-DD field, which is conducive to improving the efficiency and accuracy of PCB-DD in the manufacturing industry. The research not only advances the theoretical development of PCB-DDtechnology but also demonstrates clear practical advantages, offering an efficient and precise solution for the detection of defects in industrial automation manufacturing.

2. Methods and materials

To realize high-precision PCB-DD, the study firstly carries out PCB image restoration (PCB-IR) algorithm design on the basis of PIT. Secondly, Transformer is used to improve YOLOv5, and the normalization processing layer and loss function of YOLOv5 are improved, so as to construct the improved Transformer-YOLOv5 (T-YOLOv5) PCB-DD model. Finally, the production of PCB-DD dataset is carried out.

2.1. PCB image restoration model based on PIT

TV model is commonly used in image preprocessing for PCB-DD, which recovers the image by filtering and regularization [14]. Among them, filtering mainly removes the noise in the image by using a specific filter function. Whereas, regularization is used for noise removal and detail recovery by constructing a model [15]. The regularization expression formula for the TV model is shown in Eq (1).

minp12Bp22+γAp1 (1)

In Eq (1), p denotes the image to be recovered and denotes the damaged image. 12Bp22 denotes the fidelity term and B denotes the observation matrix. γ denotes the regularity term parameter and ‖Ap1 denotes the TV regularity term. A denotes the discrete gradient operator. When the observation matrix B is irreversible, it leads to poor detail recovery of the image. In addition, a single TV regular term cannot take into account the balance between noise removal and detail preservation. Therefore, the study improves the TV and proposes a TV-ST bi-regularized image restoration (TSBRIR) method. Firstly, the study improves the TV regularization using ST to construct a PCB-IR model. The specific objective function (OF) expression is shown in Eq (2).

f(p)=12Bp22+γ1Ap1+γ2r=1NCrp1 (2)

In Eq (2), f(p) is the OF of the PCB-IR model. γ1 and γ2 are the parameters of the TV regular term and ST regular term, respectively. N denotes the total number of ST subbands at p non-downsampling. r denotes the number of ST subbands at p non-downsampling. Cr denotes a block cyclic matrix. r=1NCrp1 denotes an ST regular term. Moreover, PIT is introduced to improve the TV fidelity term to obtain the expression formula of the PCB-IR model. In mathematics, if a matrix with the same number of rows and columns is reversible, it has an inverse matrix. Therefore, the result of multiplying the matrix with its inverse matrix is the identity matrix. However, for non-square matrices or irreversible square matrices (such as singular matrices), the inverse cannot be obtained directly. At present, PIT can be used to solve this problem. PIT is not only applicable to irreversible matrices, but also to invertible matrices. Specifically, it is shown in Eq (3).

{minp,˜12(ϑa+)2˜p22+γ1Ap1+γ2r=1NCrp1˜=Bs.t.B˜= (3)

In Eq (3), ˜ denotes an auxiliary variable and B denotes the pseudo-inverse of the observation matrix B. a denotes a vector of Gaussian random variables with mean 0, and ϑa denotes the standard deviation. ℘ denotes a parameter that avoids a standard deviation of 0. 12(ϑa+)2˜p22 denotes the pseudo-inverse fidelity term. For solving the constrained minimum optimization Eq (3), the study solves the OF of the PCB image restoration model based on the framework of the split Bregman (SB) algorithm and uses the adaptive threshold function to compute the sub-problems corresponding to the TV regular terms in the solution process. As an optimization algorithm, the SB algorithm is commonly used to solve sparse problems with global convergence property and desirable convergence speed [16,17]. The auxiliary variables b and ωr are first introduced to improve Eq (3) such that b = Ap, ωr = Crp. Specifically as shown in Eq (4).

minp,˜,b,ωr12(ϑa+)2˜p22+γ1b1+γ2r=1Nωr1 (4)

Next, the Bregman distances dk and (dr)k are introduced to convert Eq (4) to what is shown in Eq (5).

(pk+1,(ωr)k+1,bk+1,˜k+1)=argminp,˜,b,ωr12(ϑa+)2˜p22+γ1b1+γ2r=1Nωr1+12bApdk)22+22r=1NωrCrp(dr)k22 (5)

In Eq (5), ℘1 and ℘2 denote the parameters that prevent the standard deviation from being zero. k is the images. Solving Eq (5) in the framework of the SB algorithm transforms the optimization problem of minimizing the OF of the improved model into four subproblems, as shown in Eq (6).

{pk+1=argminp12(ϑa+)2˜p22+12bApdk22+22r=1NωrCrp(dr)k22(ωr)k+1=argminωrγ2ωr1+22(ωr)kCrpk+1(dr)k22bk+1=argminbγ1b1+12bApk+1dk22˜k+1=argmin˜12(ϑa+)2˜pk+122 (6)

In Eq (6), pk+1 denotes the transformed subproblem 1. (ωr)k+1 denotes the transformed subproblem 2. bk+1 denotes the transformed subproblem 3. ˜k+1 denotes the transformed subproblem 4. Based on the four subproblems obtained from the transformation, a step-by-step solution is performed. First, subproblem 1 pk+1 is solved by taking the derivative of the right-hand side of the equation and making it equal to 0, as shown in Eq (7).

(I+(2*(ϑa+)2)ATA+(2*(ϑa+)2)r=1NCrTCr)p=˜k+(2*(ϑa+)2)AT(bkdk)+(2*(ϑa+)2)r=1NCrT((ωr)k(dr)k) (7)

In Eq (7), the matrix transpose is denoted by T and the unit matrix is denoted by I. The study utilizes the conjugate gradient method to solve Eq (7), and the solution is the value of subproblem 1 pk+1. Next, subproblem 2 (ωr)k+1 is solved using the soft threshold function. The specific expression is shown in Eq (8).

(ωr)k+1=shrink(Crpk+1+(dr)k,γ22) (8)

In Eq (8), shrink(·) denotes the soft threshold function. On this basis, solve subproblem 3 bk+1. Since subproblem 3 is a subproblem about denoising the TV regular term, and the soft threshold function processed values will produce errors with the original values, it is investigated to introduce a nonlinear function for asymptotic compression of the threshold value to remove the errors [18]. The specific formula is shown in Eq (9).

{(bk+1)i=Ψ((Apk+1+dk)i,γ11)Ψ(ϖ,w)={sign(ϖ)×(|ϖ|w+w2λ+1),|ϖ|w(ϖ)2λ+1(2λ+1)×(w)2λ+1,|ϖ|<w (9)

In Eq (9), λ denotes the regulating factor and (*)i denotes a definite element in *. Ψ(·) denotes the nonlinear function, and ϖ and w denote the two input vectors in the nonlinear function. sign(·) denotes the symbolic function. To achieve better denoising effect, the dynamic adjustment of the threshold function value can be realized by adjusting λ. At the same time, the subproblem 4 ˜k+1 is solved. The specific expression formula is shown in Eq (10).

˜k+1=B+(IBB)pk+1 (10)

After solving all the subproblems, the Bregman distance is updated and the cutoff condition is set. The specific expression formula is shown in Eq (11).

{dk+1=dk+Apk+1bk+1(dr)k+1=(dr)k+Crpk+1(ωr)k+1pk+1pk22/pk22<θ (11)

In Eq (8), θ denotes the cutoff condition. Combining the above, when the TV regular term is anisotropic TV or isotropic TV, the computational flow is shown in Fig 1.

Fig 1. Pseudo-inverse transform-based PCB image restoration model solving process.

Fig 1

In Fig 1, the SB algorithm is first initialized and the parameters, conditioning factors, and cutoff conditions for model solving are set. Secondly, it solves the four subproblems of the transformation and updates the Bregman distance. When the solved subproblems satisfy the cutoff condition, the output of PCB recovery image is performed. On the contrary, the 4 sub-problems solving is repeated in order to find the optimal solution. It is worth mentioning that when the TV regular term is anisotropic TV or isotropic TV, the expression of subproblem 1 is updated as shown in Eq (12).

(I+(2*(ϑa+)2)[(Ao)TAo+(Aq)TAq]+(2*(ϑa+)2)r=1NCrTCr)p=˜k+(2*(ϑa+)2)(Aq)T((bq)k(dq)k)+(2*(ϑa+)2)(Ao)T((bo)k(do)k)+(2*(ϑa+)2)r=1NCrT((ωr)k(dr)k) (12)

In Eq (12), Aodenotes the horizontal gradient and Aq denotes the vertical gradient. o and q denote the conjugate gradient, respectively. In addition, when the TV regular term is isotropic TV, subproblem 3 also needs to be further updated as shown in Eq (13).

{((bq)k+1)i=Ψ((κ)i,γ11)Aqpk+1+(dq)kκ((bo)k+1)i=Ψ((κ)i,γ11)Aopk+1+(do)kκ (13)

In Eq (13), κ denotes the square root of the sum of squares of the conjugate gradients. Although Fourier transform and wavelet based methods are very effective in image processing, they usually need to make a global assumption about the image degradation process, such as assuming that the image degradation is linear and shift invariant. PIT can be directly adapted to specific degradation models, such as fuzzy kernel, making it more effective in dealing with specific types of degradation. The degradation characteristics of PCB images vary due to differences in manufacturing processes and conditions. PIT is capable of adapting to these changes because it is not based on a fixed transformation basis but rather on the specific information of images and the degradation process itself. Consequently, the application of PIT to enhance the fidelity term of the TV model ensures the preservation of image details and texture information, while simultaneously facilitating the removal of noise during the restoration process. This method demonstrates significant advantages in enhancing IR speed and quality.

2.2. PCB-DD model based on PIT and YOLOV5

According to the PCB-IR model based on PIT proposed in the previous section, the study further carries out the improvement of YOLOv5, which leads to the establishment of PCB-DD model based on PIT and YOLOv5. It is found that the YOLOv5 model in the process of DD of PCB images, the input image (II) will be resized to 640×640 size and downsampled by Fcous module and Conv layer into C1 (size: 320×320, channel: 64), C2 (size: 160×160, channels: 128), C3 (size: 80×80, channel: 256), C4 (size: 40×40, channel: 512) and C5 (size: 20×20, channel: 1024) five feature maps [1921]. However, multiple downsampling operations result in PCB defect features in the C5 feature map being ignored, which reduces the PCB-DD accuracy. Therefore, the study utilizes the encoder module of Transformer to replace the Bottleneck module of YOLOv5 to improve the YOLOv5 model. Transformer’s self-attention mechanism can operate on the whole image and capture the global context information. This is particularly beneficial for elucidating the interrelationships and interactions between disparate objects within a PCB image, thereby facilitating more accurate identification of the relationships between different defects. In addition, multiple downsampling in YOLOv5 can lead to the loss of important information in the high-level feature map. Transformer can supplement this information, and through its encoder-decoder architecture, it can reintegrate the low-level detailed information with the high-level semantic information. The Transformer network layer structure used in the study is shown in Fig 2.

Fig 2. Schematic diagram of transformer network layer structure.

Fig 2

In Fig 2, the dimension of the input feature map matrix X is [g,e,H,J]. g, e, H, and J denote the input feature images, the channels, and the size, respectively. WiQ, WiK and WiV denote the trainable linear variation matrix. Qi, Ki and Vi denote the corresponding matrices of the linear variation matrix, respectively. Wout denotes the linear transformation matrix. The feature image is reconstructed from the matrix consisting of dimensions height and width to obtain the [H×J,g,e] form to comply with the input feature image requirements of multi-head self-attention (MHSA) [22,23]. Second, the feature matrix is combined with the pixel-by-pixel positional coding information of the feature image to obtain a new input vector. The new input vectors are subjected to multi-head self-attentive perception in MHSA, and the reconstructed 2D image is output by the multilayer perceptron, resulting in a feature map containing more global and contextual information. The self-attention potential of MHSA enables the incorporation of more global and contextual information into the flat output feature maps. This results in the input vectors in the MHSA, after multiplication by the trainable linear variation matrix, having the corresponding matrix formulae as shown in Eq (14).

{Qi=UWiQKi=UWiKVi=UWiV (14)

In Eq (14), U denotes the input vector. According to the obtained matrix formula, the study utilizes the scaled dot product attention operation to process the matrix and introduces the Softmax function to constrain the calculation results, so as to obtain the attention score of the corresponding attention head. The specific expression formula is shown in Eq (15).

{headi=Attention(Qi,Ki,Vi)=softmax(QiKiTβk)ViMultiHead(Q,K,V)=Concat(head1,,headi)Wout (15)

In Eq (15), headi denotes the attention head of YOLOv5. MultiHead(·) denotes the result of MHSA processing. Attention(·) denotes the attention score. βk denotes the resultant limiting parameter of the Softmax function, and softmax(·) denotes the Softmax function. Concat(·) denotes extended fusion. Therefore, the C3 structure of the Transformer encoder after improving the Bottleneck module of YOLOv5 is shown in Fig 3.

Fig 3. Schematic of the C3 structure of T-YOLOv5.

Fig 3

In Fig 3, in improved C3 (IC3), the input feature image first passes through a 1×1 convolutional layer for channel number compression. The output feature image of the previous layer directly passes through a 3×3 convolutional layer for channel number adjustment and is converted into serialized data to be summed with the position code. After summation, the output feature image is transferred as input to the MHSA for residual concatenation and spliced with the input feature image again to obtain the final output of IC3. In YOLOv5, it has 8 C3 modules and 4 are in Backbone module and 4 are in Preiction module [24]. Therefore, the schematic diagram of YOLOv5 backbone network after improving the C3 modules is shown in Fig 4.

Fig 4. Schematic diagram of T-YOLOv5 backbone network.

Fig 4

In Fig 4, the study does not replace the shallow C3 module in the T-YOLOv5 backbone network, and only replaces the deeper C3 module with IC3. Since the BN normalization process relies heavily on the mean and method within each batch during the conventional YOLOv5 network training process and ignores the differences in each sample [25,26]. Therefore, the study improves the BN of the network by adding centering and scaling calibration to the beginning and ending parts of the Normalization layer of the network. This is shown in Eq (16).

{Xcm=X+wm1HJh=1Hj=1JX(s,e,h,j)Xm=XcmX¯cm (16)

In Eq (16), Xcm denotes the X centering calibration result. wm denotes the weight vector that can be used for training. ⊙ denotes the dot product operator. sS denotes the input batch size (BS). X¯cm denotes the mean value of Xcm. Xm denotes the centering feature. The centered features are subjected to a scaling process after the centering calibration is performed and a constant is introduced to avoid the denominator to be 0. Based on this, the Tanh function is utilized to limit the range of extreme values to be taken [27]. Therefore, after the scaling process and training, the final BN results are expressed as shown in Eq (17).

{Xs=XmVar(Xm)+cXcs=XsR(wvKs+wg)Y=Xcsφ+μ (17)

In Eq (17), Xs denotes the centered feature after performing the scaling process. Var(Xm) denotes the Xcm variance value. c denotes the constant that avoids Var(Xm) to be 0. Xcs denotes the original features obtained after scaling calibration. R denotes the image dimension. wv and wg both denote weight vectors that can be used for training. Ks denotes the statistics of Xs and Y denotes the final BN result. φ and μ denote the scaling parameter and the translation parameter, respectively. In addition, the loss function as an important influence on the model performance, the conventional YOLOv5 loss function is mainly composed of three losses: bounding box regression, classification and confidence [28,29]. The specific expression formula is shown in Eq (18).

Loss=lobj+lcis+lbox (18)

In Eq (18), Loss denotes the loss function and lobj denotes the confidence loss. lcis denotes classification loss and lbox denotes bounding box regression loss. In lbox, generalized IoU (GIoU) is able to distinguish between different real frames and prediction frames. However, when the prediction frame is in the true frame, it degrades to an IoU, which prevents accurate prediction [30]. Therefore, the study utilizes α-IoU loss to replace GIoU as the model training loss function of T-YOLOv5. The specific expression formula is shown in Eq (19).

lbox=lαIoU=1IoUα1+ρα2(υ,υgt) (19)

In Eq (19), lαIoU denotes the α-IoU Loss function. α denotes the adjustable parameter. υ denotes the predicted frame area. υgt denotes the real frame area and ρ denotes the predicted frame. Combining the above, the flow of the PCB-DD model based on PIT and YOLOv5 proposed in the study is shown in Fig 5.

Fig 5. PCB-DD model flow based on pseudo-inverse transformation and YOLOv5.

Fig 5

In Fig 5, the study firstly utilizes PIT to improve the TV model and constructs the IR model for PCB-DD in order to improve the clarity of PCB images. ST and biregularization strategies are introduced to perform the image recovery process in the framework of SB algorithm. The OF is transformed into a subproblem that can be solved in steps by introducing auxiliary variables and Bregman distance to output the recovered PCB image. Secondly, Transformer is introduced to improve YOLOv5, and the BN and loss function of YOLOv5 are optimized. The recovered image is input into T-YOLOv5 for DD and the results are output.

2.3. Self-built PCB-DD dataset

Since PCB-DD mainly analyzes the image data of PCBs in order to determine their defects, the criteria for defining PCB defects are not clearly defined. Therefore, the study uses the Institute of Printed Circuit (IPC) standard as the principle of PCB-DD, and uses the PCB open dataset released by Peking University as the basis for data enhancement and other techniques to expand the number of PCB dataset samples. The PCB-DD dataset contains 1386 images, covering 6 different types of defects, including pin holes, mouse bites, open circuits, short circuits, dispersion, and miscellaneous copper. These images can be used for image detection, classification, and registration tasks. The images in the dataset are captured by industrial cameras with a resolution of 1920×1080, and the dataset is divided into training, validation, and testing sets in a ratio of 6:2:2. The format of the dataset follows the PASCAL VOC format. The IPC standards are shown in Table 1.

Table 1. PCB defect types.

Small size defects Large size defects Hole type defects Other types of defects
Missing hole Broken solder joints Round hole deformation Circuit breaker
Edge lifting Broken pads Round hole misalignment Short circuit
Small spot Copper surplus Cracks inside the hole Rodent bite
Micro etching Broken wire Burr inside round hole Burr
Conductor spacing issue Layers Uneven size of holes Craters

According to the PCB defect types shown in Table 1, the study flipped, randomly cropped, and added Gaussian white noise to 693 PCB images to obtain 12890 PCB images. The images contain 23464 defects of different types. It mainly includes 3919 hole defects, 3987 rat tear defects, 3855 open circuit defects, 3801 short circuit defects, 3913 burr defects, and 3989 residual copper type defects. For the purpose of training models and validating their performance, the dataset is split 9:1 into training and test sets. The visual analysis of PCB data set is shown in Fig 6.

Fig 6. Analysis chart of PCB number series.

Fig 6

Fig 6a and 6b show the sample distribution of the PCB dataset and the position of the center of the object. There are 11,601 images in the training set and 1,289 images in the test set. There are 11,601 images in the training set and 1,289 images in the test set.

3. Results

Firstly, the effectiveness of the proposed PIT-based PCB-IR model is verified with natural scenery images and PCB images. Secondly, the performance of T-YOLOv5 and its based PCB-DD model is validated using accuracy, recall, mean average precision (mAP) and frame per second (FPS).

3.1. PIT-based PCB image restoration model validation

Both PCB and natural light images are used in the study in order to confirm the validity of the PCB-IR model based on PIT. 1.28 and 0.001 are the regularization parameters that are set, respectively. The adjustment factor is set to 1 and the cutoff condition is 0.0001. Meanwhile, two-step iterative shrinkage/thresholding (TwIST) algorithmic framework is introduced to compare with SB algorithmic framework. Moreover, the anisotropic TV calculation under TwIST solution is defined as TwIST-1 and isotropic TV is defined as TwIST-2. The anisotropic TV under SB algorithmic framework solution is defined as SB-1 and isotropic TV is defined as SB-2. To assess the performance of the PCB-IR model under the two solution frameworks, the various methods are applied to four natural light photos with varying values of blur kernel, peak signal-to-noise ratio (PSNR), and image processing time. The study firstly compares the PSNR of the four calculation methods under different values of the fuzzy kernel (FK), as shown in Fig 7.

Fig 7. Comparison of PSNR of different methods with different fuzzy kernels.

Fig 7

It can be seen from Fig 7A that the research proposed algorithm has the highest PSNR value among the four images when the value of FK is taken as 1. Fig 7B–7D also show the reasonableness and effectiveness of the research proposed using the SB algorithm as a PCB image restoration model solving algorithm. The research proposed method has the highest PSNR value in all natural light image processing. The average increase in PSNR obtained by SB algorithm for restoration of 4 images is 0.68% when FK is 1. The average increase in PSNR obtained by restoration of 4 images when FK is 2 is 2.43% compared to TwIST. When FK was 4, SB increased PSNR by an average of 1.35% over TwIST. When FK was 6, SB showed an average increase of 1.46%. Among them, the PSNR value of SB-2 is optimal among the four methods, while the PSNR value of TwIST-2 is also significantly better than TwIST-1. This may be due to the fact that isotropic TV can greatly preserve the details of the image and reduce its distortion when restoring the image, thus obtaining a better image quality for restoring the PCB image. TwIST converges slower, often requires more iterations when dealing with large-scale datasets, and it is more sensitive to noise, which may be the reason why TwIST performs inferior to SB. The recovery times of the four methods with different FKs are shown in Fig 8.

Fig 8. Comparison of time of different methods with different fuzzy kernels.

Fig 8

From Fig 8A–8D, it can be seen that the time overhead required for the PCB image restoration model proposed in the study is significantly lower than that of TwIST. when FK is 1, the time overhead required for SB is reduced by an average of 39.89% compared to that of TwIST; when FK is 2, the time overhead of SB is reduced by an average of 39.88% compared to that of TwIST; and when FK is 4 and 6, respectively, the time overhead required for SB to in 4 image The time overhead for performing the recovery process is reduced by 38.78% and 40.95% compared to TwIST, respectively. Combining anisotropic TV and isotropic TV also shows that the time overhead of anisotropic TV in performing image restoration is generally lower than that of isotropic TV under the framework of both algorithms, which may be attributed to the fact that the computational complexity required in solving anisotropic TV is lower, and thus the time it requires is reduced accordingly. However, on the whole, the study proposes that the proposed PCB image restoration model is reasonable and effective using the SB algorithm to solve the proposed PCB image restoration model. At the same time, the study further analyses the iterative change of PSMR values when the four methods perform the restoration process by taking image 3 as an example, as shown in Fig 9.

Fig 9. Iterative change of PSNR value during image 3 restoration process.

Fig 9

The study’s suggested method’s iterative convergence is fastest in Fig 9A during image 3 recovery, whereas the TwIST approach has the slowest convergence and a substantially lower PSNR value than the SB algorithm. Combined with the iteration step size of different methods in Fig 9B, it can be concluded that the SB algorithm is superior. Meanwhile, the study further utilized the acquired PCB degradation images to verify the IR results, which are shown in Fig 10.

Fig 10. Pseudo-inverse transform based PCB image restoration model restoration results.

Fig 10

Comparison of the PCB degradation image in Fig 10A with the anisotropic TV recovered image in Fig 10B shows that the PCB image is clearer after the recovery. Additionally, the anisotropic TV recovered image in Fig 10C can demonstrate the efficacy of the study’s suggested strategy. Therefore, the PCB image recovery model proposed by the study on the basis of PIT can effectively remove the noise and retain the detail information of the PCB image, while the model solving in the framework of the SB algorithm is able to obtain a superior PCB recovery image. And in order to further illustrate the applicability of the model in a wider range of scenarios, the study introduces the publicly available PCB-DD (D1) and the self-constructed PCB-DD (D2) from Peking University for the comparison of the model training effect. The details are shown in Table 2.

Table 2. Performance comparison of different dataset models.

Data set Accuracy (%) Precision (%) Recall (%) F1 Score (%)
D1 94.57 94.53 92.33 93.42
D2 99.20 98.97 97.87 98.42

As can be seen from Table 2, the proposed model has superior training results in the self-built dataset D2, while the model accuracy and F1 score in the unimproved public dataset D1 are above 93%. This indicates that the model is better adapted to the specific features of PCB defect detection and has strong generalisation ability.

3.2. PCB-DD model validation based on PIT and YOLOV5

After the proposed PCB dataset is preprocessed by the PIT-based PCB-IR model, the study uses the pre-training weights published by the YOLOv5 developers to train T-YOLOv5. Moreover, the study utilizes stochastic gradient descent (SGD) to update the model parameters. The BS is set to 16, the weight decay is 0.0005, the learning rate is 0.01, the hyperparameter is 0.9, the II size is set to 640×640, and the training rounds is 200. To effectively illustrate the rationality and superiority of the study’s improvement of YOLOv5, the study firstly conducts ablation experiments to systematically analyze the system with three parts, namely, IC3, modified BN and α-IoU. Table 3 displays the specific outcomes.

Table 3. Results of ablation experiments.

Experiment number IC3 Modify BN α-IoU mAP/IoU = 0.5 (%) FPS
1 No No No 96.35 46
2 Yes No No 97.82 43
3 No Yes No 97.24 49
4 No No Yes 96.85 45
5 Yes Yes No 98.63 44
6 Yes No Yes 98.82 41
7 No Yes Yes 98.53 46
8 Yes Yes Yes 99.14 43

The results of the ablation experiments obtained with IC3, BN and α-IoU when the value of IoU is taken as 0.5 are shown in Table 3. Comparing Experiments 1 and 2, it can be noticed that the improvement of IC3 increased the model mAP value by 1.47%, while the FPS decreased by 3 FPS. The model mAP value of Experiment 3, which only modified the BN, increased by 0.89% compared to Experiment 1. Moreover, the mAP value of the Experiment 4 model with only improved α-IoU increased by 0.50% compared to Experiment 1. This indicates that either improving IC3, BN or α-IoU can improve the performance of the YOLOv5 model. The combination of Experiment 5, Experiment 6 and Experiment 7 further shows that the model mAP value is significantly increased compared to a single improvement. Whereas the combined mAP value of the three improved strategies in Experiment 8 is as high as 99.14%, the mAP values of the other seven experiments increased by 0.32%-2.79%. This demonstrates that the study’s revised YOLOv5 technique can increase the model’s performance. Combining the different methods of improvement shows that IC3 is the main variable that determines the performance of the model. The introduction of MHSA into the IC3 module may be responsible for this improvement. MHSA expands the receptive field of the T-YOLOv5 model, allowing it to capture more global information about the PCB image. Additionally, it addresses the deficiency of T-YOLOv5, which previously resulted in the loss of shallow information when performing continuous downsampling operations. Moreover, the BN modification mainly enhances the feature expression of the T-YOLOv5 model and improves the stability of the image feature distribution. Furthermore, by using α-IoU as the loss function, the degrading faults of GIoU are also eliminated, and the prediction frame is brought closer to the actual frame, improving the accuracy of the loss function’s bounding box regression to the target. Based on this, the study goes on to examine the T-YOLOv5 model’s performance as well as the findings of its detection of the six PCB dataset fault types. The details are shown in Fig 11.

Fig 11. Validation results of T-YOLOv5 on PCB dataset.

Fig 11

In Fig 11A, the proposed T0YOLOv5 model of the study has an accuracy of 98.37%, a recall of 99.24%, and a mAP/IoU = 0.5 of 99.15% after 200 rounds of iterations in the PCB dataset. It is evident that it is more successful in identifying the six types of faults when combined with the T-YOLOv5 model in Fig 11B for the six types of PCB-DD confusion matrices. To further illustrate the effectiveness of the PCB-DD model proposed in the study, the study introduces faster region-based convolutional network (Faster R-CNN) [31]. Single shot multibox detector (SSD), YOLOv3, YOLOv4, and the unimproved YOLOv5 are compared with the performance of the proposed T-YOLOv5 [3234]. Among them, the AP for six defect types of PCB dataset is shown in Fig 12.

Fig 12. Absence detection results of different models for each type of absence in the test set of PCB dataset.

Fig 12

In Fig 12, the research proposed T-YOLOv5 has the highest detection results in five types of defects. The AP values in the hole defect types increased by 1.60%-39.19% over the other models. In the rat-bite defect type, the T-YOLOv5 model have an AP value of 98.81%, which is an average increase of 16.28% over the other models. Moreover, the AP value of T-YOLOv5 in the three types of DD, namely open circuit, burr and residual copper, is still 98.52% and above. This indicates the reliability of the study proposing improvements to the YOLOv5 model. The AP value in short-circuit type defects is reduced by 0.11% compared to Faster R-CNN. There may be fewer examples for short-circuit type problems as a result of the training set’s unequal sample distribution. Faster R-CNN usually requires higher computational resources and a longer training process, which contributes to the degradation of its DA. And SSD is similar to Faster R-CNN in that its detection results usually need to remove overlapping detection frames through post-processing steps such as non-great value suppression, which increases the complexity of the algorithm. Comparatively speaking, among the six models, the T-YOLOv5 model is more advantageous for PCB-DD. In the meantime, Table 4 presents the precise findings of the study’s comparison of the six models’ performances in the PCB dataset.

Table 4. Comparison of detection results of different models in PCB dataset.

Model Faster R-CNN SSD YOLOv3 YOLOv4 YOLOv5 T-YOLOv5
Backbone network VGG16 VGG16 D3 C3 C3 IC3
Weights (mb) 298.2 105.7 225.0 246.0 28.2 28.7
Recall (%) 96.5 79.4 84.6 91.3 97.7 99.7
mAP/IoU = 0.5 (%) 94.4 73.4 82.7 92.3 96.3 99.1
FPS 26 57 39 42 45 43

In Table 4, the proposed T-YOLOv5 model of the study has a detection recall of 99.7% in the PCB dataset, which is an average increase of 10.90% compared to the other five models. In terms of mAP value, the T-YOLOv5 model has a mAP of 99.1%, which is an average increase of 12.87% over the other models. The Faster R-CNN model needs to pre-generate candidate ports during the PCB-DD process and then perform sliding window operation with convolutional computation, which may be the reason for its poor FPS and weight. While SSD is mainly recognized by the generated multi-scale feature images, it is weak in recognizing shallow feature maps, which may be the reason for its poorer effect on PCB-DD. Further comparing the study’s proposed T-YOLOv5 with the YOLO series model, it can be noticed that after IC3, BN, and the loss function, T-YOLOv5 has been significantly improved in terms of detection speed, accuracy, and weight. On this basis, the study further compares the effect of YOLOv5 and T-YOLOv5 in PCB-DD. Fig 13 displays the specific visualization findings.

Fig 13. Comparison of the detection results of the two models for PCB defects "short" and "open circuit".

Fig 13

Comparing the detection results of YOLOv5 in Fig 13A with those of T-YOLOv5 in Fig 13B, it can be observed that the T-YOLOv5 model PCB is more accurate in the detection of open-circuit defects. The combination of the previous validation results provides further evidence of the effectiveness of the PCB-DD model based on PIT and YOLOv5, as proposed by the study. Additionally, the study’s improvement of YOLOv5 has been demonstrated to enhance the DA of the PCB-DD model. Finally, the DNN-based PCB-DD method proposed in reference [4] and the CNN-based PCB-DD method proposed in reference [6] are presented and compared with T-YOLOv5. Based on these literatures, the study proposes optimal parameters. The performance is compared and the test is repeated five times to get the t-test results as shown in Table 5.

Table 5. Performance comparison of different methods.

Model Recall Testing time Accuracy
t-value p-value t-value p-value t-value p-value
T-YOLOv5 vs DNN 2.35 <0.001 3.45 <0.001 2.41 <0.001
T-YOLOv5 vs CNN 4.56 <0.001 4.87 <0.001 3.59 <0.001

In Table 5, the t-values between the proposed method and other methods are all above 1.96 (at 95% confidence level, two-tailed test). It shows that the differences between different methods are statistically significant. Concurrently, the results illustrate the efficacy and superiority of the proposed method.

4. Conclusion

To improve the effectiveness of the current detection model in image DD of PCB, the study proposed a PCB-DD model based on PIT and YOLOv5. Firstly, the PIT was utilized to improve the TV model to construct the PCB-IR model, and the SB algorithm was utilized to solve the model. On this basis, TOLOv5 was further improved using Transformer, and the network BN and loss function were optimized, so as to construct a PCB-DD model on the basis of T-YOLOv5. The experimental validation shows that the PSNR values of SB recovered images are increased by 0.68%, 2.34%, 1.35%, and 1.46% over TwIST when FK is taken as 1, 2, 4, and 6, respectively. The accuracy of the proposed T-YOLOv5 model in the study after 200 rounds of iterations in the PCB dataset was 98.37%, the recall was 99.24%, and the mAP/IoU = 0.5 was 99.15%. Compared to the other models, the T-YOLOv5 model achieved an average increase in recall of 10.90% and an average increase in mAP value of 12.87%. The results demonstrated that the construction of a PCB-IR model using PIT could enhance the quality of the image. Furthermore, the improvement of YOLOv5 on this basis could enhance the DA of the model. The PCB-DD model proposed in the study was capable of retaining image detail information and improving the acquisition of shallow image features, thereby enhancing the recognition and detection of PCB image defects. This had the potential to have a positive impact in the field of PCB-DD. By more accurately detecting defects in PCBs, it is possible to reduce the number of defective products reaching the market, thereby improving the reliability and quality of the final product. Automated and efficient defect detection can reduce the cost of manual inspection and potentially reduce material waste and rework due to defects. As electronic devices become more complex, PCBs need to be designed and manufactured with greater precision. This technology can support more complex and detailed PCB designs. In addition, fast and accurate defect inspection can shorten the time it takes to get a product from design to market. Nevertheless, a limitation of the study is that the design of a visual system for PCB defect recognition has not been further developed. In the future, the proposed model will be considered to be optimized by combining client-side, optimization algorithms, etc., and a PCB visual DD system will be developed. In addition, the T-YOLOv5 model is being considered for application in areas such as security monitoring and medical image analysis to improve the accuracy of lesion detection and public safety. In precision agriculture, the model can be used to monitor crop health, detect pests and diseases, and automate harvesting. In environmental monitoring, the model can be used to detect and classify different types of pollution or signs before natural disasters.

Supporting information

S1 File

(DOC)

pone.0315424.s001.doc (139.9KB, doc)

Data Availability

All relevant data are within the paper and its Supporting Information files.

Funding Statement

The author(s) received no specific funding for this work.

References

  • 1.Zhou Y., Yuan M., Zhang J., Ding G., and Qin S, "Review of vision-based defect detection research and its perspectives for printed circuit board," J. Manuf. Syst., vol. 70, no. 1, pp. 557–578, Oct. 2023, doi: 10.1016/j.jmsy.2023.08.019 [DOI] [Google Scholar]
  • 2.Preethi P. and Mamatha H. R., "Region-based convolutional neural network for segmenting text in epigraphical images," Artif. Intell. Appl., vol. 1, no. 2, pp. 119–127, Sep. 2023, doi: 10.47852/bonviewAIA2202293 [DOI] [Google Scholar]
  • 3.Chen W., Huang Z., Mu Q., and Sun Y., "PCB defect detection method based on transformer-YOLO," IEEE Access, vol. 10, no. 1, pp. 129480–129489, Dec, 2022, doi: 10.1109/ACCESS.2022.3228206 [DOI] [Google Scholar]
  • 4.Li C. J., Qu Z., Wang S. Y., Bao K. H., and Wang S. Y., "A method of defect detection for focal hard samples PCB based on extended FPN model. IEEE Transactions on Components," Pack. Man. Tech., vol. 12, no. 2, pp. 217–227, Feb. 2021, doi: 10.1109/TCPMT.2021.3136823 [DOI] [Google Scholar]
  • 5.Jeon M., Yoo S., and Kim S. W., "A contactless PCBA defect detection method: Convolutional neural networks with thermographic images," IEEE Trans. Compon. Pack. Manuf., vol. 12, no. 3, pp. 489–501, Mar. 2022, doi: 10.1109/TCPMT.2022.3147319 [DOI] [Google Scholar]
  • 6.Alghassab M. A., "Defect detection in printed circuit boards with pre-trained feature extraction methodology with convolution neural networks," Comput. Mater. Contin., vol. 70, no. 1, pp. 637–652, Jan. 2022, doi: 10.32604/cmc.2022.019527 [DOI] [Google Scholar]
  • 7.Zeng N., Wu P., Wang Z., Li H., Liu W., and Liu X., "A small-sized object detection oriented multi-scale feature fusion approach with application to defect detection," IEEE Trans. Instrum. Meas., vol. 71, no. 3507014, pp. 1–14, Feb. 2022, doi: 10.1109/TIM.2022.3153997 [DOI] [Google Scholar]
  • 8.Yuan M., Zhou Y., Ren X., Zhi H., Zhang J., and Chen H., "YOLO-HMC: An improved method for PCB surface defect detection," IEEE Trans. Instrum. Meas., vol. 73, no. 2001611, pp. 1–11, Jan. 2024, doi: 10.1109/TIM.2024.3351241 [DOI] [Google Scholar]
  • 9.Xie J. C., Xi R., and Chang D. F., ’’Mask wearing detection based on YOLOv5 target detection algorithm under COVID-19,’’ Acadlore Trans. AI Mach. Learn., vol. 1, no. 1, pp. 40–51, Dec. 2022, doi: 10.56578/ataiml010106 [DOI] [Google Scholar]
  • 10.Liu Z., Gao X., Wan Y., Wang J., and Lyu H., ’’An improved YOLOv5 method for small object detection in UAV capture scenes,’’ IEEE Access, vol. 11, no. 1, pp. 14365–14374, Jan. 2023, doi: 10.1109/ACCESS.2023.3241005 [DOI] [Google Scholar]
  • 11.Song Y., Xie Z., Wang X., and Zou Y., "MS-YOLO: Object detection based on YOLOv5 optimized fusion millimeter-wave radar and machine vision," IEEE Sens. J., vol. 22, no. 15, pp. 15435–15447, Aug. 2022, doi: 10.1109/JSEN.2022.3167251 [DOI] [Google Scholar]
  • 12.Sadiq M., Masood S., and Pal O., "FD-YOLOv5: A fuzzy image enhancement based robust object detection model for safety helmet detection," Int. J. Fuzzy Syst., vol. 24, no. 5, pp. 2600–2616, Jul. 2022, doi: 10.1007/s40815-022-01267-2 [DOI] [Google Scholar]
  • 13.Wang H., Jin Y., Ke H., and Zhang X., "DDH-YOLOv5: improved YOLOv5 based on Double IoU-aware Decoupled Head for object detection," J. Real-Time Image Process., vol. 19, no. 6, pp. 1023–1033, Dec. 2022, doi: 10.1007/s11554-022-01241-z [DOI] [Google Scholar]
  • 14.Chen Y., Zhang H., Liu L., Tao J., Zhang Q., Yang K., and Xie J., "Research on image inpainting algorithm of improved total variation minimization method," J. Ambient Intell. Humanized Comput., vol. 14, no. 5, pp. 5555–5564, May. 2023, doi: 10.1007/s12652-020-02778-2 [DOI] [Google Scholar]
  • 15.Sarwar T., Yaras C., Li X., Qu Q., and Ku P. C., "Miniaturizing a chip-scale spectrometer using local strain engineering and total-variation regularized reconstruction," Nano Lett., vol. 22, no. 20, pp. 8174–8180, Oct. 2022, doi: 10.1021/acs.nanolett.2c02654 [DOI] [PubMed] [Google Scholar]
  • 16.Movafeghi A., Yahaghi E., Monem S., Nekouei J., Rostami P., and Mirzapour M., "Defect analysis in compressor vanes using split bregman noise-reduced digital industrial radiography," Russ. J. Nondestruct. Test., vol. 59, no. 5, pp. 622–632, May. 2023, doi: 10.1134/S1061830923600211 [DOI] [Google Scholar]
  • 17.Moradlou F., Jouymandi Z., and Ghassabzade F. A., "Bregman projections and parallel extragradient methods for solving multiple-sets split problems," Taiwan. J. Math., vol. 28, no. 1, pp. 163–185, Feb. 2024, doi: 10.11650/tjm/230904 [DOI] [Google Scholar]
  • 18.Khmag A., "Additive Gaussian noise removal based on generative adversarial network model and semi-soft thresholding approach," Multimed. Tools Appl., vol. 82, no. 5, pp. 7757–7777, Feb. 2023, doi: 10.1007/s11042-022-13569-6 [DOI] [Google Scholar]
  • 19.Wang Z., Chen J., Yang L., and Wang Z., "Deep learning-based chip identification of discarded circuit boards," Int. Core J. Eng., vol. 8, no. 11, pp. 267–273, Nov. 2022, doi: 10.6919/ICJE.202211_8(11).0033 [DOI] [Google Scholar]
  • 20.Long Y., Li Z., Cai Y., Zhang R., and Shen K., "PCB defect detection algorithm based on improved YOLOv8," AJST, vol. 7, no. 3, pp. 297–304, Oct. 2023, doi: 10.54097/ajst.v7i3.13420 [DOI] [Google Scholar]
  • 21.Huang J. T. and Ting C. H., "Deep learning object detection applied to defect recognition of memory modules," Int. J. Adv. Manuf. Tech., vol. 121, no. 11, pp. 8433–8445, Aug. 2022, doi: 10.1007/s00170-022-09716-w [DOI] [Google Scholar]
  • 22.Vasanthi P. and Mohan L., "Multi-Head-Self-Attention based YOLOv5X-transformer for multi-scale object detection," Multimed. Tools Appl., vol. 83, no. 12, pp. 36491–36517, Apr. 2024, doi: 10.1007/s11042-023-15773-4 [DOI] [Google Scholar]
  • 23.Pan Z., Zhou S., Zou H., Liu C., Zang M., Liu T., and Wang Q., "CRMSNet: A deep learning model that uses convolution and residual multi-head self-attention block to predict RBPs for RNA sequence," Proteins, vol. 91, no. 8, pp. 1032–1041, Mar. 2023, doi: 10.1002/prot.26489 [DOI] [PubMed] [Google Scholar]
  • 24.Fan Y., Cai Y., and Yang H., "A detection algorithm based on improved YOLOv5 for coarse-fine variety fruits," J. Food Meas. Charact., vol. 18, no. 2, pp. 1338–1354, Feb. 2024, doi: 10.1007/s11694-023-02274-z [DOI] [Google Scholar]
  • 25.Huang L., Qin J., Zhou Y., Zhu F., Liu L., and Shao L., "Normalization techniques in training dnns: Methodology, analysis and application," TPAMI, vol. 45, no. 8, pp. 10173–10196, Aug. 2023, doi: 10.1109/TPAMI.2023.3250241 [DOI] [PubMed] [Google Scholar]
  • 26.Saeed U., Kumar K., Khuhro M. A., Laghari A. A., Shaikh A. A., and Rai A., "DeepLeukNet-A CNN based microscopy adaptation model for acute lymphoblastic leukemia classification," Multimed. Tools Appl., vol. 83, no. 7, pp. 21019–21043, Feb. 2024, doi: 10.1007/s11042-023-16191-2 [DOI] [Google Scholar]
  • 27.Afshari Nia M., Panahi F., and Ehteram M., "Convolutional neural network-ANN-E (Tanh): a new deep learning model for predicting rainfall," Water Resour. Manage., vol. 37, no. 4, pp. 1785–1810, Mar. 2023, doi: 10.1007/s11269-023-03454-8 [DOI] [Google Scholar]
  • 28.Yang H., Fang Y., Liu L., Ju H., and Kang K., "Improved YOLOv5 based on feature fusion and attention mechanism and its application in continuous casting slab detection," IEEE Trans. Instrum. Meas., vol. 72, no. 2518116, pp. 1–16, Jun. 2023, doi: 10.1109/TIM.2023.328402137323850 [DOI] [Google Scholar]
  • 29.Zhang R., Xie C., and Deng L., "A fine-grained object detection model for aerial images based on YOLOv5 deep neural network," Chin. J. Electron., vol. 32, no. 1, pp. 51–63, Jan. 2023, doi: 10.23919/cje.2022.00.044 [DOI] [Google Scholar]
  • 30.Wu H., Hua Y., Zou H., and Ke G., "A lightweight network for vehicle detection based on embedded system," J. Supercomput., vol. 78, no. 16, pp. 18209–18224, Nov. 2022, doi: 10.1007/s11227-022-04596-z [DOI] [Google Scholar]
  • 31.Nawaz M., Masood M., Javed A., Iqbal J., Nazir T., Mehmood A., and Ashraf R., "Melanoma localization and classification through faster region-based convolutional neural network and SVM," Multimed. Tools Appl., vol. 80, no. 19, pp. 28953–28974, Aug. 2021, doi: 10.1007/s11042-021-11120-7 [DOI] [Google Scholar]
  • 32.Yan C., Zhang H., Li X., and Yuan D., "R-SSD: Refined single shot multibox detector for pedestrian detection," Appl. Intell., vol. 52, no. 9, pp. 10430–10447, Jul. 2022, doi: 10.1007/s10489-021-02798-1 [DOI] [Google Scholar]
  • 33.Liu W., Ren G., Yu R., Guo S., Zhu J., and Zhang L., "Image-adaptive YOLO for object detection in adverse weather conditions," AAAI Publ., vol. 36, no. 2, pp. 1792–1800, Jun. 2022, doi: 10.1609/aaai.v36i2.20072 [DOI] [Google Scholar]
  • 34.Zhao Q., Ji T., Liang S., and Yu W., "PCB surface defect fast detection method based on attention and multi-source fusion," Multimed. Tools Appl., vol. 83, no. 2, pp. 5451–5472, Jan. 2024, doi: 10.1007/s11042-023-15495-7 [DOI] [Google Scholar]

Decision Letter 0

Azim Uddin

8 Oct 2024

PONE-D-24-40368PCB Defect Detection Based on Pseudo-inverse Transformation and YOLOv5PLOS ONE

Dear Dr. Wang,

Thank you for submitting your manuscript to PLOS ONE. After careful consideration, we feel that it has merit but does not fully meet PLOS ONE’s publication criteria as it currently stands. Therefore, we invite you to submit a revised version of the manuscript that addresses the points raised during the review process.

==============================

 Please revise your manuscript on the basis of the reviewers' comments. Moreover, it is suggested to emphasis more on the novelty of your work and make a comparison of your work with other previously reported ones.​

==============================

Please submit your revised manuscript by Nov 22 2024 11:59PM. If you will need more time than this to complete your revisions, please reply to this message or contact the journal office at plosone@plos.org. When you're ready to submit your revision, log on to https://www.editorialmanager.com/pone/ and select the 'Submissions Needing Revision' folder to locate your manuscript file.

Please include the following items when submitting your revised manuscript:

  • A rebuttal letter that responds to each point raised by the academic editor and reviewer(s). You should upload this letter as a separate file labeled 'Response to Reviewers'.

  • A marked-up copy of your manuscript that highlights changes made to the original version. You should upload this as a separate file labeled 'Revised Manuscript with Track Changes'.

  • An unmarked version of your revised paper without tracked changes. You should upload this as a separate file labeled 'Manuscript'.

If you would like to make changes to your financial disclosure, please include your updated statement in your cover letter. Guidelines for resubmitting your figure files are available below the reviewer comments at the end of this letter.

If applicable, we recommend that you deposit your laboratory protocols in protocols.io to enhance the reproducibility of your results. Protocols.io assigns your protocol its own identifier (DOI) so that it can be cited independently in the future. For instructions see: https://journals.plos.org/plosone/s/submission-guidelines#loc-laboratory-protocols. Additionally, PLOS ONE offers an option for publishing peer-reviewed Lab Protocol articles, which describe protocols hosted on protocols.io. Read more information on sharing protocols at https://plos.org/protocols?utm_medium=editorial-email&utm_source=authorletters&utm_campaign=protocols.

We look forward to receiving your revised manuscript.

Kind regards,

Azim Uddin, Ph.D.

Academic Editor

PLOS ONE

Journal Requirements: When submitting your revision, we need you to address these additional requirements. 1. Please ensure that your manuscript meets PLOS ONE's style requirements, including those for file naming. The PLOS ONE style templates can be found at https://journals.plos.org/plosone/s/file?id=wjVg/PLOSOne_formatting_sample_main_body.pdf and https://journals.plos.org/plosone/s/file?id=ba62/PLOSOne_formatting_sample_title_authors_affiliations.pdf 2. Please note that PLOS ONE has spec6ific guidelines on code sharing for submissions in which author-generated code underpins the findings in the manuscript. In these cases, all author-generated code must be made available without restrictions upon publication of the work. Please review our guidelines at https://journals.plos.org/plosone/s/materials-and-software-sharing#loc-sharing-code and ensure that your code is shared in a way that follows best practice and facilitates reproducibility and reuse. 3. We note that Figure 6 in your submission contain copyrighted images. All PLOS content is published under the Creative Commons Attribution License (CC BY 4.0), which means that the manuscript, images, and Supporting Information files will be freely available online, and any third party is permitted to access, download, copy, distribute, and use these materials in any way, even commercially, with proper attribution. For more information, see our copyright guidelines: http://journals.plos.org/plosone/s/licenses-and-copyright. We require you to either (1) present written permission from the copyright holder to publish these figures specifically under the CC BY 4.0 license, or (2) remove the figures from your submission: A. You may seek permission from the original copyright holder of Figure 6 to publish the content specifically under the CC BY 4.0 license.  We recommend that you contact the original copyright holder with the Content Permission Form (http://journals.plos.org/plosone/s/file?id=7c09/content-permission-form.pdf) and the following text:“I request permission for the open-access journal PLOS ONE to publish XXX under the Creative Commons Attribution License (CCAL) CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). Please be aware that this license allows unrestricted use and distribution, even commercially, by third parties. Please reply and provide explicit written permission to publish XXX under a CC BY license and complete the attached form.” Please upload the completed Content Permission Form or other proof of granted permissions as an ""Other"" file with your submission.  In the figure caption of the copyrighted figure, please include the following text: “Reprinted from [ref] under a CC BY license, with permission from [name of publisher], original copyright [original copyright year].” B. If you are unable to obtain permission from the original copyright holder to publish these figures under the CC BY 4.0 license or if the copyright holder’s requirements are incompatible with the CC BY 4.0 license, please either i) remove the figure or ii) supply a replacement figure that complies with the CC BY 4.0 license. Please check copyright information on all replacement figures and update the figure caption with source information. If applicable, please specify in the figure caption text when a figure is similar but not identical to the original image and is therefore for illustrative purposes only.

[Note: HTML markup is below. Please do not edit.]

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Author

1. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer #1: Partly

Reviewer #2: Partly

**********

2. Has the statistical analysis been performed appropriately and rigorously?

Reviewer #1: No

Reviewer #2: Yes

**********

3. Have the authors made all data underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data—e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: No

Reviewer #2: Yes

**********

4. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer #1: Yes

Reviewer #2: No

**********

5. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer #1: Comments on manuscript ID PONE-D-24-40368:

Title: “PCB Defect Detection Based on Pseudo-inverse Transformation and YOLOv5”

Some key suggestions are listed below:

1. There are certain grammatical and misspelling issues noted throughout the text, like “TOLOv5 is further improved using Transformer”. Please check and make sure to address them.

2. The abstract is not well written. The abstract could benefit from a more concise presentation of key points. Some sentences feel lengthy and complex, which can reduce readability.

3. The key contributions of your proposed method are missing in introduction section.

4. The methodology should explain how the PCB-DD dataset was constructed, including details about the number of samples, types of defects included, resolution of images, and data augmentation techniques. This information is critical for replicability and for understanding the dataset’s role in enhancing model performance. It would be useful to compare the proposed PCB-DD dataset against existing publicly available datasets (if any exist) to demonstrate the model's applicability in broader scenarios.

5. The conclusion can benefit from a broader reflection on the potential impact of the proposed model beyond the experiment. How might this technology affect industries that rely on PCB production? What future applications, besides just PCB-DD, could benefit from the advancements in the model?

Reviewer #2: Title: “PCB Defect Detection Based on Pseudo-inverse Transformation and YOLOv5”

Some key suggestions are:

1. Some misspellings and grammatical issues noted throughout the text. Please check and make sure to address them all.

2. The term "pseudo-inverse transformation" is used without prior context. Since it is a key component of the method, a brief explanation or rationale for choosing this approach would enhance understanding for readers unfamiliar with this technique.

3. The mention of "Transformer is introduced to improve YOLOv5" is quite brief. It would be helpful to provide a bit more insight into how the Transformer architecture is incorporated and why it enhances the performance of YOLOv5 in this specific context.

4. The abstract can be reorganized slightly to follow a more typical structure: problem statement, method, results, and significance.

5. The methodology does not explain how PIT is applied or why it was chosen over other traditional methods like Fourier transforms or wavelet-based methods. Including a brief explanation of why PIT is particularly well-suited for PCB image restoration would strengthen the methodology.

6. Dataset details are insufficient

7. The proposed methodology experimental results are not compared with any state of the art methods.

**********

6. PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: No

Reviewer #2: No

**********

[NOTE: If reviewer comments were submitted as an attachment file, they will be attached to this email and accessible via the submission site. Please log into your account, locate the manuscript record, and check for the action link "View Attachments". If this link does not appear, there are no attachment files.]

While revising your submission, please upload your figure files to the Preflight Analysis and Conversion Engine (PACE) digital diagnostic tool, https://pacev2.apexcovantage.com/. PACE helps ensure that figures meet PLOS requirements. To use PACE, you must first register as a user. Registration is free. Then, login and navigate to the UPLOAD tab, where you will find detailed instructions on how to use the tool. If you encounter any issues or have any questions when using PACE, please email PLOS at figures@plos.org. Please note that Supporting Information files do not need this step.

PLoS One. 2024 Dec 12;19(12):e0315424. doi: 10.1371/journal.pone.0315424.r002

Author response to Decision Letter 0


21 Nov 2024

The manuscript has finished the revise.

I can confirm: "All relevant data are within the paper and its Supporting Information files"

Figure 7 has been modified and provided specific link to these images on Wikipedia

Attachment

Submitted filename: Response to reviewers comments.doc

pone.0315424.s002.doc (11.5MB, doc)

Decision Letter 1

Azim Uddin

26 Nov 2024

PCB Defect Detection Based on Pseudo-inverse Transformation and YOLOv5

PONE-D-24-40368R1

Dear Dr. Wang,

We’re pleased to inform you that your manuscript has been judged scientifically suitable for publication and will be formally accepted for publication once it meets all outstanding technical requirements.

Within one week, you’ll receive an e-mail detailing the required amendments. When these have been addressed, you’ll receive a formal acceptance letter and your manuscript will be scheduled for publication.

An invoice will be generated when your article is formally accepted. Please note, if your institution has a publishing partnership with PLOS and your article meets the relevant criteria, all or part of your publication costs will be covered. Please make sure your user information is up-to-date by logging into Editorial Manager at Editorial Manager® and clicking the ‘Update My Information' link at the top of the page. If you have any questions relating to publication charges, please contact our Author Billing department directly at authorbilling@plos.org.

If your institution or institutions have a press office, please notify them about your upcoming paper to help maximize its impact. If they’ll be preparing press materials, please inform our press team as soon as possible -- no later than 48 hours after receiving the formal acceptance. Your manuscript will remain under strict press embargo until 2 pm Eastern Time on the date of publication. For more information, please contact onepress@plos.org.

Kind regards,

Azim Uddin, Ph.D.

Academic Editor

PLOS ONE

Additional Editor Comments (optional):

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Author

1. If the authors have adequately addressed your comments raised in a previous round of review and you feel that this manuscript is now acceptable for publication, you may indicate that here to bypass the “Comments to the Author” section, enter your conflict of interest statement in the “Confidential to Editor” section, and submit your "Accept" recommendation.

Reviewer #1: All comments have been addressed

Reviewer #2: All comments have been addressed

**********

2. Is the manuscript technically sound, and do the data support the conclusions?

The manuscript must describe a technically sound piece of scientific research with data that supports the conclusions. Experiments must have been conducted rigorously, with appropriate controls, replication, and sample sizes. The conclusions must be drawn appropriately based on the data presented.

Reviewer #1: Yes

Reviewer #2: Yes

**********

3. Has the statistical analysis been performed appropriately and rigorously?

Reviewer #1: Yes

Reviewer #2: Yes

**********

4. Have the authors made all data underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data—e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

Reviewer #2: (No Response)

**********

5. Is the manuscript presented in an intelligible fashion and written in standard English?

PLOS ONE does not copyedit accepted manuscripts, so the language in submitted articles must be clear, correct, and unambiguous. Any typographical or grammatical errors should be corrected at revision, so please note any specific errors here.

Reviewer #1: Yes

Reviewer #2: (No Response)

**********

6. Review Comments to the Author

Please use the space provided to explain your answers to the questions above. You may also include additional comments for the author, including concerns about dual publication, research ethics, or publication ethics. (Please upload your review as an attachment if it exceeds 20,000 characters)

Reviewer #1: All the required changes are addressed properly in the revised version. I am satisfied now with the revised version now and agree to accept.

Reviewer #2: All suggested comments have been carefully addressed, and detailed responses are provided in the revised manuscript.

**********

7. PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: No

Reviewer #2: No

**********

Acceptance letter

Azim Uddin

2 Dec 2024

PONE-D-24-40368R1

PLOS ONE

Dear Dr. Wang,

I'm pleased to inform you that your manuscript has been deemed suitable for publication in PLOS ONE. Congratulations! Your manuscript is now being handed over to our production team.

At this stage, our production department will prepare your paper for publication. This includes ensuring the following:

* All references, tables, and figures are properly cited

* All relevant supporting information is included in the manuscript submission,

* There are no issues that prevent the paper from being properly typeset

If revisions are needed, the production department will contact you directly to resolve them. If no revisions are needed, you will receive an email when the publication date has been set. At this time, we do not offer pre-publication proofs to authors during production of the accepted work. Please keep in mind that we are working through a large volume of accepted articles, so please give us a few weeks to review your paper and let you know the next and final steps.

Lastly, if your institution or institutions have a press office, please let them know about your upcoming paper now to help maximize its impact. If they'll be preparing press materials, please inform our press team within the next 48 hours. Your manuscript will remain under strict press embargo until 2 pm Eastern Time on the date of publication. For more information, please contact onepress@plos.org.

If we can help with anything else, please email us at customercare@plos.org.

Thank you for submitting your work to PLOS ONE and supporting open access.

Kind regards,

PLOS ONE Editorial Office Staff

on behalf of

Dr. Azim Uddin

Academic Editor

PLOS ONE

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Supplementary Materials

    S1 File

    (DOC)

    pone.0315424.s001.doc (139.9KB, doc)
    Attachment

    Submitted filename: Response to reviewers comments.doc

    pone.0315424.s002.doc (11.5MB, doc)

    Data Availability Statement

    All relevant data are within the paper and its Supporting Information files.


    Articles from PLOS ONE are provided here courtesy of PLOS

    RESOURCES