## 3 Anomaly Detection Process for Battery Cells
### The Principle of RPCA  
RPCA decomposes the observation data matrix \(\mathbf{D}\) into a low-rank matrix \(\mathbf{A}\) and a sparse matrix \(\mathbf{E}\), as shown in Figure 5. Here, the low-rank matrix \(\mathbf{A}\) retains the main components of the data, while the sparse matrix \(\mathbf{E}\) contains random noise in the observed data. Using RPCA can identify the most essential elements and structures within the data effectively, simplifying the original data. The principle is shown below.  
Figure 4: Process of anomaly detection for battery cells.  
Figure 3: Charging curves of 238 series-connected battery cells.  
The decomposition problem of an observed data matrix can be modeled as the following convex optimization problem.  
\[\begin{array}{l}\min\limits_{\mathbf{A},\mathbf{E}}\mathbf{A}_{*}+\lambda\|\mathbf{E}\|_{1,1}\\ \text{s.t. }\mathbf{D}=\mathbf{A}+\mathbf{E}\end{array} \tag{1}\]  
Here, \(\mathbf{D},\mathbf{A},\mathbf{E}\in\mathbb{R}^{m\times n}\).  
Equation (1) is solved by using the ADMM, and an augmented Lagrangian function is constructed.  
\[L(\mathbf{A},\mathbf{E},\mathbf{Y},u)=\|\mathbf{A}\|_{*}+\lambda\|\mathbf{E}\|_{1,1}+<\mathbf{Y},\mathbf{D} -\mathbf{A}-\mathbf{E}>+\frac{u}{2}\|\mathbf{D}-\mathbf{A}-\mathbf{E}\|_{F}^{2} \tag{2}\]  
Here, \(\lambda\) is the Lagrange multiplier. When \(\mathbf{Y}=\mathbf{Y}_{k}\) and \(u=u_{k}\), the alternating method is used to solve the block optimization problem:  
\[\min\limits_{\mathbf{A},\mathbf{E}}L(\mathbf{A},\mathbf{E},\mathbf{Y}_{k},u_{k}) \tag{3}\]  
For \(k=1,2,3,\ldots\), the ADMM iteratively updates \(\mathbf{A}\) and \(\mathbf{E}\) until convergence is achieved.  
\[\mathbf{A}_{k+1}=\underset{\mathbf{A}}{\text{argmin}}L(\mathbf{A},\mathbf{E}_{k+1},\mathbf{Y}_{k},u_{k})=D_{\frac{1}{u_{k}}}(\mathbf{D}-\mathbf{E}_{k+1}+\frac{\mathbf{Y}_{k}}{u_{k}}) \tag{4}\]  
\[\mathbf{E}_{k+1}=\underset{\mathbf{E}}{\text{argmin}}L(\mathbf{A}_{k+1},\mathbf{E},\mathbf{Y}_{k},u_{k})=S_{\frac{\lambda}{u_{k}}}(\mathbf{D}-\mathbf{A}_{k+1}+\frac{\mathbf{Y}_{k}}{u_{k}}) \tag{5}\]  
Here, \(D_{\frac{1}{u_{k}}}\) is the singular value threshold operator, and \(S_{\frac{\lambda}{u_{k}}}\) is the soft threshold operator. \(D_{\frac{1}{u_{k}}}\) is specifically designed to handle the low-rank approximation problems of matrices, which is implemented through Singular Value Decomposition (SVD), as shown in Equation (6).  
\[\mathbf{D}=\mathbf{U}\mathbf{E}\mathbf{V}^{T} \tag{6}\]  
Here, \(\mathbf{U}\in\mathbb{R}^{m\times m}\), \(\mathbf{\Sigma}\in\mathbb{R}^{m\times n}\), \(\mathbf{V}\in\mathbb{R}^{n\times n}\), \(\mathbf{U}\), and \(\mathbf{V}\) are orthogonal matrices, while \(\mathbf{\Sigma}\) is a diagonal matrix. Here, \(\mathbf{\Sigma  
Here, \(\rho>1\), which is a constant, and \(\varepsilon>0\), which is a small positive number.  
The characteristics of series-connected battery cells should be consistent, and the rows of the voltage data matrix composed of battery cells should have strong similarities; therefore, the data matrix should have a low rank. In an ideal state, the rank of this data matrix should be 1. However, abnormal voltages caused by inconsistency among battery cells and random noise destroy this low-rank property. Therefore, to restore the low-rank structure of the battery cell voltage data, the RPCA is used to denoise and extract the anomaly components.