# Channel Code-Book (CCB): Semantic Image-Adaptive Transmission in Satellite-Ground Scenario
## 2 System Model
### The Training Process of the End-to-End Transmission Model  
For the transmission model, our goal is to minimize the difference between the output image and the input image, that is, \((\phi^{*},\phi^{\prime*})=\arg\min_{\phi,\phi^{\prime}}[d(\mathbf{s},\mathbf{ s}^{\prime})]\), where \(d(\cdot)\) is the loss function. We use the MSE function as the loss function. The MSE function is widely used in image restoration models [35; 36; 37], and the formula is  
\[\text{MSE}=\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}, \tag{6}\]  
where \(y_{i}\) is the actual value and \(\hat{y}_{i}\) is the predicted value. After training the end-to-end transmission model, it can be employed for real-time transmission. The whole process is outlined in Algorithm 1. ```
0: Dataset \(\mathbf{S}\), train epoch \(E_{p}\), learning rate \(l_{r}\), batch size \(b\). 0: Encoder parameters \(\phi\), decoder parameters \(\phi^{\prime}\), and denoiser parameters \(\theta\). 1:Training stage:
2:Initialize the model architecture. 3:for epoch = 1 : \(E_{p}\)do
4: Sample a batch of images \(\mathbf{s}_{1}\),..., \(\mathbf{s}_{b}\in\mathbf{S}\);
5: Generate semantic features \(\mathbf{x}_{1}\),..., \(\mathbf{x}_{b}\) from encoder with \(\phi\);
6: Transmit the bit streams to the receiver through a channel and get \(\mathbf{x}_{1}^{\prime}\),..., \(\mathbf{x}_{b}^{\prime}\);
7: Remove noise and fading effects from denoiser and get \(\mathbf{x}_{1}^{\prime\prime}\),..., \(\mathbf{x}_{b}^{\prime\prime}\);
8: Generate the images \(\mathbf{s}_{1}^{\prime}\),..., \(\mathbf{s}_{b}^{\prime}\) from decoder with \(\phi^{\prime}\);
9: Calculate the loss function between \(\mathbf{s}^{\prime}\) and \(\mathbf{s}\);
10: Calculate the gradient and update \(\phi\), \(\phi^{\prime}\);
11:endfor
12: Set the channel environment parameters;
13:for epoch = 1 : \(E_{p}\)do
14: Get denoising parameters from Algorithm 2;
15: Train denoising parameters \(\theta\) from Algorithm 3;
16:endfor
17:return the model parameters \(\phi\), \(\phi^{\prime}\), and \(\theta\). 18:Inference stage:
19: Choose denoising parameters through Algorithm 4;
20:Transmit images. ```  
**Algorithm 1** Training and Inference of the End-to-End Transmission Model  
```
0: Recorded channel parameters (\(b_{0}\), \(m\), \(\Omega\), SNR), train epoch \(E_{p}\). 0: Denoising model parameters \(\theta_{dn}\). 1: Recorded fixed channel parameters (\(b_{0}\), \(m\), \(\Omega\), SNR). 2:for epoch = 1 : \(E_{p}\)do
3: Transmit \(\mathbf{x}\);
4: Receive the transmitted data \(\mathbf{x}^{\prime}\) through the channel with above channel parameters;
5: Generate \(\mathbf{x}^{\prime\prime}=f(\mathbf{x}^{\prime})\) with model parameter \(\theta_{dn}\);
6: Calculate the loss function between \(\mathbf{x}^{\prime\prime}\) and \(\mathbf{x}\);
7: Calculate the gradient and update \(\theta_{dn}\);
8:endfor
9:return the final \(\theta_{dn}\) with above channel parameters;
10:Change the channel model parameters and repeat the above steps. ```  
**Algorithm 2** Training Algorithm for Channel Code-Book MappingNet  
```
0: Input features \(\mathbf{x}^{\prime}\). 0: Denoiser parameters \(\mathbf{W}\) and \(\mathbf{b}\). 1: Initialize the denoiser model architecture;
2: Generate encoder1's convolution kernel \(\mathbf{W}_{conv}\) and bias term \(\mathbf{b}_{conv}\) from \(f_{conv}(\mathbf{x}^{\prime})=\mathbf{W}_{conv}*\mathbf{x}^{\prime}+\mathbf{b}_ {conv}\);
3: Generate decoder1's convolution kernel \(\mathbf{W}_{deconv}\) and bias term \(\mathbf{b}_{deconv}\) from \(\mathbf{x}^{\prime\prime}=f_{deconv}(\mathbf{a})=\mathbf{W}_{deconv}*\mathbf{ a}+\mathbf{b}_{deconv}\);
4: Get specific \(\theta_{dn}\) from Section 3;
5: Transform \(\theta_{dn}\) into \(\mathbf{W}\) and \(\mathbf{b}\). ```  
**Algorithm 3** Training Algorithm for Channel DenoisingNet  
```
0: Input features \(\mathbf{x}^{\prime}\). 0: Denoiser parameters \(\mathbf{W}\) and \(\mathbf{b}\).