## 3 Proposed Adaptive Deep Learning
When \(\theta\) is set close to 1, the feature dimension of the last hidden layer of the pre-trained model is close to that of the original data; when \(\theta\) is set close to 0, the feature dimension of the last hidden layer of the pre-trained model is lower. The number of neurons in the first layer of the neural network is pre-set to be the same as the original data, and the data features are transformed through the hidden layers. The number of hidden layers and the number of neurons are determined by the original training data and \(\theta\). After the pre-training of the model, the back-propagation algorithm is used to adjust the parameters of the preset network model. The error gradient between the input training data \(v_{i}\) and the model output data \(v^{\prime}_{i}\) is adjusted, \(\delta_{h}\) is the weight of the node from the hidden layer to the next layer, and \(\delta_{i}\) is the error gradient of node \(j\). The training results were obtained using the rectified linear activation function (ReLU), but experiments showed that the normal ReLU may result in the weights not being updated. Therefore, when \(x\leq 0\), \(\alpha x\) is used instead of 0 and the value of \(\alpha\) is set to a smaller value to ensure that the weights can be updated correctly and speeds up the convergence of the network. \[A(x)=\left\{ \begin{array}{l}\alpha x,x\leq 0\\ x,x>0\end{array} \right. \tag{12}\]  
The output layer uses a sigmoid function to fit the output, ranging from 0.1 to 1, which determines the behaviour and legitimacy of the data. \[s(x)=\frac{1}{1+e^{-x}} \tag{13}\]  
Figure 3: Illustration diagram of the model of transferring learning. Figure 2: Illustration diagram of the adaptive deep learning framework. ```
procedureADL(\(v,\theta,\eta\))\(\triangleright\) adaptive deep learning \(N_{training\_data}\gets v\) if\(\theta\) is empty then \(\theta\gets 0.3\) endif if\(\eta\) is empty then \(\eta\gets 0.1\) endif \(N\leftarrow\emptyset\) \(D\leftarrow\text{sizeof}(N_{training\_data})\) \(l\gets D/5\) \(n_{i}\leftarrow\theta*D\) \(i\gets 2\) while\(i\leq l-1\)do \(n_{i}\leftarrow\left(D/i^{2}\right)+\theta*D\) \(N.append(n_{i})\) \(i\gets i+1\) endwhile \(i\gets 1\) while\(i\leq l\)do  use N to build the current layer and the \(n_{i}\) neuron node endwhile  output layer function\(s(x)\gets 1/(1+e^{-x})\) for each training sample \(v_{i}\)do  calculate the actual output of the model \(v_{i}^{\prime}\) endfor \(\delta_{k}\gets v_{i}^{\prime}*(1-v^{\prime}_{i})*(v_{i}-v^{\prime}_{i})\) \(\delta_{l}\leftarrow v_{h}^{\prime}*(1-v^{\prime}_{h})*W_{hk}*\delta_{k}\) \(W_{ij}\gets W_{ij}+\Delta W_{ij}\) \(O_{i}\Delta W_{ij}\gets W_{ij}+\eta*O_{i}*\delta_{j}\) \(b_{j}\leftarrow\delta*b_{j}\) return\(x*W+b\) endprocedure
```  
**Algorithm 1** Proposed ADL algorithm: where \(v\) is number of training data samples, \(\theta\) is the key parameter to balance the training speed and classification accuracy, \(\eta\) is the learning rate. \(N\) represents the set of neurons in the neural network; \(l\) is the number of neuron layers; \(D\) represents the dimension of the training data; and \(n_{i}\) is the \(i^{th}\) neuron. \(\delta_{k}\), \(\delta_{h}\), \(W_{ij}\), and \(O_{i}\Delta W_{ij}\) are the intermediate variables, \(W_{ij}\) denotes the weights, and \(b_{j}\) is the bias. After the model has been trained, the remaining part of the network other than the output layer is removed and the resultant model for the network is used for pre-processing. The number of neurons in the last layer of the hidden layers is the feature dimension of the output data. The algorithm determines the structure of the neural network through \(\theta\) and the data dimension. The features of the data output from the hidden layers are considered as a downscaling of the original data. The smaller the dimension of the features generated by the model, the faster the detection, at the expense of reduced accuracy. Four performance metrics are evaluated, namely accuracy, precision, recall, and F1-score.