Giter VIP home page Giter VIP logo

jpeg-compression-detection's Introduction

JPEG Image Compression Detection And Quality Factor Detection

Few methods for JPEG Image Compression Detection And Quality Factor Detection

Low Compression Medium Compression High Compression

Methods

DCT Based JPEG Compression Detection

Image taken from here

method

  • Split the image into 8x8 blocks.
  • Compute the DCT coefficients for each block and quantize the frequency components.
  • Compute the normalized frequencies across all the blocks.
  • Compute the variance of the high frequency blocks.
  • If the variance is high, then unclamped high frequency components are present. If the variance is low, then jpeg quanitzed high frequency components are present.
  • The above observation can be used to classify if a jpeg image is compressed.

Model Based Detection and Regression

Reconstructed Reference Input Residual
  • Compute a reference denoised image using Real-ESRGAN.
  • Compute the residual image, i.e., difference between reference denoised image and input image.
  • The residual image contains high-frequency components, artifacts, etc.
  • The residual image is passed to a resnet model to get classifcation and regression of jpeg-compression and quality factor respectively.
  • The model is trained with augmenting single, doube jpeg compressions.
  • Non-aligned double JPEG compression should be implicitly handled as the reference image should produce a constant noise pattern.

Pre-Trained Regression Model

Usage

Run get_dataset.sh to download the datasets.

bash get_dataset.sh

DCT Based JPEG Compression Detection

Execute dct_validation.py to obtain the validation results stored as csv in outputs/dct.csv

python3 dct_validation.py

Model Based Detection and Regression

Execute dnn_validation.py to obtain the validation results stored as csv in outputs/dnn.csv

python3 dnn_validation.py

Pre-Trained Regression Model

Execute fbcnn_validation.py to obtain the validation results stored as csv in outputs/fbcnn.csv

python3 fbcnn_validation.py

Train

To train the DNN model, we run train.py

python3 train.py

jpeg-compression-detection's People

Contributors

chris10m avatar mrkristen avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.