# Distinction of Scrambled Linear Block Codes Based on Extraction of Correlation Features
## 4 Scrambled Linear Block Code Identification Based on Correlation Features Extraction Network
### Input-Output Relationship of Each Network Layer  
The input \(2\times\beta\) training data are represented as \(I_{N,T}\), where \(N\) represents the dimension of the two features, and \(T\) is the number of sampling points. The input-output relationship of each network layer is detailed as follows:  
(1) Input layer:  
\[Input=I_{N,T}. \tag{22}\]  
(2) Convolutional layer:  
\[y_{m}^{(2)}(j,k)=f(\sum\limits_{i=1}^{3}I_{j,(k-1)\times 1+i}\times\text{ker}_{m} ^{(2)}+b_{m}^{(2)}(j,k)). \tag{23}\]  
(3) LSTM layer:  
\[h_{t}=f(W_{hx}y_{m,i}^{(3)}(j)+W_{hh}h_{t-1}+b_{h}), \tag{24}\]  
\[h_{t}^{n}=f(W_{h^{n-1}u}h_{t}^{n-1}+W_{h^{n}u}h_{t-1}^{n}+b_{h}^{n}), \tag{25}\]  
\[y_{m}^{(4)}(j)=W_{h^{N}y}h_{t}^{N}+b_{y}, \tag{26}\]  
where \(W_{hx}\) represents the weight matrix between the input layer and the hidden layer, \(W_{hh}\) represents the weight matrix between the hidden layers, \(h_{t}\) represents the hidden activation at time \(t\), \(n(n=1,2,\dots,N)\) represents the current network layer, and \(h_{t}^{n}\) represents the \(n\) layer and output at time \(t\).  
(4) SoftMax layer:  
\[y^{5}(j)=f(\sum\limits_{i=1}^{n_{4}}y^{(4)}(i)\times w^{(5)}(i)+b^{(5)}(j)). \tag{27}\]  
where \(w_{i}^{(5)}(l)\) represents the connection weight between the fifth and sixth layers, and \(n_{4}\) is the number of neurons in the fifth layer.  
The SoftMax layer calculates the probability estimate of the corresponding category in the sample, and the learned hypothesis function \(h_{\theta}(x)\) is expressed as follows:  
\[h_{\theta}(y^{i})=\begin{bmatrix}p(q^{(i)}=1\Big{|}y^{(i)};\theta)\\ p(q^{(i)}=2\Big{|}y^{(i)};\theta)\\ \dots\\ p(q^{(i)}=k\Big{|}y^{(i)};\theta)\end{bmatrix}=\frac{1}{\sum\limits_{j=1}^{k}e ^{\theta^{T}y^{(i)}}}. \tag{28}\]  
where \(\theta_{1},\theta_{2},\dots,\theta_{k}\in R^{n+1}\) is the model parameter. To simplify the model, we define the function  
\[l\{\alpha\}=\begin{cases}1,&\alpha=true\\ 0,&\alpha=false\end{cases}. \tag{29}\]  
The cost function of the SoftMax layer can be further expressed as  
\[J(\theta)=-\frac{1}{m}(\sum\limits_{i}^{m}\sum\limits_{j=1}^{k}l\{q^{(i)}=j \}\log\frac{e^{\theta^{T}y^{(i)}}}{\sum\limits_{l=1}^{k}e^{\theta^{T}y^{(i)}}}. \tag{30}\]  
By superimposing the \(k\) values, the probability that the network classifies the scrambled data into the \(j\)-th category is  
\[p(q^{(i)}=j|y^{(i)};\theta)=\frac{e^{T}_{j}y^{(i)}}{\sum\limits_{l=1}^{k}e^{T}_ {j}y^{(i)}}. \tag{31}\]where the maximum probability corresponds to the classification category of the scrambling code.  
We first extract the autocorrelation and the intercorrelation features of the code element data used as input data; compared with the method in [27], the training and learning of the neural network are carried out, and the biggest advantage of a neural network over manually extracting features is that it can learn the training autonomously, so the recognition effect is better than simply manually extracting features. Compared with the method in Reference [26], a detailed neural network model is constructed, but the autocorrelation features and the intercorrelation features extracted in this paper have better anti-BER and noise performance than the matrix rank features in Reference [26]. When the BER is greater than 0.1, the matrix rank features become extremely insignificant because of erroneous code elements, and this leads to weaker features extracted by the neural network. Therefore, the current method in this paper achieves better results.