In an era of rising digital fraud and high-quality AI-generated forgeries, standard data extraction (OCR) is no longer sufficient. This project offers a comprehensive solution for automated identity document authentication (using the Spanish DNI as a model), combining classic validation algorithms with advanced digital forensic methods.

FacePhi Challenge 2026, FacePhi

ISO Region Validation: Confirmation that issuing state and nationality codes match the ISO 3166-1 “ESP” standard
MRZ & ICAO Analysis: Full validation of the Machine Readable Zone against international format standards.
CAN Format Integrity: Verification of the 6-digit Card Access Number found on the front of the ID.

Visual-MRZ Synchronization: Cross-referencing data fields between the visual zone and the MRZ, including support number, nationality, birth date, and expiry.
Mathematical Logic (Module 23): Verification of the DNI control letter using the official Spanish Ministry of the Interior algorithm.
Temporal Logic & Renewal: Calculation of the holder’s age to ensure the document’s validity period (5, 10 years, or permanent) matches Spanish legal requirements.



ELA (Error Level Analysis): Detecting digital tampering by re-saving images and analyzing pixel-level changes to identify edited areas, such as photos replaced via design software.
FFT (Frequency Analysis): Utilizing Fast Fourier Transform to detect screen grids, identifying if a photo was taken of a screen or is AI-generated.
Texture Verification: Measuring spatial sharpness and micro-textures to distinguish between natural photos and suspicious, overly uniform images.
EXIF Metadata Analysis: Identifying traces of editing software, stripped metadata, or hardware inconsistencies between the front and back images.



“The best way to fight fraud is to not let it happen”