## 3 Methodology
### Attention-Averaging-Based Predictive Coding  
Following the quantization step, a pivotal aspect of our proposed method to reduce data size involves the attention-averaging-machine-learning-based predictive coding step. In this process, a predictive model anticipates data values, comparing them with the actual values to derive errors or residuals. These residuals, representing the difference between predicted and actual data, are transmitted or stored in a reduced data size instead of the entire dataset.  
The effectiveness of predictive coding hinges on the precision of the applied predictive model. Machine-learning-based prediction offers potential for generating more accurate predicted values, which are notably successful in compressing textual and genomic data [18; 23]. However, text and genomic data's limited symbol variations enable the generation of probability values for each input symbol, facilitating their application in arithmetic encoding. Yet, directly applying existing predictive coding methods to ship status data presents a challenge. The extensive range and volume of ship status data values make generating probability values for each integer point impractical.  
To address this, we designed a tailored predictive coding process for ship status data, enabling the transmission of residual errors between predicted and true values instead of transmitting the entire sensor data for arithmetic coding. This approach proves feasible for ship status data due to its periodic generation and transmission, maintaining continuous time correlations. Leveraging transmitted historical data at the receiver end, we can pre-train a predictor based on this historical ship sensor data. Calculating the residual error between predicted and true values of current real-time ship data enables us to transmit only these residuals to the next arithmetic coding step. These residuals can be  
Figure 1: Flow chart of our proposed method. This figure is only used to show the global process of our data compression approach; therefore, it does not contain the technique details of each step. The corresponding specific structures or implementation details can be found in the subsequent sections.  
reconstructed at the receiver end using the same predictor, ensuring the retrieval of the complete required data.  
Figure 2 illustrates the specific process of our custom-designed predictive coding method. This method's key sub-step involves pre-training a predictor based on historical ship sensor data, utilized to generate predicted values for both ship and shore-side data. This pre-trained predictor enables the transmission of significantly smaller residual errors rather than the entire dataset to the subsequent arithmetic coding step. Formally, the predictor \(P\) forecasts the quantized current data \(\mathbf{y}_{t}\) using the most recent \(m\) quantized historical data \(\{\mathbf{y}_{\tau}\}_{\tau=t-m}^{t-1}\).  
Subsequently, only the predicted error \(\mathbf{e}_{t,i}=(\mathbf{y}_{t}-\mathbf{y}_{t}^{\prime})_{i}\bmod L_{i}\) is transmitted, facilitating the reconstruction of \(\mathbf{y}_{t}\) as \(\mathbf{y}_{t,i}=(\mathbf{e}_{t}+\mathbf{y}_{t}^{\prime})_{i}\bmod L_{i}\). Both sender and receiver independently calculate \(\mathbf{y}_{t}^{\prime}\) using synchronized historical data \(\{\mathbf{y}\tau\}_{\tau=t-m}^{t-1}\), ensuring identical results. Given that \(\mathbf{e}_{t}\) tends to be close to zero most of the time, predictive coding substantially reduces message length, aided by arithmetic coding in Section 3.5.