How mrnidhi/sensitive_data_classification works
Project type and purpose
• This is a machine-learning–driven, client-side inference web application.
• Purpose: classify images (and optionally text) as “sensitive” or “non-sensitive” to prevent data leaks.
File structure
• Top level
• README.md, Sensitive_Data_Classification.ipynb (training notebook)
• dataset/ (raw training & validation data, split into sensitive/nonsensitive)
• training_set/ (possibly processed or archive of training data)
• webapp/ (static frontend & hosting config)
• webapp/
• .firebaserc, firebase.json (Firebase Hosting configuration)
• public/
– index.html, style.css, script.js (UI assets)
– assets/images (UI mockups, examples)
– models/
· image_model/… (TF.js–converted CNN artifacts)
· text_model/… (TF.js text classification artifacts + word_index.json)
• No backend code—entire inference runs in the browser; Firebase is used only for static hosting.
Insights from the README
• CNN chosen for image classification.
• Workflow: collect images → train CNN in Python notebook → convert model to TF.js → deploy model files → client uses TF.js to infer.
• UI screenshot (Web UI) and methodology flowchart illustrate a clear, two-phase pipeline: Training and Inference.
Main components
a. Data & Training Pipeline
• Raw Dataset (dataset/training + dataset/validation)
• Jupyter/Python Training Environment (Sensitive_Data_Classification.ipynb)
• Model Converter (tensorflowjs converter)
→ Outputs: image_model and text_model artifacts
b. Deployment & Inference Pipeline
• Firebase Hosting (serves static files under webapp/)
• Static Web Application (index.html, script.js, style.css)
• TF.js Library (loaded by script.js)
• Model Artifacts (public/models/image_model + public/models/text_model)
• Client Browser (user uploads image / text, TF.js runs inference locally)
c. (Optional) Future Integration
• Firebase Cloud Storage or Firestore for analytics/logging (not yet implemented)
• Authentication & Access Control (e.g., Firebase Auth)
Relationships & data flow
• Training: Dataset → Notebook → Model Converter → Model Artifacts
• Deployment: Model Artifacts + Static UI → Firebase Hosting
• Inference: Browser ← Firebase (serves UI & model files) → TF.js → User’s Data
• Output: Classification result displayed in UI
Architectural patterns & principles
• Client-side inference: no server compute required at runtime
• Static hosting: simple CI/CD pipeline (push to Git → Firebase deploy)
• Separation of concerns:
• Training pipeline (Python/Jupyter)
• Inference pipeline (JavaScript/TF.js)
• Scalability: CDN distribution of static assets (Firebase Hosting)
Technologies & frameworks
• Python, Jupyter Notebook, TensorFlow/Keras (training)
• tensorflowjs-converter (model conversion)
• HTML5, CSS3, JavaScript (frontend)
• TensorFlow.js (inference library)
• Firebase Hosting (static deployment)
Final checklist
• Components: raw data, training notebook, converter, models, hosting, client app
• Labels: exact directory names (e.g., “public/models/image_model”)
• Annotations: note technologies (e.g., “TensorFlow.js loads model.json”)