# Signal Interference Detection Algorithm Based on Bidirectional Long Short-Term Memory Neural Network

Authors: Ningbo Xiao; Zuxun Song
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

In the process of wireless communication, the transmission of signals will be subject to various kinds of interference, which will affect the quality of communication. Interference detection is an important part of improving the reliability of communication. When the interfering signal has the same frequency as the original communication signal, with traditional methods, it is difficult to extract feature parameters. Aiming at this special cofrequency interference signal, this paper proposes a time series signal prediction model based on deep learning and uses the difference between the predicted signal and the received signal as the eigenvalue to detect interference. In order to improve the detection rate, the eigenvalues predicted by LSTM and Bi-LSTM networks are subjected to windowing experiments. The Support Vector Machine (SVM) is used to detect the interference of eigenvalues, and the comparison results are visualized by the confusion matrix. The experimental simulation results show that the Bi-LSTM model has better feature extraction ability for time series signals, and the prediction ability of the signal and the accuracy of interference detection are higher than those of the LSTM model.


---

## Body

## 1. Introduction

The traditional interference detection method mainly analyzes the parameter characteristics such as spectrum and power of the received signal and then confirms whether there is interference. However, it is difficult to extract characteristic parameters for the interference signals with overlapping time and frequency. In recent years, deep learning algorithms have flourished and time series-based signal prediction neural network models have provided a new method for signal interference detection. Recurrent neural network (RNN) has been widely used in the study of time series data. However, when the time series of the input data is large, the RNN cannot learn the relevant information among the data [1]. It will be affected by short-term memory and has the problem of gradient disappearance, so RNN has short-term memory.Long short-term memory (LSTM) neural networks can solve the short-term memory problem by introducing gate functions in the RNN cell structure. Chen explored the attention mechanism in the prediction of stock price trends based on LSTM network. The proposed model based on LSTM significantly improves the predictive performance of stock market [2]. In terms of environmental monitoring, there is an LSTM-KF algorithm, which uses the Kalman filter to correct the prediction results; the simulation experiments on ocean Hurricane data show that the algorithm has the smallest prediction error and the best prediction accuracy [3]. Wang utilizes the deep learning technique of LSTM network to learn the spatiotemporal relationship between earthquakes at different locations and uses this relationship to make earthquake predictions [4]. In terms of fault diagnosis, Tian proposed the Error-LSTM model, which improved the accuracy and efficiency of the model according to the test error of the model, and updated the compressor vibration signal prediction model [5]. Stefenon performed time series prediction using hybrid deep learning technology with small-wavelength short-term memory and proposed a new research method for the fault prediction of distribution insulators [6]. Ma adopted a neural network based on convolutional LSTM to predict the service life of rotating machinery mining in situ vibration data [7]. Compared with the LSTM network, the proposed network performs convolutional operations on both input and state transitions. It not only retains the advantages of LSTM but also integrates time-frequency features. The scholars use the LSTM algorithm to quantify the perception of streaming video users, which not only monitors the data transmission performance in the network environment but also improves user experience satisfaction [8, 9]. In the field of medicine, Shah and other scholars observe EEG based on the LSTM model, track the activity of the brain, and help patients recover as soon as possible [10].The LSTM unit has a limitation that it cannot use future data to make predictions. To overcome the limitations of LSTM units, Schuster and Paliwal proposed Bi-LSTM, which consists of two different LSTM hidden layers with opposite output directions. In this structure, both previous and future information can be utilized at the output layer. In terms of time series prediction, Shen combines Bi-LSTM and data sequencing to prebuild the volume of architectural models in real time [11]. Zhang used the Bi-LSTM model for PM2.5 numerical prediction, and a city hourly and daily PM2.5 dataset collected from the National Environmental Monitoring Center was used to verify the predictive performance of the proposed model. The results show that the model is more accurate than other LSTM-based models [12, 13]. In the field of quality monitoring and testing, Xu proposed a method for suppressing MT power frequency interference based on long-short-term memory recurrent neural network. The output of the model is power frequency noise, and the difference between the input and output is the real signal after denoising. The measured data processing results show that this method can improve the quality of data processing [14]. Qiao proposed a tool wear detection and prediction system based on Bi-LSTM, which improves the accuracy and reduces the response time [15]. In the field of medical application, Li proposed an electrocardiogram QRS wave detection method with a windowed Bi-LSTM network [16]. By increasing the sampling window and adding a convolutional layer to the Bi-LSTM structure, the model is given the ability to extract features and a predictable model can be obtained after sample training. Geng proposed an efficient automatic epilepsy detection method based on the Bi-LSTM model, with high sensitivity and low false detection rate [17]. Using Bi-LSTM can enhance the accuracy of time-series signal prediction and provide a preliminary theoretical basis for signal interference detection.


