# Analog Circuit Fault Diagnosis Using a Novel Variant of a Convolutional Neural Network
## 3 The Proposed Method
### Convolution Kernel Dynamic Selection Mechanism  
In traditional convolutional neural networks, the receptive field of each convolutional layer is set to the same size. However, the consensus in the neuroscience community is that the size of the receptive field of visual cortex neurons is dynamically adjusted. In practical applications, the size of the receptive field of the convolutional layer often needs to be determined artificially through trial error, which requires more time and energy for researchers. In addition, the fault features of the circuit do not have the same size, and the fixed receptive field size is often sub-optimal in the feature extraction process. Therefore, this paper introduces a dynamic selection mechanism of the convolution kernel [16], which allows convolutional layer neurons to adaptively select the size of their receptive field according to the input information. As shown in Figure 1, the dynamic selection mechanism of the convolution kernel includes three steps: branch, fusion and selection.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline \(X\) & **0 th Order Mean Difference** & **1 st Order Mean Difference** & **2 nd Order Mean Difference** \\ \hline \(x_{0}\) & \(f(x_{0})\) & – & – \\ \(x_{1}\) & \(f(x_{1}  
1. Branch: given input \(X\in\mathbb{R}^{H\times W\times C}\), where \(H\), \(W\) and \(C\) denote the height, width and channel of the input, respectively, perform three convolution conversions with convolution kernel sizes of \(3\times 3\), \(5\times 5\) and \(7\times 7\), \(F_{3\times 3}:X\to U_{3\times 3}=\mathbb{R}^{H\times W\times C}\), \(F_{5\times 5}:X\to U_{5\times 5}=\mathbb{R}^{H\times W\times C}\), \(F_{7\times 7}:X\to U_{7\times 7}=\mathbb{R}^{H\times W\times C}\).
2. Fusion: the convolution transformation results of the three branches are fused by element-by-element summation \(U=U_{3\times 3}+U_{5\times 5}+U_{7\times 7}\). Then, apply global average pooling to compress the result of the fusion in the spatial dimension \(H\times W\) to obtain global feature information \(S=F_{\text{gap}}(U)=\frac{1}{H\times W}\sum\limits_{i=1}^{H}\sum\limits_{j=1} ^{W}U(i,j)\). Finally, through the fully connected layer, the global feature information \(S\in\mathbb{R}^{1\times 1\times C}\) compressed as a feature \(Z\in\mathbb{R}^{1\times 1\times d}\), the compression ratio is \(r=C/d\). The purpose of compression is to enhance the nonlinear representation ability of the model.
3. Selection: use three fully connected layers to map the features \(Z\in\mathbb{R}^{1\times 1\times d}\), and then three weight vectors \(a_{3\times 3},b_{5\times 5}\) and \(c_{7\times 7}\) are generated, respectively, where \(a_{3\times 3},b_{5\times 5},c_{7\times 7}\in\mathbb{R}^{1\times 1\times C}\). The weight vector is calculated by Softmax to obtain the result \(a_{3\times 3},b_{5\times 5},c_{7\times 7}\), then add the vector \(\hat{a}_{3\times 3},b_{5\times 5},c_{7\times 7}\) to the feature matrix \(U_{3\times 3},U_{5\times 5},U_{7\times 7}\) for weighted summation, generate the final output \(V=\hat{a}_{3\times 3}\cdot U_{3\times 3}+\hat{b}_{5\times 5}\cdot U_{5 \times 5}+c_{7\times 7}\cdot U_{7\times 7}\). Thus, the importance of different branch information can be adjusted to realize the selection of a more suitable receptive field.