ROI based Hybrid Lossy and Lossless Image Compression
Last Updated on February 25, 2021 by Editorial Team
Author(s): Mahisha Patel
Computer Vision
You donβt always need an entire high-quality image for insights!
This article aims to present the amalgamation of lossy and lossless compression for building a hybrid approach based on Region Of Interest that provides a high compression ratio and serves the purpose of efficient storage and transmission without affecting the accuracy.
Presently, we have entered an era where information holds value more than anything else. It has been a crucial thing to store and maintain massive amount of data for future insights. For this, we need a huge capacity for storage and high bandwidth to transfer theΒ data.
In many sectors, we deal with large number of image datasets including the Healthcare and Multimedia sectors. Here, Image Compression plays an important role in reducing the size of the image data seeking less storage space and providing lowΒ latency.
Table ofΒ Contents
- Image Compression: Lossy andΒ Lossless
- Introduction to ROI inΒ Images
- Hybrid Approach towards Image Compression
- Conclusion
Image Compression: Lossy andΒ Lossless
Image Compression, a type of data compression, is a technique of reducing image size for a reduction in the cost of storage and transmission. Image Compression is of basically two typesΒ :
- Lossy Compression: This technique is used in areas where not every bit of data is important. Lossy compression leads to the loss of some information. When the image is decoded, it represents the uncompressed image but with the loss of some of the information. Examples of Lossy Compression are JPEG andΒ WebP.
- Lossless Compression: This technique is used in areas where data is critical, and loss of information is not acceptable. When the image is decoded, it completely matches with the original image without loss of data. Examples of Lossless Compression are Gif andΒ PNG.
Introduction to ROI inΒ Images
An image consists of three parts which areΒ :
- Region of interestΒ (ROI)
- Non-Region of interest (Non-ROI)
- Background
To illustrate ROI, Iβve taken a brain MRI image from Kaggle Dataset as shown above. The red-colored portion is shown as a Region of interest (ROI) which is the part affected by the tumor. Only this portion is needed for further evaluation by the doctor. Other than that, the Non-ROI portion shown has not much of an importance to be observed, and the black portion which is the background can completely beΒ ignored.
So, a technique can be derived that takes into account the unimportant parts of the images, i.e. Non-ROI and background, to maximize the compression ratio.
Hybrid Approach towards Image Compression
Direction: To achieve a high compression ratio, the hybrid approach is proposed to combine lossy and lossless compression based on the Region of Interest. ROI is the most important part of the image that covers a very minute area of the image. Non ROI is also included which enables the user to bifurcate the most critical part from the whole image. Part other than ROI and Non-ROI is the background and most unused part of the image. As ROI is most crucial, it must be compressed using Lossless compression and Non-ROI can be compressed via Lossy compression whereas the background can beΒ ignored.
There exists numerous Lossless as well as Lossy compression techniques. The input image will be segmented into ROI and Non-ROI image and finally different techniques of Lossless Compression and Lossy Compression will be applied respectively.
Here, Context tree weighting lossless(CTW) for the ROI part and Fractal lossy compression for Non-ROI part is shown. We can use any other techniques of lossy and lossless compression instead of CTW and Fractal compression.
Lossy CompressionβββFractal Compression
Fractal compression is a lossy compression method for digital images, primarily based on fractals. The method is best applicable for textures and natural images, relying on the fact that parts of an image often resemble different parts of the same image. Fractal algorithms convert these parts into mathematical data called βfractal codesβ which are used to recreate the encodedΒ image.
Lossless CompressionβββContext Tree Weighting (CTW)
Context Tree Weighting is a lossless compression and prediction algorithm. It gives the both theoretical and practical guarantees for the performance. The CTW technique is a βgroup technique,β combining the expectations of numerous hidden variable request Markov models, where each such model is built utilizing zero-request probability estimators.
– Preprocessing (Rotation, Scaling, Translation, etc.) is done on the inputΒ image.
– Segmentation is done based on Region Of Interest.
1. ROI part: Context Tree Compression isΒ applied.
2. Non-ROI part: Fractal Compression isΒ applied.
– Storage or Transmission takes place after merging both parts ofΒ images.
– Decompression is performed.
The hybrid approach of combining these techniques of lossy and lossless compression outperforms many other techniques (Huffman and Arithmetic coding, IWT and Scalable RBC, etc.) when their performance parameters are compared.
Some of the performance parameters are:
- Mean Squared Error (MSE): It is the widely used measurement criteria for evaluating image quality in terms of error value between compressed and uncompressed images. The algorithm having the least MSE value is the most efficient algorithm.
- Compression Ratio (CR): It is the ratio between a number of pixels uncompressed (input) image to compressed (output) image. If the compression ratio is more, it will be beneficial for storage and transmission.
- Peak Signal to Noise Ratio (PSNR): It is a measure between the peak error between the compressed and uncompressed original image. It basically represents the quality of the image. The value of PSNR must be high for betterΒ quality.
The above-stated hybrid method for lossy and lossless compression gives higher CR, higher PSNR, and lower MSE than many state-of-the-art techniques.
ConclusionΒ :
Image Compression is important from the research as well as the implementation point of view. This hybrid approach is better than the lossy or lossless technique as it highly increases the rate of compression and does not affect further evaluation or future insights. We can further apply a different combination of lossy and lossless compression methods to further increase the compression ratio without affecting the quality of theΒ image.
ReferencesΒ :
- ROI Based Medical Image Compression for Telemedicine
Application - https://en.wikipedia.org/wiki/Fractal_compression
- https://en.wikipedia.org/wiki/Context_tree_weighting
Thank you for reading! Have a nice day!!Β π
ROI based Hybrid Lossy and Lossless Image Compression was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.
Published via Towards AI