## 3 Data Fusion Method Based on Self-Adaptive
### BackPropagation Algorithm Based on Neighborhood Search Structure Design  
The main function of the backpropagation algorithm based on neighborhood search is to learn the mapping relationship between inputs and outputs, demonstrating powerful nonlinear mapping capabilities even with a three-layer network. In this paper, a three-layer neural network structure is designed for the fusion method of attitude information based on visual and inertial measurements. The network structure includes an input layer, a hidden layer, and an output layer. The input layer comprises six nodes corresponding to three attitude angles derived from visual estimation and three attitude angles from inertial measurement (namely azimuth, pitch, and roll angles). The output layer consists of three nodes representing the fused final output attitude angles. The scale of the backpropagation network is determined by the depth of the hidden layer and the number of neurons per layer, which directly affects the performance of the network. Therefore, determining the number of hidden layer neurons is crucial for building a training model. In general, the formula for determining the number of hidden layer neurons is as follows:  
\[\left\{ \begin{aligned} & count_{hidden}=\sqrt{count_{input}+count_{output}}+a\\ & count_{hidden}=\log_{2}count_{input}\\ & count_{hidden}=2 count_{input}+count_{output}\\ & count_{hidden}=\frac{count_{input}+count_{output}}{2}\end{aligned} \right. \tag{5}\]  
Figure 2: Fusion method of visual and inertial combined measurements. where \(count_{input}\) and \(count_{output}\) represent the number of neurons in the input layer and the output layer. \(\alpha\) is the regulatory parameter between 0 and 10. \(count_{hidden}\) represents the number of neurons in the hidden layer. The number of nodes in the input layer is usually determined according to the dimension of the input data, and the number of nodes in the output layer is determined according to the dimension of the output data. For the backpropagation algorithm of this system, there are six nodes in the input layer and three nodes in the output layer. Using Formula (5), the number of hidden layer neurons in the backpropagation algorithm can be obtained, and the value range should be between 3 and 15. In the design of neural network structure, the number of neurons in the hidden layer is typically greater than that in the input layer, a phenomenon widely documented in the literature [17]. Based on this, the present study sets the range of neuron numbers in the hidden layer from 6 to 15. This range is selected based on a comprehensive consideration of network complexity and computational efficiency. Specifically, the minimum number of neurons in the hidden layer is set to 6 to ensure that the network has sufficient capacity to capture the basic features of the input data; the maximum is set to 15 to maintain the model's generalization ability while avoiding overfitting. This range of neuron numbers is intended to balance the learning ability of the model with the consumption of computational resources, aiming to achieve optimal network performance. In this study, to implement the backpropagation algorithm, we adopted MATLAB R2022b as the main software tool. We utilized its built-in Deep Learning Toolbox to construct and train the backpropagation algorithm structure. When training a neural network, the maximum number of iterations is set to 600, and the learning rate is set to 0.01. At the same time, in order to optimize the network parameters, we used Gradient Descent with Momentum as an optimizer. We utilized a dataset comprising 10,000 samples. To evaluate the predictive performance of the model, the dataset was partitioned into training, testing, and validation sets. The training set consisted of 7000 samples, accounting for 70% of the total dataset. The testing set included 1500 samples, representing 15% of the total dataset. Similarly, the validation set also comprised 1500 samples, making up the remaining 15% of the dataset.