pyIFD: Python-based Image Forgery Detection Toolkit
Is this image fake? Has it been manipulated? Was something added after the fact?

Attempting to detect image manipulations, forgeries, and photoshops is a popular task for machine learning and an increasingly popular pastime for people. Image manipulations are often used for fun or aesthetics, but they also mislead and misinform their viewers. Detecting and pointing out manipulations allows viewers to decide an image’s intent. And while human intuition can go a long way towards detecting manipulations, these manipulations are designed to fool us. Various algorithms have been developed to help.
As with most algorithms resulting from scientific research, there is little consistency of language, quality, code style, documentation, etc. pyIFD brings the most popular and effective techniques together into one package with the consistent quality and coding standards of Red Hat software engineering. Written for Python 3+ with minimal dependencies — pyIFD brings together 14 image manipulation detection techniques for easy use and comparison — and the devs are planning to add more moving forward.
Algorithms
The toolkit consists of a number of different algorithms (click on each to be taken to a usage page and description).
ADQ1, ADQ2, ADQ3, BLK, CAGI, CFA1, DCT, ELA, GHOST, NADQ, NOI1, NOI2, NOI4, NOI5
PIP Installation:
pip install pyIFD
Example Usage:
Example Outputs:
All masks were produced using the CAGI manipulation detection algorithm. The leftmost images are the originals, the center images are heat-maps of grid alignment abnormalities, and the rightmost image is the inverse of those abnormalities.
For more examples along with output check out this Python Notebook:
Acknowledgments:
The University of Notre Dame Computer Vision Research Laboratory (CVRL) and Red Hat.
Links:
PYPI: pyIFD · PyPI
Github: EldritchJS/pyIFD (github.com)