## 2 Materials and Methods
### Evaluation of Scatter Estimation Models on Simulated CXRs  
To assess the performance of the trained models, an additional test set of 22 CT images was taken from the same COVID-19 Lung CT Lesion database, and the three projections (scatter, scatter-free, and uncorrected scatter) were simulated as explained in Section 2.2. Four metrics were evaluated to quantify the accuracy of the scatter correction with the single and dual-energy NN models for the test set: the mean squared error (MSE), the mean absolute percentage error (MAPE), the structural similarity index (SSIM) and the relative error (\(E_{rel}\)), which are defined as:  
\[MSE=\frac{1}{M\times N}\sum_{i=1}^{M}\sum_{j=1}^{N}\|x_{i,j}-y_{i,j}\|^{2} \tag{1}\]  
\[MAPE=\frac{1}{M\times N}\sum_{i=1}^{M}\sum_{j=1}^{N}\left(\frac{|x_{i,j}-y_{i, j}|}{|x_{i,j}|}\right)\times 100 \tag{2}\]  
\[SSIM=\frac{1}{M\times N}\sum_{i=1}^{M}\sum_{j=1}^{N}\frac{\left(2\mu_{x}\mu_{y }+c_{1}\right)\left(2\sigma_{xy}+c_{2}\right)}{\left(\mu_{x}^{2}+\mu_{y}^{2}+ c_{1}\right)\left(\sigma_{x}^{2}+\sigma_{y}^{2}+c_{2}\right)}\times 100 \tag{3}\]  
\[E_{rel}=\frac{1}{M\times N}\sum_{i=1}^{M}\sum_{j=1}^{N}\frac{|x_{i,j}-y_{i,j}|} {\left(x_{i,j}+y_{i,j}\right)} \tag{4}\]  
where \(M\) and \(N\) are the number of pixels in the X and Y direction, and \(x_{i,j}\) and \(y_{i,j}\) are the values of ground truth and estimated images, respectively, for pixel \((i,j)\). In Equation (3), \(\mu_{x}\) and \(\mu_{y}\) are the average of \(x_{i,j}\) and \(y_{i,j}\); \(\sigma_{x}\) and \(\sigma_{y}\) are the standard deviations of \(x_{i,j}\) and \(y_{i,j}\); \(\sigma_{xy}\) is the covariance of \(x_{i,j}\) and \(y_{i,j}\); \(c_{1}=(K_{1}L)^{2}\) and \(c_{2}=(K_{2}L)^{2}\), where \(L\) represents the range of pixel values and \(K_{1}\) and \(K_{2}\) are small positive constants that keep the denominator non-zero [51; 52]. Metrics were applied to a region of interest (ROI) focused in the lungs. The 22 CT test cases were simulated with 10 additional source-to-detector distances different from the one used to train the NN algorithms (SDD = 180 cm, see Table 1), from 100 to 200 cm. Then, the robustness of the models to variations in the SDD was evaluated with the above-mentioned metrics (Equations (1)-(4)). To determine the gain when correcting scatter, a comparison of the contrast value in the lung between the COVID-19-affected region and the non-affected region on soft-tissue images was performed. Soft-tissue images were calculated by performing dual-energy subtraction, i.e., subtracting the low-energy CXR from the high-energy CXR. This operation was carried out for the uncorrected-scatter CXRs, the ground-truth scatter-corrected CXRs (Figure 5), and the estimated scatter-corrected CXRs with the three NNs. A mask of the COVID-19 region for each CT was found in the original database, so the COVID-19 region corresponding to the 2D projection was obtained with the MC simulation (Figure 6a). The lung mask was calculated with a U-Net CNN previously trained, with batch normalization, Adam optimizer, binary cross entropy as loss function, and sigmoid as output activation, and the mask of the healthy-lung region was obtained by subtracting the COVID-19 mask from the lung mask (Figure 6b). The contrast metric is calculated as follows:  
\[C=\frac{\frac{1}{F}\sum_{k=1}^{F}img(k)}{\frac{1}{G}\sum_{l=1}^{G} img(l)} \tag{5}\]  
where \(F\) and \(G\) stand for the total number of pixels in the COVID-19 and the healthy-lung mask, respectively, and \(img(k)\) and \(img(l)\) represent the values of the given image \(img\) in pixel \(k\) (COVID mask) or in pixel \(l\) (healthy-lung mask). To evaluate the contrast, each lung was considered to be a different case for patients who have both lungs affected, so there were 31 affected lungs in which the contrast was calculated.