SALANA-ML Security System

License Python Flask

SALANA-ML Security System is a Machine Learning-based facial recognition web application designed for monitoring and logging user access. Built with Python, Flask, OpenCV, and the face_recognition library, it provides real-time face detection, user registration, and security logging capabilities.

Features

  • Real-time Facial Recognition: Utilizes the webcam to detect and recognize registered users in real-time.
  • User Registration: Simple web interface to register new users by uploading their photo along with their name and security ID.
  • Automated Logging: Automatically logs the entry time of recognized individuals into a database. Unknown faces are flagged and logged as "Unknown".
  • Web Interface: Built with Flask and styled with Bootstrap for a clean and responsive user experience.
  • SQLite Database: Uses SQLite for lightweight, local storage of user profiles and security access logs.

Technology Stack

  • Backend: Python, Flask
  • Machine Learning / Computer Vision: OpenCV, face_recognition, NumPy
  • Database: SQLite (sqlite3)
  • Frontend: HTML, CSS, Bootstrap 5

Prerequisites

Before running the project, ensure you have the following installed:

  • Python 3.8 or higher
  • A C++ compiler (required by dlib, which is a dependency of face_recognition). On Windows, install Visual Studio with C++ build tools. On Linux, run sudo apt-get install build-essential cmake.

Installation & Setup

  1. Clone the repository

    git clone https://github.com/yourusername/SALANA-ML-Security-System.git
    cd SALANA-ML-Security-System
    
  2. Create and activate a virtual environment (recommended)

    python -m venv venv
    
    # On Windows:
    venv\Scripts\activate
    
    # On macOS/Linux:
    source venv/bin/activate
    
  3. Install dependencies Install the required Python packages. If a requirements.txt is not provided, you can install them manually:

    pip install Flask opencv-python face_recognition numpy werkzeug
    
  4. Directory Structure Configuration Ensure the following directories exist in the root of the project to avoid errors during registration:

    mkdir -p static/uploads
    
  5. Run the application

    python app.py
    
  6. Access the Web App Open your web browser and navigate to http://127.0.0.1:5000/.

Usage

  1. Register a User: Navigate to the "User Registration" section on the home page. Enter a name, ID, and upload a clear picture of the user's face.
  2. Start Monitoring: Click the "Start Recognition" button. The system will access your webcam and begin detecting faces.
  3. View Logs: The home page displays a table of recent security logs, showing who was detected and at what time.

Running Project Screenshots

The screenshots below were captured from the running application at http://127.0.0.1:5000/.

Full Page View

SALANA-ML Security System Full Page

Funtional View

SALANA-ML Security System Viewport

Project Structure

SALANA-ML-Security-System/
├── app.py                  # Main Flask application file
├── static/                 # Static assets
│   └── uploads/            # Directory for uploaded user profile images
├── templates/              # HTML templates
│   ├── index.html          # Main dashboard template
│   └── security.html       # Alternative security view template
├── security_logs.db        # SQLite database (auto-generated upon running)
└── README.md               # Project documentation

Disclaimer

This project is intended for educational purposes and as a demonstration of implementing machine learning models within a web framework. It is not intended for deployment in high-security production environments without significant security enhancements.

Built With

Share this project:

Updates