Behavioral Biometrics for Continuous Authentication on Mobile Devices: Anomaly Detection through Keystroke Dynamics with Machine Learning

Kelvin S. Lopes, D. Lopes, Wesley G. P. Pavanello, César Mattos, Jarelio G. da S. Filho, José D. C. Neto, Rafael L. Gomes, Nicksson C. A. de Freitas, Emanuel B. Rodrigues2023

Abstract

The popularity of mobile devices generates the need for security solutions to ensure user identity. One approach to deal with this scenario is behavioral biometric for continuous authentication (BBCA), which has become increasingly known with advances in hardware and data science technologies. However, this approach still lacks greater robustness in how to model the user’s behavioral biometrics as well as maximize the effectiveness of this authentication. It is particularly important to note in this context that this paper presents an approach to BBCA using machine learning (ML) techniques integrated with sliding windows. Accordingly, biometric data collected from keystroke dynamics typing activities on mobile devices were used to identify genuine users, random (unskilled) imposters and skilled imposters. The ML models for impostor identification followed an anomaly detection (AD) approach, where only genuine data is available at training time. In addition, the use of sliding windows allowed the inclusion of the temporal dimension of the task. The results obtained indicate that the proposed solution has a practical feasibility in terms of its suitability to perform user identification, specifically, the KNN model stood out by achieving a superior performance in the value window 4. In this configuration, it achieved a score of 94% for the F1-score metric in the random imposter scenario, and 93% in the skilled imposter scenario.

Introduction

Traditional security mechanisms, such as PINs, passwords, or one-time biometric scans, provide "point-in-time" authentication. Once a device is unlocked, it remains accessible until manually locked or timed out. This creates a vulnerability if the device is stolen while in use. Behavioral Biometrics for Continuous Authentication (BBCA) addresses this by monitoring user behavior throughout a session.

This research focuses on keystroke dynamics—the unique rhythms and patterns of a user's typing—to develop a robust authentication system. A primary challenge in BBCA is the "imposter data" problem: while data for the device owner is readily available, obtaining data for every potential attacker is impossible. This study addresses this by employing Anomaly Detection (AD), which learns the profile of the genuine user and flags any significant deviation as a potential threat.

Methodology

The proposed system treats authentication as an outlier detection problem. The pipeline involves several stages, from data ingestion and pre-processing to final classification.

Proposed methodology pipeline for behavioral biometric continuous authentication.

Anomaly Detection (AD) Approach

Unlike standard binary classification, AD models are trained exclusively on genuine user data. This makes the system highly practical for real-world deployment where attacker data is unknown. The study compared four models: K-Nearest Neighbors (KNN), One-Class Support Vector Machine (OCSVM), Local Outlier Factor (LOF), and Isolation Nearest Neighbor Ensemble (INNE).

Sliding Windows and Pre-processing

To capture the temporal rhythm of typing, the researchers implemented sliding windows (sizes 1 to 7), allowing the model to analyze sequences of keystrokes. Pre-processing included handling null values, column removal, and data normalization using StandardScaler. Hyperparameters were optimized using Grid Search on validation data.

Experimental Setup

The study utilized the BehavePassDB, a public database for mobile behavioral biometrics, focusing on free-text typing. Two threat scenarios were evaluated:

  1. Random Imposters: Unskilled attackers using different devices without specific instructions.
  2. Skilled Imposters: Attackers using the same device as the victim and attempting to mimic the genuine user's behavior.

Results and Discussion

The experimental results highlighted the effectiveness of the temporal context provided by sliding windows. A window size of 4 was found to be the "sweet spot," capturing sufficient behavioral rhythm without introducing excessive noise.

Performance metrics for the Random Imposter scenario across different anomaly detection models.

The KNN model emerged as the most effective and stable algorithm. As shown in the performance data, KNN achieved a 94% F1-score and an AUC of 0.99 in the Random Imposter scenario. Crucially, it maintained high performance in the Skilled Imposter scenario with a 93% F1-score, demonstrating that even intentional mimicry fails to replicate the subtle micro-behaviors of a genuine user. KNN's success is attributed to its simplicity and lower sensitivity to hyperparameter tuning compared to more complex models like OCSVM.

Conclusion

This research demonstrates the feasibility of using keystroke dynamics and anomaly detection for continuous mobile authentication. While the results are promising, future work will address scalability—specifically the computational cost of maintaining personalized models—and the integration of multi-modal behavioral data, such as combining typing with swiping and gait analysis.

Summary updated

BibTeX
@misc{lopes2023behavioral,
  author = {Kelvin S. Lopes and D. Lopes and Wesley G. P. Pavanello and César Mattos and Jarelio G. da S. Filho and José D. C. Neto and Rafael L. Gomes and Nicksson C. A. de Freitas and Emanuel B. Rodrigues},
  title = {{Behavioral Biometrics for Continuous Authentication on Mobile Devices: Anomaly Detection through Keystroke Dynamics with Machine Learning}},
  year = {2023},
  doi = {10.5753/eniac.2023.234623},
}
Figure