Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Web

In-Browser Document Redaction for ID Cards, Bank Statements and Medical Reports

Build a web app that finds and removes personal details such as CNIC numbers, account numbers, phone numbers, addresses and names from PDFs and photos entirely inside the browser, using on-device OCR and small models, so the file never leaves the phone. People share copies of ID cards and bank statements with landlords, employers and agents every day, usually unredacted. The hard part is true redaction that removes hidden text, not black boxes drawn on top.

Difficulty

Advanced

Needs a team, real planning, and a supervisor who knows the area.
Effort

2 semesters · 2 to 3 students

Deliverables

8 to ship

4 optional extras

Suggested stack

TypeScriptPDF.js and pdf-libTesseract.js or ONNX Runtime WebTransformers.jsWebGPU and WebAssemblyService workers for offline use
A suggestion, not a requirement. Swap anything for what you already know.

What you should ship

  • A web app that works offline after first load and never uploads the document
  • Text extraction for digital PDFs and in-browser OCR for scanned PDFs and phone photos
  • Detectors for Pakistani identifiers (CNIC, IBAN, mobile numbers) with checksums and format rules
  • A small named entity model for names and addresses in English, plus a first Urdu model or rule set
  • A review screen where the user accepts, rejects or adds redactions before export
  • True redaction: underlying text, images and metadata removed, not only covered
  • A test suite that tries to recover redacted text from exported files
  • A benchmark on a synthetic set of documents with known personal data

If you have time left

  • Purpose presets such as "rental application" that keep only the fields a landlord needs
  • A share target so the app opens directly from WhatsApp or the Files app on Android
  • Support for Sindhi and Pashto names and addresses
  • A browser extension that redacts files before they are uploaded to any site

The problem: personal documents shared in full, every day

Renting a flat, applying for a job, opening an account, claiming insurance, applying for a visa: in Pakistan and much of South Asia, each of these involves sending a photo of your CNIC, a bank statement or a medical report over WhatsApp or email. The person asking usually needs one or two details. They receive everything: the full ID number, the account number, every transaction, home address, family details.

These copies end up in phone galleries, group chats and shared drives, and some are later misused for fraud, SIM registration or loan applications in someone else's name. People would redact more if it were easy. Today it is not.

What already exists and the gap

  • Desktop PDF editors such as Adobe Acrobat include a redaction tool. It is manual, and not something most people have on their phone.
  • Free online redaction sites require uploading the very document you are trying to protect to an unknown server.
  • Microsoft Presidio is an open source framework for detecting and anonymising personal data in text and images, designed to run on servers, with recognisers mostly built for Western identifiers.
  • Drawing a black box in a photo editor often leaves the original text in a PDF's text layer, where anyone can copy it out.

The gap is a phone-friendly tool that runs completely on the device, understands local identifiers and languages, works on scans and photos, and removes data for real.

Inspiration

WebLLM (Ruan et al., "WebLLM: A High-Performance In-Browser LLM Inference Engine", arXiv 2024) showed that WebGPU and WebAssembly can run language models inside the browser at a large share of native speed. Your project applies the same idea to a narrower, more practical task: running OCR and small entity recognition models in the browser so private documents never need a server. Presidio's design (recognisers, confidence scores, an anonymiser step) is a good model for your detection pipeline.

What you build

  • A person sharing a document opens the web app, picks a PDF or photo, reviews the highlighted personal details, adjusts them and exports a clean file.
  • Small offices such as estate agents, clinics and HR teams use it to clean documents before storing them.
  • Developers reuse the detectors as a small open source library.

The technically interesting part

  • On-device OCR on cheap phones. Scans and photos need OCR. Running it in the browser on a low-end phone is slow, so measure, choose model sizes carefully and process pages in a web worker.
  • Local identifiers. CNIC numbers have a fixed 13-digit pattern, often written with dashes, and Pakistani IBANs have a known structure and checksum. Rules with validation are more reliable than a model here, and you should measure both.
  • Names and addresses. These need a model. Start with an English named entity model in the browser, then build a small labelled set for Urdu and Roman Urdu names and test how far rules and dictionaries get you.
  • True redaction. In a PDF, remove the text objects and image regions under each redaction, rewrite the page content, and strip metadata, annotations and embedded files. Then prove it, by running text extraction and OCR on the exported file.
  • Offline and private by design. Cache models with a service worker, block all network requests after load, and show the user that nothing is being sent.

How to evaluate it

  • Detection quality: precision and recall per data type on a synthetic set of 200 documents with known personal data, including photos taken in poor light.
  • Leakage: share of exported files where any redacted value can be recovered by extraction or OCR. The target is zero.
  • Performance: time per page on a low-end Android phone and on a laptop.
  • Usability: five to ten people redact a document of their own choosing; record time, mistakes and what they found confusing.

Suggested plan

  • Weeks 1 to 4: study PDF structure, Presidio and in-browser model runtimes; build the synthetic document set.
  • Weeks 5 to 10: PDF text extraction, rule-based detectors and true redaction for digital PDFs.
  • Weeks 11 to 16: OCR for scans and photos, named entity model, review screen.
  • Weeks 17 to 21: offline mode, leakage tests and performance tuning.
  • Weeks 22 to 26: user testing, write-up and demo.

Path to a product

Banks, telecom companies, estate agents and HR teams all handle personal documents, and data protection rules are tightening in many countries. A free consumer app with a paid version for offices (batch processing, custom field rules) is a realistic model. The leak-test suite alone is a useful open source contribution, and the project is a strong portfolio piece for privacy, frontend and applied AI roles.

Scope warning

Do not train large models; use small existing ones and tune them. Do not promise perfect detection, because the user's review step is part of the design. Never add a server-side fallback for convenience, since that breaks the main promise. Start with digital PDFs before scans and photos.

Learn what you need on Sefism

Get help with this idea

The risk is slow OCR on real phones, or redaction that looks right but leaks. Tauseef can help you choose models, plan the leakage tests and decide which document types to support first. If you are new here, create a free account first.

Ideas and guidance, not finished projects

These are project ideas and scoping guidance, published free for students to use as a starting point. I do not build, write, or sell final-year projects, and I do not complete coursework for anyone. Take an idea, make it yours, and build it.

Not sure this one fits you?

I help students pick an idea that matches their skills and their deadline, then scope it down until it is finishable. Guidance only, never done for you.

Discuss this idea
Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.