Next Article in Journal
Hybrid Improved PSO Algorithm for Soil Property Parameter Estimation
Previous Article in Journal
Generation and Inhibition of SO3 in Lead Smelting Flue Gas
Previous Article in Special Issue
Decoding Lung Cancer Radiogenomics: A Custom Clustering/Classification Methodology to Simultaneously Identify Important Imaging Features and Relevant Genes
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

EPIIC: Edge-Preserving Method Increasing Nuclei Clarity for Compression Artifacts Removal in Whole-Slide Histopathological Images

1
Faculty of Automatic Control, Electronics and Computer Science, Silesian University of Technology, Akademicka 16, 44-100 Gliwice, Poland
2
Department of Data Science and Engineering, Silesian University of Technology, Akademicka 16, 44-100 Gliwice, Poland
3
Yale Cancer Center, Yale University, New Haven, CT 06511, USA
*
Author to whom correspondence should be addressed.
Appl. Sci. 2025, 15(8), 4450; https://doi.org/10.3390/app15084450
Submission received: 4 February 2025 / Revised: 7 April 2025 / Accepted: 15 April 2025 / Published: 17 April 2025

Abstract

:
Hematoxylin and eosin (HE) staining is widely used in medical diagnosis. Stained slides provide crucial information to diagnose or monitor the progress of many diseases. Due to the large size of scanned images of whole tissues, a JPEG algorithm is commonly used for compression. This lossy compression method introduces artifacts visible as 8 × 8 pixel blocks and reduces overall quality, which may negatively impact further analysis. We propose a fully unsupervised Edge-Preserving method Increasing nucleI Clarity (EPIIC) for removing compression artifacts from whole-slide HE-stained images. The method is introduced in two versions, EPIIC and EPIIC Sobel, composed of stain deconvolution, gradient-based edge map estimation, and weighted smoothing. The performance of the method was evaluated using two image quality measures, P S N R and S S I M , and various datasets, including BreCaHAD with HE-stained histopathological images and five other natural image datasets, and compared with other edge-preserving filtering methods and a deep learning-based solution. The impact of compression artifacts removal on the nuclei segmentation task was tested using Hover-Net and STARDIST models. The proposed methods led to improved image quality in histopathological and natural images and better segmentation of cell nuclei compared to other edge-preserving filtering methods. The biggest improvement was observed for images compressed with a low compression quality factor. Compared to the method using neural networks, the developed algorithms have slightly worse performance in image enhancement, but they are superior in nuclei segmentation. EPIIC and EPIIC Sobel can efficiently remove compression artifacts, positively impacting the segmentation results of cell nuclei and overall image quality.

1. Introduction

Hematoxylin and eosin (HE) stains are the principal tissue stains in histology and are the most common staining used in medical diagnosis. Eosin stains the cytoplasm and extracellular matrix red or pink, while hematoxylin stains the cell nuclei blue. Histopathological tissue slides contain a lot of important information for specialists to diagnose the patient or monitor the progress of the disease [1]. The invention of whole-slide imaging (WSI) scanners made digitizing entire slides with stained tissue possible, allowing the use of automatic image analysis techniques [2]. Numerous cell or tissue segmentation algorithms have been developed to analyze histopathological images [3,4]. Thus, many steps of the WSI analysis workflow can be executed without pathological expertise to save pathologists time.
The major challenge in the computerized analysis of digital pathology images is the size of WSIs, which might be bigger than 50,000 by 50,000 pixels. The most commonly used magnifications in WSI scanners are 20 × and 40 × , with a spatial resolution of 0.50 μ m/pixel and 0.25 μ m/pixel, respectively. Digital slides are usually saved as SVS files. In this file format, images are stored as a tiled multi-resolution pyramid [5]. The high resolution of the images causes the file size to vary from several megabytes to tens of gigabytes [6]. Transmitting and storing these large files is challenging, so in most cases, the images are compressed using the JPEG or JPEG 2000 algorithms [7]. Joint Photographic Experts Group (JPEG) [8] compression first splits an image into 8 × 8 blocks and applies a discrete cosine transform (DCT) to each block. Then, these DCT coefficients are divided by a quantization table and rounded to the nearest integer to remove high-frequency details to save space. Thus, JPEG compression results in compression artifacts. The quantization table is typically represented by the integer value from 0 to 100, known as the Quality Factor ( Q F ). Lower Q F values mean a higher loss of information but a smaller file size. For example, when the quality factor Q F = 30 is used, the resulting 8 × 8 blocks can be visually seen. These distortions can negatively impact the segmentation of small structures observed in the slide, like cells or nuclei.
The topic of removing compression artifacts is covered widely in the literature. Depending on the project mechanism, compression artifacts removal methods can be divided into four main categories [9]: filter-based methods, probabilistic-prior-based methods, deep learning-based JPEG artifacts removal methods, and deep learning-based loop filter methods. Among filtering methods, we can distinguish adaptive filtering with locally adjusted filter kernels [10] and a trilateral deringing filter [11]. In [12], the authors proposed a shape-adaptive DCT filtering method, while in [13], the authors proposed an algorithm to preserve the details of the images and reduce the effect of quantization noise. They integrated QT decomposition with block-shift filtering. Some subsequent approaches are based on probability estimation of the image prior models. These include methods based on adaptive DCT transformation [12], Markov random field [14], or sparse coding [15,16]. Deep learning has made breakthrough progress in removing JPEG compression artifacts in the past few years. The first work introducing deep models to the topic was the Artifacts Reduction Convolutional Neural Network [17], a model of a three-layer CNN, where an interpretable deep network was proposed to learn both the pixel-level regressive prior and the semantic-level discriminative prior. Some other examples are Trainable Nonlinear Reaction-Diffusion [18], and the Denoising Convolutional Neural Network [19]. Among the methods that do not require training the model for each degree of compression are the Flexible Blind Convolutional Neural Network (FBCNN) [20], that can predict an adjustable quality factor via decoupler module to control the balance between artifact removal and preservation of the details, and Quantization Guided JPEG Artifact Correction [21], that uses quantization data stored in the JPEG file.
Due to the very large size of WSIs, simple and computationally efficient image processing methods might be more beneficial than deep learning methods, which operate mostly on smaller images. To eliminate blocking artifacts, in [22], a simple edge-preserving smoothing filter was introduced, that might be efficient in WSIs pre-processing. The pixels are first tagged as edge/non-edge and the pixels are identified that lie on the 8 × 8 tile boundary used in the JPEG compression. Then, a sigma filter is applied for each non-edge pixel on the tiling boundary to smooth out the blocking artifacts. In successive years, a modified version of this edge-preserving method was used to remove compression artifacts from histopathological images with success [23]. The authors improved the original algorithm to make it adequate for processing H&E stained images. To create the edge map, they only considered the pixels that belonged to the edges in all color channels. Then, they performed a weighted smoothing of the image using a Gaussian filter. The removal of artifacts resulted in an improvement in image quality for images compressed with Q F = 30 , but failed for higher Q F values. This algorithm was also not tested on the labeled datasets used for segmentation.
This work proposes two fully unsupervised edge-preserving algorithms for removing compression artifacts from H&E stained images, named Edge-Preserving Algorithm Increasing nucleI Clarity (EPIIC), and its modification, which uses the Sobel operator to extract the information about the edges, named EPIIC Sobel. We presented the results of the developed algorithms and other edge-preserving methods on a set of histopathological HE-stained images and other natural image datasets compressed with different Q F values. Moreover, we compared the best results achieved by the developed methods with a state-of-the-art solution based on deep learning. Finally, we checked the effect of the compression artifacts removal on the nuclei segmentation. The proposed methods are adapted to process entire WSI slides at once.

2. Materials and Methods

2.1. Proposed Methods

