Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Semantic JPEG image compression using deep convolutional neural network (CNN)
| Date | Stars |
|---|---|
| 2026-07-31 | 338 |
| 2026-08-01 | 338 |
| 2026-08-02 | 338 |
| 2026-08-06 | 338 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Semantic Perceptual Image Compression using Deep Convolution Networks
This code is part of the paper [arxiv](https://arxiv.org/abs/1612.08712), abstract of the paper is provided at the bottom of this page. It consists of three parts:
1. Code to generate Multi-structure region of interest (MSROI)
(This uses CNN model. A pretrained model has been provided)
2. Code to use MSROI map to semantically compress image as JPEG
3. Code to train a CNN model (to be used by 1)
Requirements:
1. Tensorflow
2. Numpy
3. Pandas
4. Python PIL
5. Python SKimage
For detailed requirements list please see requirements.txt
Recomended:
1. Imagemagick (for faster image operations)
2. VQMT (for obtaining metrics to compare images)
Table of Contents
=================
* [How to use this code ?](#how-to-use-this-code-)
* [Generating Map](#generating-map)
* [Compressing image using the Map](#compressing-image-using-the-map)
* [Training your own model](#training-your-own-model)
* [Evaluating metrics](#evaluating-metrics)
* [Multi-Structure Region-of-interest](#multi-structure-region-of-interest)
* [What this is ?](#what-this-is-)
* [What this is NOT ?](#what-this-is-not-)
* [Design Choices](#design-choices)
* [FAQ about image compression](#faq-about-image-compression)
* [Credits](#credits)
* [Abstract](#abstract)
# How to use this code ?
## Generating Map
```
python generate_map.py <image_file>
```
Generates Map and overlay file inside 'output' directory.
If you get this error
```
InvalidArgumentError (see above for traceback): Unsuccessful TensorSliceReader constructor:
Failed to get matching files on models/model-50: Not found: models
```
It means you have not downloaded the model file or it is not accesible. Code assumes a model files inside `models` directory.
Model has been uploaded to Github, but if it does not download due to GH's restriction you may download it from here
https://www.dropbox.com/s/izfas78534qjg08/models.tar.gz?dl=0
## Compressing image using the Map
```
python combine_images.py -image <image_file> -map <map_file>
```
Map file is the file generated by aforementioned step. Default name for map is `output/msroi_map.jpg`
There are several other command line options. Please check the code for the more details.
**IMPORTANT**:
Current default setting has threshold of 20%, i.e the compressed filesize is allowed to be 20% more
than the standard JPEG. This is done so that difference in 'semantic object' compression can be visually examined.
For fair comparison use '-threshold_pct 1'.
## Training your own model
To train your model, you will need class labelled training examples, like CIFAR, Caltech or Imagenet.
There is no need for 'localization' ground truth.
1. Generate the data pickles
```
python prepare_data.py
```
Make sure that self.images point to the directory containing images.
2. It is not required to use pretrained VGG weights, but if you do training will be faster.
You may download pretrained weights referred in Params file as vgg_weights [from here](https://drive.google.com/file/d/0B5o40yxdA9PqOVI5dF9tN3NUc2c/view?usp=sharing).
3. Use train.py to train the model. Models will be saved in 'models' directory after every 10 epoch. All the parematers and hyper-paramter can be adjusted at param.py
## Evaluating metrics
1. Use the '-print_metrics' command while calling 'combine_images.py'. This will print the metrics on STDOUT with this format --
```
jpeg_psnr,jpeg_ssim,our_ssim,our_q,jpeg_psnrhvs,png_size,model_number,our_size,filename,jpeg_vifp,jpeg_q,jpeg_msssim,our_psnrhvsm,jpeg_psnrhvsm,our_vifp,our_psnr,our_msssim,our_psnrhvs,jpeg_size
```
2. Pass the file which contains one line of metrics (as shown above) to the file 'read_log.py'. This will print various stats, and also plot the graphs as shown in the paper.
# Multi-Structure Region-of-interest
![Comparison of MSROI withExcerpt of 9,361 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:0dd3edd9e276ebf1, llm:Topics: cnn, deep-convolutional-networks, image-compression, jpeg; description: 'Semantic JPEG image compression using deep convolutional neural network (CNN)'.
matched fp:0dd3edd9e276ebf1, llm:Topics: cnn, deep-convolutional-networks, image-compression, jpeg; description: 'Semantic JPEG image compression using deep convolutional neural network (CNN)'.
matched fp:0dd3edd9e276ebf1, llm:Topics: cnn, deep-convolutional-networks, image-compression, jpeg; description: 'Semantic JPEG image compression using deep convolutional neural network (CNN)'.