Image compression is necessary for handling high-resolution images in the modern world, but when images are restricted to low-bandwidth or low-storage applications, high levels of compression must be used, leading to loss of information (lossy compression), but also visible loss in quality.
In the case of JPEG Images, the most popular form of lossy compression, images with high compression tend to appear blocky, and smooth curves will often become jagged. This is because JPEG compresses each 8x8-pixel region of an image separately, and borders between tiles of an image often appear jarring and unnatural.
BlockCNN, A network architecture detailed in this paper and re-implemented using tensorflow in this repository, seeks to deblock and recover visual fidelity from highly-compressed JPEG images. (The network can also be used for image compression, but this is outside the scope of our current implementation)
This is an image from the testing portion of the dataset, meaning the network was not trained using this image.
Zooming in on fine details or contrast changes, it's clear that the output from the network is far superior to the blocky jpeg.
Compressed Image
Deblocked Image
Deblocking is best seen in images with curves, such as this portion, containing a parrot's beak:
Compressed Image
Deblocked Image
- First, create data by running
create_data.py-- This processes images in theKodak_Full_Imagesdirectory, and should create thedatafolder upon completion. - Next, run
main.py, which will train the network, and output all images (training and testing) to a folder calledoutput - Success! Observe that the images in
outputare much less blocky when compared to those indata/compressed_images, which are the inputs to the network. (alternatively, changeverbose_img_outputtoTruein main.py to get inputs/labels created in theoutputdirectory)




