A Learning-Based Approach to Reduce JPEG Artifacts in Image Matting

Inchang Choi, Sunyeong Kim, Michael S. Brown, Yu-Wing Tai

Abstract: Image matting is a fundamental task in computer vision, yet most existing algorithms assume high-quality, uncompressed input. In practice, JPEG compression is ubiquitous, introducing artifacts that severely degrade the accuracy of alpha mattes. This paper presents a learning-based post-processing framework that leverages sparse dictionary learning to restore fine details in alpha mattes extracted from compressed images. By utilizing specialized dictionaries for different image structures and a Markov Random Field (MRF) for patch selection, the proposed method significantly reduces error and improves visual quality compared to standard matting and deblocking techniques.

The Challenge of Compressed Image Matting

Image matting involves estimating the fractional transparency (alpha) of foreground objects, a process highly sensitive to pixel-level noise. JPEG compression, which utilizes the Discrete Cosine Transform (DCT) to reduce file size, introduces blocking and ringing artifacts. While these artifacts may be subtle to the human eye, they are catastrophic for matting algorithms, which often interpret compression noise as fine structural detail.

Impact of JPEG compression quality on Mean Squared Error (MSE) and visual matte quality.

As shown in the figure above, the error in the resulting alpha matte increases dramatically as JPEG quality decreases. Standard deblocking filters often fail to resolve this issue as they tend to blur high-frequency details like hair, which are critical for high-quality matting.

Learning-Based Matte Refinement

To address this, the authors propose a refinement method based on sparse representation. The core idea is to learn the relationship between "low-quality" patches (from compressed mattes) and "high-quality" patches (from uncompressed ground truth).

  1. Sparse Dictionary Learning: The system co-trains two dictionaries: $D_l$ (low-quality) and $D_h$ (high-quality). Any given matte patch is assumed to be representable as a sparse linear combination of basis functions from these dictionaries.
  2. Specialized Dictionaries: Recognizing that different image structures require different reconstruction logic, the authors trained three distinct sets of dictionaries for long hair, short hair, and sharp boundaries.
Specialized dictionaries for different image structures (long hair, short hair, sharp boundaries) and their corresponding reconstructions.
  1. MRF-Based Selection: For each $8 \times 8$ block, a Markov Random Field (MRF) framework selects the most appropriate dictionary. The selection is based on which dictionary's reconstruction, when re-compressed, most closely matches the original input, while ensuring spatial consistency with neighboring blocks.

Experimental Results

The method was evaluated using the alphamatting.com benchmark and real-world images from mobile devices. Quantitatively, the approach consistently achieved lower Root Mean Square Error (RMSE) across various test cases compared to raw matting outputs. Qualitatively, it effectively removes blocking artifacts and restores delicate structures like individual hair strands that are typically lost in compression.

Compared to general-purpose denoising algorithms like BM3D, this structure-aware approach provides sharper and more accurate boundaries. While extremely complex hair patterns occasionally pose alignment challenges for the reconstruction, the method represents a significant step forward in making image matting robust for real-world, compressed photography.

Conclusion

By treating matte refinement as a structure-specific super-resolution problem, this research bridges the gap between laboratory matting performance and the practical needs of web and mobile imaging. The use of specialized sparse dictionaries allows for the "hallucination" of lost details, providing a powerful tool for high-quality foreground extraction from everyday images.

Summary updated

BibTeX
@inproceedings{choi2013learning,
  author = {Inchang Choi and Sunyeong Kim and Michael S. Brown and Yu-Wing Tai},
  title = {{A Learning-Based Approach to Reduce JPEG Artifacts in Image Matting}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2013},
  doi = {10.1109/iccv.2013.358},
}
Figure