# Improved MSRN-Based Attention Block for Mask Alignment Mark Detection in Photolithography
## 4 Experiment and Results
### Evaluation Metrics  
To evaluate the model, there are different methods to quantitatively evaluate the image quality in the field of image resolution restoration. Among the various methods, Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index Measure (SSIM) were applied for evaluation. PSNR represents the power value of noise concerning the maximum power of the signal and is mainly used to evaluate image quality loss information in lossy compression. PSNR is defined as follows:  
\[PSNR =10 log_{10}\left(\frac{MAX_{I}^{2}}{MSE}\right) \tag{13}\] \[=20 log_{10}(MAX_{I})-10 log_{10}(MSE)\]  
_MAX_(_I_) is the maximum value of the corresponding image and becomes 255 in the case of an 8-bit grayscale image. Mean square error (_MSE_) is calculated in accordance with Equation (14). A small _MSE_ value means that it is very close to the original, so the higher the _PSNR_ value, the smaller the loss.  
\[MSE=\frac{1}{mn}\sum_{i=0}^{m-1}\sum_{j=0}^{n-1}\left[I(i,j)-K(i,j)\right]^{2} \tag{14}\]  
where \(I\) is a grayscale image of size \(m\times n\), and \(K\) is an image including noise in \(I\). Since there is _MSE_ in the denominator, the smaller the _MSE_, the larger the _PSNR_. Therefore, a high-quality image will have a relatively large _PSNR_, and a low-quality image will have a relatively small _PSNR_.  
_SSIM_ evaluates the similarity to the original image as a method for image quality evaluation. This is an index to overcome the limitations of _PSNR_, and it is a method of obtaining the similarity of images considering L (Luminance), C (Contrast), and S (Structure). It has a value between zero and one, and the closer it gets to one, the higher the similarity. The evaluation method of _SSIM_ is defined as follows:  
\[SSIM(x,y)=[I(x,y)]^{\alpha}\cdot[c(x,y)]^{\beta}\cdot[s(x,y)]^{\gamma} \tag{15}\]  
To proceed with the quantitative evaluation of the image quality of the proposed model, Precision, Recall, Accuracy, _F1-score_, mAP, and Intersection Over Union (_IOU_) were verified based on the _TP_, _FP_, _FN_, and _TN_, which define the relationship between the answer provided by the model for evaluating the detection of an object and the actual result.  
Precision is the proportion of what the model classifies as true that is actually true. The evaluation formula is expressed as follows:  
\[Precision=\frac{TP}{TP+FP} \tag{16}\]  
The recall is the ratio of those predicted by the model to be true among those that are true, and is expressed as follows:  
\[Recall=\frac{TP}{TP+FN} \tag{17}\]  
Accuracy is an intuitive evaluation indicator that can indicate the performance of a model. Accuracy is the number of correctly predicted data divided by the total amount of data.  
The formula is expressed as  
\[Accuracy=\frac{TP+TN}{TP+FN+FP+TN} \tag{18}\]The _F1-score_ is the harmonic average of precision and recall, and is expressed as follows:  
\[F1-Scroe=\frac{Precision\times Recall}{Precision+Recall} \tag{19}\]  
_IOU_ is an indicator that determines whether the detection of each object is successful in general object detection. It is evaluated through the size of the area where the two boxes represent the actual object position and the predicted object overlap, and is expressed as a metric as follows:  
\[IOU=\frac{Area\ of\ Overlap}{Area\ of\ Union} \tag{20}\]