# A Methodology Based on Deep Learning for Contact Detection in Radar Images
## 3 Methodology
### Phase 1: Preprocessing and Enhancement
#### 3.1.2 Gaussian Filtering  
The _bin1_ file is passed through a Gaussian filter in 1D (one dimension). Each line of the radar image is taken as if it were a signal. To explain this, we can look at the radar image as a matrix, where the columns represent the azimuths, and the rows represent the different values at a given point in space for each of the azimuths as shown in Figure 6.  
Figure 5: Preprocessing and enhancement phase flow chart. Figure 6: Radar image structure as matrix. Each column is an azimuth, and each row is the distance value given to all azimuths. Each index row starts with 0. For example, if we analyze the row with index 0, the first line, we will see the value taken at the distance of 37.5 km for all azimuths from 1 to 1024. When referring to the index, we are talking about a matrix position usually read starting with 0. If we take the index row 1, it would be the values at a distance of 37.48 km for each azimuth. So, each row can be represented as a signal or a vector of size 1024 for this case. Taking each row as a vector of 1024 values is better for visualizing the following convolution process. The convolution filter is one-dimensional because each row of the radar image is 254 convoluted with the filter and then moved to the next row. The one-dimensional convolution is depicted in Figure 7.  
An 8-term signal convoluted with a 3-term filter can be assumed in a convolution representation. Note that the terms at the ends are repeated to keep the dimension of the output signal the same as the dimension of the input signal. This technique, called padding, is used to avoid the output signal, being smaller than the input signal. If this technique is not used, the output signal would have only six terms instead of eight. A signal smoothing filter is the Gaussian filter. The purpose of a smoothing filter is to reduce the noise caused by high-frequency disturbances in a signal. The Gaussian probability equation is seen in Equation (1):  
\[f(x;\mu,\sigma)=\frac{1}{\sqrt{2\pi\sigma}}e^{-\frac{1}{2}\frac{(x-\mu)^{2}}{ (\sigma)}} \tag{1}\]  
where \(x\) is the data to be evaluated, \(\mu\) is the mean, and \(\sigma\) is the standard deviation. For one dimension and choosing a mean equal to 0, we have Equation (2):  
\[G(x)=\frac{1}{\sqrt{2\pi\sigma}}e^{-\frac{1}{2}\frac{(x)^{2}}{(\sigma)}^{2}} \tag{2}\]  
The constants \(K_{1}\) and \(K_{2}\) are then defined for the calculation of each point of the convolution filter as shown in Equations (3) and (4):  
\[K_{1}=\frac{1}{\sqrt{2\pi\sigma}} \tag{3}\]  
\[K_{2}=-\frac{1}{2\sigma^{2}} \tag{4}\]  
\(K_{1}\) belongs to the right-hand constant of the equation, and \(K_{2}\) is the exponent of the expression. Figure 7: Representation of a convolution in 1 dimension. * has been placed to represent the output value of the corresponding vector at that index, after convolution. Example: x1* is equal to the resulting convolution at the index where x1 was without *. Once the constants are replaced in Equation (2), the new equation is shown in (5):  
\[G(x)=K_{1}e^{k_{2}x^{2}} \tag{5}\]  
So, as a filter, we use a vector that follows the Gaussian likelihood ratio so that the central value in the convolution vector is \(x=0\). The best way to perform this is to consider a value \(Lk\). This value will be the points within the Gaussian distribution to be taken for each side of the mean. For example, if \(Lk=3\), seven values will be taken, where the central value will take the maximum value of the Gaussian equation. This \(Lk\) value, therefore, returns a convolution vector with \(2*Lk+1\) values representing a Gaussian distribution to eliminate noise in the radar image signal. Several equations can be used to choose the value of \(Lk\), like the equations proposed in (6) and (7):  
Figure 5:0  
Figure 5:1  
where \(F_{TK}\) is a mass approximation constant; if \(F_{TK}\) is high, it will capture a large percentage of the Gaussian distribution. However, the convolution vector will become unnecessarily large.