# Research on Data Link Channel Decoding Optimization Scheme for Drone Power Inspection Scenarios
## 2 Materials and Methods
### Prior Work
#### 2.3.2 Codebook-Based Quantization Method
* Codebook-based weight parameter quantization: In the proposed new-SNNMS LDPC decoding neural network, the parameters in the network are quantized. First, the decimal places of float32 floating-point weights are quantized to q bits. Then, a codebook-based weight quantization method is used to reduce the number of weight types to \(2^{c}\). This approach decreases the precision of each weight and reduces the variety of network weight values. By incorporating these techniques into the NNMS LDPC decoding network, the shared neural network trainable parameters and codebook-based weight parameter quantization effectively reduce the computational complexity while maintaining decoding performance. The codebook-based quantization of the shared-parameter neural-network-normalized min-sum (shared-NNMS-Q) decoding network can be represented as a deep feed-forward neural network consisting of one input layer, L check node layers, L variable node layers, and one output layer. It comprises three types of neurons: neuron I (check node layer), neuron II (variable node layer), and neuron III (output layer). The deep-learning-based SNNMS decoding network, driven by a model, is illustrated in Figure 6.  
We proposed the new-SNNMS algorithm, replacing Formulas (2) and (3) of the NNMS algorithm with Formulas (4) and (5) through the forward propagation of interpretable neural networks. Neuron I (check node layer neuron) calculates the CN-to-VN messages in the CN layer:  
\[U_{cv}^{l}=w_{vc}^{l}\times\prod_{\sigma^{\prime}\in V_{l}\backslash i}\text{ sgn}\Big{(}U_{\sigma^{\prime}c}^{(l-1)}\Big{)}\cdot\min_{\sigma^{\prime}\in V_{l} \backslash i}\Big{|}U_{\sigma^{\prime}c}^{(l-1)}\Big{|} \tag{4}\]  
Figure 6: Multi-hop single-link model based on multi drone relay system. Neuron II (variable node layer neuron) calculates the VN-to-CN messages in the VN layer:  
\[U_{vc}^{l}=L_{v}+\sum_{c^{\prime}\in C_{i}\backslash j}\left(W_{cv}\times U_{c^ {\prime}v}^{l}\right) \tag{5}\]  
Neuron III (output layer neuron) calculates the final output in the output layer:  
\[o_{i}=\sigma\left(L_{v}+\sum_{c^{\prime}\in C_{i}\backslash j}\left(W_{cv} \times U_{cv}^{(l_{\text{max}})}\right)\right) \tag{6}\]  
where L denotes the iteration index, \(L_{max}\) represents the maximum number of iterations, and \(\sigma\)(x) denotes the activation function. Based on the above equations, it can be observed that the shared neural network with learnable weight vector \(w_{cv}\) and correction factor \(w_{vc}\) employs different sharing schemes, significantly reducing the number of weights and parameters in the network. While parameter sharing effectively reduces the required number of parameters, the use of float32 floating-point values still hinders the hardware implementation of the neural network decoder. Therefore, a codebook-based weight quantization method is applied. In the proposed shared normalized min-sum (shared NNMS) decoding neural network, which incorporates shared parameters, the training parameters of each layer undergo two quantization operations. Firstly, the precision of the weights and parameters is quantized. Then, based on a codebook, weight sharing is performed to further reduce the number of weight types in the network. This method effectively quantizes the weights and parameters in the network, reducing computational complexity and decoding latency without significant performance degradation.