# Blister Defect Detection Based on Convolutional Neural Network for Polymer Lithium-Ion Battery
## 2 Blister Defect Detection for PLB Based on CNN
### Improved Architecture for CNN  
In the deep learning approach, deeper networks are used to accomplish complex tasks. The learning process of the neural network adopts the strategy of backpropagation, that is, the error calculated by the loss function is used to guide the update and optimization of the weights of the deep network through the backpropagation of the gradient. The deep neural network is composed of many nonlinear layers, and each nonlinear layer can be regarded as a nonlinear function. Therefore, the entire deep network can be regarded as a composite nonlinear function. The purpose of neural network learning is to make this nonlinear function perform a good mapping between input and output. To find the optimal solution of different input and output, the learning process is to find the appropriate depth network weights so that the loss function takes a minimum value. The gradient descent method is used to solve this minimum problem. Its idea is to take the negative direction of the current gradient as the search direction, and adjust the weights to make the loss function approach the local minimum, that is, let the loss function become smaller and smaller. In backpropagation, the gradient is updated layer by layer. The gradient update can be seen as multiplying the output of the upper layer network nonlinear function by a factor. If the factor is less than 1, as the number of layers increases, the gradient update will decay exponentially and become smaller and smaller, gradually disappearing. This is called the gradient vanishment; it causes poor learning and training effect. To solve the gradient vanishment problem, short paths are often created from early layers to later layers in CNN architecture. DenseNet is an efficient architecture of CNN for image classification. In DenseNet, all layers are connected directly to ensure maximum information transmission to solve the gradient vanishment problem. DenseNet uses dense block to create short paths from early layers to later layers. Dense block uses skip connections not only to connect the upper and lower layers, but also to achieve cross-layer connections. The gradients obtained from each layer are derived from the gradient concatenation of the preceding layers. Because the gradient transfers directly between layers, the effect of gradient vanishment is reduced. This kind of architecture also strengthens the transmission and usage of features. Denote the input and output of the \(d\)th layer as \(x_{d}\) and \(y_{d}\), respectively, then  
\[y_{d}=F_{d}([x_{0},x_{1},...,x_{d-1}],W_{d})\,, \tag{1}\]where \(F_{d}\) is a nonlinear transformation function, the symbol \([]\) indicates the concatenation operation, and \(W_{d}\) is the parameters of \(F_{d}\) in the \(d\)th layer. In the dense block of DenseNet, previous layer features are skipped and connected with concatenation operation. That is to say, the features of different layers are treated in an equivalent manner in this architecture. However, this is not the case in actual classification systems. Not all features of the previous layers play a key role in image classification. Only some of the key features are important for classification. Inspired by this, a novel weight-based architecture is proposed to improve the network performance of dense block. An improved dense block architecture is proposed in this paper, as shown in Figure 3. Its detailed architecture is shown in Figure 4. In this architecture, the output is  
\[y_{d}=F_{d}([x_{0}k_{d,0},x_{1}k_{d,1},...,x_{d-1}k_{d,d-1}],W_{d}), \tag{2}\]  
where \(k_{d,0},k_{d,1},...,k_{d,d-1}\) are the parameters that determine the weights of \(x_{0},x_{1},...,x_{d-1}\) to be concatenated together. These parameters are trained during the CNN training process. The whole CNN architecture proposed in this paper is illustrated in Figure 5.  
In the above architecture, the weight parameters will be effectively trained in the training of CNN network.