# Shoulder-Elbow Joint Angle Prediction Using COANN with Multi-Source Information Integration
## 2 COANN Network Optimization Algorithm Architecture
### COANN Network Optimization Algorithm  
In this study, the COA dynamically optimizes the network weights by minimizing the prediction error of the ANN with the updated formula in Equation (7). COANN Pseudo-Code is shown in Algorithm 1:  
\[W^{t+1}=W^{t}+S\cdot\big{(}X_{\text{best}}^{\mathrm{t}}-W^{t}\big{)}, \tag{7}\]  
where \(S\) is a population aggregation factor used to balance global exploration with localized exploitation. ```
\(n\), \(T\) = 30, 50# population size 30, 50 iterations \(d\), hidden, out = 5, [8,6,4], 2 # Input 5 nodes, Hidden layer 8\(\rightarrow\)6\(\rightarrow\)4, Output 2 nodes LB, UB = -1.0, 1.0 # Weighting range [-1, 1] # Initialize the population population = [ [np.random.uniform(LB, UB, (\(d\), hidden[0])), np.random.uniform(LB, UB, (hidden[0], hidden[1])), np.random.uniform(LB, UB, (hidden[1], hidden[2])), np.random.uniform(LB, UB, (hidden[2], out))]  for \(n\) in range(n) ]  W_best, best_fitness = None, float('inf') for \(t\) in range(T): for \(i\) in range(n):
```
#Forwardpropagation to computeRMSE h1=sigmoid(input_data @population[i][0]) h2=sigmoid(h1 @ population[i][1]) predict=sigmoid(h2 @ population[i][2]) @ population[i][3] RMSE=np.sqrt(mean((true_angles - predict)**2)) fitness=1/(1+RMSE)
#Updating the global optimum if fitness>best_fitness: W_best, best_fitness=population[i], fitness
#Updatingweights in stages fori inrange(n): ift < 0.3*T: #globalsearch \(\alpha\)=0.1*(UB - LB)*(1 - t/T) new_weights=[W + \(\alpha\)*np.random.randn(*W.shape) forW in population[i]] elift < 0.7*T: #localamush \(\text{decay}=np.exp(-t/T)\) \(\text{new\_weights}=[W*decay+0.1*(W\_best\_l-W)\) forW,W_best_l in zip(population[i],W_best)] else: #convergence attack \(\beta\)=0.05*(UB - LB) \(\text{new\_weights}=[W\_best\_l+\beta*np.random.randn(*W\_best\_l.shape) forW_best_l in W_best) population[i]=[np.clip(W, LB, UB) forW in new_weights]
#Final projections final_predict= sigmoid(sigmoid(sigmoid(new_input@W\_best[0])@W\_best[1])@W\_best[2])@W\_best[3]
```

**Algorithm 1**_Cont_. ## 3 Experimental Program Flow Design

### Pre-Experiment Preparation

Before the experiment, the skin surface of the target muscle region of the subjects was cleaned with 75% medical alcohol cotton balls, followed by the removal of localized hair with a disposable razor to reduce the epidermal impedance and minimize the interference of movement artifacts to ensure the quality of surface electromyography (sEMG) signal acquisition. According to the international standard for bioelectric signal acquisition (SENIAM guidelines), disposable Ag/AgCl electrode sheets (10 mm in diameter, pre-coated with conductive paste) were attached along the muscle belly of the target muscle to ensure that the electrodes were spaced at a distance of 20 mm and were in close contact with the skin, and then the sEMG acquisition system was activated. A six-channel sEMG acquisition device (EMG_06, Wuxi Porunin Technology Co., Ltd., Wuxi, China, sampling rate 2000 Hz, bandwidth 20-500 Hz) was used to synchronously record the EMG activities of the biceps, brachioradialis, and triceps brachii muscles and display the signal waveforms in real time through the software of the upper computer. When the acquisition was completed, the EMG signal data were transmitted to the upper computer through the transmission line in real time without loss and then stored and processed in depth with the help of MATLAB software version 2021a for subsequent research and analysis. The Experimental program flow design is shown in Figure 1.

### Subject (Of an Experiment)

Three male and two female volunteers were carefully selected for this experiment, all of whom had a body mass index (BMI) in the normal range (see Table 1 for details) and were of similar age between 23 and 26 years old.