# An Intelligent DOA Estimation Error Calibration Method Based on Transfer Learning
## 3 Models and Methods
### Error Calibration Method Based on Transfer Learning  
After training a CNN-based intelligent DOA estimation model with a large number of ideal simulation signal samples, the CNN model is used as a pretrained model. A small number of actual signal samples are used to fine-tune the pretrained model. Figure 7 shows the error calibration method based on transfer learning. The first \(t\) convolutional layers are frozen, and the weight is not updated. The weight of the \(t+1\)-th to the last convolutional layer and the weight of the fully connected layer is updated. That is to keep the parameters \(\Omega_{1}\in\Omega\) unchanged. \[\Omega_{1}=\left\{\left\{k_{j}^{1},b_{j}^{1}\right\}_{j=1}^{N_{1}},\left\{k_{ j}^{2},b_{j}^{2}\right\}_{j=1}^{N_{2}},\ldots,\left\{k_{j}^{i},b_{j}^{i} \right\}_{j=1}^{N_{t}}\right\}\in\Omega \tag{18}\]  
The parameters \(\Omega_{2}\in\Omega\) are updated. \[\Omega_{2}=\left\{\left\{k_{j}^{t+1},b_{j}^{t+1}\right\}_{j=1}^{N_{t+1}}, \ldots,\left\{k_{j}^{5},b_{j}^{5}\right\}_{j=1}^{N_{5}},\left\{W,b^{{}^{\prime }}\right\}\right\}\in\Omega \tag{19}\]  
The gradient of the convolutional layers is calculated as follows:  
\[\frac{\partial E_{conv}}{\partial k_{i,j}^{l}}=\frac{\partial E_{conv}}{ \partial a_{j}^{l}}\frac{\partial a_{j}^{l}}{\partial k_{i,j}^{l}} \tag{20}\]  
where \(a_{j}^{l}\) is the input sum of the \(j\)-th neuron of the \(l\)-th convolutional layer, \(k_{i,j}^{l}\) is the weight of the convolutional layer, which represents the connection weight between the \(i\)-th neuron of the \(l\)-th layer and the \(j\)-th neuron of the \(l+1\)-th layer, and \(\partial E_{conv}\) is the error of convolutional layers. When updating the weights, the gradient descent algorithm is used to calculate the gradient \(g\) for a batch of samples. \[g=\frac{1}{m}\sum_{i=1}^{m}\frac{\partial E_{i}}{\partial\varphi} \tag{21}\]  
where \(m\) is the number of samples for a batch, and \(\partial E_{i}\) is the sample error. Adaptive time estimation (Adam) is used to optimize the gradient. The gradient of the first-order moment vector \(s\) and the second-order moment vector \(r\) over time \(t\) is calculated as follows:  
\[s_{t}=\rho_{1}s_{t-1}+(1-\rho_{1})g_{t} \tag{22}\]  
\[r_{t}=\rho_{2}r_{t-1}+(1-\rho_{2})g_{t}^{2} \tag{23}\]  
where \(\rho_{1}\) and \(\rho_{2}\) are the exponential decay rates of moment estimation. The calibrated first-order moment vector deviation \(\xi_{t}\) and second-order moment vector deviation \(\hat{r}_{t}\) are as follows:  
\[\hat{s_{t}}=\frac{s_{t}}{1-\rho_{1}^{t}} \tag{24}\]  
\[\hat{r_{t}}=\frac{r_{t}}{1-\rho_{2}^{t}} \tag{25}\]  
\(\eta\) is the learning rate, \(\theta\) is a small constant--generally \(10^{-8}\)--and the weights are updated as follows:  
\[k_{i,j}^{l}=k_{i,j}^{l}-\frac{\eta\hat{s_{t}}}{\sqrt{\hat{r_{t}}+\theta}} \tag{26}\]  
\[b_{j}^{l}=b_{j}^{l}-\frac{\eta\hat{s_{t}}}{\sqrt{\hat{r_{t}}+\theta}} \tag{27}\]  
When the model has trained to convergence again, the training is stopped. The Algorithm \(1\) is as follows. \[\Omega_{2}=\left\{\left\{k_{j}^{t+1},b_{j}^{t+1}\right\}_{j=1}^{N_{t+1}}, \ldots,\left\{k_{j}^{5},b_{j}^{5}\right\}_{j=1}^{N_{5}},\left\{W,b^{{}^{\prime }}\right\}\right\}\in\Omega \tag{19}\]0 Proposed transfer learning method. ```
0: A large number of ideal simulation signal samples \(D_{S}\), A small number of actual samples \(D_{T}\). 0: Fine-tuning trained DOA estimation model \(f_{T}\) Process:
1: Use a large number of ideal samples \(D_{S}\) to train an intelligent DOA estimation model based on CNN. 2: Set the number of training iterations \(T\) and a smaller learning rate \(\eta\). 3: Freeze the parameters \(\left\{\left\{k_{j}^{1},b_{j}^{1}\right\}_{j=1}^{N_{1}},\left\{k_{j}^{2},b_{j}^ {2}\right\}_{j=1}^{N_{2}},\ldots,\left\{k_{j}^{t},b_{j}^{t}\right\}_{j=1}^{N_{ t}}\right\}\) of the previous \(t\)-th convolutional layers.