A Python-based facial recognition security application designed to protect your workspace privacy in real time. If an unauthorized person is detected viewing the screen while the admin is working, the app instantly locks the screen and displays a security alert message.
Repository: Akilesh-GA/CryptoEye
Crypto Eye is an intelligent security solution that continuously monitors your workspace environment using real-time facial recognition technology. It identifies authorized users and detects unauthorized access attempts, triggering immediate protective measures to safeguard sensitive information.
In today's digital workspace, data breaches often occur through unauthorized viewing of sensitive information on screens. Traditional security measures focus on preventing digital access but ignore the physical threat of someone observing your screen.
Crypto Eye shifts from reactive to proactive security, automatically detecting and preventing unauthorized screen viewing in real-time.
- Real-time detection of unauthorized access attempts
- Automatic prevention of data breaches through instant screen locking
- Comprehensive audit trail of all security events
- Zero-knowledge approach to privacy (facial data processed locally)
- Minimal system overhead - runs efficiently in the background
1. Real-time Facial Recognition
- Continuous monitoring using your webcam
- Processes frames at 30 FPS for smooth operation
- Utilizes advanced deep learning models for accurate face detection
- Handles multiple faces simultaneously
2. Instant Screen Lock
- Automatic screen locking when unauthorized access is detected
- Prevents sensitive data exposure
- Works across Windows, macOS, and Linux
- Configurable lock duration and security level
3. Security Alert Notifications
- Real-time pop-up alerts notifying the admin
- Sound notifications for critical events
- Desktop notification integration
- Email alerts for critical incidents (configurable)
4. Comprehensive Alert Logging
- Maintains detailed logs of all unauthorized access attempts
- Timestamp recording for audit trails
- Face recognition confidence scores
- CSV export functionality for analysis
5. Proactive Security Approach
- Shifts from reactive to active problem-solving
- Reduces risk of accidental or intentional data exposure
- Customizable security policies
- Role-based access control
6. User Management
- Admin profile setup and configuration
- Multiple authorized user support
- User registration with facial enrollment
- Session management and auto-logout
7. Configuration Dashboard
- Easy-to-use PyQt5 GUI interface
- Real-time configuration updates
- Security policy customization
- System status monitoring
8. Logging & Analytics
- Detailed event logging with timestamps
- Unauthorized access attempt tracking
- System performance metrics
- Report generation
9. Database Integration
- Local SQLite database for user management
- Encrypted storage of facial encodings
- Efficient data retrieval and querying
10. Performance Optimization
- Lightweight processing
- GPU acceleration support
- Minimal CPU/memory footprint
- Background thread processing
Languages & Frameworks
- Python 3.8+ - Core programming language
- Flask - Web server and API backend (optional REST endpoints)
- PyQt5 - Desktop GUI framework for user interface
- Threading - Concurrent processing for real-time monitoring
Computer Vision & AI Libraries
- OpenCV (cv2) - Real-time video processing and face detection
- face-recognition - Facial recognition and encoding
- dlib - Deep learning-based face detection and recognition
- NumPy - Numerical computing and array operations
- Pillow (PIL) - Image processing and manipulation
Database & Storage
- SQLite3 - Lightweight database for user profiles
- pickle - Serialization for facial encodings
- JSON - Configuration file storage
Additional Libraries
- os - System operations and file management
- sys - System-specific parameters and functions
- time - Time-related functionality
- datetime - Date and time handling
- subprocess - System command execution for screen locking
- logging - Application logging and debugging
- csv - CSV export for reports
- pyaudio (optional) - Audio notifications
- playsound (optional) - Sound alert playback
Hardware
- Webcam (minimum HD quality recommended)
- Processor: Intel i5/AMD Ryzen 5 or better
- RAM: 4GB minimum, 8GB recommended
- Storage: 500MB for application and models
Operating Systems
- Windows 10/11
- macOS 10.14+
- Linux (Ubuntu 18.04+, Debian 10+)
Python Version
- Python 3.8 or higher
┌────────────────────────────────────────────────────────────┐
│ USER INTERFACE LAYER │
│ (PyQt5 GUI Components) │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Dashboard | Settings | Alert Logs | User Management│ │
│ └──────────────────────────────────────────────────────┘ │
└────────────────────┬─────────────────────────────────────┘
│
┌────────────────────▼─────────────────────────────────────┐
│ BUSINESS LOGIC LAYER │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Security Manager | Face Recognition Engine │ │
│ │ Alert Handler | Session Manager │ │
│ │ Configuration Manager │ │
│ └──────────────────────────────────────────────────────┘ │
└────────────────────┬─────────────────────────────────────┘
│
┌────────────────────▼─────────────────────────────────────┐
│ MONITORING & DETECTION LAYER │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Webcam Capture (Threading) │ │
│ │ Face Detection (OpenCV + dlib) │ │
│ │ Facial Recognition (face-recognition library) │ │
│ │ Real-time Analysis & Decision Making │ │
│ └──────────────────────────────────────────────────────┘ │
└────────────────────┬─────────────────────────────────────┘
│
┌────────────────────▼─────────────────────────────────────┐
│ DATA PERSISTENCE LAYER │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ SQLite Database (User Profiles) │ │
│ │ Facial Encodings (pickle files / Database) │ │
│ │ Alert Logs (CSV / Database) │ │
│ │ Configuration Files (JSON) │ │
│ └──────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────┘
Security alert displayed when unauthorized access is detected:
images/alert.png
The system immediately displays a prominent alert window with:
- Alert Title: "UNAUTHORIZED ACCESS DETECTED"
- Alert Message: Details about the detected person
- Timestamp: When the unauthorized access occurred
- Confidence Level: Face recognition confidence score
- Action Buttons: Acknowledge, Lock Now, Settings
Comprehensive history of all unauthorized access attempts:
images/alertlog.png
Features include:
- Date & Time: Precise timestamp of each alert
- Confidence Score: How similar the detected face is to known users
- Duration: How long the unauthorized person was detected
- Thumbnail: Small preview image of the detected face
- Status: Alert severity and resolution status
- Export: Button to export logs to CSV
Real-world example of unauthorized person being detected:
images/unauthorized_person1.jpg
Shows:
- Real-time webcam feed with face detection box
- Confidence percentage displayed
- "UNKNOWN" label indicating unauthorized access
- System immediately triggering lock protocol
Another real-world example demonstrating system effectiveness:
images/unauthorized_person2.jpg
Shows:
- Multiple detection frames
- Face detection accuracy
- Real-time alert triggering
- Timestamp of detection
Application Start
│
▼
Load Configuration & User Profiles
│
├─ Load admin facial encoding
├─ Load authorized users list
├─ Initialize security policies
│
▼
Start Monitoring Thread
│
├─ Initialize Webcam
├─ Start video capture loop
│
▼
Frame Processing (Continuous Loop)
│
├─ Capture frame from webcam
│
├─ Detect faces in frame (OpenCV)
│ ├─ No face detected → Continue monitoring
│ └─ Face(s) detected → Continue to next step
│
├─ Generate facial encodings (face-recognition)
│
├─ Compare with known encodings
│ ├─ Known user detected (confidence > threshold)
│ │ └─ Update last seen timestamp
│ │
│ └─ Unknown user detected
│ └─ Trigger Security Protocol
│
▼
Security Protocol (When Unauthorized Access Detected)
│
├─ Lock screen immediately
│
├─ Log unauthorized access attempt
│ ├─ Timestamp
│ ├─ Face image
│ ├─ Confidence score
│ └─ Duration detected
│
├─ Display alert message
│
├─ Play sound notification
│
├─ Send email alert (if configured)
│
└─ Update statistics & continue monitoring
User Actions
│
├─ View Logs → Display alert history
├─ Configure Settings → Update policies
├─ Register User → Add facial encoding
├─ Emergency Stop → Disable monitoring
└─ View Dashboard → System status
System Requirements
- Python 3.8 or higher installed
- pip (Python package manager)
- Webcam or external camera connected
- Administrator/sudo access for screen locking functionality
Check Python Version
python --version
# or
python3 --version# Using HTTPS
git clone https://github.com/yourusername/crypto-eye.git
cd crypto-eye
# Or using SSH
git clone git@github.com:yourusername/crypto-eye.git
cd crypto-eye# Windows
python -m venv venv
venv\Scripts\activate
# Linux / macOS
python3 -m venv venv
source venv/bin/activate# Upgrade pip first
pip install --upgrade pip
# Install all required packages
pip install -r requirements.txtThe first time you run the application, it will automatically download the required pre-trained models.
# Optional: Pre-download models
python -c "import face_recognition; print('Models downloaded successfully')"# Run setup to create necessary directories and database
python crypto_eye.py --setup# Launch the application
python crypto_eye.pyThe GUI will guide you through:
- Setting up the admin account
- Capturing facial encoding
- Configuring security policies
-
Install Visual C++ Build Tools (if not already installed)
- Required for dlib compilation
- Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
-
Install dependencies
pip install -r requirements.txt
-
Run application
python crypto_eye.py
python crypto_eye.py
Facial recognition uses confidence levels:
- 0.95+ (95%): Extremely confident - Authorized
- 0.85-0.94 (85-94%): Confident - Authorized
- 0.75-0.84 (75-84%): Moderately confident - May require confirmation
- 0.50-0.74 (50-74%): Low confidence - Likely unauthorized
- <0.50 (<50%): Very low confidence - Treat as unauthorized
- Release Date: August 2024
- Features:
- Real-time facial recognition monitoring
- Instant screen lock on unauthorized access
- Comprehensive alert logging and export
- Multi-user support
- Advanced security policies
- Email notifications
- Database-backed user management
- Cross-platform support (Windows, macOS, Linux)
- Added email notifications
- Improved facial recognition accuracy
- Better error handling
- Initial PyQt5 GUI
- Database integration
- Alert logging
- Basic facial recognition
- Command-line interface
- Initial release
- Proof of concept
- face-recognition library: By Adam Geitgey
- OpenCV: OpenCV team and contributors
- dlib: By Davis E. King
- PyQt5: Riverbank Computing Limited
- Community: All contributors and users
# Core Dependencies
Python==3.8+
# Computer Vision & Face Recognition
opencv-python==4.8.1.78
opencv-contrib-python==4.8.1.78
face-recognition==1.3.5
dlib==19.24.2
numpy==1.24.3
# GUI Framework
PyQt5==5.15.9
PyQt5-sip==12.13.0
# Database
SQLAlchemy==2.0.21
sqlite3 # Built-in
# Web Framework (Optional)
Flask==2.3.3
Flask-RESTful==0.3.10
Flask-CORS==4.0.0
# Image Processing
Pillow==10.0.0
scikit-image==0.21.0
# Data Processing & Utilities
pandas==2.0.3
scipy==1.11.3
# Configuration & Logging
python-dotenv==1.0.0
pyyaml==6.0.1
python-logging-loki==0.3.2 # For centralized logging
# Email & Notifications
python-telegram-bot==20.3 # For Telegram alerts
google-auth-oauthlib==1.0.0 # For Gmail
google-auth-httplib2==0.1.1
# Audio Notifications
playsound==1.2.2
pydub==0.25.1
# System Operations
pyautogui==0.9.53
psutil==5.9.5
pyperclip==1.8.2
# Testing
pytest==7.4.2
pytest-cov==4.1.0
pytest-mock==3.11.1
pytest-qt==4.2.0
mock==5.1.0
# Code Quality
black==23.9.1
flake8==6.1.0
pylint==3.0.2
mypy==1.5.1
# Documentation
Sphinx==7.2.6
sphinx-rtd-theme==1.3.0
# Scheduling & Tasks
APScheduler==3.10.4
# Performance
numba==0.57.1 # JIT compilation for performance-critical code
# Security
cryptography==41.0.4
passlib==1.7.4
python-jose==3.3.0
# Development Tools
pre-commit==3.4.0
black==23.9.1
isort==5.12.0
# Additional Utilities
tqdm==4.66.1 # Progress bars
requests==2.31.0 # HTTP requests
Werkzeug==2.3.7 # WSGI utilities



