PrivGuard is a Flutter-based privacy protection mobile application that uses on-device AI inferences to helps users detect oversharing risks and sensitive information in their digital content including texts and images, along with secore local data storage.
Over 90% of digital threats begin with publicly available data.
PrivGuard educates and protects users by identifying:
- Posts that reveal personal details
- Real-time travel or location risks
- Information linked to password recovery
- IDs, documents, tickets captured in photos
- Capture or upload media/text posts
- Securly save to local storage
- Long-press to run on-device scan
- Text classifier: NER-based risk labeling with DistilBERT
- Risk Score: 0–100 with Low, Medium, High tag
- Smart Tips: Context-aware advice (e.g., mask phone numbers, generalise location)
- Image Scanning: Object detection to extract and detect any risky details from image post
- Input Social Media handles like Instagram/Twitter
- Uses
Instaloader/snscrapeto fetch data - NLP analysis of bio, captions, hashtags
- Auto-rescan every 30 days with push alerts
| Feature | Stack |
|---|---|
| Upload UI + Gallery | Flutter, path_provider, image_picker |
| AI Risk Detection | DistilBERT, tflite_flutter,HuggingFace Transformers |
| Security | flutter_secure_storage, encrypt |
- Fine-tuned DistilBERT (
distilbert-base-uncased) for token-level detection of Personally Identifiable Information in text. - Trained on the English split of
ai4privacy/pii-masking-400kand exported to int8 dynamic-range TFLite so all inference runs on-device. - Covers 17 PII entity types (35 BIO labels), including:
- Names — given name, surname, username
- Address details — city, street, building number, ZIP code
- Phone numbers, email addresses, date of birth
- Financial / ID numbers — credit card, bank account, tax, social, driver's licence, ID card
- Passwords
- The training + export pipeline lives in
ner model/pii_ner_colab.ipynb, which produces the four asset files the app loads:pii_model.tflite,vocab.txt,tokenizer.json,tokenizer_config.json.
Trained on the English split (68,275 records) of ai4privacy/pii-masking-400k, the
model reaches 0.841 entity-level micro-F1 on a held-out validation set. The
figures below are generated by the final cell of the training notebook.
Dynamic-range int8 quantization shrinks the model ~4× (252 MB → 64 MB) with a negligible accuracy change (ΔF1 = −0.003), which is why the quantized model is the one shipped on-device.
Structured, high-signal types (email, phone, city) score highest; free-form numeric IDs (account number, social number) remain the hardest and are the main targets for future data/labelling work.
Figures live in
images/and are regenerated by re-running the notebook's figures cell.
-
Gallery Screen
- Grid view of all uploaded content
- Scan option on long-press
-
Scan Result Screen
- Risk tag + reason:
"Passport detected"or"Location inferred" - Actionable suggestions
- Risk tag + reason:
-
Social Media Scanner
- Input handle + email
- View/email detailed report
- Enable auto-scan mode
- All analysis is performed locally
- No 3rd-party cloud APIs (e.g., Google Vision, Gemini)
- All posts, media files stored securly in local storage
To Run the application locally-
- This repo uses Git LFS to store large model files. Before cloning, install Git LFS
git lfs install. - Clone the repository
git clone https://github.com/Shaurya-Saini/Priv_Guard.git
cd Priv_Guard
git lfs pull - Create project
flutter create . - Run the application using an emulator from Android studio
flutter run



