# Spatial Monitoring of Wafer Map Defect Data Based on 2D Wavelet Spectrum Analysis
## 3 Wavelet Spectrum Based 2D Statistical Process Control
The wavelet function of the original image (2) can be re-written with a self-similar model in the fractional Brownian field, \(B_{H_{l}^{i}}(\mathbf{u})\), and the detailed coefficients of a single window \(d_{j,\mathbf{k}}^{i,l}\) can be defined as: \[d_{j,\mathbf{k}}^{i,l}=2^{j}\int_{\mathbb{R}}B_{H_{l}^{i}}(\mathbf{u})\ \psi^{j,l}\big{(}2^{j}\mathbf{u}-\mathbf{k}\big{)}\ d\mathbf{u},\] (8) where the detailed coefficients have zero mean and variance: \[E\bigg{[}\Big{|}d_{j,\mathbf{k}}^{i,l}\Big{|}^{2}\bigg{]}=2^{2j}\iint\psi^{j,l} \big{(}2^{j}\mathbf{u}-\mathbf{k}\big{)}\psi^{j,l}\big{(}2^{j}\mathbf{v}-\mathbf{k}\big{)}E \bigg{[}B_{H_{l}^{i}}(\mathbf{u})B_{H_{l}^{i}}(\mathbf{v})\bigg{]}\ d\mathbf{u}d\mathbf{v}.\] (9)  
If there is some replacement \(\mathbf{p}=2^{j}(\mathbf{u}-\mathbf{v}),\ \mathbf{q}=2^{j}\mathbf{v}-\mathbf{k}\) for a simplification, Equation (8) is modified as:  
\[E\bigg{[}\Big{|}d_{j,\mathbf{k}}^{i,l}\Big{|}^{2}\bigg{]}=-\frac{\sigma_{H_{l}^{i }}^{2}}{2}2^{2j}\iint\psi^{j,l}(\mathbf{p}+\mathbf{q})\psi^{j,l}(\mathbf{q})\big{|}\mathbf{p} \big{|}2^{H_{l}^{i}}2^{-(2H_{l}^{i}+2)j}\ d\mathbf{p}d\mathbf{q}. \tag{10}\]  
Taking the natural logarithm of the variance of Equation (9), we can obtain the regression form of wavelet energy:  
\[\log_{2}E\bigg{[}\Big{|}d_{j,\mathbf{k}}^{i,l}\Big{|}^{2}\bigg{]}\approx-\big{(}2 H_{l}^{i}+2\big{)}j+C_{l}^{i}, \tag{11}\]  
where \(C_{l}^{i}\) denotes a constant composed of the integrals of wavelet functions. Using the generalized power spectrum and linear relationship, the Hurst exponents and constants of the windows are estimated. * Step 5: Define the control statistics and control limits using the density of statistics to monitor the image process. In order to distinguish the irregular pattern from a normal region, the distance between each Hurst exponent and mode of windows is calculated. Since there are three features generated from each direction of 2D DWT, the distance matrix (denoted as \(\mathbf{D}\) ) for all features to the background are considered as: \[\mathbf{D}=\left[ \begin{array}{ccc}dist_{1}&\cdots&dist_{n\times(n-1)+1}\\ \vdots&\ddots&\vdots\\ dist_{n}&\cdots&dist_{n\times n}\end{array} \right]=\sum_{i}\Big{|}H^{i}-Bg \Big{[}\mathbf{H}^{i}\Big{]}\Big{|}\] (12)where \(Bg\big{[}\mathbf{H^{i}}\big{]}\) is the background values or matrix of features and \(\mathbf{H^{i}}\) is the Hurst matrix of a whole image containing individual (scalar) Hurst exponents from each window in direction \(i\) as:  
\[\mathbf{H^{i}}=\left[ \begin{array}{ccc}H_{1}^{i}&\cdots&H_{n\times(n-1)+1}^{i}\\ \vdots&\ddots&\vdots\\ H_{n}^{i}&\cdots&H_{n\times n}^{i}\end{array} \right]. \tag{13}\]  
For the distance measurements, the \(L1\) norm is selected due to its appropriacy for the sparse model, where the distance matrix with a large normal region should be treated as the sparse matrix. From the above equation, the distance matrix \(\mathbf{D}\) is generated as the features of control statistics, which represent the degree of faults and energies with spectral information. Then, the control limits for the distance matrix are determined by the distribution of \(\mathbf{D}\). In addition to the spectral information, we can calculate the control limit by estimating the kernel density of \(\{dist_{1},\ dist_{2},\ldots,dist_{n\times n}\}\). Density estimation results show that the normal region \(N\) and suspicious regions \(S\) are divided into two parts based on the points of the valley in the distribution. If a probability of a suspicious region is more than the pre-determined rates, the maximizer of the suspicious density, \(\underset{dist\in S}{\text{argmax}}f(dist)\), is considered as the upper control limit (UCL). In WS-2 DSPC, pre-processing of the image and division of a single image into multiple windows is conducted. After wavelet coefficients are obtained by 2D DWT, the Hurst matrices from three directions are generated from spectrum analysis, where the distance matrix is calculated from the Hurst features to represent the status of processes as control statistics.