Skip to content

Latest commit

Β 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ SafeHer AI

AI-Powered Women's Safety Companion

SafeHer AI is a comprehensive safety application that uses artificial intelligence to detect harassment, provide emergency alerts, and keep women safe.

SafeHer AI Python React FastAPI License

system-workflow

πŸ“‹ Problem Statement

The solution is designed for women who face harassment, stalking, or feel unsafe in daily situations. Globally, about 1 in 3 women experience physical or sexual violence, and many lack instant access to help during emergencies. The system must be offline-capable, discreet, easy to use without technical knowledge, and able to send alerts within seconds. Success is achieved when a user can trigger an emergency alert with location in under 3 seconds and the AI detects over 70% of threatening messages.


🌟Key Features

SafeHer AI is an AI-powered safety companion that:

  1. πŸ” Harassment Detectiont - AI analyzes messages for toxic/threatening content using toxic-bert model
  2. 🚨 Panic Button - One-tap emergency alerts with GPS location
  3. πŸ“ Location Sharing: Automatic GPS location in alerts
  4. πŸ“± Automatic Protection - Shake/fall detection triggers automatic alerts
  5. πŸ“Š Safety Dashboard - Real-time safety statistics, threats and alert history
  6. πŸ”” Sensor Detection: Support for accelerometer/fall detection

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     FRONTEND (React)                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚Dashboard β”‚ β”‚ Scanner  β”‚ β”‚ Sensors  β”‚ β”‚  Panic   β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚            β”‚            β”‚            β”‚
        β–Ό            β–Ό            β–Ό            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  BACKEND REST API (FastAPI)             β”‚
β”‚         /status    /scan-message    /panic              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β–Ό                 β–Ό                 β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  AI Model    β”‚  β”‚ Safety Agent β”‚  β”‚ Alert System β”‚
β”‚ (toxic-bert) β”‚  β”‚  (Decision)  β”‚  β”‚(Twilio/Email)β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ Tech Stack

Layer Technology Why Chosen
Frontend React 18, Axios, IS, HTML5, CSS3 User interface, Component-based, sensor acces, large ecosystem
Styling CSS3 No dependencies, fast loading
Backend FastAPI, Python, Uvicorn, Pydantic Async, fast, auto-documentation, API endpoints
AI/ML Hugging Face Transformers, PyTorch State-of-the-art NLP models
Model toxic-bert Pre-trained for toxicity detection / Harassment detection
SMS Twilio, SMTP Reliable, global coverage, SMS and email notifications
Hosting Vercel Free tier, easy Serverless deployment

πŸ“ Project Structure

SafeHER-AI/
β”œβ”€β”€ frontend/                # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.js          # Main component
β”‚   β”‚   β”œβ”€β”€ App.css         # Styles
β”‚   β”‚   β”œβ”€β”€ config.js       # API configuration
β”‚   β”‚   β”œβ”€β”€ PanicButton.js  # Emergency button
β”‚   β”‚   β”œβ”€β”€ MessageScanner.js # AI text analyzer
β”‚   β”‚   β”œβ”€β”€ SensorDetection.js # Motion sensors
β”‚   β”‚   └── StatusDashboard.js # Statistics
β”‚   └── package.json
β”‚
β”œβ”€β”€ backend/                 # Python backend (local)
β”‚   β”œβ”€β”€ main.py             # FastAPI server
β”‚   β”œβ”€β”€ model.py            # AI harassment detection
β”‚   β”œβ”€β”€ goose_agent.py      # Safety decision agent
β”‚   β”œβ”€β”€ alerts.py           # SMS/Email system
β”‚   └── requirements.txt
β”‚
β”œβ”€β”€ api/                     # Vercel serverless
β”‚   β”œβ”€β”€ index.py            # Serverless API
β”‚   └── requirements.txt
β”‚
β”œβ”€β”€ docs/                    # Documentation
β”‚   β”œβ”€β”€ DECISION_LOG.md     # Technical decisions
β”‚   β”œβ”€β”€ RISK_LOG.md         # Issues & resolutions
β”‚   └── EVIDENCE_LOG.md     # Sources & licenses
β”‚
β”œβ”€β”€ .env.example            # Environment template
β”œβ”€β”€ vercel.json             # Deployment config
β”œβ”€β”€ LICENSE                 # MIT License
└── README.md               # This file

πŸ“± Screenshots

