# Using Compressed JPEG and JPEG2000 Medical Images in Deep Learning: A Review
## 4 DNNs and Irreversibly Compressed Images  
DNNs continue to achieve state-of-the-art performance in medical image analysis; however, these models are typically trained and tested on high-quality image datasets. In real-world medical applications, irreversibly compressed images may be the only available input due to factors such as poor internet connections or the irreversible storage formats of historical records. Irreversible compression can present a significant practical challenge that is often overlooked in the design of DNN architectures. Can we assume that DL models trained on uncompressed images will deliver accurate results when applied to irreversibly compressed images? On the other hand, can we train DNN models with compressed medical images to speed up the training time of the models and use the trained models for uncompressed image data? These questions have been the motivation for this work. We commence this discussion by examining the impact of irreversible compression artifacts on the training and testing of DNN models. For natural images, a study by [PERSON] et al. [67] showed that the tested DNN models were sensitive to noise and blur distortions but invariant to JPEG and JPEG2000 compression, as well as changes in contrast in a classification task. However, the authors also concluded that training on degraded images may enhance testing results for similar degraded images, but this could potentially result in decreased model performance on uncompressed images. The DNN models demonstrated lower accuracy for images compressed with a JPEG quality factor of less than 10 and a Peak Signal-to-Noise Ratio (PSNR) of less than 30 for JPEG2000. In another study by [PERSON] et al. [68], it was shown that the performance of a pre-trained state-of  
Figure 4: Basic CNN architecture for a binary classification problem. the-art CNN model improved with higher compression ratios for JPEG. Furthermore, it was concluded that the model relied on artifacts produced by JPEG compression to achieve better classification results. In a study by [PERSON] et al. [69] with experiments on the MNIST and CIFAR-10 image databases, it was shown that the complexity of DNN learning tasks can be reduced by using partially decompressed images, resulting in minimal accuracy loss. Conversely, the accuracy loss for CNNs depends on the JPEG compression level. A compromise is necessary; for instance, using a quality factor of 80 achieves a 45% reduction in decompression computation complexity at the cost of a 13% accuracy loss. This study also highlights the necessity for models specifically adapted to irreversibly compressed image data. The idea of adapting models to JPEG degraded images has been proposed in the literature by utilizing the use of the DCT frequency coefficients and spectral loss of image information [70]. In 2021, [PERSON] et al. [71] published a study examining the impact of JPEG2000 irreversible image compression on DL-based mammogram (CR breast) classification. The authors assert that they are the first to explore how such compression affects DNN models for medical images. Their research involved training CNNs to classify mammograms as malignant or non-malignant using compressed images. The performance of the models began to decline only at extreme compression ratios exceeding 5000:1, where saliency maps failed to accurately reflect the ground truth. Their findings suggest that training and testing models on a single compression ratio do not influence classification performance. Furthermore, the study observed that using a diverse set of images with varying compression ratios improves model generalization when tested across different compression ratios. In Digital Pathology, for example, images can be compressed by 85% while still preserving 95% of the performance of DL algorithms compared to using uncompressed images. Interestingly, the highest level of compression that DL algorithms can handle is often reached when pathologists start to face difficulties in making accurate diagnoses [72].