## 2. Materials and Methods

A signal is a time series with periodic temporal correlation, and unknown sampling points can be predicted by the correlation between sampling points. According to this feature, assuming that the training signals are all normal signals, the predicted future signals should also be normal signals. In this case, calculating the difference between the real signal and the predicted signal as the detection feature can get a good detection effect. The signal prediction problem can be solved by a time prediction neural network. In essence, signal prediction is a time series prediction problem with periodic characteristics, the input is the previous received signal, and the output is the signal at the time when the prediction is desired.


### 2.1. The Structure of LSTM

As a memory model, LSTM is widely used in the processing of time series data. The control flow of LSTM is similar to that of RNN in that they process the data flowing through the cells in a forward pass. It is a special kind of RNN, but the difference is the way the state is updated between neurons. The update module of the traditional RNN is just one tanh layer as the activation layer, while there are 4 different layers in the LSTM interacting with each other. Besides the hidden state, LSTM adds a cell state. The core concept of LSTM lies in the “gate” structure and the cell state. Each computation that controls state updates can be viewed as a gating unit that decides the storage or deletion of previous information in the neuron. Control which information is used for calculation by setting different weights. The cell state is equivalent to the path of information transmission, so that the information can be transmitted in the sequence connection, which can be regarded as the “memory” of the network.A neuron of LSTM includes an input gate, a forget gate, and an output gate, as shown in Figure1; the function of the forget gate is to determine what information should be discarded or retained in the previous step. The calculation is performed according to(1)ft=σgWfxt+Ufht−1+bf.Figure 1
LSTM structure.The input gate is used to update the cell state. Determine which information in the current input is important and needs to be added, calculate the cell state, and perform the calculation according to(2)it=σgWixt+Uiht−1+bi,(3)c∼t=σhWcxt+Ucht−1+bc.Calculate the cell state at the current moment, and the calculation is performed according to(4)ct=ft×ct−1+it×c∼t.The output gate is used to determine the value of the next hidden state, passing the new cell state and new hidden state to the next time step. Theoretically, the cell state can transmit the relevant information in the process of sequence processing all the time, and the calculation is performed according to(5)ot=σgWOxt+Uoht−1+bo,(6)ht=ot×σhct.


### 2.2. Structure of Bi-LSTM

Bi-LSTM network consists of two different LSTM hidden layers with opposite output directions. Under this structure, the first layer is used as the starting input of the sequence from the left, which can be understood as starting input from the beginning of the sequence in terms of time sequence, and the second layer is used as the starting input of the series from the right. In terms of time series processing, it can be understood as the last input of the sequence and the same processing as the first layer is performed in reverse. Finally, the two obtained results are merged. The Bi-LSTM structure is shown in Figure2.Figure 2
Bi-LSTM structure.In Figure2, w1w2, w3, w4, w5, and w6, respectively, represent the connection weights between different layers and these six weights are used repeatedly at the same time.The calculation of the backward layer, the forward transmission layer, and the output layer of Bi-LSTM is performed according to(7)ht=fw1xt+w2ht−1,(8)ht′=fw3xt+w5ht+1′,(9)yt=gw4ht+w6ht′.


### 2.3. SVM Interference Detection Classifier Design

On the pattern classification problem, SVM has good binary classification performance and good generalization performance. First, the eigenvalues predicted by LSTM and Bi-LSTM are preprocessed, then it is sent to the SVM classifier for detection, and the detection accuracy with and without interference signal is obtained. Finally, the detection results are visualized. The process is shown in Figure3.Figure 3
Design of the SVM classifier.


## 2.1. The Structure of LSTM

