# Neural Network System for Recognizing Images Affected by Random-Valued Impulse Noise
## 3 Proposed Method and Results  
### Proposed Method  
The paper proposes a neural network system for recognizing images exposed to random-valued impulse noise; the system has been built taking into account the stage of preliminary processing of incoming images for recognition by the system. Figure 1 shows the scheme of the proposed neural network system. The input was a color or grayscale image and entered the distorted pixel detector. Each pixel was examined for the presence of a pulse. Information about the location of noisy pixels in the form of a noise map G entered the cleaning system based on an adaptive median filter. A 3 \(\times\) 3 window was used, but if all the pixels in this small window were noisy, then the filter was applied iteratively. After calculating the median of the neighbors of the distorted pixel, this value was assigned to it. Furthermore, the already cleaned image entered the neural network recognizer, and the result is displayed as a percentage between 10 categories, since the network was trained and tested on the basis of CIFAR10. Recognizing and cleaning up random-valued impulse noise was a more difficult task than removing salt and pepper noise. A distinctive feature of the proposed scheme is the presence of a detector. The distorted pixel detector was specially designed and tested on various noise efficiencies and showed high cleaning results. The developed detector, which is part of the image recognition neural network complex, is a 3 \(\times\) 3 filter, which, by comparing the brightness of the central pixel and the brightness of its neighbors, revealed whether the pixel is noisy. The original brightness values may be close to the pulse values, and the distorted pixels may be nearby. The detection depends on the Euclidean distance between pixels and their brightness difference and calculates a weighted average value over a certain neighborhood. The similarity between any two pixels can be set as follows  
where \(\lambda(p_{k,l},p_{m,o})\)--coefficient of influence of the geometric distance between pixels, \(\eta(p_{k,l},p_{m,o})\)--coefficient of influence of brightness difference between pixels, \((k,l)\) and \((m,o)\) denote the pixel coordinates in the local area \(\Omega\), \(\psi_{\eta}\) and \(\psi_{\lambda}\)--parameters of standard deviation of coefficients. The sum \(\theta\) is calculated as follows:  
\[\varsigma_{x_{k,l}}=\sum_{x_{m,o}\in\ \Omega_{x_{k,l}}}\theta(p_{k,l},p_{m,o}). \tag{9}\]  
Assuming that \(T\) is a threshold value selected empirically, and the array \(g_{k,l}\)--map of noisy pixels, then from (8):  
\[g_{k,l}= \begin{cases}0,\ if\ \ \varsigma_{x_{k,l}}<T;\\ 1,\ if\ \varsigma_{x_{k,l}}\geq T.\end{cases}  \tag{10}\]  
Thus, the value obtained from (8) is compared with the threshold \(T\). In known approaches, the threshold is usually selected experimentally, based on an empirical analysis of the results of the detector operation. In the proposed method, we will apply a similar approach for this purpose. We recommend choosing a threshold according to Table 1. It can be concluded that as the noise intensity in the image increases, the threshold value \(T\) decreases. The proposed method used the distance between pixels and the difference in brightness values in the local window to determine the similarity between pixels. First, the pixel in question must be defined as noisy or clean. An estimate of the difference in the distance between pixels in the local window was calculated using (5). The figure represents the \begin{table}
\begin{tabular}{c c c c c} \hline N & 0.01 & 0.1 & 0.25 & 0.5 \\ \(T\) & 40 & 35 & 25 & 20 \\ \hline \end{tabular}
\end{table} 
Table 1: Threshold value \(T\) chosen for noise intensities N.  
Figure 1: Scheme of a neural network system for recognizing images exposed to random-valued impulse noise. squared distances according to the Euclidean metric \(L_{2}\) between the central pixel and its neighbors located in the window.