# An Explainable Deep Semantic Coding for Binary-Classification-Oriented Communication
## 3 Deep Variational Semantic Coding
### The DVSC Model and Training Algorithm  
We now revisit the BCOC optimization objective (11). In this formulation, the expected distortion is directly computable using MSE, whereas the mutual information and Chernoff information terms are estimated via discriminator networks. With all components of the objective function now accessible, we propose the DVSC model, as illustrated in Figure 2.  
In Figure 2, we employ two deep neural networks (DNNs) as encoder networks, denoted as \(F_{\omega_{1}}\) and \(F_{\omega_{2}}\), respectively. Discriminator networks \(T_{\phi_{1}}\) and \(T_{\phi_{2}}\) are trained to estimate mutual information \(I_{\phi_{1}^{*}}(X_{1};Y_{1})\) and \(I_{\phi_{2}^{*}}(X_{2};Y_{2})\), respectively. Similarly, discriminator network \(T_{\psi}\) along with the parameter \(\alpha\) are optimized to estimate Chernoff information \(C_{\psi^{*},A^{*}}(P_{Y_{1}},P_{Y_{2}})\). Therefore, for given distortion constraint \(D\) and weight coefficient \(\mu\), the encoders can be optimized according to the following objectives  
\[ \begin{split}&\min_{\omega_{1}}I_{\phi_{1}^{*}}(X_{1};F_{\omega_{1}} (X_{1}))-\mu C_{\psi^{*},A^{*}}(F_{\omega_{1}}(X_{1}),Y_{2})+\lambda_{1}\big{(} \mathbb{E}[d(X_{1},F_{\omega_{1}}(X_{1}))]-D\big{)},\\ &\min_{\omega_{2}}I_{\phi_{2}^{*}}(X_{2};F_{\omega_{2}}(X_{2}))- \mu C_{\psi^{*},A^{*}}(Y_{1},F_{\omega_{2}}(X_{2}))+\lambda_{2}\big{(} \mathbb{E}[d(X_{2},F_{\omega_{2}}(X_{2}))]-D\big{)},\end{split}  \tag{27}\]  
and Lagrange multipliers can be optimized according to  
\[ \begin{split}&\max_{\lambda 1}I_{\phi_{1}^{*}}(X_{1};Y_{1})-\mu C_{ \psi^{*},A^{*}}(Y_{1},Y_{2})+\lambda_{1}\big{(}\mathbb{E}[d(X_{1},Y_{1})]-D \big{)},\\ &\max_{\lambda 2}I_{\phi_{2}^{*}}(X_{2};Y_{2})-\mu C_{\psi^{*},A^{*} }(Y_{1},Y_{2})+\lambda_{2}\big{(}\mathbb{E}[d(X_{2},Y_{2})]-D\big{)}.\end{split}  \tag{28}\]  
In sum, the training process of DVSC model involves optimization of five neural networks, two Lagrange multipliers, and a Chernoff coefficient. The optimization process takes four key steps:  
1. Train discriminator networks \(T_{\phi_{1}}\) and \(T_{\phi_{2}}\), and estimate mutual information;  
Figure 2: The DVSC model. 2. Train discriminator network \(T_{\psi}\) and Chernoff coefficient \(\alpha\), and estimate Chernoff information;
3. Train encoders \(F_{\omega_{1}}\) and \(F_{\omega_{2}}\);
4. Optimize Lagrange multipliers \(\lambda_{1}\) and \(\lambda_{2}\). These steps are performed iteratively until all network parameters and Lagrange multipliers converge. The detailed DVSC-Opt algorithm is given in Algorithm 1. The overall training complexity of the DVSC-Opt algorithm per iteration is \(\mathcal{O}(M^{2}\cdot n)\), where \(M\) is the mini-batch size and \(n\) denotes the typical forward/backward cost of a neural network module. Across \(T\) iterations, the total training cost becomes \(\mathcal{O}(T\cdot M^{2}\cdot n)\). Although the training complexity introduces some modest overhead, each component in the framework is implemented with lightweight network architectures. As a result, the overall runtime remains practical and can support real-world deployment. ```
1:Input: Training dataset: \[\mathcal{S}_{1}=\big{\{}x_{1,i}\mid x_{1,i}\sim P_{1}(X)\big{\}},\ \mathcal{S}_{2}=\big{\{}x_{2,i}\mid x_{2,i}\sim P_{2}(X)\big{\}},i=1,2,\dots,N;\]  Distortion constraint \(D\), weight coefficient \(\mu\);  Initialized hyper-parameters \(\lambda_{1},\lambda_{2}\), and Chernoff coefficient \(\alpha\);  Initialized network parameters \(\omega_{1},\omega_{2},\phi_{1},\phi_{2},\psi\).