Removing compression artifacts by the EPIIC and EPIIC Sobel methods is divided into six main steps. A flowchart containing these successive steps and exemplary image fragments showing the results are shown in Figure 1.
The first step, common for both methods, involves the color deconvolution for hematoxylin-eosin staining. The algorithm explained in [24] was applied to construct an H channel image containing mostly nuclei stained by hematoxylin from eosin-stained tissue structures. A common Matlab implementation released for public use [25] was used. For other images than H&E-stained slides, the H channel image is replaced by converting the RGB image to grayscale.
The next step aims to preprocess the H image to increase the visibility of cell nuclei and reduce the noise present in the image caused by compression artifacts and the deconvolution process itself. In the EPIIC method, the threshold value is calculated first with the Otsu algorithm. Next, the contrast of the H image is adjusted by scaling the pixels with values from zero to the threshold value so that they occupy the entire allowed range of intensity values. As a result, only the most intensely colored elements are visible, and unnecessary background is removed. Then, the image is smoothed with the averaging filter to obtain more uniform shapes and colors of cell nuclei, which enables easier detection of the edges. In the EPIIC Sobel method, the image closing operation is performed on the H image with the structural element in the shape of a disk with a 3-pixel radius. After that, the contrast of an image is adjusted as before, but this time, the threshold value is fixed at 0.75. Next, the obtained image is smoothed with the averaging filter. The different threshold values make the EPIIC method better suited to images with more hematoxylin-stained structures, but in some cases, this results in the loss of poorly stained nuclei, which occurs less frequently in EPIIC Sobel.
In the next step, the gradient magnitude is calculated. In the EPIIC algorithm, the central difference method is used to calculate the gradient magnitude, which is blurred using the average smoothing filter. In the EPIIC Sobel, the gradient is calculated using the Sobel operator. The resulting image G is used to create an edge map.
In the following stage, the image G is processed to obtain the binary edge map M b i n . In the EPIIC method, the image is binarized with the Otsu method. The threshold value T obtained by the Otsu algorithm is multiplied by the T m parameter. This will ensure that weaker edges are not included in the map. This operation is followed by a morphological opening with a square-shaped structural element of size 2 × 2 to remove isolated pixels from the map. In the EPIIC Sobel algorithm, the threshold value T is calculated based on the Root Mean Square (RMS) estimate of noise (the method described in [26], pp. 466–469), and its original value is multiplied by the T m parameter. The additional thinning stage is performed, and the opening operation is skipped. As a result of this method, the edges are much thinner than for EPIIC.
Since we are also interested in preserving information about the intensity of the edges, in the EPIIC method, the binary map M b i n is multiplied by the image G and the pixel values are then scaled. Pixels larger than zero are reduced by the threshold value and then divided by 1 T . Finally, the inverse image is used to obtain an edge map M. In the EPIIC Sobel variant, edge maps are created for each of the three RGB color channels. The gradient magnitudes of each channel, calculated with the central difference operator, are used instead of the image G in the multiplication. Pixel scaling is performed as in the EPIIC method. The threshold T is set to the original threshold value calculated in the previous step. To obtain the final edge maps, scaled images for each channel are inverted. Compared to the EPIIC method, which uses only the H channel to create the map, Sobel’s EPIIC method creates a separate edge map for each channel of the RGB color space.
The final step of both algorithms is weighted smoothing. First, weights for each pixel are calculated. In the EPIIC, only one weight matrix W is created by blurring the edge map M with a Gaussian filter. Then, each color channel of the compressed image is multiplied by the edge map, and the result of this operation is filtered with the same Gaussian filter used in the previous step. Pixel values are divided by corresponding weights from the W to obtain the final image I without compression artifacts. In the EPIIC Sobel, the weight matrix is calculated for each color channel. Then, the same operations as above are performed using the edge maps and the weight matrices appropriate for the color channel.
We tested both the averaging filter and the Gaussian filter with sizes ranging from 3 × 3 to 7 × 7 . The standard deviation of the Gaussian filter varied between 0.4 and 2.8 . Additionally, we examined the performance of different T m parameter values, which ranged from 1.25 to 2.0 .

2.2. Other Edge-Preserving Methods

