## 3 Methodology
### ConvNeXtBlock Module  
ConvNeXt [35], a purely convolutional architecture developed by Facebook AI Research and UC Berkeley, reimagines ResNet's structure using a Transformer-inspired design principles. It incorporates large-kernel (\(7\times 7\)) depthwise convolutions, inverted bottlenecks, and layer normalization while retaining the intrinsic translation equivariance and computational efficiency of convolutional networks.  
The ConvNeXtBlock framework, as the core component of ConvNeXt, replaces the original C3k2 module at the P4 layer in this paper. The frame diagram of ConvNeXtBlock  
Figure 2: The framework of the PRFE module.  
module is shown in Figure 3. It employs \(7\times 7\) depthwise convolutional operations for spatial feature extraction, effectively expanding the receptive field to incorporate broader contextual information. This design helps reduce interference from PCB backgrounds during defect detection, thereby enhancing detection accuracy. Following the depthwise convolution, ConvNeXtBlock applies LayerNorm (LN) to normalize the channel dimensions of each sample, improving model stability during training. The formulas for calculating the normalized mean and variance are as follows:  
\[\mu_{n}(x)=\frac{1}{CHW}{\sum_{c=1}^{C}{\sum_{h=1}^{H}{\sum_{w=1}^{W}{x_{n,c,h,w }}}}}, \tag{2}\]  
\[\sigma_{n}(x)^{2}=\frac{1}{CHW}{\sum_{c=1}^{C}{\sum_{h=1}^{H}{\sum_{w=1}^{W}{( x_{n,c,h,w}-\mu_{n}(x))^{2}}}}}, \tag{3}\]  
where parameters \(C\), \(H\), and \(W\) denote the number of channels, height, and width of the input feature map, respectively. The total number of learnable parameter groups is \(C\times H\times W\).  
Subsequently, ConvNeXtBlock adopts an inverted bottleneck structure. It utilizes two consecutive \(1\times 1\) convolutional layers to adjust channel dimensions, extending channel dimensions before feature compression. The combined effect of these two convolutional layers enhances the feature representation for PCB defects. Specifically, the first \(1\times 1\) convolution allows the model to learn more complex nonlinear mappings, while the second \(1\times 1\) convolution reduces computational complexity and preserves key features. Moreover, the ConvNeXtBlock exploits Gaussian Error Linear Unit (GELU) as its sole activation function, which amplifies PCB defect feature representation capabilities through stochastic regularization properties. Its calculation formula is defined as follows:  
\[GELU(x)=0.5\times x\times\left(1-\tanh\left[\sqrt{\frac{2}{\pi}}\times\left(x+0.044715x^{3}\right)\right]\right) \tag{4}\]  
The ConvNeXtBlock demonstrates exceptional effectiveness in capturing edge features and fine-grained patterns characteristic in high-density PCB defects, such as short circuits, broken traces, and missing pads. Its expansive receptive field offers distinct advantages for detecting minute defects against complex backgrounds, markedly reducing the likelihood of oversight compared to conventional approaches. Additionally, its inverted bottleneck structure and GELU activation function enhance the feature representation of PCB defects, decreasing the likelihood of false detections. These designs enable the model to better distinguish subtle defect patterns from normal circuit structures, further improving the reliability of high-density PCB inspection.