# Piston Error Measurement for Segmented Telescopes Based on a Hybrid Artificial Neural Network
## 2 Piston Error Detection Method Based on Hybrid Neural Network
### Use BP Network to Detect the Absolute Value of Piston Errors from MTF  
According to Equation (10), when the system parameters are determined and the piston errors are given, the sidelobes of the system MTF can be directly obtained. However, when the values of the MTF sidelobes are obtained, it is very difficult to use Equation (10) to solve the piston errors in reverse. [PERSON] et al. utilized piecewise quartic polynomials to fit the theoretical relationship, but different polynomial coefficients are needed to be constructed in different piston error detection ranges. Thus, the implementation is complicated, and most importantly their method cannot distinguish the signs of piston error. In our work, a BP network is used to learn the mapping relationship between the absolute value of piston error and the MTF sidelobes. When the network training is completed and the value of the MTF sidelobes is input to the network, the absolute value of the corresponding sub-mirror piston error can be directly output. The reason we use a BP neural network to realize the detection of the absolute value of piston error is that the established theoretical relationship between the MTF and the piston value is quite clear, it is just a mapping relation from data to data, which can be easily modeled by a BP network. The structure diagram of the BP neural network is shown in Figure 8, which contains three layers: an input layer, hidden layer, and output layer. The dark blue circle nodes in each layer represent artificial neurons, which are analogous to axons in a biological brain. The \(m\)-dimensional vector \(\mathbf{x}\) is the input signals, the \(n\)-dimensional vector \(\mathbf{y}\) is the signals of the hidden layer, and the \(p\)-dimensional vector \(\mathbf{o}\) stands for the final output signals. The connection using arrows between neurons illustrates transmitting of the signals from one  
Figure 6: The structural diagram of the Resnet network. Figure 7: Different residual elements. neuron to next neuron. The receiving neuron can process the signals and then signal to downstream neurons connected to it. The relation between the signals of the receiving neurons and the emitting neurons can be shown as \(y_{k}=\varphi\bigg{(}\sum\limits_{i=1}^{m}x_{i}w_{ik}-b_{ik}\bigg{)}\), where \(\varphi(\cdot)\) is called activation function, \(m\) is the number of the input neurons, \(w_{ik}\) is the weight for the \(i\)th input signal \(x_{i}\), and \(b_{ik}\) is the bias which used to properly shift the results of this linear transformation. The same relationship also exists between the output signals \(o\) and the signals \(y\) in the hidden layer, where \(v_{ik}\) represents the weight coefficient. The weights and bias are unknown, and the process of adjusting the weights such that they can learn the appropriate mapping relations between the inputs and the outputs is called learning or training. The training begins with random weights, and the goal is to adjust them so that the error defined by the difference between the expected outputs and the actual network outputs will be minimal. The BP network algorithm can be divided into two steps: forward propagation and back propagation. In the forward propagation process, the input signal of the input layer is propagated to the output layer through the hidden layer, then the actual outputs are obtained. In the back propagation process, the difference between the actual output and the expected output of the network is taken as the error signal, and the error signal is propagated layer by layer from the output layer to the input layer, and the weights and thresholds of the network are adjusted by a certain algorithm. Through one forward propagation and one back propagation, one update of the network parameters can be realized.