User registration and login method based on keyboard tapping
By improving the Tensorflow framework and heuristic confidence enhancement algorithm, a small model is trained on each device for each user, solving the problems of complex model training, high computing resource consumption, insufficient user data security, and poor cross-device adaptability in existing technologies, and achieving efficient and secure user identification and login.
Patent Information
- Application Number
- CN202511105744.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-08-08
AI Technical Summary
Existing user recognition technology based on keyboard tapping has problems such as complex model training and deployment, high computing resource consumption, insufficient user data security, and poor cross-device adaptability, which affect the practicality of the system and user experience.
An improved TensorFlow framework is used, including an input layer, a mask layer, an LSTM recurrent neural network, and a fully connected layer. The output dimension of the output layer is 1. A sigmoid activation function is used, combined with a heuristic confidence enhancement algorithm. A small model is trained on each device for each user to avoid storing data with user identifiers. A sliding window and multi-stage scoring logic are used for login judgment.
It reduces the time and computing cost of new user registration, protects user privacy, improves cross-device adaptability and login efficiency, reduces the impact on existing users, and enhances system stability and security.
Smart Images

Figure CN120611368A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of user identity recognition and verification, and in particular to a user registration and login method based on keyboard tapping. Background Art
[0002] With the rapid development of information technology, user identity verification technology is increasingly being used in areas such as network security, e-commerce, and financial payments. Traditional identity authentication methods primarily include knowledge-based authentication (such as username and password), physical device-based authentication (such as smart cards and USB keys (hardware security devices based on USB interfaces)), and biometric authentication (such as fingerprint and facial recognition). While these methods can ensure system security to a certain extent, they still pose risks and drawbacks, such as password leakage, biometric forgery, and device loss.
[0003] Therefore, user behavior-based identity recognition technologies are gaining increasing attention. Keystroke Dynamics, in particular, is a soft biometric technology that requires no additional hardware and is user-imperceptible. By analyzing characteristics such as the rhythm, speed, and intervals between keystrokes during keyboard input, it can effectively identify and differentiate users.
[0004] In the prior art, Chinese Patent No. 202511080019.6 discloses a "Method for Constructing a User Identity Recognition Model and Method for Determining User Identity." This method utilizes an LSTM recurrent neural network (Long Short-Term Memory Recurrent Neural Network) to model keyboard input event sequences, thereby implementing a method for user identity determination. By learning features such as the user's temporal input, this method achieves good classification results, validating the feasibility of this approach.
[0005] However, existing technologies still face several limitations and challenges in practical applications. First, the model training and deployment process is complex, making it difficult to directly embed into standardized processes such as user registration and login, limiting its operability in real-world business scenarios. Second, this method lacks a path to integrate with common user authentication mechanisms, preventing seamless integration with existing systems and exhibiting significant shortcomings in compatibility and system coupling. Third, the model must be retrained for each new user, incurring not only repeated computational overhead but also the need to store keystroke data, which is strongly tied to the user, for long-term training. This significantly increases the risk of user privacy leaks. The cost of required training resources increases linearly with the user base. According to our estimates, when the user base reaches 10,000 and a batch size of 1024 is used for training (reducing the batch size further increases training time), an NVIDIA 4090 graphics card with 24GB of video memory will be nearly fully loaded. Incremental training of the model may have a negative impact on existing users, such as decreased recognition accuracy and increased misrecognition rate for original users, making it difficult to ensure the stability of the overall model performance. Finally, users have different operating habits on different devices (such as keyboard layout, key feedback, etc.). This behavioral shift between devices may reduce the model's recognition accuracy for the same user, affecting system reliability and user experience.
[0006] In summary, existing technologies still have much room for improvement in terms of practicality, deployment efficiency, user data security, and cross-device adaptability. Summary of the Invention
[0007] The present invention solves the problems of the prior art in terms of practicality, deployment efficiency, user data security, and cross-device adaptability.
[0008] The user registration method based on keyboard tapping of the present invention comprises the following steps: Step S1, collecting a user keyboard tapping event data set; Step S2, randomly selecting part of the data from the collected user keyboard tapping event data set, and preprocessing the part of the data to form preprocessed data; Step S3: The pre-processed data is input into the TensorFlow framework for training and verification operations respectively, and whether the verification results meet the expected results is determined. If so, the operation of step S4 is executed; otherwise, the operation of step S2 is executed; Step S4: Bind the trained TensorFlow framework to the user and the current device.
[0009] Furthermore, in one embodiment of the present invention, in step S1, the user keyboard tapping event dataset is a user keyboard tapping event dataset with user identifiers removed.
[0010] Furthermore, in one embodiment of the present invention, the Tensorflow framework is composed of an input layer, a mask layer, an LSTM recurrent neural network, a fully connected layer, and an output layer; The output dimensions of the LSTM recurrent neural network and the fully connected layer are both 32; The output dimension of the output layer is 1, and a sigmoid activation function is used for nonlinear transformation.
[0011] The keyboard-tap-based user login method of the present invention is implemented by using any of the keyboard-tap-based user registration methods described above, and includes the following steps: Step S5: Determine whether the user and the current device have been bound to the trained TensorFlow framework. If not, the user needs to register. Otherwise, execute the operation of step S6. Step S6: Load the trained Tensorflow framework and collect the user's keyboard tapping event dataset; Step S7: Call the trained TensorFlow framework to perform inference on the collected user keyboard tapping event dataset in the form of a sliding window, aggregate the multiple inference results obtained into an overall result, and use a heuristic confidence enhancement algorithm to process the overall result to obtain a confidence score; Step S8, respectively determining whether the number of rounds and the overall confidence score reach a threshold value. If so, the login is successful. Otherwise, the operation of step S9 is executed; In step S9, it is considered that the user login has failed.
[0012] Furthermore, in one embodiment of the present invention, in step S7, the sliding window is in the form of collecting at least 4 user keyboard tapping events every 2 seconds or more.
[0013] Furthermore, in one embodiment of the present invention, in step S7, the heuristic confidence enhancement algorithm adopts a multi-stage scoring logic, combined with confidence threshold interval determination and a dynamic enhancement mechanism.
[0014] Furthermore, in one embodiment of the present invention, in step S7, the heuristic confidence enhancement algorithm is specifically: Input confidence score sequence; Initialize cumulative score , initialize the amplification factor ; Iterate over the confidence score sequence , then for If the confidence score is less than 0.3, the cumulative score , amplification factor ; 0.3≤Confidence score<0.7, then the cumulative score , amplification factor ; 0.7≤confidence score, then the cumulative score , amplification factor ,in, is the minimum value; Output overall confidence score .
[0015] The present invention solves the problems of existing technologies in terms of practicality, deployment efficiency, user data security, and cross-device adaptability. Specific beneficial effects include: 1. The keyboard-based user registration method of the present invention significantly reduces the time and computational cost of single training when registering a new user (the reduction increases significantly with the total number of users); training the model for new user registration does not affect the user experience of existing users; it avoids storing keyboard data with user identification (protecting user privacy); and it can collect and retrain data for individual users at any time; 2. The keyboard-tap-based user login method described in the present invention has faster model inference during login; the inference results do not leak information about unrelated users (for example, the current user's keyboard tapping habits may be similar to those of a certain user (when the total number of users is very large)). BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which: Figure 1 This is a flowchart of the keyboard-tap-based user registration method described in Embodiment 1; Figure 2 This is a flowchart of the keyboard-tap-based user login method described in Embodiment 2; Figure 3 This is a diagram of the heuristic confidence enhancement algorithm described in Implementation Method 2. DETAILED DESCRIPTION
[0017] The following will clearly and completely describe various embodiments of the present invention in conjunction with the accompanying drawings. The embodiments described with reference to the accompanying drawings are exemplary and intended to be used to explain the present invention, but should not be understood as limiting the present invention.
[0018] Implementation method 1: The user registration method based on keyboard tapping described in this implementation method includes the following steps: Step S1, collecting a user keyboard tapping event data set; Step S2, randomly selecting part of the data from the collected user keyboard tapping event data set, and preprocessing the part of the data to form preprocessed data; Step S3: The pre-processed data is input into the TensorFlow framework for training to determine whether the training results meet the expected results. If so, the operation of step S4 is executed; otherwise, the operation of step S2 is executed. Step S4: Bind the trained TensorFlow framework to the user and the current device.
[0019] In this embodiment, in step S1, the user keyboard tapping event dataset is a user keyboard tapping event dataset with the identifiers removed.
[0020] In this embodiment, the Tensorflow framework consists of an input layer, a mask layer, an LSTM recurrent neural network, a fully connected layer, and an output layer; The output dimensions of the LSTM recurrent neural network and the fully connected layer are both 32; The output dimension of the output layer is 1, and a sigmoid activation function is used for nonlinear transformation.
[0021] In this embodiment, in order to solve the technical problems existing in the prior art, such as Figure 1 As shown, a user registration method based on keyboard tapping is proposed, which includes the following steps: Collect a dataset of user keyboard tapping events (≥100 users and ≥1000 records). Remove the user IDs from the dataset. The user keyboard tapping event dataset that has been removed by the user identifier cannot find the corresponding input user by backtracking the existing tapping events.
[0022] Step S1: When a new user registers or a registered user registers a new device, a data set of keyboard tapping events of the user is collected; Step S2: Randomly select a portion of data (5%) from the previously collected data set; In step S3, the data set collected in step S1 is marked as True, and the data set selected in step S2 is marked as False. After mixing, preprocessing is performed. 95% of the preprocessed data is used for training, and 5% of the preprocessed data is used for verification. 95% of the preprocessed data is input into the Tensorflow framework (open source machine learning framework) for training, and 5% of the preprocessed data is input into the Tensorflow framework for verification. The accuracy and loss function are judged to see whether they meet the expected results. If they do, the operation of step S4 is executed. Otherwise, the operation of step S2 is executed. Through verification, this embodiment found that applying the Tensorflow framework in the prior art to the described method would cause the following technical problems: First, as the number of registered users increases, the physical size of the Tensorflow framework increases linearly, and the training time and cost also increase accordingly. Under a certain computing power, this method has a theoretical upper limit on the number of users that can be accommodated; second, the model trained for new users will affect the accuracy of existing users with a certain probability, thereby causing a certain negative impact on the latter's login process; third, in order to train new users' data at any time, the prior art must preserve data with user identification for a long time, which may lead to user privacy leakage to a certain extent; finally, users' keystroke habits vary on different devices. At the same time, as the time dimension lengthens (for example, after becoming more familiar with the keyboard), their own habits are also changing. Therefore, the following problems need to be solved: 1) reduce the time and computing cost of a single training session; 2) train new users without affecting the user experience of existing users; 3) avoid storing keyboard data with user identification (to protect user privacy); 4) collect and retrain data for a single user at any time.
[0023] In order to solve the above technical problems, this embodiment improves the Tensorflow framework in the prior art. Specifically, the Tensorflow framework consists of an input layer, a mask layer, an LSTM recurrent neural network, a fully connected layer, and an output layer. The output dimension of the LSTM recurrent neural network and the fully connected layer is 32; The output dimension of the output layer is 1, and a sigmoid activation function (non-linear activation function) is used for non-linear transformation.
[0024] Therefore, this implementation addresses the technical issues of existing technologies by adjusting the inference objectives of the model framework and improving the existing TensorFlow framework. 1) While existing technologies use a large model to infer and determine the current user (returning the user ID), the improved technology trains a small model for each user's device. This small model is used solely to determine whether the current keystroke event is attributed to that user (returning true or false). This design improvement reduces the dimension of the output layer from the number of users N to 1 (model size is no longer dependent on the number of users). 2) Experiments have confirmed that reducing the dimension of the LSTM recurrent neural network and fully connected layers from 64 to 32 has limited negative impact on model accuracy and loss, while further reducing the physical size of the model. 3) Keystroke events with user IDs are no longer stored for a long time. 4) This eliminates the risk of misuse if a user's keystroke habits are leaked. 5) Each user's device is assigned a small model, eliminating negative interactions between users.
[0025] Step S4: Bind the trained TensorFlow framework to the user and the current device.
[0026] Implementation 2: The keyboard-tap-based user login method described in this implementation is implemented using the keyboard-tap-based user registration method described in Implementation 1, and includes the following steps: Step S5: Determine whether the user and the current device have been bound to the trained TensorFlow framework. If not, the user needs to register. Otherwise, execute the operation of step S6. Step S6: Load the trained Tensorflow framework and collect the user's keyboard tapping event dataset; Step S7: Call the trained TensorFlow framework to perform inference on the collected user keyboard tapping event dataset in the form of a sliding window, aggregate the multiple inference results obtained into an overall result, and use a heuristic confidence enhancement algorithm to process the overall result to obtain a confidence score; Step S8, respectively determining whether the number of rounds and the confidence score have reached a threshold value. If so, the login is successful. Otherwise, the operation of step S9 is executed; In step S9, it is considered that the user login has failed.
[0027] In this embodiment, in step S7, the sliding window is in the form of collecting at least 4 user keyboard tapping events every 2 seconds or more.
[0028] In this embodiment, in step S7, the heuristic confidence enhancement algorithm adopts a multi-stage scoring logic, combined with confidence threshold interval determination and a dynamic enhancement mechanism.
[0029] In this embodiment, in step S7, the heuristic confidence enhancement algorithm is specifically: Input confidence score sequence; Initialize cumulative score , initialize the amplification factor ; Iterate over the confidence score sequence , then for If the confidence score is less than 0.3, the cumulative score , amplification factor ; 0.3≤Confidence score<0.7, then the cumulative score , amplification factor ; 0.7≤confidence score, then the cumulative score , amplification factor ,in, is the minimum value; Output overall confidence score .
[0030] Similarly, this embodiment is to solve the technical problems existing in the prior art, such as Figure 2 As shown, a user login method based on keyboard tapping is proposed, which includes the following steps: Step S5: Determine whether the user and the current device have both been bound to the trained Tensorflow framework. If not, execute the operation of step S6; otherwise, execute the operation of step S7.
[0031] Step S6: If the trained Tensorflow framework is not bound, the user is guided to register a new device.
[0032] In step S7, if the trained Tensorflow framework has been bound, the trained Tensorflow framework is loaded, and the user is guided to use the keyboard to input a paragraph of text, and multiple user keyboard tapping event data are collected. During this process, every 2 seconds or more, and after collecting at least 4 user keyboard tapping events, the most recent 20 key events are called to the trained Tensorflow framework to infer the 20 key events respectively, and multiple inference results are obtained.
[0033] In step S8, each of the multiple inference results is given an estimated value between 0 and 1. The closer the estimated value is to 1, the more likely the keystroke behavior collected is from the target user.
[0034] Based on the technical problems existing in the Tensorflow framework in the prior art described in Implementation Method 1, an improvement is made to it. By adjusting the dimension and activation function of the output layer respectively, it is determined whether the input belongs to the current user {0 or 1}, so that the improved Tensorflow framework is suitable for the user login method based on keyboard tapping.
[0035] Step S9: record multiple inference results, summarize the multiple inference results into an overall result, and then use a heuristic confidence enhancement algorithm to judge the overall result to obtain an overall confidence score.
[0036] like Figure 3 As shown in the figure, the heuristic confidence enhancement algorithm adopts a multi-stage scoring logic, combined with confidence threshold interval judgment and dynamic enhancement mechanism, to effectively enhance the recognition ability of "high confidence continuous segments" while being tolerant to occasional abnormal noise points. Specifically: 1. Input definition: Assume the input is a sequence of confidence scores: ; Initialize cumulative score , initialize the amplification factor .
[0037] 2. Update rules: For each , according to the following rules: Low confidence score ( ), the cumulative score , amplification factor ; Medium confidence score ( ), the cumulative score , amplification factor ; High confidence score ( ), the cumulative score , amplification factor ,in, is the minimum value; The final output is the overall confidence score .
[0038] In step S10, the number of rounds and the overall confidence score are determined to be at a threshold (e.g., if the number of rounds is ≥ 8 and the overall confidence score is ≥ 0.6), the login is considered successful. If the number of rounds reaches a set upper limit (e.g., 20 rounds) and the confidence score is still below the threshold, the user login is considered unsuccessful.
[0039] The above is a detailed introduction to the user registration and login method based on keyboard tapping proposed in the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A user registration method based on keyboard tapping, characterized in that: The following steps are involved: Step S1, collecting a user keyboard tapping event data set; Step S2, randomly selecting part of the data from the collected user keyboard tapping event data set, and preprocessing the part of the data to form preprocessed data; Step S3: The pre-processed data is input into the TensorFlow framework for training and verification operations respectively, and whether the verification results meet the expected results is determined. If so, the operation of step S4 is executed; otherwise, the operation of step S2 is executed; Step S4: Bind the trained TensorFlow framework to the user and the current device.
2. The user registration method based on keyboard tapping according to claim 1, characterized in that: In the step S1, the user keyboard tapping event data set is a user keyboard tapping event data set without the user identifier.
3. The user registration method based on keyboard tapping according to claim 1, characterized in that: The Tensorflow framework consists of an input layer, a mask layer, an LSTM recurrent neural network, a fully connected layer, and an output layer; The output dimensions of the LSTM recurrent neural network and the fully connected layer are both 32; The output dimension of the output layer is 1, and a sigmoid activation function is used for nonlinear transformation.
4. A user login method based on keyboard tapping, wherein the method is implemented by using the user registration method based on keyboard tapping according to any one of claims 1 to 3, characterized in that: The following steps are involved: Step S5: Determine whether the user and the current device have been bound to the trained TensorFlow framework. If not, the user needs to register. Otherwise, execute the operation of step S6. Step S6: Load the trained Tensorflow framework and collect the user's keyboard tapping event dataset; Step S7: Call the trained TensorFlow framework to perform inference on the collected user keyboard tapping event dataset in the form of a sliding window, aggregate the multiple inference results obtained into an overall result, and use a heuristic confidence enhancement algorithm to process the overall result to obtain a confidence score; Step S8, respectively determining whether the number of rounds and the overall confidence score reach a threshold value. If so, the login is successful. Otherwise, the operation of step S9 is executed; In step S9, it is considered that the user login has failed.
5. The user login method based on keyboard tapping according to claim 4, characterized in that: In step S7, the sliding window is in the form of collecting at least 4 user keyboard tapping events every 2 seconds or more.
6. The user login method based on keyboard tapping according to claim 4, characterized in that: In step S7, the heuristic confidence enhancement algorithm adopts a multi-stage scoring logic, combined with confidence threshold interval determination and dynamic enhancement mechanism.
7. The keyboard-tap-based user login method according to claim 4 or 6, characterized in that: In step S7, the heuristic confidence enhancement algorithm is specifically: Input confidence score sequence; Initialize cumulative score , initialize the amplification factor ; Iterate over the confidence score sequence , then for If the confidence score is less than 0.3, the cumulative score , amplification factor ; 0.3≤Confidence score<0.7, then the cumulative score , amplification factor ; 0.7≤confidence score, then the cumulative score , amplification factor ,in, is the minimum value; Output overall confidence score .
Citation Information
Patent Citations
Method for constructing user identity recognition model and method for judging user identity
CN120560560A
Modeling and analysis system for user keyboard key pressing activity mode and identity identification method thereof
CN104318136A
Identity recognition keyboard and method of performing identity authentication according to identity recognition keyboard
CN106529354A
Identification method and device for login authentication through mouse and keyboard tapping rhythm
CN112100598A
Speech recognition method and device, server and storage medium
CN114299928A