As a memory model, LSTM is widely used in the processing of time series data. The control flow of LSTM is similar to that of RNN in that they process the data flowing through the cells in a forward pass. It is a special kind of RNN, but the difference is the way the state is updated between neurons. The update module of the traditional RNN is just one tanh layer as the activation layer, while there are 4 different layers in the LSTM interacting with each other. Besides the hidden state, LSTM adds a cell state. The core concept of LSTM lies in the “gate” structure and the cell state. Each computation that controls state updates can be viewed as a gating unit that decides the storage or deletion of previous information in the neuron. Control which information is used for calculation by setting different weights. The cell state is equivalent to the path of information transmission, so that the information can be transmitted in the sequence connection, which can be regarded as the “memory” of the network.A neuron of LSTM includes an input gate, a forget gate, and an output gate, as shown in Figure1; the function of the forget gate is to determine what information should be discarded or retained in the previous step. The calculation is performed according to(1)ft=σgWfxt+Ufht−1+bf.Figure 1
LSTM structure.The input gate is used to update the cell state. Determine which information in the current input is important and needs to be added, calculate the cell state, and perform the calculation according to(2)it=σgWixt+Uiht−1+bi,(3)c∼t=σhWcxt+Ucht−1+bc.Calculate the cell state at the current moment, and the calculation is performed according to(4)ct=ft×ct−1+it×c∼t.The output gate is used to determine the value of the next hidden state, passing the new cell state and new hidden state to the next time step. Theoretically, the cell state can transmit the relevant information in the process of sequence processing all the time, and the calculation is performed according to(5)ot=σgWOxt+Uoht−1+bo,(6)ht=ot×σhct.


## 2.2. Structure of Bi-LSTM

Bi-LSTM network consists of two different LSTM hidden layers with opposite output directions. Under this structure, the first layer is used as the starting input of the sequence from the left, which can be understood as starting input from the beginning of the sequence in terms of time sequence, and the second layer is used as the starting input of the series from the right. In terms of time series processing, it can be understood as the last input of the sequence and the same processing as the first layer is performed in reverse. Finally, the two obtained results are merged. The Bi-LSTM structure is shown in Figure2.Figure 2
Bi-LSTM structure.In Figure2, w1w2, w3, w4, w5, and w6, respectively, represent the connection weights between different layers and these six weights are used repeatedly at the same time.The calculation of the backward layer, the forward transmission layer, and the output layer of Bi-LSTM is performed according to(7)ht=fw1xt+w2ht−1,(8)ht′=fw3xt+w5ht+1′,(9)yt=gw4ht+w6ht′.


## 2.3. SVM Interference Detection Classifier Design

On the pattern classification problem, SVM has good binary classification performance and good generalization performance. First, the eigenvalues predicted by LSTM and Bi-LSTM are preprocessed, then it is sent to the SVM classifier for detection, and the detection accuracy with and without interference signal is obtained. Finally, the detection results are visualized. The process is shown in Figure3.Figure 3
Design of the SVM classifier.


## 3. Results

### 3.1. Prediction of Time Series Signals without Interference

In the AWGN channel environment, the sampling frequency fs of the received signal is set to 3 KHz, the center frequency of the communication signal is 1 KHz, and the communication signal is modulated by the BPSK mode. Both LSTM and Bi-LSTM are set to train the first 0.6 parts of the time series data and test the remaining 0.4 parts and 200 training iterations, and reduce the learning rate after the 125th training. The predicted comparison results are shown in Figure4.Figure 4
Comparison of signal prediction between LSTM and Bi-LSTM without interference.It can be seen from Figure4 that both LSTM and Bi-LSTM have better predictive ability under the same simulation conditions. But the RMSE of LSTM prediction is 0.1236, while the RMSE of Bi-LSTM is 0.0509. Bi-LSTM outperforms LSTM in the prediction ability of signals.


### 3.2. Extraction of the Eigenvalues of the Interference Signal When There Is Interference

The sampling signal of received signalrt is rn=sn+jn+wn, n = 1, 2, …, N, where N is the sampling length, sn is the received communication signal, jn is the interference signal, and wn is Gaussian white noise. The frequency of the interference signal is the same frequency as that of the communication signal, and the signal power is set to 10 dB.LSTM trains a part of the received signal and predicts the future received signal based on the previous signal sequence. After the network is trained, the remaining received signal is tested and the difference between the predicted signal and the original received signal is calculated as the detection feature. Bi-LSTM trains the network using previous and future received signals and then performs testing on the remaining received signals. The difference between LSTM and Bi-LSTM time series signal prediction as detection feature is shown in Figure5.Figure 5
Eigenvalues.From the eigenvalues in Figure5, it can be seen that no matter LSTM or Bi-LSTM, the amplitude of the signals with interference and without interference is quite different, which provides a basis for the SVM to classify the eigenvalues.


