This project demonstrates the requested pipeline end to end:
face scan -> face detection/encoding -> live reverse-image search -> blockchain record -> re-verification
python -m venv .venv
# Windows: .venv\\Scripts\\activate
# macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
python pipeline.py path/to/face.jpgThe scan is uploaded to Google Lens. The first returned external result is recorded. If Google presents a consent or challenge page, inspect the printed search URL and replay the run with the selected result:
python pipeline.py path/to/face.jpg --skip-search --result-url "https://example.com/post"chain.json is an append-only local blockchain. Each block contains the source image hash, the face encoding hash, the discovered URL, and the search metadata. Blocks are mined with a small proof-of-work and linked by previous_hash; the CLI immediately recomputes every block and prints PASS/FAIL. You can verify an existing ledger without image dependencies using python verify_chain.py (or python pipeline.py --verify after installing the requirements).
- OpenCV's Haar cascade detects the largest visible face. The encoding is a deterministic normalized 32x32 grayscale face fingerprint, suitable for demonstrating identity linkage but not a production biometric system.
- Google Lens is a public web endpoint and may rate-limit, require consent, or change its HTML. No search result is hardcoded.
- The blockchain is local and simulated, so it demonstrates tamper evidence and re-verification without requiring a wallet or paid RPC. For production, replace
mine_blockwith a public testnet transaction and store the same record hash on-chain. - Only publicly returned links are recorded; the project does not download or republish social media content.
Show the terminal steps [1/3], [2/3], [3/3], one or more live Lens result URLs, the mined block hash, and Re-verification: PASS. Then edit one value in chain.json and run python verify_chain.py to show that tampering fails.