# Convolved Feature Vector Based Adaptive Fuzzy Filter for Image De-Noising
## 4 Proposed Methodology: Convolved Feature Vector Based Fuzzy Filter
### Noise Detection Mechanism
#### 4.1.3 Adaptive Threshold  
A number of existing methods [7; 8; 9; 23; 26] for impulse noise removal need either ad-hoc or pre-defined threshold values or settings. There is normally a tradeoff between simple and complex methods, simple methods are good but they may perform poorly under certain conditions whereas complex methods are not always a good choice but they perform better with an extra overhead of computational cost. Furthermore, complex methods sometime require unlike trainings for optimal arrangement of pixels which results in unpredictable responses due to unfitting procedures. Let's consider an example in which a method is trained on data set containing fairly smooth images having small amount of impulse noise, then its output will surely be a smooth image irrespective of edges and fine details. Similarly, it may perform poorly for a smooth image if it is trained on a data set containing mostly the edges, lines and the fine image details. So the performance may be irregular for the methods that require trainings as they are normally designed for large outlier values and they may fail in prediction when the impulse noise causes a slight variation in the original pixel values. In response, we have used an adaptive method which neither require training nor the user defined threshold values for noise estimation as well as noise removal. Consider an input image \(I\) and a sliding window \(\Omega^{2}=\left\{x_{i-2,j-2},\ldots,\ x_{i+2,j+2}\right\}\) of size \(5\times 5\) placed at center \(x_{i,j}\). First of all, we calculate absolute gray-level variances between central pixel and its neighbors aligning in four directions as,  
\[A_{d}(i,j)=\frac{1}{4}\left[\sum_{p\ \epsilon\ \text{Dir}^{k}}\big{|}p-x_{i,j} \big{|}\right] \tag{13}\]  
where \(Dir^{k},\ k=1,\ 2,\ 3,\ 4\), denote edge directions in horizontal, vertical and two diagonal directions as shown in Figure 3. Edge and the corrupted pixels usually contribute large \(A_{d}(i,j)\) values which makes the problem more critical. A crisp decision at this stage may lead to false detection as well as poor de-noising results. To avoid this situation, a fuzzy based mechanism is required. We have introduced two parameters \(a(i,j)\) and \(\beta(i,j)\) that are used to establish a relationship between edge and a noisy pixel and are calculated as,  
\[\alpha(i,j)=\sum_{u=-2}^{2}\sum_{v=-2}^{2}\frac{A_{d}(i+u,j+v)}{\left|Dir^{k} \right|+9} \tag{14}\]  
\[\beta(i,j)=A_{d}(i,j) \tag{15}\]  
where \(Dir^{k}\) denotes total number of directional edge pixels. Consider a pixel lying at central location \(x_{i,j}\) of the sliding window, following fuzzy rule is used to decide whether a pixel under consideration is noisy, edge or noise free pixel. \begin{tabular}{c c} \hline \hline  & _If \(\mid\alpha-\beta\mid\) is Large,_ \\  & _Then \(x_{i,j}\) is a corrupted pixel._ \\  & _Else-If \(\alpha\) and \(\beta\) both are Large,_ \\  & _Then \(x_{i,j}\) is an edge pixel._ \\  & _Else-If \(\alpha=\beta\),_ \\  & _Then \(x_{i,j}\) is a noise-free._ \\ \hline \hline \end{tabular}   
As discussed earlier, _Large_ is a fuzzy set [21] and can be represented with a fuzzy membership function as shown in Figure 4. Fuzzy membership degrees which play important role are extracted from a fuzzy membership function _Large_ as follows,  
\[\mu_{D}(i,j)=\mu_{\text{Large}}[\ \big{|}\alpha(i,j)-\beta(i,j)\big{|}, \lambda_{1},\lambda_{2}] \tag{16}\]  
In filtering phase, pixels are classified as corrupted or noise-free based on fuzzy membership degrees which are mapped from 0 to 1. Consider a simple example where endpoints of the interval are passed as input to _Large_, then zero (0) will return a noise-free pixel and one (1) will return a noisy pixel. For all the remaining options between the endpoints, the output remains ambiguous.