Dashboard Panic Button Message Scanner Sensor
πŸ“Š Stats 1 πŸ” Message Analysis msg_scan 🚨 Emergency em_alert πŸ“± Automatic Protection auto_protect

πŸš€ Quickstart

Prerequisites

  • Python 3.9+
  • Node.js 16+
  • Git

Quick Start

# Clone the repo
git clone https://github.com/mmoneka11/SafeHER-AI.git
cd SafeHER-AI

# Copy environment template
cp .env.example .env

# Run setup script (Windows)
setup.bat

# OR manually:
# Backend
cd backend && pip install -r requirements.txt && uvicorn main:app --reload &

# Frontend
cd frontend && npm install && npm start

That's it! Open http://localhost:3000 πŸŽ‰


βš™οΈ Environment Variables

Copy .env.example to .env and configure:

# Optional: For SMS alerts (Twilio)
TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_FROM_NUMBER=+1234567890
EMERGENCY_CONTACT=+0987654321

# Optional: For Email alerts
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
EMAIL_ADDRESS=your-email@gmail.com
EMAIL_PASSWORD=your-app-password
EMERGENCY_EMAIL=emergency@email.com

Note: The app works without these - alerts are logged instead of sent.


πŸ“Š API Endpoints

Endpoint Method Description
/ GET Health check
/api/scan-message POST Detect harassment
/api/panic POST Trigger emergency alert
/api/status GET Safety statistics
/api/health GET API health check
/docs GET Interactive API docs

πŸ§ͺ Testing

# Test API locally / Health Check
curl http://localhost:8000/api/health

# Test message scanning
curl -X POST http://localhost:8000/api/scan-message \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello", "location": "40.7128,-74.0060"}'

🎯 UN Sustainable Development Goals

SDG Alignment
SDG 5: Gender Equality Combats violence and harassment against women through technology-based safety solutions.
SDG 3: Good Health & Well-being Supports women’s mental and physical well-being through technology-based emergency protection.
SDG 11: Sustainable Cities & Communities Promotes safer public spaces with technology-driven personal safety systems.

πŸ› Known Issues & Next Steps

Known Issues

  • Sensor detection requires HTTPS (works on Vercel, not localhost)
  • AI model uses keyword detection in serverless (ML model too large)
  • Stats reset on Vercel cold start (no database yet)

Next Steps

  • Add database for persistent storage
  • Implement voice activation ("Hey SafeHer")
  • Add trusted contacts management UI
  • Create mobile app (React Native)
  • Add multi-language support

πŸ†˜ Emergency Resources

If you're in immediate danger, contact local emergency services:

Country Number Helpline
USA 911 National DV Hotline: 1-800-799-7233
UK 999 Women's Aid: 0808-2000-247
India 100 Women Helpline: 181
EU 112 -


πŸ‘©β€πŸ’» Team - Authors & Contributions

Name Role Contributions GitHub
Moneka Meghwar AI Developer AI model integration, Backend API, Core features @mmoneka11
Kashmala Saddiqui Security Specialist Alert system, Sensor detection, Security review @kashmalaasif
Umaima Rizwan Documentation Lead Documentation, UI/UX design, Testing @umaim691


πŸ† Hackathon

This project was built as part of the 75Her Challenge Hackathon, an initiative focused on developing innovative solutions that support women's empowerment, safety, and leadership through technology.

πŸ”— Hackathon Page
https://75her-challenge.devpost.com/


πŸ’‘ Project Impact

SafeHer AI aims to provide women with:

  • Instant emergency assistance
  • AI-powered harassment detection
  • Location-based alert systems
  • Safer digital and physical environments

The project focuses on using technology for social good, helping build safer communities for women worldwide.


🀝 Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Credits & Attribution

APIs & Services

AI Models

Frameworks & Libraries

Data Sources

  • WHO Statistics on Violence Against Women
  • UN Women Global Database

Icons & Assets

  • Emoji icons (Unicode standard)
  • Custom CSS (original)

⭐ Support

If you find this project useful:

⭐ Star the repository
🍴 Fork the project
🀝 Contribute improvements


SafeHer AI - Because Your Safety Matters πŸ›‘οΈ

Built with ❀️ by the IGOGs Team
for women's safety & empowerment✨

About

SafeHer AI is a comprehensive safety application that uses artificial intelligence to detect harassment, provide emergency alerts, and keep women safe.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages