A comprehensive authentication system using Hand Movement, Orientation, and Grasp (HMOG) behavioral biometrics with two different approaches.
Download the HMOG dataset from: https://github.com/hmog-dataset/hmog
Place the dataset in hmog_dataset/public_dataset/ directory.
# Create virtual environment
python -m venv behav_env
source behav_env/bin/activate # On Windows: behav_env\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the system
python main.py- data_processor.py - Handles data extraction and loading from user ZIP files
- feature_extractor.py - Extracts HMOG and keystroke behavioral features
- feature_processor.py - Performs feature engineering, selection, and preprocessing
- authenticator.py - Traditional One-Class SVM authentication approach
- global_feature_model.py - Global feature extractor and per-user classifiers
- embedding_authenticator.py - Novel embedding-based authentication system
- visualization.py - Generates results visualization and comparison plots
- main.py - Orchestrates the entire authentication pipeline
Instead of training separate models for each user on raw features, we:
- Train a Global Model: Learn general behavioral patterns from all users
- Extract Embeddings: Use the global model as a frozen feature extractor
- Train Lightweight Classifiers: Each user gets a simple binary classifier
- Better Generalization: Global model learns robust behavioral representations
- Less Data Required: Per-user classifiers need fewer samples
- Transfer Learning: Knowledge from all users helps individual authentication
- Computational Efficiency: Lightweight classifiers are fast to train/deploy
Raw Features → Global Model → Embeddings → User Classifier → Decision
(X) (frozen) (128-D) (SVM/RF/MLP) (genuine/impostor)
The system generates:
- Console Output: Detailed progress and metrics
- Visualizations:
traditional_results.png: Traditional approach performanceembedding_results.png: Embedding-based performancecomparison_results.png: Side-by-side comparisonper_user_comparison.png: Individual user comparison
- Cached Files:
processed_data.pkl: Processed datasetglobal_model.pkl: Trained global feature extractor
- EER (Equal Error Rate): Primary authentication metric
- Genuine Scores: Authentication scores for legitimate users
- Impostor Scores: Authentication scores for impostors
- Per-User EER: Individual user performance
If you use this system, consider citing relevant HMOG research papers on behavioral biometrics and authentication.