Production-ready multi-modal content moderation with LlamaGuard and DistilBERT+LoRA
Understanding the challenge and solution approach
Build a production-ready dual-stage moderation system that can analyze both text and images for harmful content, providing comprehensive safety assessments with real-time processing capabilities for digital platforms.
Implemented a dual-stage pipeline combining LlamaGuard for hard filtering and DistilBERT+LoRA for fine-grained classification, with BLIP integration for multi-modal content analysis through a modular Streamlit application.
Create a production-ready dual-stage moderation system capable of detecting harmful content across multiple modalities with high accuracy, real-time performance, and comprehensive safety assessments.
Live demo, repo and local setup for reproducing the Week 2 app
Reproduce the Streamlit app locally using the project requirements and a local copy of the fine-tuned model.
pip install -r requirements.txt # copy .env.example to .env and add your OpenRouter API key # place model weights under the path used by the app (see README) streamlit run app_streamlit.py
Model files used in Week 2 are expected at: C:/Users/NightPrince/OneDrive/Desktop/Cellula-Internship/Week1/peft-distilbert-toxic-classifier/last-checkpoint/
— update paths in the app if needed.
What was achieved during the second week of the internship
Week2/ ├── app_streamlit.py # Main Streamlit app ├── pipeline/ # Modular pipeline │ ├── blip_caption.py │ ├── llama_guard.py │ └── toxic_classifier.py ├── requirements.txt ├── .env.example ├── README.md └── internship_week2_report.html
How the multi-modal safety system works
Accepts text and image inputs through Streamlit interface
LlamaGuard analyzes text for safety violations
BLIP generates captions and analyzes image content
Combines results for comprehensive safety evaluation
Step-by-step approach to building the multi-modal safety system
Key metrics and achievements from the multi-modal safety system
Technologies and frameworks used in the project
Access to live demo, code, and documentation
Key obstacles encountered and how they were overcome