# Spatial Monitoring of Wafer Map Defect Data Based on 2D Wavelet Spectrum Analysis
## 3 Wavelet Spectrum Based 2D Statistical Process Control  
In this section, we propose a wavelet spectrum based two-dimensional statistical process control (WS-2 DSPC). WS-2 DSPC is a procedure to detect localized faulty regions, as well as overall defective regions without any distributional assumption. First, image features are selected from 2D DWT, and wavelet spectrum analysis is performed by calculating the fault strengths of divided windows. In order to obtain the spatial characteristics from a single image, the image should be divided into multiple windows to apply 2D DWT to each window. After dividing the image, 2D DWT is conducted for each window in order to capture the potential variability of signals, where the hierarchical structure of the detailed coefficients can be constructed, where the energy of the detailed coefficients is calculated for each resolution level. Once energies are calculated for each resolution level, a linear regression model can be constructed so that Hurst exponents of the divided windows are estimated as representative values. Based on the indices, a matrix of control statistics and control limits is computed, then the spatial control chart for the image is constructed. A detailed description of the WS-2 DSPC procedure is listed below. * Step 1: Remove noise regions from raw images by applying the universal thresholding suggested by [PERSON] and [PERSON] [14], and transform the images into gray-scale. Thresholding is a de-noising method to remove the converted wavelet coefficients smaller than a specific threshold value. This step could be omitted if the images do not include any noise. In this step, we decomposed the applied images into the maximum resolution level to minimize the loss of useful information and preserve the local defects as much as possible. * Step 2: Split a \(d\times d\) matrix of image X into multiple sub-matrices as windows, \(W_{1},W_{2},\ \ldots,W_{n\times n}\), which are given as: \[\text{X}=\left[ \begin{array}{ccc}x_{1,1}&\cdots&x_{1,d}\\ \vdots&\ddots&\vdots\\ x_{d,1}&\cdots&x_{d,d}\end{array} \right]=\left[ \begin{array}{ccc}W_{1}& \cdots&W_{n\times(n-1)+1}\\ \vdots&\ddots&\vdots\\ W_{n}&\cdots&W_{n\times n}\end{array} \right],\] (6) with the total number of windows \(n^{2}\). Each window is divided into a \(\frac{d}{n}\times\frac{d}{n}\) square matrix. To apply 2D DWT, it is recommended that both the image and divided windows have a \(2^{l}\times 2^{l}\) size format for a positive integer \(l\). The larger width and height the windows have, the more possible is the precision of the monitoring; thus, the trade-off between accuracy and computation time must be considered. In order to obtain sufficient information from the wavelet hierarchy, it is desirable for the height and width of windows to be more than \(2^{5}\). * Step 3: Conduct window-wise 2D DWT to extract the representations of divided images generated by wavelets. The number of resolution levels is dependent on the dimension of the sub-matrices. If the size of windows is \(2^{l}\), 2D DWT provides \(l\) resolution levels containing wavelet coefficients. From this, three wavelet matrices per each window are generated, where the results come from three directions: horizontal, vertical, and diagonal. Conducting 2D DWT for every window using Equation (1), the \(l^{\text{th}}\) window matrix is decomposed as: \[W_{l}(\mathbf{t})=\sum_{\mathbf{k}}c_{1,\mathbf{k}}^{l}\phi_{1,\mathbf{k}}^{l}(\mathbf{t})+\sum_{j \geq 1}\sum_{\mathbf{k}}\sum_{i}d_{j,\mathbf{k}}^{i,l}\psi_{j,\mathbf{k}}^{j,l}(\mathbf{t}).\] (7)
* Step 4: Estimate the Hurst exponents of each window in three directions using wavelet spectrum analysis, which is used for calculating the control statistics of WS-SPC. As mentioned in Section 2.1, the detailed coefficients actually work as the key for capturing the vibrating pattern and energy of objects.