### 3.3. Influence of Data Windowing on Interference Detection

If each difference data is only used as the feature value of interference detection, the detection effect may be poor due to the random error of the data. Therefore, here we select the average value of everyn continuous difference data as an eigenvalue and use the method of constant translation to construct the complete feature of interference detection. The accuracy of interference detection under different windowing effects is shown in Figure 6.Figure 6
The effect of windowing on the detection rate of signal interference.As can be seen from Figure6, when the value predicted by LSTM is used as the eigenvalue, the optimal window value is 2, and the use of window processing can improve the interference detection rate; however, when the value predicted by Bi-LSTM is used as the feature value, the interference detection rate is reduced after windowing, so the value predicted by Bi-LSTM does not need to be windowed.


### 3.4. SVM Classifier Classification Results

The difference signal generated by LSTM is windowed with a length of 2, and the difference signal generated by Bi-LSTM is not windowed. After normalization, it is sent to SVM for classification. Label 1 is a signal without interference, label 2 is a signal with interference, and there are 300 eigenvalues for testing, of which 100 eigenvalues have interference and the remaining 200 eigenvalues have no interference. The result of detection and classification is shown in Figure7.Figure 7
Comparison of the accuracy of interference detection between LSTM and Bi-LSTM.As can be seen from Figure7, the detection rates of LSTM and Bi-LSTM are both 100% without interference; however, the detection accuracy values are different when there is interference. The interference detection value of LSTM is 98.99%, and the interference detection value of Bi-LSTM is 99.66%. The interference detection accuracy of Bi-LSTM is higher than that of LSTM.


### 3.5. Confusion Matrix

The confusion matrix is used to refine the classification results, because SVM cannot accurately represent the classification of each category; therefore, the confusion matrix is used to check the recognition accuracy under the two conditions of interference signal and no interference signal. The confusion matrix for LSTM and Bi-LSTM interference detection classification is shown in Figure8.Figure 8
Confusion matrix of LSVM and Bi-LSTM classification.As can be seen from Figure8, when the signal-to-noise ratio is 20 dB and there is interference signal, the detection accuracy of LSTM is 97% and the detection accuracy of Bi-LSTM is 99%. The prediction difference of Bi-LSTM is more conducive to detect the presence of interference signals.


## 3.1. Prediction of Time Series Signals without Interference

In the AWGN channel environment, the sampling frequency fs of the received signal is set to 3 KHz, the center frequency of the communication signal is 1 KHz, and the communication signal is modulated by the BPSK mode. Both LSTM and Bi-LSTM are set to train the first 0.6 parts of the time series data and test the remaining 0.4 parts and 200 training iterations, and reduce the learning rate after the 125th training. The predicted comparison results are shown in Figure4.Figure 4
Comparison of signal prediction between LSTM and Bi-LSTM without interference.It can be seen from Figure4 that both LSTM and Bi-LSTM have better predictive ability under the same simulation conditions. But the RMSE of LSTM prediction is 0.1236, while the RMSE of Bi-LSTM is 0.0509. Bi-LSTM outperforms LSTM in the prediction ability of signals.


## 3.2. Extraction of the Eigenvalues of the Interference Signal When There Is Interference

The sampling signal of received signalrt is rn=sn+jn+wn, n = 1, 2, …, N, where N is the sampling length, sn is the received communication signal, jn is the interference signal, and wn is Gaussian white noise. The frequency of the interference signal is the same frequency as that of the communication signal, and the signal power is set to 10 dB.LSTM trains a part of the received signal and predicts the future received signal based on the previous signal sequence. After the network is trained, the remaining received signal is tested and the difference between the predicted signal and the original received signal is calculated as the detection feature. Bi-LSTM trains the network using previous and future received signals and then performs testing on the remaining received signals. The difference between LSTM and Bi-LSTM time series signal prediction as detection feature is shown in Figure5.Figure 5
Eigenvalues.From the eigenvalues in Figure5, it can be seen that no matter LSTM or Bi-LSTM, the amplitude of the signals with interference and without interference is quite different, which provides a basis for the SVM to classify the eigenvalues.


