# Classification and Regression of Muscle Neural Signals on Human Lower Extremities via BP_AdaBoost
## 2 Materials and Methods
### Design of BP_AdaBoost Classifier  
The basic concept of AdaBoost algorithm is that the initial weight \(w_{1}\) is assigned to the data set T (the initial weights \(w_{1}\) are usually the uniform distribution); then, the weak classifier \(G_{1}\) is bestowed to classify the data set T and the weight of this classifier at the time of final result voting is calculated as \(\alpha_{1}\). Secondly, the weight \(w\) through the error of the weak classifier is adjusted and given to data set T again. The voting weight \(\alpha_{2}\) is recalculated. After training \(m\) weak classifiers in turn, output \(m\) classifiers with sign function [20]. The basic process of AdaBoost is as follows in Figure 5.  
Figure 4: Extraction of muscle activity of biceps femoris.  
Figure 3: Effect of \(A\) on muscle neural activation.  
Setting the training data set as:  
\[T=\{(x_{1},y_{1}),(x_{2},y_{2}),\cdots,(x_{n},y_{n})\} \tag{4}\]  
where \(x_{i}\in x\subseteq R^{n}\), \(y_{i}\in y\subseteq\{-1,1\}\). \(x\) is the muscle neural activation of EMG signal and \(y\) is the object to be classified. The weight distribution of initialization training data is uniform [20]:  
\[D_{1}=(w_{11},w_{12},\cdots,w_{1n}) \tag{5}\]  
where \(w_{1i}=\frac{1}{n}\), \(i=1,2,3\cdots n\). \(n\) is the length of training set data. Furthermore, let \(M=1\), \(2,3\)... m represent the number of weak classifiers. The weak classifier \(G_{m}(x)\) is obtained by using the training data set with weight distribution \(G_{m}\)[20]:  
\[G_{m}(x):x\rightarrow\{-1,+1\} \tag{6}\]  
Calculate the classification error rate of \(G_{m}(x)\) on the training data set:  
\[e_{m}=P(G_{m}(x_{i})\
eq y_{i})=\sum_{i=1}^{n}w_{m,i}I(G_{m}(x_{i})\
eq y_{i}) \tag{7}\]  
where \(I(G_{m}(x_{i})\
eq y_{i})=\begin{cases}1&G_{m}(x_{i})\
eq y_{i}\\ 0&G_{m}(x_{i})=y_{i}\end{cases}\).  
Calculate the weight coefficient \(\alpha_{m}\) of \(G_{m}(x)\) at the final vote [20]:  
\[\alpha_{m}=\frac{1}{2}\log(\frac{1-e_{m}}{e_{m}}) \tag{8}\]  
The logarithm here represents the natural logarithm. Then, the weight distribution of the training data set is updated by the following formula:  
\[D_{m+1}=(w_{m+1,1},w_{m+1,2},\cdots,w_{m+1,n}) \tag{9}\]  
Update rule is:  
\[w_{m+1,i}=\frac{w_{m,i}}{Z_{m}}e^{(-\alpha_{m}y_{i}G_{m}(x_{i}))} \tag{10}\]  
Figure 5: Flow chart of AdaBoost algorithm.  
where \(Z_{m}\) is the normalization factor.  
\[Z_{m}=\sum_{i}^{n}w_{m,i}e^{(-\alpha_{m}y_{i}G_{m}(x_{i}))} \tag{11}\]  
It makes the weight \(D_{m+1}\) of \(m+1\) a probability distribution. Therefore, a linear combination of weak classifiers is constructed:  
\[f(x)=\sum_{m=1}^{M}\alpha_{m}G_{m}(x) \tag{12}\]  
The final strong classifier is obtained. The output result of the input signal after passing through the strong classifier is voted according to the sign function:  
\[G_{m}(x)=G(f(x))=\text{sign}(f(x)){=}\text{sign}(\sum_{m=1}^{M}\alpha_{m}G_{m} (x)) \tag{13}\]  
The optimization method of BP neural network classification algorithm is gradient descent method. When encountering complex objective function, its learning speed and convergence speed will become very slow, causing the objective to reach a local minimum and eventually lead to training failure [21]. Therefore, in order to improve the recognition rate of BP neural network algorithm, this article designs BP_AdaBoost reinforcement learning algorithm with BP neural network as weak classifier. Simultaneously, it solves the single binary classification function when the decision tree is used as the weak classifier in the classical AdaBoost algorithm [21].