Having a strong interest in the best possible nuclei edge retention, the results of the developed methods were compared with the performance of dedicated filters for edge preservation and noise reduction.
The following filters were considered: the average (mean) filter, the median filter, the Wiener filter, which derives from the mean operator, and the Median Modified Wiener filter (MMWF), which is a nonlinear adaptive spatial filter that uses the quality and abilities of both median and Wiener filters [27]. MMWF provides global denoising, eliminating spikes and Gaussian noise while preserving the structures visible in the image. For each of the filters listed, the only parameter is the window size, which was tested in the range from 3 to 7, depending on the type of filter.
In addition, the performance of a Gaussian filter of size 3, 5, and 7 with standard deviation σ varying from 0.4 to 2.8, and the Guided filter [28] was tested. The input image was used as a guidance image with the size of the rectangular neighborhood around each pixel from 3 to 7 and the amount of smoothing ranged from 0.001 to 0.05 (when the value is small, only the neighborhood with a small variance will be smoothed and the areas with stronger edges will be preserved).
In [29], the authors proposed a class of algorithms that realizes image denoising using a diffusion process. An anisotropic diffusion filter was used as a speckle removal technique to improve the quality of ultrasonography [30] and the magnetic resonance images [31]. In this work, different connectivity values were examined: four or eight neighborhoods and conduction methods: exponential and quadratic. In the diffusion process, five iterations were used.
In [32], the authors introduced a non-iterative bilateral filter to preserve edges through a nonlinear combination of nearby pixels. Noise removal is achieved by combining two Gaussian filters: the first works in the spatial domain, and the second filter works in the intensity domain. This filter applies spatially weighted averaging to smooth edges and preserve their shape. This method was also used to eliminate distortions from medical images [30]. Here, degrees of smoothing from 0.005 to 0.02 and standard deviations of spatial Gaussian smoothing kernel from 0.4 to 1.3 were tested.
Another tested algorithm, the non-local means (NL-means), based on a non-local averaging of all pixels in the image, was presented in [33]. It can smooth blocking artifacts and preserve the edges simultaneously. Due to the nature of the algorithm, the most favorable case is the textured or periodic image, but some natural images also have sufficient redundancy for the filtering action to have a positive impact on image quality.
Finally, the deep convolutional neural network FBCNN [20], which achieves state-of-the-art performance in the blind JPEG artifacts removal on single and multiple compressed color and grayscale images, was tested. Trained weights were used for a model designed to remove single compression artifacts from color images provided by the authors (https://github.com/jiaxi-jiang/FBCNN/releases/tag/v1.0, accessed on 4 February 2025).

2.3. Compression Artifacts Removal Evaluation

Two common metrics to evaluate the quality of reconstructed images after compression artifacts removal were calculated: Peak Signal-to-Noise Ratio ( P S N R ) and Structural Similarity Index Measure ( S S I M ) [34]. P S N R can be represented as follows:
P S N R = 10 · l o g 10 M A X I 2 M S E
where M A X I 2 is the maximum possible pixel value for the given range, and the Mean Squared Error ( M S E ) is calculated by averaging the squared intensity differences between two images. S S I M for given original image I and transformed image J is defined by the following formula:
S S I M = ( 2 μ I μ J + C 1 ) ( 2 σ I J + C 2 ) ( μ I 2 + μ I 2 + C 1 ) ( σ J 2 + σ J 2 + C 2 )
where μ is the average and σ is the variance of pixel intensity. S S I M is generally regarded as a closer metric to human perception than P S N R .

2.4. Sensitivity Analysis

To determine how changing the parameters of compression artifacts removal methods affects the final image quality, two methods were implemented. The difference in S S I M and P S N R between the analyzed method and compressed images were used as image quality metrics. First, the Partial Rank Correlation Coefficient (PRCC), which measures nonlinear and monotonic relationships between parameters and image quality metrics, was calculated. PRCC uses the Spearman correlation after removing linear dependencies between parameters. Second, the impact of parameters on image quality was estimated using the variable importance measure from the multivariate adaptive regression spline (MARS) model implemented in the caret R package [35]. Specifically, the changes in the generalized cross-validation estimate of error for each predictor are tracked, and reductions in the statistic when each predictor’s feature is added to the model are accumulated. The variable importance is scaled to sum up to 100%.

2.5. Nuclei Segmentation Methods

Two state-of-the-art nuclei instance segmentation methods, Hover-Net [36] and STARDIST [37], were employed to assess the impact of developed methods on the segmentation quality.
The Hover-Net network received an input RGB patch of 270 × 270 , with values normalized between 0 and 1. Since we wanted to verify whether removing compression artifacts would cause segmentation improvement, reference models were trained for each dataset separately using original images without any modification for training and validation. These models were marked as no correction method. For reference models, in online augmentation, identical techniques were used as in the original paper [36], that is, flip, rotation, Gaussian blur, median blur, additive Gaussian noise, modification of contrast, hue, and saturation.
Next, we trained models for each selected artifact removal method for each dataset. First, compression artifacts were removed from images from the training and test sets. The EPIIC and EPIIC Sobel methods used a Gaussian filter with a window size of 3 × 3 and a standard deviation σ = 0.7 , a parameter T m = 1.25 , and an averaging filter of size 5 × 5 . For the Gaussian filtering, the same σ and kernel size were used as in the previous methods. For the Guided filter, we set the degree of smoothing to 0.001 and the neighborhood size to 3. During model training, the augmentation was limited to flip, rotation, contrast modification, hue, and saturation.
All models described above were initialized with pre-trained weights on the ImageNet dataset [38]. Only decoders were trained for the first 50 epochs, and then all layers were fine-tuned for 75 epochs. The Adam optimizer was used with the following learning schedule: for each stage, the initial value of the learning rate was 10 4 , and after every 25 epochs, it was reduced ten times. Batch size was set to 10 and 2 for the first and second stages, respectively. An early stopping method with patience equal to 50 was used by selecting the model that achieved the best D I C E score on the validation dataset.
The STARDIST model with 64 rays and a U-Net [39] backbone of depth 4 was used. The dropout equal to 0.7 was added to the network to avoid overfitting, and loss functions specified by the authors were used. The weights of the network were initialized randomly. Each model was trained for 400 epochs with a batch size equal to 2 using the Adam optimizer, starting with a learning rate of 0.0003. If no progress was made for 80 epochs, the learning rate was reduced by half. The weights for the final model were selected based on the smallest validation loss during training. The network received an RGB input patch with a size of 256 × 256 normalized to the range 0–1. The same online augmentation procedure as for the Hover-Net model was applied.

2.6. Nuclear Segmentation Evaluation Metrics

To evaluate the overall score for nuclear instance segmentation, three metrics widely used in the literature were used: Ensemble Dice [40], Aggregated Jaccard Index ( A J I ) [41], and Panoptic Quality ( P Q ) [42]. Ensemble Dice computes and aggregates Dice coefficient ( D I C E ) per nucleus, which is defined as:
D I C E = 2 × X Y | X | + | Y |
where X denotes the ground truth and Y is a prediction. It is usually used to calculate the similarity of two samples. A J I calculates the ratio of an aggregated intersection cardinality and an aggregated union cardinality between the ground truth and the prediction. P Q for nuclear segmentation is defined as the product of the Detection Quality ( D Q ) and the Segmentation Quality ( S Q ):
P Q = D Q × S Q
The Detection Quality ( D Q ) can be interpreted as the F1-score, which is widely used to evaluate instance detection. At the same time, segmentation quality ( S Q ) informs how close each correctly detected instance is to its matched ground truth. The following formulas describe these measures:
D Q = | T P | | T P | + 1 2 | F P | + 1 2 | F N |
S Q = ( x , y ) T P I o U ( x , y ) | T P |
where x stands for a ground truth segment, y is a prediction segment and I o U denotes intersection over union. P Q provides a direct insight into the detection quality of individual nuclear instances and the segmentation of each detected nucleus. If the I o U ( x , y ) > 0.5 each ( x , y ) pair is unique [42]. This property allows to divide the predicted and ground truth segments into the following sets: true positives (TP), false positives (FP), and false negatives (FN), which represent correctly matched pairs of segments, mismatched predicted segments, and mismatched ground truth segments, respectively.

2.7. Datasets

Several datasets were used to evaluate the impact of selected artifacts removal methods on the image quality. The BreCaHAD dataset [43] includes 162 uncompressed histopathological RGB images showing tissue sections with breast cancer cells. The images are divided into 17 different cases. Each image was taken with 40× magnification and then divided into smaller tiles saved as 1360 × 1024 TIFF files. The proposed methods were also tested on the datasets commonly used in a task of compression artifacts removal: the test set of BSDS500 [44], LIVE1 [45], Kodak24 (https://r0k.us/graphics/kodak/, accessed on 4 February 2025) Set5 [46], and Set14 [47]. All of these datasets consist of uncompressed RGB images.
Since the BreCaHAD dataset is not labeled for the nuclear segmentation task, two additional datasets were used: Kumar [41] and CPM-17 [40]. Both datasets contain compressed images of varying quality, with visible JPEG compression artifacts, but the information about the compression quality factor is not included. The Kumar dataset consists of 30 image tiles of size 1000 × 1000 . Slides were acquired at 40 × magnification and come from seven organs (6 breasts, 6 livers, 6 kidneys, 6 prostates, 2 bladders, 2 colons, and 2 stomachs) of The Cancer Genome Atlas (TCGA) database. We split this dataset into the test set with 14 images (2 prostates, 2 kidneys, 2 livers, 2 breasts, 2 bladders, 2 colons, and 2 stomachs) and the training set with 16 image tiles (4 prostates, 4 kidneys, 4 livers, and 4 breasts). The CPM-17 dataset includes 32 images from TCGA varying in size from 500 × 500 to 600 × 600 in both the training and test datasets. Images were taken at 20 × and 40 × magnification and included four different types of cancer. Note, we utilize the same split used in the [36] for both datasets.

2.8. Whole-Slide Images Processing

The developed algorithms have been implemented to process entire WSI images in the Matlab R2022b software. Figure 2 illustrates the process of removing artifacts. The code is publicly available in a remote repository https://github.com/julimer228/EPIIC, accessed on 4 February 2025). The image with the coarsest resolution is divided into blocks. Each block is then processed separately using the selected method. Appropriate padding with a default value of 5 pixels is set to prevent distortion of block edges. In the next step, the image is scaled to successive layers of lower resolution according to the information read from the original image. Layers that are included as labels are rewritten in the original order. After removing the artifacts, the image is compressed using the lossless LZW compression algorithm [48], which does not decrease image quality but reduces the size of the resulting file. The example WSI image of 299 MB after artifacts removal increased its size to 2.69 GB for both methods.

3. Results

3.1. Improving Image Quality by Removing Compression Artifacts

In all analyses, we compressed the original images with JPEG compression quality factor Q F values from 10 to 90 in increments of 10. We then tested each described method for removing compression artifacts in terms of the quality of reconstructed images and compared them to results obtained for JPEG compressed images.
The results for histopathological H&E stained images are presented in Table 1. We included the best mean S S I M and P S N R scores obtained by each method for the tested parameter sets. Figure 3 depicts fragments of uncompressed histopathological images, images after compression, and the effects of removing compression artifacts by methods that obtained the highest image quality: EPIIC, EPIIC Sobel, FBCNN, the Gaussian filter, and the Guided filter. As can be seen, the deep learning-based solution significantly outperformed the other methods. However, our proposed artifact removal methods improved image quality for all tested compression quality parameters. They were also slightly better than the Gaussian filter in most cases. The EPIIC method performed worse than the Sobel variant. The Guided filter gave more satisfying results for images compressed with lower Q F values than the mentioned filtering methods. If we carefully look at the images processed by the network, we can see some smoothing and unification of the color of the structures visible in the image. The images processed by the developed methods are blurred. However, they allowed slightly better preservation of the minor color variations in the actual tissue image.
The best methods mentioned above were evaluated on other image datasets containing natural images. Again, the best results for most cases were achieved by the FBCNN neural network. The EPIIC, EPIIC Sobel, Gaussian Filter, and Guided filter algorithms also improved the average S S I M and P S N R scores for selected datasets for most of the tested Q F values. The best results of each method are included in the Appendix A. The diagram presented in Figure 4 shows the average difference between the S S I M and P S N R values before and after removal of the blocking artifacts for the top four methods. Some examples of the outcomes are presented in Figure 5.
The comparison of computational time presented in Table 2 shows the average, standard deviation, and median time per image calculated on the BreCaHAD dataset. The tests were conducted on a workstation equipped with a 12th Gen Intel Core i9-12900KF processor (16 cores, 24 threads, 800–5200 MHz; Intel Corporation, Santa Clara, CA, USA) and an NVIDIA GeForce RTX 3060 GPU (NVIDIA Corporation, Santa Clara, CA, USA). It can be concluded that the developed methods are slightly slower compared to classical filters, such as the Gaussian and average filters. Additionally, the Sobel variant is slower than the EPIIC method. However, they perform significantly faster than the FBCNN method, even when a graphics card is used for the inference, which makes the proposed methods better suited for processing large WSI images.
For each artifacts removal method, we estimated which parameters have the highest impact on image quality by calculating two metrics: PRCC (Figure A1) and variable importance (Figure A2). Additionally, we included the Quality Factor ( Q F ) in the analysis to show if the achieved gain in image quality compared to JPEG compressed images varies with the compression ratio. In all methods, Q F was negatively correlated with gain in P S N R and S S I M , meaning a higher need for artifacts removal for low Q F values. Also, the highest variable importance value for this factor was observed in most cases. For EPIIC and EPIIC Sobel, window size and the standard deviation of the Gaussian filter have a higher influence on the results than the two other parameters. Similarly, in the other methods, changing window size resulted in different image quality, so it is an important parameter to tune. For the Anisotropic Diffusion Filter, we observe a small influence of changing parameters on the results, while for the Gaussian Bilateral Filter, no influence was observed for the tested parameter ranges.

3.2. Impact of Compression Artifacts Removal on Nuclei Segmentation

The main purpose of removing compression artifacts from HE-stained images is to improve the performance of further analysis, e.g., segmentation of cell nuclei. We tested the performance of the nuclei segmentation using Hover-Net and STARDIST models after the application of the four best artifact removal methods. Two datasets were used in this analysis: Kumar and CPM-17.
We calculated the difference between the performance scores obtained for each image processed without removing compression artifacts (marked as no correction) and images after removal. Table 3 and box plots in Figure 6 and Figure 7, contain the outcomes of selected segmentation measures for both nuclei segmentation methods. We conducted a Wilcoxon test to determine if the results were statistically significant. The p-values for each measure are shown in the Table 4. The developed methods improved the results, particularly considering the P Q measure. Figure 8 presents the example segmented images for both datasets with Hover-Net models.
As can be seen for some nuclei, the EPIIC and EPIIC Sobel methods allowed more precise nuclei detection. It can also be seen that some instances that were not detected by the no-correction Hover-Net model were detected after artifacts removal. In addition, note the results of image segmentation after removing compression artifacts with the Guided filter. For the first of the presented image fragments from the CPM-17 set, a sizable section between the nuclei with irregular outlines was marked as the nucleus area. Such a phenomenon can be a significant obstacle in using this algorithm to remove compression artifacts.
Moreover, the median differences of D I C E , A J I , and P Q for this method do not indicate such significant differences in segmentation results. The FBCNN network allowed for enhanced image quality, but for most images, it caused the degradation of the segmentation performance for both tested segmentation models. The developed edge-preserving algorithms also achieved slightly better results than the Gaussian filter with the same parameters.

4. Discussion

The edge-preserving methods we introduced here allowed us to successfully remove compression artifacts and improve the overall image quality. We decided to take into account the color intensity values on the edges instead of simple binarization as in the original method described in [23]. Moreover, we used color stain deconvolution to extract the information about the nuclei boundaries more precisely, which allowed us to improve the image quality more than other non-deep learning methods for most compression quality factors used in the JPEG algorithm. The developed methods were designed to process H&E images but also improved the quality of compressed images from multiple other datasets with various origins (mostly natural images). The results of EPIIC and EPIIC Sobel achieved for images from datasets commonly used to show the efficiency of different compression artifacts removal algorithms and the BreCaHAD dataset are inferior to those for the method based on deep learning. This outcome was rather expected since our goal was to ensure the simplicity of the developed algorithms even at the cost of performance because they are designed to be used to process large WSI images. FBCNN on CPU was almost 100 times slower than EPIIC, while on GPU, it was still more than 5 times slower. However, a comparison of all deep learning-based methods and our methods in terms of computational efficiency on WSI images is needed.
The main drawback of compression of WSI images is the reduced efficiency of algorithms used to segment individual cells or important fragments of the tissue. We introduced edge-preserving methods that could efficiently remove blocking artifacts but that should not decrease the performance of cell/tissue segmentation methods. Note that the developed methods are based on classical image processing operations. Unlike deep neural networks, they do not require datasets to train the model. The developed methods improved performance and allowed more accurate detection of nuclear instances.
D I C E and A J I have a limitation: predictions that differ by only a few pixels can have significantly different A J I and D I C E results, particularly when two nuclei are adjacent and only one is detected. This can strongly affect the accurate evaluation of segmentation results, especially if the tissue image contains a lot of difficult-to-detect instances. Therefore, using the P Q measure to assess the segmentation quality allows for a more reliable analysis of the results. Based on P Q , EPIIC and EPIIC Sobel led to better nuclei segmentation results than all other methods.
Interestingly, processing the images with FBCNN, which performed best in removing artifacts in most cases, caused a decline in segmentation results tested by two different models. It is worth noting that this particular method takes the Q F parameter value into account when eliminating distortions. The FBCNN method focuses on improving image quality, and the methods we propose are aimed at improving segmentation quality. Using the generated edge maps, the pixels along cell edges undergo less blurring compared to those inside the cells, resulting in better preservation of these regions. The proposed edge-preserving algorithms provided better results than Gaussian blur in terms of both segmentation results and image quality improvement. The Guided filter enabled improved image quality, especially for small Q F values. However, the incorrect predictions seen in some of the segmentation results bring into doubt the validity of applying this method to the removal of blocking artifacts from histopathology images.
Both datasets contained compressed images with different values of the Q F parameter, and nuclei determinations were already made on the compressed images, which could have affected the results. To better evaluate the methods mentioned above, testing their performance on datasets labeled before compression would be necessary. Further testing is required on other datasets from different sources containing preparations from other tissue types. It is necessary to keep working on fine-tuning the algorithm’s parameters to the degree of image compression. In future analyses, it would also be worth checking the performance of edge-preserving filters based on deep-learning methods and hybrid solutions that combine classical techniques with deep-learning approaches. Such solutions have already been applied to remove additive white Gaussian noise from biomedical images [49].
An additional advantage of our methods is the ability to remove JPEG compression artifacts from entire WSI images. When artifacts are removed, the size of the image increases, which is obvious. However, it should be considered whether that is a significant disadvantage if this process can result in enhanced segmentation results.

5. Conclusions

We developed two edge-preserving methods for removing compression artifacts in histopathological images. The developed methods were efficient even for images compressed with a low compression quality factor. Despite this, tests conducted on both HE-stained images and popular image datasets indicated worse performance than the tested deep learning method; our methods improved segmentation for the two selected datasets compared to the state-of-the-art neural network. Since the proposed solutions are faster than DL-based methods, we adopted the algorithms to process the entire gigapixel WSI.

Author Contributions

Conceptualization, M.M.; methodology, J.M. and M.M.; software, J.M.; formal analysis, J.M.; investigation, J.M.; resources, M.M.; data curation, J.M.; writing—original draft preparation, J.M.; writing—review and editing, M.M.; visualization, J.M.; supervision, M.M.; funding acquisition, M.M. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Excellence Initiative—Research University program 2023 implemented at the Silesian University of Technology [02/070/SDU/10-21-02].

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A

This Appendix A contains the outcomes of sensitivity analysis (Figure A1 and Figure A2) and the results of tested methods for removing compression artifacts in the BSDS500, Kodak24, LIVE1, Set14, and Set5 datasets, which contain natural images (Table A1, Table A2, Table A3, Table A4 and Table A5.
Table A1. S S I M and P S N R scores for BSDS500 dataset. The first, the second, and the third best results are highlighted.
Table A1. S S I M and P S N R scores for BSDS500 dataset. The first, the second, and the third best results are highlighted.
BSDS500
Method Metric QF = 10 QF = 20 QF = 30 QF = 40 QF = 50 QF = 60 QF = 70 QF = 80 QF = 90
JPEG S S I M 0.74070.82660.86430.88580.90130.91470.93020.94780.9702
P S N R 25.9228.2929.6430.5931.3732.1633.2434.8237.64
EPIIC S S I M 0.75070.83020.86740.88860.90420.91750.93300.95070.9737
P S N R 26.2328.5029.8730.8231.6332.4433.5335.1237.88
EPIIC Sobel S S I M 0.75090.83020.86740.88860.90420.91750.93290.95070.9736
P S N R 26.2428.5029.8730.8231.6332.4333.5235.1037.86
FBCNN S S I M 0.79490.86370.89340.91020.92240.93280.94460.95820.9761
P S N R 27.9130.1931.4732.3633.1033.8334.7936.1638.44
Gaussian Filter S S I M 0.75000.83010.86730.88860.90410.91750.93290.95060.9736
P S N R 26.2028.5029.8630.8231.6232.4333.5235.1137.87
Guided Filter S S I M 0.75860.83700.87020.88910.90290.91490.92870.94520.9665
P S N R 26.4228.7130.0230.9531.7332.5133.5635.0937.66
Average Filter S S I M 0.73330.78930.80810.81670.82170.82510.82830.83070.8319
P S N R 25.7627.1027.5527.7627.8927.9728.0628.1428.20
Median Filter S S I M 0.73100.79530.81750.82800.83410.83830.84240.84550.8466
P S N R 25.8527.4428.0428.3428.5228.6628.8028.9429.05
Wiener Filter S S I M 0.75090.81770.84290.85600.86500.87180.87880.88540.8900
P S N R 26.3128.4529.4930.1430.6431.0731.5732.1332.68
Non-local Means Filter S S I M 0.74070.82670.86460.88620.90180.91520.93070.94820.9706
P S N R 25.9228.2929.6430.5931.3732.1633.2534.8337.66
Median Modified Wiener Filter S S I M 0.74510.81860.84660.86120.87100.87850.88640.89360.8983
P S N R 26.2228.4629.5830.2930.8431.3231.8932.5433.21
Anisotropic Diffusion Filter S S I M 0.74330.79820.81730.82690.83430.83780.84470.85260.8581
P S N R 26.2828.2229.1529.6930.1330.4530.9031.4131.89
Gaussian Bilateral Filter S S I M 0.72570.80080.83460.85360.86740.87950.89330.91020.9346
P S N R 25.5727.7628.9529.7630.4231.1032.0433.3936.19
Figure A1. Partial Rank Correlation Coefficient (PRCC), which measures nonlinear and monotonic relationships between parameters of each artifacts removal method and gain in image quality metrics ( P S N R and S S I M ) in comparison to JPEG compressed images.
Figure A1. Partial Rank Correlation Coefficient (PRCC), which measures nonlinear and monotonic relationships between parameters of each artifacts removal method and gain in image quality metrics ( P S N R and S S I M ) in comparison to JPEG compressed images.
Applsci 15 04450 g0a1
Figure A2. Variable importance of MARS model, which estimates the impact of parameters on gain in image quality metrics ( P S N R and S S I M ) for each artifacts removal method.
Figure A2. Variable importance of MARS model, which estimates the impact of parameters on gain in image quality metrics ( P S N R and S S I M ) for each artifacts removal method.
Applsci 15 04450 g0a2
Table A2. S S I M and P S N R scores for the Kodak24 dataset. The first, the second, and the third best results are highlighted.
Table A2. S S I M and P S N R scores for the Kodak24 dataset. The first, the second, and the third best results are highlighted.
Kodak24
Method Metric QF = 10 QF = 20 QF = 30 QF = 40 QF = 50 QF = 60 QF = 70 QF = 80 QF = 90
JPEG S S I M 0.74520.82430.85960.88000.89460.90700.92170.93870.9613
P S N R 26.5829.0230.3431.2632.0032.7433.7435.2037.87
EPIIC S S I M 0.75610.82800.86300.88320.89750.90970.92420.94070.9622
P S N R 26.8629.2230.5631.4932.2332.9633.9635.3537.72
EPIIC Sobel S S I M 0.75630.82800.86300.88320.89750.90970.92420.94070.9622
P S N R 26.8729.2230.5631.4932.2332.9633.9535.3437.70
FBCNN S S I M 0.80270.86480.89320.90940.92060.92990.94100.95360.9697
P S N R 28.7931.1532.4533.3634.0834.7735.7137.0139.30
Gaussian Filter S S I M 0.75550.82800.86290.88310.89750.90970.92410.94070.9622
P S N R 26.8329.2230.5531.4832.2332.9633.9535.3437.71
Guided Filter S S I M 0.74450.83560.86630.88390.89610.90650.91860.93250.9489
P S N R 27.0929.4630.7431.6532.3733.0633.9935.2837.28
Average Filter S S I M 0.74040.79380.81250.82160.82710.83100.83490.83820.8411
P S N R 26.3927.8228.2828.5028.6328.7328.8228.9129.01
Median Filter S S I M 0.73900.80050.82280.83380.84060.84560.85050.85510.8598
P S N R 26.4828.1828.7929.1129.3029.4629.6129.7729.95
Wiener Filter S S I M 0.75690.81940.84350.85620.86460.87090.87780.88440.8904
P S N R 26.9629.2130.2730.9331.4131.8232.3132.8633.45
Non-local Means Filter S S I M 0.74520.82430.85970.88020.89480.90720.92190.93890.9613
P S N R 26.5829.0230.3431.2632.0032.7433.7435.2037.87
Median Modified Wiener Filter S S I M 0.75130.82040.84730.86150.87090.87820.88600.89370.9012
P S N R 26.8729.2230.3531.0731.6132.0732.6433.2934.06
Anisotropic Diffusion Filter S S I M 0.75290.81510.83130.84310.84830.86170.86320.87090.8768
P S N R 26.9229.2030.1530.8131.2231.8132.2032.7633.37
Gaussian Bilateral Filter S S I M 0.74520.82430.85960.88000.89460.90700.92170.93870.9613
P S N R 26.5829.0230.3431.2632.0032.7433.7435.2037.87
Table A3. S S I M and P S N R scores for the LIVE1 dataset. The first, the second, and the third best results are highlighted.
Table A3. S S I M and P S N R scores for the LIVE1 dataset. The first, the second, and the third best results are highlighted.
LIVE1
Method Metric QF = 10 QF = 20 QF = 30 QF = 40 QF = 50 QF = 60 QF = 70 QF = 80 QF = 90
JPEG S S I M 0.74550.82720.86270.88320.89770.91010.92460.94130.9631
P S N R 25.6928.0629.3730.2831.0331.7732.7734.2336.86
EPIIC S S I M 0.75560.83120.86620.88640.90070.91290.92700.94320.9637
P S N R 25.9428.2729.5930.5231.2732.0032.9834.3636.67
EPIIC Sobel S S I M 0.75550.83120.86620.88640.90070.91290.92700.94310.9637
P S N R 25.9428.2729.5930.5131.2631.9932.9734.3536.65
FBCNN S S I M 0.80370.86970.89800.91390.92470.93400.94460.95640.9714
P S N R 27.7730.1131.4332.3433.0633.7734.7136.0238.25
Gaussian Filter S S I M 0.75460.83110.86620.88640.90060.91280.92700.94310.9637
P S N R 25.8828.2629.5830.5131.2531.9832.9734.3536.65
Guided Filter S S I M 0.76380.83890.87030.88820.90060.91130.92370.93760.9540
P S N R 26.1928.4529.7630.6631.3932.1133.0634.3836.45
Average Filter S S I M 0.73520.78810.80580.81420.81920.82280.82630.82940.8328
P S N R 25.3226.5726.9627.1527.2627.3427.4227.5027.60
Median Filter S S I M 0.73640.79790.81930.82960.83600.84060.84550.85000.8552
P S N R 25.5427.0927.6527.9428.1128.2528.4028.5528.73
Wiener Filter S S I M 0.75570.81880.84220.85450.86250.86880.87530.88160.8878
P S N R 26.0628.1829.1729.7930.2430.6331.0931.6032.17
Non-local Means Filter S S I M 0.74550.82730.86300.88350.89810.91060.92500.94170.9632
P S N R 25.6928.0629.3730.2831.0331.7732.7734.2336.87
Median Modified Wiener Filter S S I M 0.75010.81950.84550.85900.86790.87500.88240.88970.8972
P S N R 25.9728.1729.2229.8930.3830.8131.3231.9132.61
Anisotropic Diffusion Filter S S I M 0.74530.79780.81800.82390.83820.83610.84580.85520.8631
P S N R 25.9727.9428.9029.3729.9530.1730.6831.2031.86
Gaussian Bilateral Filter S S I M 0.74550.82720.86270.88320.89770.91010.92460.94130.9631
P S N R 25.6928.0629.3730.2831.0331.7732.7734.2336.86
Table A4. S S I M and P S N R scores for the Set14 dataset. The first, the second, and the third best results are highlighted.
Table A4. S S I M and P S N R scores for the Set14 dataset. The first, the second, and the third best results are highlighted.
Set14
Method Metric QF = 10 QF = 20 QF = 30 QF = 40 QF = 50 QF = 60 QF = 70 QF = 80 QF = 90
JPEG S S I M 0.72570.80080.83460.85360.86740.87950.89330.91020.9346
P S N R 25.5727.7628.9529.7630.4231.1032.0433.3936.19
EPIIC S S I M 0.73790.80460.83780.85640.87010.88190.89560.91200.9355
P S N R 25.8827.9529.1529.9530.6231.2932.2233.5135.81
EPIIC Sobel S S I M 0.73780.80460.83780.85640.87010.88190.89550.91200.9354
P S N R 25.8827.9429.1429.9430.6131.2832.2133.4935.79
FBCNN S S I M 0.79210.84810.87290.88680.89700.90550.91550.92770.9448
P S N R 27.8929.9831.1231.8532.4533.0333.8234.9036.67
Gaussian Filter S S I M 0.73700.80450.83770.85640.87000.88190.89550.91190.9354
P S N R 25.8227.9329.1429.9430.6031.2832.2133.5035.80
Guided Filter S S I M 0.74450.81220.84230.85830.87030.88030.89220.90600.9250
P S N R 26.0828.1829.3230.0930.7431.3732.2433.3635.13
Average Filter S S I M 0.72250.77250.79120.79960.80560.80980.81390.81790.8228
P S N R 25.3926.6427.0827.2927.4327.5427.6527.7627.90
Median Filter S S I M 0.72290.78060.80260.81280.82000.82540.83050.83560.8420
P S N R 25.6027.1727.8028.1228.3628.5628.7728.9729.25
Wiener Filter S S I M 0.73800.79610.81980.83140.83980.84620.85260.85910.8662
P S N R 25.9627.8928.8129.3429.7530.1330.5531.0031.55
Non-local Means Filter S S I M 0.72570.80090.83470.85380.86760.87970.89360.91050.9347
P S N R 25.5727.7628.9529.7630.4331.1032.0433.4036.19
Median Modified Wiener Filter S S I M 0.73380.79790.82400.83690.84600.85310.86020.86750.8759
P S N R 25.8927.9328.9329.5329.9830.4030.8931.4432.13
Anisotropic Diffusion Filter S S I M 0.71480.76250.78230.78490.79650.80590.80660.81710.8247
P S N R 25.7227.3928.1228.4328.8829.1929.4630.1430.44
Gaussian Bilateral Filter S S I M 0.72570.80080.83460.85360.86740.87950.89330.91020.9346
P S N R 25.5727.7628.9529.7630.4231.1032.0433.3936.19
Table A5. S S I M and P S N R scores for the Set5 dataset. The first, the second, and the third best results are highlighted.
Table A5. S S I M and P S N R scores for the Set5 dataset. The first, the second, and the third best results are highlighted.
Set5
Method Metric QF = 10 QF = 20 QF = 30 QF = 40 QF = 50 QF = 60 QF = 70 QF = 80 QF = 90
JPEG S S I M 0.74780.81960.85340.87210.88470.90050.91500.92920.9515
P S N R 26.5829.0130.3231.1331.7132.9434.7435.8638.14
EPIIC S S I M 0.77470.83480.86340.87720.89030.90360.91720.93060.9525
P S N R 27.0929.2930.5231.3132.0933.3635.0335.6437.87
EPIIC Sobel S S I M 0.77420.83460.86300.87700.89020.90360.91720.93060.9525
P S N R 27.0929.3030.5231.3132.0833.3535.0135.6237.84
FBCNN S S I M 0.83430.87610.89630.90640.91500.92230.93090.94080.9563
P S N R 29.2331.3532.5233.1833.6934.3035.1636.0937.48
Gaussian Filter S S I M 0.77260.83330.86170.87550.88880.90350.91710.93050.9525
P S N R 27.0229.1830.5031.2832.0733.3535.0235.6037.82
Guided Filter S S I M 0.78210.83980.86750.88200.89480.90610.91580.92570.9436
P S N R 27.2729.5930.8431.5532.2833.4734.8535.3937.19
Average Filter S S I M 0.77080.82550.84940.86030.86900.87630.88260.88740.8932
P S N R 26.8428.6229.3629.7230.0030.2430.4930.6830.94
Median Filter S S I M 0.76470.82720.85440.86750.87640.88530.89370.90010.9065
P S N R 26.9129.0229.9930.4830.8131.2031.6532.0132.41
Wiener Filter S S I M 0.77500.83430.86030.87240.88320.89140.89870.90450.9125
P S N R 27.1229.4030.5331.1031.7732.3832.9433.2834.00
Non-local Means Filter S S I M 0.74780.81970.85350.87230.88510.90070.91530.92950.9519
P S N R 26.5829.0130.3331.1431.7232.9434.7435.8638.13
Median Modified Wiener Filter S S I M 0.76720.83320.86220.87610.88720.89680.90580.91340.9231
P S N R 27.0029.4430.6831.3532.0332.7733.5534.0935.06
Anisotropic Diffusion Filter S S I M 0.78060.83700.86200.87320.88450.89260.89920.90350.9110
P S N R 27.2329.4630.5831.1031.7632.3432.8433.0633.69
Gaussian Bilateral Filter S S I M 0.74780.81960.85340.87210.88470.90050.91500.92920.9515
P S N R 26.5829.0130.3231.1331.7132.9434.7435.8638.14

References

  1. Aswathy, M.; Jagannath, M. Detection of breast cancer on digital histopathology images: Present status and future possibilities. Inform. Med. Unlocked 2017, 8, 74–79. [Google Scholar] [CrossRef]
  2. Nam, S.; Chong, Y.; Jung, C.K.; Kwak, T.Y.; Lee, J.Y.; Park, J.; Rho, M.J.; Go, H. Introduction to digital pathology and computer-aided pathology. J. Pathol. Transl. Med. 2020, 54, 125–134. [Google Scholar] [CrossRef] [PubMed]
  3. Irshad, H.; Veillard, A.; Roux, L.; Racoceanu, D. Methods for nuclei detection, segmentation, and classification in digital histopathology: A review-current status and future potential. IEEE Rev. Biomed. Eng. 2014, 7, 97–114. [Google Scholar] [CrossRef]
  4. Wang, S.; Yang, D.M.; Rong, R.; Zhan, X.; Xiao, G. Pathology Image Analysis Using Segmentation Deep Learning Algorithms. Am. J. Pathol. 2019, 189, 1686–1698. [Google Scholar] [CrossRef]
  5. Brixtel, R.; Bougleux, S.; Lézoray, O.; Caillot, Y.; Lemoine, B.; Fontaine, M.; Nebati, D.; Renouf, A. Whole Slide Image Quality in Digital Pathology: Review and Perspectives. IEEE Access 2022, 10, 131005–131035. [Google Scholar] [CrossRef]
  6. Prochorec-Sobieszek, M.; Szumera-Ciećkiewicz, A. Current state of knowledge about digital pathology. Hematol. Clin. Pract. 2017, 8, 1–11. [Google Scholar]
  7. Fırat, A.; Fatih, Ö. Chaotic quantization based JPEG for effective compression of whole slide images. Vis. Comput. 2022, 39, 5609–5623. [Google Scholar] [CrossRef]
  8. Wallace, G. The JPEG still picture compression standard. IEEE Trans. Consum. Electron. 1992, 38, xviii–xxxiv. [Google Scholar] [CrossRef]
  9. Liu, J.; Liu, D.; Yang, W.; Xia, S.; Zhang, X.; Dai, Y. A Comprehensive Benchmark for Single Image Compression Artifact Reduction. IEEE Trans. Image Process. 2020, 29, 7845–7860. [Google Scholar] [CrossRef]
  10. Tschumperle, D.; Deriche, R. Vector-valued image regularization with PDEs: A common framework for different applications. IEEE Trans. Pattern Anal. Mach. Intell. 2005, 27, 506–517. [Google Scholar] [CrossRef]
  11. Wang, T.; Zhai, G. JPEG2000 image postprocessing with novel trilateral deringing filter. Opt.-Eng. 2008, 47, 027005. [Google Scholar] [CrossRef]
  12. Foi, A.; Katkovnik, V.; Egiazarian, K. Pointwise Shape-Adaptive DCT for High-Quality Denoising and Deblocking of Grayscale and Color Images. IEEE Trans. Image Process. 2007, 16, 1395–1411. [Google Scholar] [CrossRef] [PubMed]
  13. Zhai, G.; Lin, W.; Cai, J.; Yang, X.; Zhang, W. Efficient quadtree based block-shift filtering for deblocking and deringing. J. Vis. Commun. Image Represent. 2009, 20, 595–607. [Google Scholar] [CrossRef]
  14. Sun, D.; Cham, W.K. Postprocessing of Low Bit-Rate Block DCT Coded Images Based on a Fields of Experts Prior. IEEE Trans. Image Process. 2007, 16, 2743–2751. [Google Scholar] [CrossRef]
  15. Liu, X.; Wu, X.; Zhou, J.; Zhao, D. Data-driven sparsity-based restoration of JPEG-compressed images in dual transform-pixel domain. In Proceedings of the 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Boston, MA, USA, 7–12 June 2015; pp. 5171–5178. [Google Scholar] [CrossRef]
  16. Liu, X.; Wu, X.; Zhou, J.; Zhao, D. Data-Driven Soft Decoding of Compressed Images in Dual Transform-Pixel Domain. IEEE Trans. Image Process. 2016, 25, 1649–1659. [Google Scholar] [CrossRef]
  17. Dong, C.; Deng, Y.; Loy, C.C.; Tang, X. Compression Artifacts Reduction by a Deep Convolutional Network. In Proceedings of the 2015 IEEE International Conference on Computer Vision (ICCV), Santiago, Chile, 7–13 December 2015; pp. 576–584. [Google Scholar] [CrossRef]
  18. Chen, Y.; Pock, T. Trainable Nonlinear Reaction Diffusion: A Flexible Framework for Fast and Effective Image Restoration. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 1256–1272. [Google Scholar] [CrossRef]
  19. Zhang, K.; Zuo, W.; Chen, Y.; Meng, D.; Zhang, L. Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising. IEEE Trans. Image Process. 2017, 26, 3142–3155. [Google Scholar] [CrossRef] [PubMed]
  20. Jiang, J.; Zhang, K.; Timofte, R. Towards Flexible Blind JPEG Artifacts Removal. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada, 10–17 October 2021; pp. 4997–5006. [Google Scholar]
  21. Ehrlich, M.; Davis, L.; Lim, S.N.; Shrivastava, A. Quantization Guided JPEG Artifact Correction. arXiv 2020, arXiv:2004.09320. [Google Scholar] [CrossRef]
  22. Oztan, B.; Malik, A.; Fan, Z.; Eschbach, R. Removal of artifacts from JPEG compressed document images. In Proceedings of the Color Imaging XII: Processing, Hardcopy, and Applications, San Jose, CA, USA, 30 January–1 February 2007; Volume 6493, p. 705414. [Google Scholar] [CrossRef]
  23. Jóźwik-Wabik, P.; Gładys, B.; Hermansa, M.; Macha, D.; Seweryn Kalisz, T.S.; Foszner, P.; Popowicz, A.; Marczyk, M. Removing compression artifacts on whole slide HE-stained histopathological images. In Recent Advances in Computational Oncology and Personalized Medicine; Bajkacz, S., Ostrowski, Z., Eds.; Silesian University of Technology: Gliwice, Poland, 2021; pp. 79–88. [Google Scholar]
  24. Ruifrok, A.C.; Johnston, D.A. Quantification of histochemical staining by color deconvolution. Anal. Quant. Cytol. Histol. 2001, 23, 291–299. [Google Scholar]
  25. Kather, J.N. Color Deconvolution in MATLAB. GitHub Repository. 2020. Available online: https://github.com/jnkather/ColorDeconvolutionMatlab (accessed on 14 April 2025).
  26. Pratt, W.K. Digital Image Processing; PixelSoft, Inc.: Los Altos, CA, USA, 2001. [Google Scholar]
  27. Cannistraci, C.; Abbas, A.; Gao, X. Median Modified Wiener Filter for nonlinear adaptive spatial denoising of protein NMR multidimensional spectra. Sci. Rep. 2015, 5, 8017. [Google Scholar] [CrossRef]
  28. He, K.; Sun, J.; Tang, X. Guided Image Filtering. IEEE Trans. Pattern Anal. Mach. Intell. 2013, 35, 1397–1409. [Google Scholar] [CrossRef] [PubMed]
  29. Perona, P.; Malik, J. Scale-space and edge detection using anisotropic diffusion. IEEE Trans. Pattern Anal. Mach. Intell. 1990, 12, 629–639. [Google Scholar] [CrossRef]
  30. Bhonsle, D.; Chandra, V.; Sinha, P.G. An Optimized Framework Using Adaptive Wavelet Thresholding and Total Variation Technique for De-noising Medical Images. J. Adv. Res. Dyn. Control. Syst. 2018, 10, 13. [Google Scholar]
  31. Gerig, G.; Kubler, O.; Kikinis, R.; Jolesz, F. Nonlinear anisotropic filtering of MRI data. IEEE Trans. Med. Imaging 1992, 11, 221–232. [Google Scholar] [CrossRef] [PubMed]
  32. Tomasi, C.; Manduchi, R. Bilateral Filtering for Gray and Color Images. In Proceedings of the 1998 IEEE International Conference on Computer Vision, Bombay, India, 7 January 1998; pp. 836–846. [Google Scholar]
  33. Coll, B.; Morel, J.M. A non-local algorithm for image denoising. In Proceedings of the 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR’05), San Diego, CA, USA, 20–25 June 2005; Volume 2, pp. 60–65. [Google Scholar] [CrossRef]
  34. Wang, Z.; Bovik, A.; Sheikh, H.; Simoncelli, E. Image quality assessment: From error visibility to structural similarity. IEEE Trans. Image Process. 2004, 13, 600–612. [Google Scholar] [CrossRef] [PubMed]
  35. Kuhn, M. Building Predictive Models in R Using the caret Package. J. Stat. Softw. 2008, 28, 1–26. [Google Scholar] [CrossRef]
  36. Graham, S.; Vu, Q.D.; Raza, S.E.A.; Azam, A.; Tsang, Y.W.; Kwak, J.T.; Rajpoot, N. Hover-net: Simultaneous segmentation and classification of nuclei in multi-tissue histology images. Med. Image Anal. 2019, 58, 101563. [Google Scholar] [CrossRef]
  37. Weigert, M.; Schmidt, U. Nuclei Instance Segmentation and Classification in Histopathology Images with Stardist. In Proceedings of the 2022 IEEE International Symposium on Biomedical Imaging Challenges (ISBIC), Kolkata, India, 28–31 March 2022; pp. 1–4. [Google Scholar] [CrossRef]
  38. Deng, J.; Dong, W.; Socher, R.; Li, L.J.; Li, K.; Fei-Fei, L. ImageNet: A large-scale hierarchical image database. In Proceedings of the 2009 IEEE Conference on Computer Vision and Pattern Recognition, Miami, FL, USA, 20–25 June 2009; pp. 248–255. [Google Scholar] [CrossRef]
  39. Ronneberger, O.; Fischer, P.; Brox, T. U-Net: Convolutional Networks for Biomedical Image Segmentation. In Proceedings of the Medical Image Computing and Computer-Assisted Intervention (MICCAI), Munich, Germany, 5–9 October 2015. [Google Scholar]
  40. Vu, Q.D.; Graham, S.; To, M.N.N.; Shaban, M.; Qaiser, T.; Koohbanani, N.A.; Khurram, S.A.; Kurc, T.; Farahani, K.; Zhao, T.; et al. Methods for Segmentation and Classification of Digital Microscopy Tissue Images. arXiv 2018, arXiv:cs.CV/1810.13230. [Google Scholar] [CrossRef]
  41. Kumar, N.; Verma, R.; Sharma, S.; Bhargava, S.; Vahadane, A.; Sethi, A. A Dataset and a Technique for Generalized Nuclear Segmentation for Computational Pathology. IEEE Trans. Med. Imaging 2017, 36, 1550–1560. [Google Scholar] [CrossRef]
  42. Kirillov, A.; He, K.; Girshick, R.B.; Rother, C.; Dollár, P. Panoptic Segmentation. In Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA, 15–20 June 2019; pp. 9396–9405. [Google Scholar]
  43. Aksac, A.; Demetrick, D.J.; Ozyer, T.; Alhajj, R. BreCaHAD: A dataset for breast cancer histopathological annotation and diagnosis. BMC Res. Notes 2019, 12, 82. [Google Scholar] [CrossRef] [PubMed]
  44. Arbelaez, P.; Maire, M.; Fowlkes, C.; Malik, J. Contour Detection and Hierarchical Image Segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 2011, 33, 898–916. [Google Scholar] [CrossRef] [PubMed]
  45. Sheikh, H.R.; Wang, Z.; Cormack, L.; Bovik, A.C. LIVE Image Quality Assessment Database Release 2. 2005. Available online: http://live.ece.utexas.edu/research/quality (accessed on 6 April 2025).
  46. Bevilacqua, M.; Roumy, A.; Guillemot, C.; Alberi-Morel, M.L. Low-Complexity Single-Image Super-Resolution based on Nonnegative Neighbor Embedding. In Proceedings of the British Machine Vision Conference, Surrey, UK, 3–7 September 2012; BMVA Press: Durham, UK, 2012; pp. 135.1–135.10. [Google Scholar] [CrossRef]
  47. Zeyde, R.; Elad, M.; Protter, M. On Single Image Scale-Up Using Sparse-Representations. In Curves and Surfaces, Proceedings of the 7th International Conference, Avignon, France, 24–30 June 2010; Boissonnat, J.D., Chenin, P., Cohen, A., Gout, C., Lyche, T., Mazure, M.L., Schumaker, L., Eds.; Springer: Berlin/Heidelberg, Germany, 2012; pp. 711–730. [Google Scholar]
  48. Welch. A Technique for High-Performance Data Compression. Computer 1984, 17, 8–19. [Google Scholar] [CrossRef]
  49. Krylov, A.; Karnaukhov, V.; Mamaev, N.; Khvostikov, A. Hybrid Method for Biomedical Image Denoising. In Proceedings of the 2019 4th International Conference on Biomedical Imaging, Signal Processing, New York, NY, USA, 17–19 October 2020; ICBSP ’19. pp. 60–64. [Google Scholar] [CrossRef]
Figure 1. The following steps of processing a compressed H&E stained image with EPIIC and EPIIC Sobel. For the Sobel variant, we presented an edge map for the red color channel.
Figure 1. The following steps of processing a compressed H&E stained image with EPIIC and EPIIC Sobel. For the Sobel variant, we presented an edge map for the red color channel.
Applsci 15 04450 g001
Figure 2. The diagram illustrates the process of removing compression artifacts from the WSI slide.
Figure 2. The diagram illustrates the process of removing compression artifacts from the WSI slide.
Applsci 15 04450 g002
Figure 3. Results of the best methods for the BreCaHAD dataset. Images present: original image, compressed image Q F = 30 , EPIIC, EPIIC Sobel, FBCNN, image after Gaussian smoothing, Guided filtering.
Figure 3. Results of the best methods for the BreCaHAD dataset. Images present: original image, compressed image Q F = 30 , EPIIC, EPIIC Sobel, FBCNN, image after Gaussian smoothing, Guided filtering.
Applsci 15 04450 g003
Figure 4. A plot showing the average improvement in P S N R and S S I M values after removing compression artifacts using the best methods, relative to compressed image quality for natural image datasets.
Figure 4. A plot showing the average improvement in P S N R and S S I M values after removing compression artifacts using the best methods, relative to compressed image quality for natural image datasets.
Applsci 15 04450 g004
Figure 5. Results of the best methods for Set5, Set14, Kodak24, LIVE1 and BSDS500 datasets. Images present: original image, compressed image Q F = 30 , EPIIC, EPIIC Sobel, FBCNN, image after Gaussian smoothing, guided filtering.
Figure 5. Results of the best methods for Set5, Set14, Kodak24, LIVE1 and BSDS500 datasets. Images present: original image, compressed image Q F = 30 , EPIIC, EPIIC Sobel, FBCNN, image after Gaussian smoothing, guided filtering.
Applsci 15 04450 g005
Figure 6. Box plots highlighting the performance of competing methods on the CPM-17 and Kumar datasets for the Hover-Net segmentation algorithm. The graphs show the differences between the results obtained for the model without correction and the models after removing compression artifacts. The black line indicates the value of zero for a better interpretation.
Figure 6. Box plots highlighting the performance of competing methods on the CPM-17 and Kumar datasets for the Hover-Net segmentation algorithm. The graphs show the differences between the results obtained for the model without correction and the models after removing compression artifacts. The black line indicates the value of zero for a better interpretation.
Applsci 15 04450 g006
Figure 7. Box plots highlighting the performance of competing methods on the CPM-17 and Kumar datasets for the STARDIST segmentation algorithm. The graphs show the differences between the results obtained for the model without correction and the models after removing compression artifacts. The black line indicates the value of zero for a better interpretation.
Figure 7. Box plots highlighting the performance of competing methods on the CPM-17 and Kumar datasets for the STARDIST segmentation algorithm. The graphs show the differences between the results obtained for the model without correction and the models after removing compression artifacts. The black line indicates the value of zero for a better interpretation.
Applsci 15 04450 g007
Figure 8. Example visual results on the Kumar and CPM-17 datasets with Hover-Net models. The ground truth is presented on the left side at the intersection of the rows. In the first row, the black lines indicate the segmented nuclear instances predicted by each model. For better visualization, we included prediction maps for each image in the second row. The green color indicates TP regions, blue FN, and red FP.
Figure 8. Example visual results on the Kumar and CPM-17 datasets with Hover-Net models. The ground truth is presented on the left side at the intersection of the rows. In the first row, the black lines indicate the segmented nuclear instances predicted by each model. For better visualization, we included prediction maps for each image in the second row. The green color indicates TP regions, blue FN, and red FP.
Applsci 15 04450 g008
Table 1. S S I M and P S N R scores for the BreCaHAD dataset. The first, the second, and the third best results are highlighted.
Table 1. S S I M and P S N R scores for the BreCaHAD dataset. The first, the second, and the third best results are highlighted.
MethodMetricQF = 10QF = 20QF = 30QF = 40QF = 50QF = 60QF = 70QF = 80QF = 90
JPEG S S I M 0.82590.89280.91950.93300.94220.94950.95710.96460.9728
P S N R 29.7633.0534.8235.9836.8637.6738.6539.8341.41
EPIIC S S I M 0.87900.92130.93910.94830.95450.95950.96490.97010.9757
P S N R 30.9334.0735.7536.8537.6738.4239.3140.3341.56
EPIIC Sobel S S I M 0.87900.92130.93900.94830.95450.95950.96490.97010.9757
P S N R 30.9334.0835.7636.8637.6738.4339.3240.3441.58
FBCNN S S I M 0.90290.94030.95460.96170.96640.97010.97390.97740.9814
P S N R 32.5235.4436.9437.8638.5539.1339.8440.6441.67
Gaussian Filter S S I M 0.87860.92110.93900.94820.95440.95940.96480.97010.9756
P S N R 30.9134.0535.7436.8337.6638.4139.3040.3141.54
Guided Filter S S I M 0.87840.92170.93840.94760.95360.95820.96280.96720.9715
P S N R 30.9434.1235.7736.8537.6838.3939.2240.1341.18
Average Filter S S I M 0.87510.92050.93880.94770.95350.95790.96240.96670.9709
P S N R 30.8234.0435.7236.7637.5138.1638.8939.6840.54
Median Filter S S I M 0.86110.91150.93280.94310.94990.95510.96040.96560.9709
P S N R 30.5733.7035.4236.5237.3238.0238.8439.7640.85
Wiener Filter S S I M 0.87540.91930.93860.94790.95380.95850.96300.96740.9718
P S N R 30.8633.9835.7336.8337.6338.3339.1340.0040.99
Non-local Means Filter S S I M 0.82590.89280.91950.93300.94220.94950.95710.96460.9729
P S N R 29.7633.0534.8235.9836.8637.6738.6539.8341.41
Median Modified Wiener Filter S S I M 0.85960.90950.93220.94310.95010.95560.9610.96630.9718
P S N R 30.5233.7335.4036.5437.3838.1339.0140.0141.21
Anisotropic Diffusion Filter S S I M 0.87500.92160.93850.94660.95180.95580.95970.96350.9672
P S N R 30.8334.1035.7136.7037.4037.9838.6439.3340.05
Gaussian Bilateral Filter S S I M 0.82590.89280.91950.93300.94220.94950.95710.96460.9728
P S N R 29.7633.0534.8235.9836.8637.6738.6539.8341.41
Table 2. Comparison of computing times for the tested methods on the BreCaHAD dataset. The reported values include the mean, standard deviation, and median time in seconds.
Table 2. Comparison of computing times for the tested methods on the BreCaHAD dataset. The reported values include the mean, standard deviation, and median time in seconds.
MethodMean [s]Std [s]Median [s]
EPIIC0.1870.0460.178
EPIIC Sobel0.3160.0530.308
FBCNN (CPU)17.0520.64216.980
FBCNN (GPU)1.0430.0501.039
Gaussian Filter0.0110.0030.011
Guided Filter0.2230.0380.223
Average Filter0.0100.0030.010
Median Filter0.0530.0090.053
Wiener Filter0.0850.0160.083
Non-local Means Filter2.4900.2382.461
Median Modified Wiener Filter2.0600.1392.054
Anisotropic Diffusion Filter12.0829.2179.686
Gaussian Bilateral Filter0.4720.0620.470
Table 3. The table presents the performance of competing methods on the Kumar and CPM-17 datasets for both segmentation methods. The best results are underlined.
Table 3. The table presents the performance of competing methods on the Kumar and CPM-17 datasets for both segmentation methods. The best results are underlined.
DatasetSegmentation
Method
MethodMeanMedian
Δ DICE Δ AJI Δ PQ Δ DICE Δ AJI Δ PQ
CPM-17Hover-NetEPIIC0.0002−0.00300.00050.00180.00180.0105
EPIIC Sobel−0.00100.00450.00560.00130.00680.0072
FBCNN−0.0054−0.00440.0016−0.0029−0.0001−0.0024
Gaussian Filter−0.0052−0.0026−0.0026−0.00200.0014−0.0005
Guided Filter−0.0069−0.0100−0.0058−0.0003−0.0025−0.0024
STARDISTEPIIC0.00260.00870.01690.00610.01400.0207
EPIIC Sobel0.00380.01350.02170.00480.01440.0251
FBCNN−0.0018−0.00450.0025−0.0018−0.00560.0014
Gaussian Filter−0.0058−0.0083−0.0053−0.0036−0.0062−0.0043
Guided Filter0.00750.00890.00820.00800.01190.0105
KumarHover-NetEPIIC0.00660.00280.02340.00340.00060.0254
EPIIC Sobel0.0008−0.00730.01550.0013−0.00110.0231
FBCNN0.0007−0.00680.0124−0.0058−0.01190.0106
Gaussian Filter0.0036−0.00850.01720.0000−0.00550.0229
Guided Filter0.0063−0.00070.01100.00340.00220.0135
STARDISTEPIIC0.00680.00430.00200.01070.00090.0003
EPIIC Sobel0.0044−0.00200.00600.0067−0.00350.0050
FBCNN−0.0185−0.0071−0.0194−0.00510.0016−0.0146
Gaussian Filter−0.0130−0.0078−0.0041−0.0041−0.0056−0.0088
Guided Filter−0.0236−0.0217−0.0252−0.0136−0.0183−0.0244
Table 4. The table presents the p-values of the Wilcoxon test.
Table 4. The table presents the p-values of the Wilcoxon test.
DatasetSegmentation
Method
Method DICE AJI PQ
CPM-17Hover-NetEPIIC 2.052 × 10 1 5.037 × 10 1 2.270 × 10 1
EPIIC Sobel 1.391 × 10 1 8.888 × 10 2 6.440 × 10 2
STARDISTEPIIC 1.024 × 10 1 4.540 × 10 2 1.500 × 10 3
EPIIC Sobel 9.840 × 10 2 4.700 × 10 3 8.19 × 10 5
KumarHover-NetEPIIC 1.206 × 10 1 3.349 × 10 1 4.300 × 10 3
EPIIC Sobel 4.039 × 10 1 7.292 × 10 1 5.020 × 10 2
STARDISTEPIIC 3.910 × 10 1 3.910 × 10 1 7.609 × 10 1
EPIIC Sobel 2.958 × 10 1 8.552 × 10 1 3.575 × 10 1
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Merta, J.; Marczyk, M. EPIIC: Edge-Preserving Method Increasing Nuclei Clarity for Compression Artifacts Removal in Whole-Slide Histopathological Images. Appl. Sci. 2025, 15, 4450. https://doi.org/10.3390/app15084450

AMA Style

Merta J, Marczyk M. EPIIC: Edge-Preserving Method Increasing Nuclei Clarity for Compression Artifacts Removal in Whole-Slide Histopathological Images. Applied Sciences. 2025; 15(8):4450. https://doi.org/10.3390/app15084450

Chicago/Turabian Style

Merta, Julia, and Michal Marczyk. 2025. "EPIIC: Edge-Preserving Method Increasing Nuclei Clarity for Compression Artifacts Removal in Whole-Slide Histopathological Images" Applied Sciences 15, no. 8: 4450. https://doi.org/10.3390/app15084450

APA Style

Merta, J., & Marczyk, M. (2025). EPIIC: Edge-Preserving Method Increasing Nuclei Clarity for Compression Artifacts Removal in Whole-Slide Histopathological Images. Applied Sciences, 15(8), 4450. https://doi.org/10.3390/app15084450

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop