## 3 Impulse Detection Methodology Using Deep Learning Flexible Boundary Regression
### Impulse Detection with the Deep Learning Flexible Boundary Regression Detector
Splitting the signal into the grid cells was implicitly done by several layers of 1D-CNN. The convolutions enable us to compute predictions at different positions in a signal in an optimized way. The network downsamples the input signal by the factor stride (i.e., the factor by which the output of the layer is smaller than the input signal of the network) until the boundaryregression layer; thus, the output from the final convolution layer has the size of the predefined grid. The grid size determination enforces spatial diversity in the boundary predictions. The convolution layers employ the leaky RELU as the activation function with  
\[\psi(x)=\left\{ \begin{array}{ll}x,&ifx>0\\ 0.1x,&otherwise\end{array} \right.. \tag{4}\]  
All of the convolution layers are added by the batch normalization to create improvements in the training convergence while avoiding the regularization requirement found in other methods. The method also helps regularize the model so that the network does not need a dropout step to avoid overfitting. In the second step, the boundary regression layer predicts the output probabilities and coordinates. The boundary regression layer utilizes the anchor boxes to decouple the object prediction from the spatial location for every box. In this way, the impulse location predictor predicts the box coordinate, and the object predictor predicts the conditional probability of whether or not there is an object in the given box. The boundary box width is normalized by the sample signal length so that it falls between 0 and 1. The boundary box coordinate is parameterized to be offset by a particular cell location to ensure that it is also bounded in the range of 0 and 1. Then, the sum-squared error used as the output loss function helps to optimize the parameters of the model. Because most of the cells in the grid do not contain an impulse, but the sum-squared error weights the location error equally with the classification error, misalignment occurs; this affects the precision. To solve this issue, the two parameters, i.e., \(\alpha_{loca}\) and \(\alpha_{noObj}\), are used to increase the value of the loss component from the coordinate estimations and to decrease the value of the loss component from the confidence core for boxes that do not contain objects. This research also predicts the square root of the width to reflect the fact that small deviations in large boxes matter less than they do in small boxes; this is done instead of using the width directly to solve the problem that arises when the sum-squared error weights the error from the large boxes and small boxes equally. During training, DLFBR predicts multiple boxes for each cell, but only one box is chosen to be responsible for each impulse; the prediction box that has the highest current IOU proportion with the ground truth is selected. The loss function used to optimize the parameters of the network is shown below. Figure 4: The deep learning flexible boundary regression (DLFBR) impulse detection algorithm. \[ \begin{array}{l}L_{\theta}(o^{pred},o^{truth})=\alpha_{lox}\sum\limits_{i=0}^{G} \sum\limits_{j=0}^{B}1_{ij}^{obj}\left[\left(x_{i}^{truth}-x_{i}^{pred}\right)^{2 }\right]+\alpha_{lox}\sum\limits_{i=0}^{G}\sum\limits_{j=0}^{B}1_{ij}^{obj} \left[\left(\sqrt{w_{i}^{truth}}-\sqrt{w_{i}^{pred}}\right)^{2}\right]\\ +\sum\limits_{i=0}^{G}\sum\limits_{j=0}^{B}1_{ij}^{obj}\left(c_{i}^{truth}-c_ {i}^{pred}\right)^{2}+\alpha_{nocObj}\sum\limits_{i=0}^{G}\sum\limits_{j=0}^{ B}1_{ij}^{nObj}\left(c_{i}^{truth}-c_{i}^{pred}\right)^{2}\end{array}  \tag{5}\]  
Here, \(1_{ij}^{obj}\) denotes that it has the value 1 when the object exists in the predicted boundary box \(j^{th}\) of cell \(i^{th}\). Additionally, \(1_{ij}^{nObj}\) is almost the same, except it has a value of 1 when there are no objects in the \(i^{th}\) cell. The first component in the loss function calculates the loss related to the predicted box's center position. The second part is the loss related to the predicted box's width.