Introduction
This project was born from the shared personal experiences of our team members with bullying during their school years. Frustrated by the inadequate measures in place to address such issues, we were inspired to create a proactive solution. Our goal is to create a safer learning environment for students from all backgrounds.
https://youtu.be/AlLmdO8t34k?si=HJ_qGfrlBx_4EV1U
Our system is an intelligent, two-tiered AI pipeline that detects, verifies, and reports acts of violence in real time from a webcam feed.
Local Detection (Client-Side): A lightweight CNN and LSTM ensemble continuously monitors video streams for signs of aggression. If a potential threat is detected, the client records a short video clip.
Server-Side Verification: The clip is sent to a FastAPI backend, which calls OpenAI’s GPT-4o for secondary analysis.
Incident Report: The server returns a JSON response with:
Violence determination (yes/no)
Classification (for example, Fighting, Self-harm)
A concise, actionable incident report
This creates a robust and efficient safety monitoring solution with both speed and accuracy.
Client-Side Monitoring: Python and OpenCV for live webcam feed and TensorFlow/Keras for initial real-time detection.
Backend API: FastAPI to receive video uploads and trigger analysis.
Advanced AI Analysis: GPT-4o (multimodal) samples video frames and outputs structured incident reports.
Communication: Client and server communicate via HTTP requests for seamless integration.
git clone https://github.com/your-repo/bullying-detection.git
cd bullying-detectionSet up a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtCreate a .env file in the root directory and add your OpenAI API key:
OPENAI_API_KEY=your_api_key_hereRun the client:
python client.pyRun the server:
uvicorn server:app --reloadNavigate to the frontend folder:
cd frontend
npm install
npm startPython 3.9+
TensorFlow / Keras
OpenCV
NumPy
FastAPI
Uvicorn
Requests
OpenAI API
(See requirements.txt for the complete list.)
Model Compatibility: Struggled with deprecated TensorFlow/Keras versions.
Real-Time Performance: Balancing latency with inference speed was difficult.
Dataset Scarcity: Ethical, diverse violence datasets are limited, restricting robustness.
Going from theory to application is harder and more rewarding than expected.
How to ensemble CNN and LSTM for video classification.
How to build a client-server ML pipeline with real-time data streams.
FastAPI and OpenAI integration for multimodal AI.
Performance Tuning: Further optimization needed for ultra-low latency.
Dataset Expansion: More diverse and ethically sourced training data.
Deployment: Currently works locally; scaling to production requires containerization and cloud infrastructure.
Privacy Considerations: Future versions need built-in anonymization and data handling policies.