## 3.3. Influence of Data Windowing on Interference Detection

If each difference data is only used as the feature value of interference detection, the detection effect may be poor due to the random error of the data. Therefore, here we select the average value of everyn continuous difference data as an eigenvalue and use the method of constant translation to construct the complete feature of interference detection. The accuracy of interference detection under different windowing effects is shown in Figure 6.Figure 6
The effect of windowing on the detection rate of signal interference.As can be seen from Figure6, when the value predicted by LSTM is used as the eigenvalue, the optimal window value is 2, and the use of window processing can improve the interference detection rate; however, when the value predicted by Bi-LSTM is used as the feature value, the interference detection rate is reduced after windowing, so the value predicted by Bi-LSTM does not need to be windowed.


## 3.4. SVM Classifier Classification Results

The difference signal generated by LSTM is windowed with a length of 2, and the difference signal generated by Bi-LSTM is not windowed. After normalization, it is sent to SVM for classification. Label 1 is a signal without interference, label 2 is a signal with interference, and there are 300 eigenvalues for testing, of which 100 eigenvalues have interference and the remaining 200 eigenvalues have no interference. The result of detection and classification is shown in Figure7.Figure 7
Comparison of the accuracy of interference detection between LSTM and Bi-LSTM.As can be seen from Figure7, the detection rates of LSTM and Bi-LSTM are both 100% without interference; however, the detection accuracy values are different when there is interference. The interference detection value of LSTM is 98.99%, and the interference detection value of Bi-LSTM is 99.66%. The interference detection accuracy of Bi-LSTM is higher than that of LSTM.


## 3.5. Confusion Matrix

The confusion matrix is used to refine the classification results, because SVM cannot accurately represent the classification of each category; therefore, the confusion matrix is used to check the recognition accuracy under the two conditions of interference signal and no interference signal. The confusion matrix for LSTM and Bi-LSTM interference detection classification is shown in Figure8.Figure 8
Confusion matrix of LSVM and Bi-LSTM classification.As can be seen from Figure8, when the signal-to-noise ratio is 20 dB and there is interference signal, the detection accuracy of LSTM is 97% and the detection accuracy of Bi-LSTM is 99%. The prediction difference of Bi-LSTM is more conducive to detect the presence of interference signals.


## 4. Discussion

Compared with the traditional interference detection algorithm, this paper is based on deep learning, from the perspective of time domain, using the LSTM and Bi-LSTM models that have good predictive ability for time series signals, a comparison experiment of interference detection was conducted, the eigenvalue is obtained by the difference between the predicted signal and the received signal, and the extraction and analysis of the time-domain and frequency-domain characteristic parameters of the received signal are not required, which solves the problem of signal interference detection. The simulation results show that the method of interference detection using Bi-LSTM and LSTM is feasible. Since Bi-LSTM adopts a bidirectional processing method, the prediction root mean square error value of time series signals is smaller.However, the interference detection method proposed in this paper can be further improved. First, if the communication signal and the interference signal use different modulations, the reliability of the detection accuracy needs to be verified. Second, the Bi-LSTM model still has the possibility of further optimization. Finding other methods for parameter tuning, combined with the advantages of Bi-LSTM for timing signal prediction, can further improve the detection accuracy of timing signal interference.


## 5. Conclusion

Aiming at the problem of time-frequency overlapping interference signal detection that cannot be well solved by traditional methods, this paper proposes a signal prediction interference detection model based on deep learning. The Bi-LSTM network is used to predict the value of the sampling point at a certain time more accurately by combining the information before and after the time series, and the difference between the predicted value and the received signal is used as the classification feature value. The LSTM model is compared with the Bi-LSTM model. First, in the case of no interference, the root mean square error value is calculated. The signal prediction ability of the Bi-LSTM model is better than that of the LSTM. Secondly, in order to overcome the influence of signal burst on detection, the eigenvalues are processed through the windowing strategy and LSTM model windowing can improve the detection rate, while Bi-LSTM model windowing effect is not good. Under the optimal window value, the accuracy of Bi-LSTM model and LSTM model interference detection is obtained and the results are visualized by the confusion matrix, and the results show that the interference detection ability of Bi-LSTM model is better than that of LSTM.



---

*Source: 4554374-2022-03-21.xml*