## 3 Methodology
### Attention-Averaging-Based Predictive Coding
#### 3.4.1 Attention-Averaging-Based Predictor  
In predictive coding, the accuracy of the predictor directly influences the length of transmitted information. Optimal predictor selection significantly impacts the efficacy of predictive coding. In our approach, we employed a predictor utilizing a blending concept akin to the attention-based averaging method proposed in [30]. This approach enables the blending of a linear model with a CNN, enhancing prediction accuracy. Our blending strategy stems from empirical observations of solely employing the linear or CNN models to predict ship status data. These observations revealed differing strengths of both models across different data fields. Consequently, to leverage their respective advantages, we designed an attention-averaging-based method, assigning different weights to the linear model and CNN based on distinct data properties.  
Figure 3 illustrates the structure of our attention-averaging-based predictor. Initially, the predictor takes historical data as input for both the linear regression and CNN models. The linear regression model, unique in this paper, operates without normalization, differing from conventional linear prediction methods common in data compression. It processes 2-D historical data as input and produces a 1-D vector as a predicted value for all fields. The weights in the linear model are calculated using the SVD algorithm, optimizing their performance based on historical training data rather than being theoretically derived.  
Concerning the CNN model, we adopted the WaveNet architecture [31], renowned for its success in audio processing. Within a WaveNet block, multi-layer convolutional kernels of size 2 and gradually increased diffusion rates are employed. The global CNN model structure includes normalization in the first layer, followed by a WaveNet block, a flattening layer, and two densely connected layers (as shown in Figure 4b). To optimize the model size, we applied valid padding.  
Figure 2: Flowchart of attention averaging based predictive coding.  
Subsequently, the outputs from both the linear regression and CNN models are fed into our attention averaging network alongside the original historical data. This network, comprising three densely connected layers, determines the suitable weights for the linear regression and CNN models based on current data characteristics. Notably, the weights generated by the attention averaging network are vectors rather than scalars. This distinction allows field-specific variation in the weights of the linear model and CNN in the weighted average, enabling the model to adapt predictors to diverse field characteristics.  
Moreover, the attention averaging model, by considering both the original inputs and outputs of the prediction models, dynamically adjusts weights based on different input conditions. Consequently, this approach amalgamates the strengths of linear models and neural networks. Additionally, to ensure the sum of output weights in each dimension equals 1, the Softmax function serves as the output layer activation function.  
Once the attention averaging-based predictor determines suitable weights for the two models, it computes the final predicted values using these generated weights. The aim is to optimize prediction accuracy specifically tailored to ship data.