Keyboard dynamic information generation method, system and storage medium based on deep learning
Through multi-layer recursive attention network and adversarial learning combined with adaptive analysis technology, the problems of insufficient feature extraction and poor model adaptability of keyboard dynamic information generation in the existing technology are solved, and more efficient and real-time keyboard dynamic information generation is achieved.
Patent Information
- Application Number
- CN202411231224.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-09-04
AI Technical Summary
The existing keyboard dynamic information generation method based on deep learning has problems such as insufficient feature extraction, complex model structure, poor real-time performance, and difficulty in adapting to changes in different users and input environments.
Using a multi-layer recursive attention network combined with adversarial learning and knowledge distillation, multi-scale features are captured through adaptive length sliding windows and multi-scale time-frequency analysis, and an adversarial sample generator is introduced to improve robustness, combining conditional batch normalization and increment The learning module realizes adaptive adjustment and personalized adaptation of the model.
It improves the accuracy and real-timeness of keyboard dynamic information generation, enhances the model's adaptability to different users and input environments, reduces computing complexity, and maintains the model's lightweight and efficient deployment.
Smart Images

Figure CN118732864B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of deep learning technology, and in particular to a method, system and storage medium for generating keyboard dynamic information based on deep learning. Background Art
[0002] With the rapid development of information technology, keyboards are important devices for human-computer interaction, and their input patterns and dynamic features are of great significance in areas such as user identity authentication, sentiment analysis, and personalized interaction. Traditional keyboard dynamic information analysis methods mainly rely on simple statistical features and rule-based models, which are difficult to effectively capture the complexity and variability of user input behavior, resulting in a lack of authenticity and personalized features in the generated keyboard dynamic information.
[0003] Deep learning technology has made significant breakthroughs in natural language processing and time series data analysis, providing new ideas and methods for keyboard dynamic information generation. However, existing methods for keyboard dynamic information generation based on deep learning still have some problems, such as insufficient feature extraction, poor real-time performance due to complex model structure, and difficulty in adapting to changes in different users and input environments. Summary of the invention
[0004] The present application provides a method, system and storage medium for generating keyboard dynamic information based on deep learning, which are used to improve the accuracy of generating keyboard dynamic information.
[0005] In a first aspect, the present application provides a method for generating keyboard dynamic information based on deep learning, the method comprising:
[0006] Acquire an original data set input by a user's keyboard, and perform feature extraction and vector mapping on the original data set to obtain a semantic feature vector;
[0007] Inputting the semantic feature vector into a multi-layer recursive attention network for iterative training and adversarial learning to obtain an initial information generation model, and calculating a model optimization index of the initial information generation model;
[0008] According to the model optimization index and keyboard input environment information, the initial information generation model is subjected to structural pruning and knowledge distillation to obtain a target information generation model;
[0009] A real-time data set is acquired, initial keyboard dynamic information is output through a target information generation model, and incremental learning and elastic weight integration are performed on the initial keyboard dynamic information and user personalized configuration information to output target keyboard dynamic information.
[0010] In a second aspect, the present application provides a keyboard dynamic information generation system based on deep learning, the system comprising:
[0011] An acquisition module is used to acquire an original data set input by a user's keyboard, and perform feature extraction and vector mapping on the original data set to obtain a semantic feature vector;
[0012] A training module, used for inputting the semantic feature vector into a multi-layer recursive attention network for iterative training and adversarial learning to obtain an initial information generation model, and calculating a model optimization index of the initial information generation model;
[0013] A processing module, used to perform structural pruning and knowledge distillation on the initial information generation model according to the model optimization index and keyboard input environment information to obtain a target information generation model;
[0014] The output module is used to obtain a real-time data set, output initial keyboard dynamic information through a target information generation model, perform incremental learning and elastic weight integration on the initial keyboard dynamic information and user personalized configuration information, and output target keyboard dynamic information.
[0015] The third aspect of the present application provides a keyboard dynamic information generation device based on deep learning, comprising: a memory and at least one processor, wherein instructions are stored in the memory; the at least one processor calls the instructions in the memory so that the keyboard dynamic information generation device based on deep learning executes the above-mentioned keyboard dynamic information generation method based on deep learning.
[0016] The fourth aspect of the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the above-mentioned keyboard dynamic information generation method based on deep learning.
[0017] In the technical solution provided by the present application, by acquiring multi-dimensional data such as key time, release time, encoding, speed and interval, the input characteristics of the user are fully captured, and the adaptive length sliding window and multi-scale time-frequency analysis are adopted to flexibly process input sequences of different lengths and capture multi-scale time and frequency characteristics. Combining word embedding technology and time-frequency features, the effective fusion of semantic information and dynamic features is realized. The multi-layer recursive attention network structure can capture long-term dependencies, and at the same time highlight important information through the self-attention mechanism, and enhance the model's perception of key features. The adversarial sample generator is introduced to improve the robustness and generalization ability of the model through the alternating optimization of the generator and the discriminator. A comprehensive evaluation function is used to comprehensively evaluate the output quality of the model. Combined with sensitivity analysis and progressive pruning, the adaptive compression of the network structure is realized, while maintaining performance and reducing computational complexity. Knowledge transfer is carried out through the teacher-student network architecture, and combined with quantization-aware training, the lightweight and efficient deployment of the model is realized. The keyboard input environment information is integrated, and the adaptive adjustment of the model to different input environments is realized through conditional batch normalization. Design incremental learning modules and knowledge forgetting suppression mechanisms to enable the model to continuously learn new knowledge while maintaining memory of learned information. Introduce user personalized configuration information, and achieve personalized adaptation to different user input habits through feature fusion and elastic weight integration. Through dynamic time warping and real-time feature extraction, combined with incremental optimization models, real-time generation and continuous optimization of keyboard dynamic information can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0019] Figure 1 A schematic diagram of an embodiment of a method for generating keyboard dynamic information based on deep learning in an embodiment of the present application;
[0020] Figure 2 This is a schematic diagram of an embodiment of a keyboard dynamic information generation system based on deep learning in an embodiment of the present application. DETAILED DESCRIPTION
[0021] Embodiments of the present application provide a method, system and storage medium for generating keyboard dynamic information based on deep learning. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0022] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 In the embodiment of the present application, an embodiment of the method for generating keyboard dynamic information based on deep learning includes:
[0023] Step S101, obtaining an original data set input by a user's keyboard, and performing feature extraction and vector mapping on the original data set to obtain a semantic feature vector;
[0024] It is understandable that the execution subject of the present application can be a keyboard dynamic information generation system based on deep learning, or a terminal or a server, which is not limited here. The embodiment of the present application is described by taking the server as the execution subject as an example.
[0025] Specifically, the user's keyboard input events are monitored in real time to obtain the original input stream. In this process, each key event is timestamped and recorded to generate a key time sequence and a release time sequence. The key time sequence and the release time sequence are subtracted to obtain a key duration sequence. The key duration sequence can reflect the duration of each key press by the user, which is helpful for analyzing the user's input habits. The key codes are numbered according to the order of occurrence of the key events to generate an ordered key code sequence. At the same time, the timestamps of adjacent key events are subtracted to obtain a key interval sequence. The key interval sequence can show the interval time between each key pressed by the user during the input process, which is helpful for understanding the user's input rhythm and speed. The input speed is calculated according to the key interval sequence and the number of keys to obtain a dynamic input speed sequence. This sequence can dynamically reflect the changes in the user's input speed in different time periods. The key duration sequence is statistically analyzed to obtain a key force estimation value. The key force estimation value can help identify the different pressures applied by the user during the input process, thereby refining the analysis of the user's input behavior. The same characters input continuously are counted according to the ordered key code sequence to obtain a repeated key pattern sequence. Repeated key pattern sequences can show the situation of users repeating keys during input, which helps detect certain input habits or incorrect behaviors. The key time series, release time series, ordered key coding sequence, dynamic input speed sequence, key interval sequence, key force estimation value and repeated key pattern sequence are structured and integrated to generate a comprehensive original data set. The original data set is subjected to sliding window segmentation and Fourier transform to obtain a mixed feature set. Sliding window segmentation can ensure that local features are retained in the time series, so that the model can focus on the local change trend of the input data. The Fourier transform helps to capture the frequency features in the input data and enrich the feature set. The mixed feature set is mapped to a word embedding vector to obtain a semantic feature vector. The high-dimensional feature set is converted into a low-dimensional dense vector while retaining the semantic information of the original data.
[0026] The original data set is analyzed by adaptive length sliding window to obtain a sequence of variable length data segments. The window length is adjusted according to the change of data to obtain more detailed dynamic features. According to the sequence of variable length data segments, each segment is transformed into the frequency domain by fast Fourier transform to obtain a frequency domain feature matrix. By converting the time domain features into frequency domain features, the potential periodicity and frequency components in the input data are obtained. The frequency domain feature matrix is decomposed by wavelet to obtain a multi-scale time-frequency feature representation. Wavelet decomposition can analyze signals at different scales to obtain a richer time-frequency feature representation. According to the multi-scale time-frequency feature representation, principal component analysis is performed to obtain a reduced dimension feature vector. The dimension of the feature vector is reduced while retaining the main information in the data as much as possible to avoid information redundancy. Kernel density estimation is performed on the reduced dimension feature vector to estimate the probability distribution of the feature vector in the feature space and obtain the probability distribution feature. According to the probability distribution feature, the original data set is resampled to generate an enhanced data set. Resampling technology helps to balance the category distribution in the data set, enhance the diversity of the data set, and improve the generalization ability of the model. The enhanced data set is processed by word vector to obtain the initial word vector representation. By mapping each data segment in the augmented dataset to a high-dimensional word vector space, the semantic information of the data is retained. According to the initial word vector representation, word embedding analysis is performed to obtain the word embedding vector. Through training, the high-dimensional word vector is converted into a low-dimensional dense vector, which retains the semantic information while simplifying the computational complexity. The word embedding vector is feature compressed to obtain compressed semantic features. Feature fusion is performed based on the compressed semantic features and the multi-scale time-frequency feature representation to obtain the final semantic feature vector.
[0027] Step S102: inputting the semantic feature vector into a multi-layer recursive attention network for iterative training and adversarial learning to obtain an initial information generation model, and calculating a model optimization index of the initial information generation model;
[0028] Specifically, the semantic feature vector is normalized to obtain standardized input data. Normalization can eliminate the differences between different feature dimensions, making the model more stable and efficient during training. A multi-layer recursive neural network is constructed based on the standardized input data to form a basic network model. The recursive neural network can effectively capture the time series characteristics of the input data through its hierarchical structure. The self-attention mechanism is applied to each layer of the basic network model to obtain an attention-enhanced network structure. The self-attention mechanism allows the model to adaptively focus on the importance of different positions in the sequence when processing the input sequence, thereby improving the model's ability to capture complex dependencies. Residual connections are designed based on the attention-enhanced network structure to construct a deep trainable recursive attention network. The introduction of residual connections effectively alleviates the gradient vanishing problem in deep network training and promotes the training of deeper networks. The recursive attention network is dynamically adjusted to form an adaptive learning strategy. The dynamic learning rate adjustment method can adaptively adjust the learning rate according to the model performance during the training process to improve the training efficiency and effect. The recursive attention network is forward propagated and reversely updated according to the adaptive learning strategy to obtain an initial training model. In the forward propagation process, the model calculates the output layer by layer, and the reverse gradient update is used to optimize the model parameters through error feedback. The adversarial sample generator is introduced into the initial training model to build an adversarial learning framework. Adversarial learning enhances the adversarial ability of the model by alternately optimizing the generator and the discriminator. The generator is responsible for generating adversarial samples, and the discriminator is used to distinguish between real samples and adversarial samples. Through this adversarial training, the model can better adapt to different input perturbations. According to the adversarial learning framework, the generator and the discriminator are alternately optimized to finally obtain an adversarially enhanced model. The adversarially enhanced model is integrated to obtain a multi-model fusion structure. Ensemble learning effectively reduces the bias and variance of a single model by combining the prediction results of multiple models. Cross-validation and early stopping strategies are performed according to the multi-model fusion structure to ensure that the model performs consistently on different data sets and avoid overfitting. Cross-validation divides the data set into multiple subsets for training and validation respectively to comprehensively evaluate the performance of the model; the early stopping strategy stops training in advance when the validation error no longer decreases to prevent overfitting. The initial information generation model is obtained. In order to further evaluate and optimize the model, random sampling and regular post-processing are performed to obtain model optimization indicators. Random sampling is used to evaluate the performance of the model on different data subsets, and rule post-processing optimizes and adjusts the model output according to predetermined rules to further improve the actual application effect of the model.
[0029] The initial information generation model is randomly sampled to obtain multiple sets of candidate output sequences. Sequence entropy values are calculated based on multiple sets of candidate output sequences to obtain diversity evaluation indicators. Sequence entropy values reflect the degree of diversity of candidate output sequences, which helps to evaluate the richness and innovation of model generation results. Multiple sets of candidate output sequences are processed by n-gram language model to obtain language fluency scores. n-gram language model can effectively evaluate the grammar and language structure of sequences, thereby providing a quantitative language fluency indicator. According to the language fluency score, multiple sets of candidate output sequences are sorted to obtain the target output sequence set. Rule-based post-processing is performed on the target output sequence set to obtain a grammatically corrected sequence set. Rule-based post-processing corrects the generated sequence by applying predefined grammatical rules to improve its grammatical correctness and readability. Based on the grammatically corrected sequence set, the edit distance with the original input is calculated to obtain a similarity indicator. Edit distance is a common indicator for measuring the similarity between two sequences. By calculating the edit distance, the similarity between the generated sequence and the original input is evaluated. At the same time, sentiment analysis is performed on the grammatically corrected sequence set to obtain a sentiment consistency score. A multi-objective optimization function is constructed based on the similarity index and the sentiment consistency score to obtain a comprehensive evaluation index. The multi-objective optimization function provides an overall evaluation standard by comprehensively considering similarity and sentiment consistency. The comprehensive evaluation index is adaptively thresholded to obtain an optimized output sequence. The adaptive threshold screening method dynamically adjusts the screening criteria according to the comprehensive evaluation index to ensure that the selected sequence has high quality in multiple indicators. According to the difference between the optimized output sequence and the output of the initial information generation model, the adjustment gradient of the initial information generation model is calculated to obtain the model optimization index. The adjustment gradient is used to guide the optimization of the model parameters so that it can produce higher quality output in the future generation process.
[0030] Step S103: Perform structural pruning and knowledge distillation on the initial information generation model according to the model optimization index and keyboard input environment information to obtain a target information generation model;
[0031] Specifically, a sensitivity analysis is performed on the model optimization index to obtain the sensitivity score of each parameter. Sensitivity analysis can help identify the key parameters in the model that have a greater impact on the output, thereby providing guidance for the subsequent pruning process. According to the sensitivity score, the initial information generation model is progressively pruned to obtain a sparse network structure. Parameters that have a smaller impact on the model performance are gradually removed to make the model structure more streamlined and efficient. The sparse network structure is reparameterized to obtain compressed model parameters. The model parameters are readjusted to adapt to the pruned network structure while maintaining the performance of the model. The keyboard input environment information is obtained, and the feature extraction and feature encoding of the environment information are performed to generate an environment feature vector. The environment feature vector can reflect the current keyboard input environment state and provide a basis for the adaptive adjustment of the model. The compressed model parameters and environment feature vector are conditionally batch normalized to obtain an adaptive model structure. Conditional batch normalization dynamically adjusts the structure and parameter distribution of the model by combining environmental features and model parameters, so that it can better adapt to different input environments. Based on the adaptive model structure, the teacher network and student network are designed to construct a knowledge distillation framework. In the knowledge distillation framework, soft labels are transferred from the teacher network to the student network, and the knowledge transfer loss function is calculated. Soft labels can provide richer information than hard labels, which helps the student network to better learn the knowledge of the teacher network. According to the knowledge transfer loss function, the student network is optimized and trained to obtain a preliminary distillation model. The optimization training process minimizes the knowledge transfer loss function and continuously adjusts the parameters of the student network to gradually approach the performance of the teacher network. The preliminary distillation model is trained with quantization awareness to obtain a low-bit weight representation. The purpose of quantization awareness training is to quantize the model weights, thereby reducing the storage and computational costs of the model and improving its efficiency in practical applications. According to the low-bit weight representation, the initial information generation model is compared and verified to obtain the target information generation model. The comparative verification evaluates the effect of the distillation process by comparing the performance of the initial model and the distillation model, and finally determines the optimized model structure.
[0032] Step S104: acquiring a real-time data set, outputting initial keyboard dynamic information through a target information generation model, performing incremental learning and elastic weight integration on the initial keyboard dynamic information and user personalized configuration information, and outputting target keyboard dynamic information.
[0033] Specifically, a real-time data set is obtained, and online feature extraction is performed on the real-time data set to obtain a real-time feature vector. According to the real-time feature vector, forward reasoning is performed through the target information generation model, and the real-time feature vector is input into the deep learning model. The prediction result is obtained through the calculation of the model to obtain the initial keyboard dynamic information. The initial keyboard dynamic information is dynamically time-warped to obtain aligned sequence data. User personalized configuration information is obtained, and user feature embedding is generated based on the information. User feature embedding generates a high-dimensional vector representation by encoding the user's personalized configuration information, so that the model can understand and use the personalized information. The aligned sequence data and the user feature embedding are feature fused to obtain personalized enhanced features. According to the personalized enhanced features, an incremental learning module is designed to obtain an updateable model structure. The incremental learning module allows the model to gradually update its own structure and parameters in the process of continuously receiving new data, so as to keep the model up-to-date and adaptable. The updateable model structure is elastically weighted to obtain a dynamically adjusted parameter space. The elastic weight integration technology can dynamically adjust the model parameters according to the characteristics of the new data, so that the model is more flexible and efficient in dealing with the changing data environment. In the dynamically adjusted parameter space, the incrementally optimized model is obtained through gradient accumulation and batch update. Gradient accumulation is an optimization technique that can accumulate gradients on small batches of data, simulate the effect of large batches of data, and improve training efficiency and stability. Batch update refers to updating model parameters at one time after a certain amount of data has accumulated to improve the efficiency and effect of training. The incrementally optimized model is processed by the knowledge forgetting suppression mechanism to obtain a balanced representation of new and old knowledge. The knowledge forgetting suppression mechanism performs special processing on the model to ensure that the model does not forget existing knowledge while learning new knowledge, thereby maintaining the comprehensive ability of the model. Based on the balanced representation of new and old knowledge, the real-time data set is re-inferred to output the target keyboard dynamic information.
[0034] In the embodiment of the present application, by acquiring multidimensional data such as key time, release time, encoding, speed and interval, the input characteristics of the user are fully captured, and the adaptive length sliding window and multi-scale time-frequency analysis are used to flexibly process input sequences of different lengths and capture multi-scale time and frequency characteristics. Combining word embedding technology and time-frequency features, the effective fusion of semantic information and dynamic features is realized. The multi-layer recursive attention network structure can capture long-term dependencies, and at the same time highlight important information through the self-attention mechanism, and enhance the model's perception of key features. The adversarial sample generator is introduced to improve the robustness and generalization ability of the model through the alternating optimization of the generator and the discriminator. A comprehensive evaluation function is used to comprehensively evaluate the output quality of the model. Combined with sensitivity analysis and progressive pruning, adaptive compression of the network structure is achieved, while maintaining performance and reducing computational complexity. Knowledge transfer is performed through the teacher-student network architecture, and combined with quantitative perception training, the lightweight and efficient deployment of the model is achieved. The keyboard input environment information is integrated, and the adaptive adjustment of the model to different input environments is realized through conditional batch normalization. The incremental learning module and the knowledge forgetting suppression mechanism are designed so that the model can continue to learn new knowledge while maintaining the memory of the learned information. Introducing user personalized configuration information, through feature fusion and elastic weight integration, to achieve personalized adaptation to different user input habits. Through dynamic time warping and real-time feature extraction, combined with incremental optimization model, to achieve real-time generation and continuous optimization of keyboard dynamic information.
[0035] In a specific embodiment, the process of executing step S101 may specifically include the following steps:
[0036] (1) Monitor keyboard input events in real time to obtain the original input stream, and record the timestamp of each key event according to the original input stream to obtain the key time series and release time series;
[0037] (2) Calculate the difference between the key pressing time series and the release time series to obtain the key pressing duration series;
[0038] (3) Numbering the key codes according to the order in which the key events occur to obtain an ordered key code sequence, and performing difference calculation on the timestamps of adjacent key events to obtain a key interval sequence;
[0039] (4) Calculate the input speed based on the key interval sequence and the number of keys to obtain a dynamic input speed sequence, and perform statistical analysis on the key duration sequence to obtain an estimated key force value;
[0040] (5) Counting the same characters input continuously according to the ordered key coding sequence to obtain a repeated key pattern sequence;
[0041] (6) structurally integrating the key press time series, release time series, ordered key coding series, dynamic input speed series, key press interval series, key force estimation value and repeated key press pattern series to obtain the original data set;
[0042] (7) Perform sliding window segmentation and Fourier transform on the original data set to obtain a mixed feature set and perform word embedding vector mapping to obtain a semantic feature vector.
[0043] Specifically, each key event is monitored and the timestamps of the key press and release are recorded. These timestamps are stored in the key press time sequence and the release time sequence respectively. By recording the timestamp of each key press event, the user's input behavior is tracked. For example, when a user presses a key on the keyboard, the timestamp of the key press is recorded. When the user releases the key, the release timestamp is recorded. The key duration sequence is obtained by performing a difference calculation on the key press time sequence and the release time sequence. The key duration sequence represents the length of time from each key press to the release. Assume that the key press time sequence is And the release time series is , then the key duration sequence for: .in Indicates At the same time, the key codes are numbered according to the order in which the key events occur to obtain an ordered key code sequence. For example, assuming that the code for each key press is , number the keys in the order they occur to get an ordered key coding sequence. Difference calculation is performed on the timestamps of adjacent key events to get a key interval sequence. The key interval sequence represents the time interval between adjacent keys. Assume that the key time sequence is , then the key interval sequence for:
[0044] ;
[0045] in Indicates and The time interval between key presses. According to the key interval sequence and the number of key presses, the input speed is calculated to obtain a dynamic input speed sequence. The dynamic input speed sequence represents the user's key speed in different time periods, which can be expressed by calculating the number of key presses per unit time. Statistical analysis is performed on the key duration sequence to obtain a key force estimate. The key force estimate estimates the user's key force based on the key duration and other features. For example, statistical features such as the mean and standard deviation of the key duration can be used to estimate the key force. At the same time, the same characters entered continuously are counted according to the ordered key coding sequence to obtain a repeated key pattern sequence. The original data set is subjected to sliding window segmentation and Fourier transform to obtain a mixed feature set. Sliding window segmentation is to divide the time series data into multiple overlapping or non-overlapping windows, and the data in each window is taken as a sample. For example, assuming the sliding window size is , then the data after sliding window segmentation is By performing Fourier transform on the data in each window, we can get the frequency domain feature set:
[0046] ;
[0047] in, is the frequency domain feature, is time series data, is the window length, is an imaginary unit. In this way, sliding window segmentation and Fourier transform can capture the periodic and local features in the signal, making the feature set richer and more representative. The mixed feature set is mapped to a word embedding vector to obtain a semantic feature vector. Word embedding vector mapping is to map discrete features to a continuous vector space, so that similar features are closer in representation in the vector space.
[0048] In a specific embodiment, the execution step performs sliding window segmentation and Fourier transform on the original data set to obtain a mixed feature set and perform word embedding vector mapping, and the process of obtaining a semantic feature vector can specifically include the following steps:
[0049] (1) Perform adaptive length sliding window analysis on the original data set to obtain a variable-length data segment sequence, and perform fast Fourier transform on each segment according to the variable-length data segment sequence to obtain a frequency domain feature matrix;
[0050] (2) Perform wavelet decomposition on the frequency domain feature matrix to obtain a multi-scale time-frequency feature representation, and perform principal component analysis based on the multi-scale time-frequency feature representation to obtain a reduced-dimensional feature vector;
[0051] (3) Perform kernel density estimation on the reduced-dimensional feature vector to obtain probability distribution characteristics, and resample the original data set based on the probability distribution characteristics to obtain an enhanced data set;
[0052] (4) Perform word embedding processing on the enhanced dataset to obtain an initial word embedding representation, and perform word embedding analysis based on the initial word embedding representation to obtain a word embedding vector;
[0053] (5) Perform feature compression on the word embedding vector to obtain compressed semantic features, and perform feature fusion based on the compressed semantic features and multi-scale time-frequency feature representation to obtain a semantic feature vector.
[0054] Specifically, a mechanism is defined to dynamically adjust the length of the sliding window to better adapt to the changing characteristics of the data. The goal of adaptive length sliding window analysis is to select an appropriate window length to capture important features in the data according to the changes in the data. Assume that the original data set is , in order to obtain a sequence of variable-length data segments, statistical properties such as variance or autocorrelation are used to adjust the window length. , choose a suitable window length To extract data fragments After obtaining a sequence of variable-length data segments, each segment is subjected to a fast Fourier transform (FFT) to convert it into the frequency domain. Fast Fourier transform is an efficient algorithm for converting time domain signals into frequency domain signals. Its formula is as follows:
[0055] ;
[0056] in, is the frequency domain feature, is a time domain signal, is the data segment length, is an imaginary unit. By performing fast Fourier transform on variable-length data segments, we get the frequency domain feature matrix, which contains the amplitude and phase information of each frequency component, and helps capture the periodic characteristics in the data. We perform wavelet decomposition on the frequency domain feature matrix to get a multi-scale time-frequency feature representation. Wavelet decomposition is a technique that can analyze signals in both the time domain and the frequency domain. It decomposes the signal through wavelet functions of different scales and extracts the characteristics of the signal at different time scales. Assume that the frequency domain feature matrix is , through wavelet decomposition, we can get time-frequency feature representations of multiple scales ,Right now:
[0057] ;
[0058] in, is the number of scales of wavelet decomposition, each Indicates Features at different scales. The wavelet decomposition formula is as follows:
[0059] ;
[0060] in, The signal is at scale and location The wavelet coefficients at It's a signal. is the mother wavelet function, represents the conjugate of the mother wavelet function, is the signal length. Through this formula, the signal is decomposed into different scales to capture the local features in the signal. Principal component analysis is performed on the multi-scale time-frequency feature representation to obtain the reduced dimension feature vector. By projecting high-dimensional data into low-dimensional space, the most important features in the data are retained. Kernel density estimation is performed on the reduced dimension feature vector to obtain the probability distribution characteristics. Kernel density estimation is a non-parametric statistical method that can estimate the probability density function of the data by smoothing the data. Assume that the reduced dimension feature vector is , the formula for kernel density estimation is:
[0061] ;
[0062] in, is the estimated probability density function, is the kernel function, is the bandwidth parameter. Through kernel density estimation, the probability distribution characteristics of the data can be obtained, and the original data set can be resampled according to these characteristics to obtain an enhanced data set. The resampling process is to randomly extract samples from the original data set according to the estimated probability distribution to generate more training data, thereby enhancing the robustness of the model. The enhanced data set is word vectorized to obtain the initial word vector representation. Word vectorization is a method of mapping discrete features to continuous vector space, which can be achieved by training word vector models (such as Word2Vec or GloVe). Word embedding analysis is performed based on the initial word vector representation to obtain a word embedding vector. Word embedding analysis maps the initial word vector to a high-dimensional semantic space by training a neural network model, so that similar words are closer in the vector space. Feature compression is performed on the word embedding vector to obtain compressed semantic features. Feature compression can be achieved through a variety of techniques, such as autoencoders or principal component analysis. Feature fusion is performed based on compressed semantic features and multi-scale time-frequency feature representation to obtain the final semantic feature vector.
[0063] In a specific embodiment, the process of executing step S102 may specifically include the following steps:
[0064] (1) Normalize the semantic feature vector to obtain standardized input data, and build a multi-layer recursive neural network based on the standardized input data to obtain the basic network model;
[0065] (2) Apply the self-attention mechanism to each layer of the basic network model to obtain an attention-enhanced network structure, and design residual connections based on the attention-enhanced network structure to obtain a deep trainable recursive attention network;
[0066] (3) Dynamically adjust the learning rate of the recursive attention network to obtain an adaptive learning strategy, and perform forward propagation and reverse gradient update on the recursive attention network according to the adaptive learning strategy to obtain an initial training model;
[0067] (4) Introducing an adversarial sample generator into the initial training model to obtain an adversarial learning framework, and alternately optimizing the generator and discriminator according to the adversarial learning framework to obtain an adversarially enhanced model;
[0068] (5) Perform ensemble learning on the adversarial enhanced model to obtain a multi-model fusion structure, and perform cross-validation and early stopping strategy based on the multi-model fusion structure to obtain an initial information generation model;
[0069] (6) Perform random sampling and rule post-processing on the initial information generation model to obtain the model optimization index.
[0070] Specifically, the semantic feature vector is standardized, each component of the feature vector is adjusted to a relatively similar scale, the scale differences between different features are eliminated, and standardized input data is obtained. A multi-layer recurrent neural network is constructed based on the standardized input data. The multi-layer recurrent neural network can capture the time dependency in the input sequence. Assume that the standardized input data is ,in represents the number of time steps, and the input of each time step is The basic formula of RNN is as follows:
[0071] ;
[0072] in, is the time step The hidden state of and are the weight matrices for the hidden state and input, respectively. is the bias term, is the activation function (such as ReLU or tanh). Through recursive calculation, the final hidden state of the sequence is obtained , the hidden state contains the dynamic information of the input sequence. The self-attention mechanism is introduced into the basic network model to enhance the model's ability to pay attention to important time steps. The self-attention mechanism calculates the attention weights based on the hidden state of each time step in the input sequence, and then performs a weighted average of the hidden states based on these weights. Assume that the hidden state sequence is , the calculation formula of the self-attention mechanism is as follows:
[0073] , ;
[0074] in, is the time step The attention weight, and is a trainable parameter. By weighted averaging, we get the hidden state of attention enhancement.
[0075] ;
[0076] Through the self-attention mechanism, the model can better capture important information in the input sequence. In order to enhance the depth and training ability of the model, residual connections are introduced into the attention-enhanced network structure. The residual connection directly adds the input and output to alleviate the gradient vanishing problem. Assume that the input is , the output after residual connection is .in, is the output of the network layer. By introducing residual connections, a deep trainable recursive attention network is obtained. When training a recursive attention network, a dynamic learning rate adjustment strategy can improve training efficiency. Dynamic learning rate adjustment dynamically adjusts the learning rate according to the performance of the model during training. For example, adaptive learning rate algorithms such as Adam or RMSprop are used, which adaptively adjust the learning rate according to the first-order and second-order momentum of the gradient. Assume that the current gradient is , the learning rate is , then the update formula of the Adam algorithm is as follows:
[0077] ;
[0078] ;
[0079] , ;
[0080] ;
[0081] in, and are the first and second order momentum of the gradient, and is the decay rate, is the minimum value that prevents division by zero. By dynamically adjusting the learning rate, an adaptive learning strategy is obtained to optimize the model parameters. An adversarial sample generator is introduced based on the initial training model to build an adversarial learning framework. The purpose of the adversarial sample generator is to generate challenging samples to improve the robustness of the model. In the adversarial learning framework, the generator generates adversarial samples, and the discriminator distinguishes between real samples and adversarial samples. The model improves performance by alternately optimizing the generator and the discriminator. The loss functions of the generator and the discriminator are as follows:
[0082] ;
[0083] in, is a generator, is the discriminator, It is a real sample. is random noise. Through adversarial learning, we get an adversarially enhanced model. We perform ensemble learning on the adversarially enhanced model to get a multi-model fusion structure. Ensemble learning can effectively improve the generalization ability and stability of the model by combining the prediction results of multiple models. We use methods such as model weighted averaging or stacking models to fuse the prediction results of multiple models. Assume that The prediction results of the models are , then the weighted average fusion result is:
[0084] ;
[0085] in, It is The weights of the models are optimized through cross-validation and early stopping strategies, and the initial information generation model is finally obtained. The initial information generation model is subjected to random sampling and rule post-processing to obtain the model optimization index. The purpose of random sampling is to evaluate the performance of the model on different data subsets, while rule post-processing is to optimize and adjust the model output, thereby improving the practical application effect of the model.
[0086] In a specific embodiment, the execution step performs random sampling and rule post-processing on the initial information generation model to obtain the model optimization index may specifically include the following steps:
[0087] (1) Randomly sample the initial information generation model to obtain multiple sets of candidate output sequences, and calculate the sequence entropy values based on the multiple sets of candidate output sequences to obtain the diversity evaluation index;
[0088] (2) Process multiple groups of candidate output sequences through the n-gram language model to obtain language fluency scores;
[0089] (3) Sort multiple groups of candidate output sequences according to language fluency scores to obtain a target output sequence set, and perform rule-based post-processing on the target output sequence set to obtain a grammatically corrected sequence set;
[0090] (4) Calculate the edit distance between the grammatically corrected sequence set and the original input to obtain a similarity index, and perform sentiment analysis on the grammatically corrected sequence set to obtain a sentiment consistency score;
[0091] (5) Construct a multi-objective optimization function based on the similarity index and the sentiment consistency score to obtain a comprehensive evaluation index, and perform adaptive threshold screening on the comprehensive evaluation index to obtain an optimized output sequence;
[0092] (6) Based on the difference between the optimized output sequence and the output of the initial information generation model, the adjustment gradient of the initial information generation model is calculated to obtain the model optimization index.
[0093] Specifically, multiple sets of candidate output sequences are generated from the initial information generation model. Assume that the initial information generation model can generate Different candidate sequences , these sequences represent the possible output results of the model under different circumstances. By randomly sampling these candidate sequences, the diversity and stability of the model are evaluated. The sequence entropy value is calculated based on multiple sets of candidate output sequences to obtain the diversity evaluation index. The sequence entropy value measures the uncertainty or information content of each element in the output sequence. Assume Represents the candidate sequence The probability of sequence entropy The calculation formula is
[0094] ;
[0095] The higher the sequence entropy value, the higher the diversity of the candidate output sequence. By calculating the sequence entropy value, the diversity of the model output is quantitatively evaluated. The n-gram language model is used to process multiple groups of candidate output sequences to obtain language fluency scores. The n-gram model is based on the statistics of continuous The co-occurrence frequency of words is used to evaluate the fluency of the sentence. Assuming the candidate output sequence By word The probability calculation formula of the n-gram language model is:
[0096] ;
[0097] By calculating the probability of each candidate sequence, its language fluency score is obtained. Multiple groups of candidate output sequences are sorted according to the language fluency score to obtain the target output sequence set. The sorted target output sequence set contains the sequences with the highest language fluency. The target output sequence set is subjected to rule-based post-processing to obtain a grammatically corrected sequence set. Rule-based post-processing includes applying predefined grammatical rules to correct the generated sequences to improve their grammatical correctness and readability. The edit distance between the grammatically corrected sequence set and the original input is calculated to obtain a similarity index. The edit distance measures the similarity between two sequences. The commonly used edit distance is the Levenshtein distance, which is defined as the minimum number of edit operations required to transform one sequence into another. By calculating the edit distance, the similarity between the generated sequence and the original input is evaluated. Sentiment analysis is performed on the grammatically corrected sequence set to obtain a sentiment consistency score. Sentiment analysis is a natural language processing technique used to identify and extract sentiment tendencies (such as positive, negative or neutral) in text. Through sentiment analysis, the consistency of the generated sequence in sentiment expression is evaluated. A multi-objective optimization function is constructed based on the similarity index and the sentiment consistency score to obtain a comprehensive evaluation index. The multi-objective optimization function provides an overall evaluation criterion by comprehensively considering similarity and sentiment consistency. The comprehensive evaluation index is adaptively thresholded to obtain the optimized output sequence. Adaptive threshold screening ensures that the selected sequence has high quality in multiple indicators by dynamically adjusting the screening criteria. According to the difference between the optimized output sequence and the output of the initial information generation model, the adjustment gradient of the initial information generation model is calculated to obtain the model optimization index. The adjustment gradient is used to guide the optimization of the model parameters so that it can produce higher quality output in the future generation process.
[0098] In a specific embodiment, the process of executing step S103 may specifically include the following steps:
[0099] (1) Perform sensitivity analysis on the model optimization indicators to obtain importance scores, and perform progressive pruning on the initial information generation model based on the importance scores to obtain a sparse network structure;
[0100] (2) Reparameterize the sparse network structure to obtain compressed model parameters;
[0101] (3) Obtain keyboard input environment information, perform feature extraction and feature encoding on the keyboard input environment information, and obtain an environment feature vector;
[0102] (4) Conditionally batch normalize the compressed model parameters and environment feature vectors to obtain an adaptive model structure;
[0103] (5) Design the teacher network and student network according to the adaptive model structure to obtain the knowledge distillation framework, and perform soft label transfer on the knowledge distillation framework to obtain the knowledge transfer loss function;
[0104] (6) Optimize and train the student network according to the knowledge transfer loss function to obtain a preliminary distillation model, and perform quantization-aware training on the preliminary distillation model to obtain a low-bit weight representation;
[0105] (7) The initial information generation model is compared and verified based on the low-bit weight representation to obtain the target information generation model.
[0106] Specifically, we quantify the impact of each model parameter on the output. Sensitivity analysis evaluates the importance of each parameter by adjusting each parameter one by one and observing the changes in the model output. Assume that the model parameters are , the corresponding output is , sensitivity analysis is performed by calculating the gradient of each parameter. The specific formula is as follows:
[0107] Sensitivity score ;
[0108] By calculating the gradient of each parameter and taking the absolute value, we get the importance score of each parameter. Based on these scores, we identify the parameters that have the greatest impact on the model output. We perform progressive pruning on the initial information generation model based on the importance scores. The goal of progressive pruning is to remove parameters that have little impact on model performance to reduce the complexity of the model. Assume that the parameters of the model are , sort them according to the importance score, set a threshold, and prune the parameters with scores below the threshold to obtain a sparse network structure. Reparameterize the sparse network structure and readjust the model parameters so that the model can still maintain good performance on the pruned structure. A common method of reparameterization is to fine-tune the remaining parameters to achieve the optimal performance on the new structure. Assume that the parameters of the sparse network structure are , the reparameterized parameters are , by minimizing the loss function To train:
[0109] ;
[0110] Through fine-tuning training, the compressed model parameters are obtained, so that the sparse network structure can maintain performance while greatly reducing the computational complexity and storage requirements. The keyboard input environment information is obtained, and the features are extracted and encoded to obtain the environment feature vector. The keyboard input environment information may include keystroke speed, keystroke force, input habits, etc. This information is converted into numerical features through feature extraction technology and encoded into an environment feature vector. For example, keystroke speed and key pressure It can be used as a component of the feature vector. Conditional batch normalization is performed on the compressed model parameters and environmental feature vectors, and the model parameters are dynamically adjusted according to the input environmental characteristics, so that the model can maintain good performance in different environments. Through conditional batch normalization, an adaptive model structure is obtained, so that the model can self-adjust according to environmental changes. Based on the adaptive model structure, the teacher network and the student network are designed, and a knowledge distillation framework is constructed. The knowledge is passed to the student network through the teacher network, so that the student network can achieve performance close to that of the teacher network with a smaller parameter scale. The output of the teacher network usually includes soft labels, which can provide more category distribution information than hard labels. Assume that the output of the teacher network is , the output of the student network is , the formula of knowledge transfer loss function is .in, is the cross entropy loss, is the Kullback-Leibler divergence, and is the weight parameter. By minimizing the knowledge transfer loss function, the parameters of the student network are optimized so that it can learn the knowledge of the teacher network. The student network is optimized and trained according to the knowledge transfer loss function to obtain a preliminary distillation model. The preliminary distillation model is quantized to obtain a low-bit weight representation. The model weight is quantized to a low-bit representation, thereby reducing the storage requirements and computational complexity of the model. Assume that the model weight is , the quantized weight is , the formula for quantization-aware training is: .in, Represents the quantization operation. Through quantization-aware training, a model with low bit weight representation is obtained. The initial information generation model is compared and verified based on the low bit weight representation to obtain the target information generation model. The comparative verification evaluates the effectiveness of the quantization process by comparing the performance difference between the quantized model and the original model, and makes necessary adjustments.
[0111] In a specific embodiment, the process of executing step S104 may specifically include the following steps:
[0112] (1) Obtain a real-time data set and perform online feature extraction on the real-time data set to obtain a real-time feature vector;
[0113] (2) Based on the real-time feature vector, forward reasoning is performed through the target information generation model to obtain the initial keyboard dynamic information, and the initial keyboard dynamic information is dynamically time-warped to obtain aligned sequence data;
[0114] (3) Obtain user personalized configuration information, generate user feature embedding based on the user personalized configuration information, and perform feature fusion on the aligned sequence data and user feature embedding to obtain personalized enhanced features;
[0115] (4) Design an incremental learning module based on personalized enhancement features to obtain an updateable model structure, and elastically integrate the weights of the updateable model structure to obtain a dynamically adjusted parameter space;
[0116] (5) Gradient accumulation and batch update are performed through the dynamically adjusted parameter space to obtain the incrementally optimized model;
[0117] (6) The incrementally optimized model is processed with a knowledge forgetting suppression mechanism to obtain a balanced representation of new and old knowledge. The real-time data set is then inferred again based on the balanced representation of new and old knowledge to output the target keyboard dynamic information.
[0118] Specifically, a real-time data set is obtained, and online feature extraction is performed on the real-time data set to generate a real-time feature vector. Online feature extraction can include multiple features, such as key press time, key press duration, key press interval, key press sequence, etc. According to the real-time feature vector, forward reasoning is performed through the target information generation model to obtain the initial keyboard dynamic information. Dynamic time warping is performed on the initial keyboard dynamic information to obtain aligned sequence data. Dynamic time warping is a time series alignment algorithm that can find the optimal alignment path between two sequences, thereby minimizing the distance between them. Assume that the initial keyboard dynamic information is , the aligned sequence data is obtained by time warping The formula for time regularization is:
[0119] ;
[0120] in, Indicates and The cumulative distance of elements, Represents the distance function between two elements. Obtain user personalized configuration information and generate user feature embedding based on this information. User personalized configuration information may include user input habits, preference settings, etc., which can be represented by predefined embedding vectors. Feature fusion is performed by aligned sequence data and user feature embedding to obtain personalized enhanced features. Based on the personalized enhanced features, an incremental learning module is designed to obtain an updateable model structure. The incremental learning module allows the model to be updated when new data is received without the need for complete retraining. Assume that the current model parameters are , through incremental learning, the model parameters can be dynamically updated as , so that the model can adapt to new data. The update formula for incremental learning is:
[0121] ;
[0122] in, is the learning rate, is the loss function, Represents the gradient of the loss function. Perform elastic weight integration on the updateable model structure to obtain a dynamically adjusted parameter space. Elastic weight integration allows the model to share parameters between different tasks, thereby improving the generalization and adaptability of the model. Gradient accumulation and batch update are performed through the dynamically adjusted parameter space to obtain an incrementally optimized model. The purpose of gradient accumulation is to accumulate gradients in each batch and update parameters after accumulating a certain number, thereby simulating the effect of large-scale training. The formula for batch update is:
[0123] ;
[0124] in, is the batch size, is the cumulative gradient. The knowledge forgetting suppression mechanism is applied to the incrementally optimized model to obtain a balanced representation of new and old knowledge. The knowledge forgetting suppression mechanism can retain old knowledge as much as possible when learning new knowledge to prevent the model from forgetting. Knowledge forgetting suppression can be achieved by adding a regularization term:
[0125] ;
[0126] in, is the regularization coefficient, is the parameter of the old knowledge. According to the representation of the balanced new and old knowledge, the real-time data set is re-reasoned to output the target keyboard dynamic information. Through these steps, the model can effectively learn new knowledge while maintaining the old knowledge and generate high-quality keyboard dynamic information.
[0127] The above describes the keyboard dynamic information generation method based on deep learning in the embodiment of the present application. The following describes the keyboard dynamic information generation system based on deep learning in the embodiment of the present application. Figure 2 In the embodiment of the present application, an embodiment of a keyboard dynamic information generation system based on deep learning includes:
[0128] The acquisition module 201 is used to acquire the original data set input by the user's keyboard, and perform feature extraction and vector mapping on the original data set to obtain a semantic feature vector;
[0129] A training module 202 is used to input the semantic feature vector into a multi-layer recursive attention network for iterative training and adversarial learning to obtain an initial information generation model, and calculate a model optimization index of the initial information generation model;
[0130] The processing module 203 is used to perform structural pruning and knowledge distillation on the initial information generation model according to the model optimization index and the keyboard input environment information to obtain the target information generation model;
[0131] The output module 204 is used to obtain a real-time data set, output the initial keyboard dynamic information through a target information generation model, perform incremental learning and elastic weight integration on the initial keyboard dynamic information and user personalized configuration information, and output the target keyboard dynamic information.
[0132] Through the collaboration of the above components, the user's input features are fully captured by acquiring multi-dimensional data such as key press time, release time, encoding, speed and interval. The adaptive length sliding window and multi-scale time-frequency analysis can flexibly process input sequences of different lengths and capture multi-scale time and frequency features. Combining word embedding technology and time-frequency features, the effective fusion of semantic information and dynamic features is achieved. The multi-layer recursive attention network structure can capture long-term dependencies. At the same time, the self-attention mechanism highlights important information and improves the model's perception of key features. The adversarial sample generator is introduced to improve the robustness and generalization ability of the model through alternating optimization of the generator and the discriminator. A comprehensive evaluation function is used to comprehensively evaluate the output quality of the model. Combined with sensitivity analysis and progressive pruning, the adaptive compression of the network structure is achieved, reducing the computational complexity while maintaining performance. Knowledge transfer is carried out through the teacher-student network architecture, and combined with quantization-aware training, the lightweight and efficient deployment of the model is achieved. The keyboard input environment information is integrated, and the model is adaptively adjusted to different input environments through conditional batch normalization. Design incremental learning modules and knowledge forgetting suppression mechanisms to enable the model to continuously learn new knowledge while maintaining memory of learned information. Introduce user personalized configuration information, and achieve personalized adaptation to different user input habits through feature fusion and elastic weight integration. Through dynamic time warping and real-time feature extraction, combined with incremental optimization models, real-time generation and continuous optimization of keyboard dynamic information can be achieved.
[0133] The present application also provides a keyboard dynamic information generation device based on deep learning, and the keyboard dynamic information generation device based on deep learning includes a memory and a processor, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the steps of the keyboard dynamic information generation method based on deep learning in the above-mentioned embodiments.
[0134] The present application also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the method for generating keyboard dynamic information based on deep learning.
[0135] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0136] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0137] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating keyboard dynamic information based on deep learning, characterized in that: The method comprises: The original data set of user keyboard input is obtained, and feature extraction and vector mapping are performed on the original data set to obtain a semantic feature vector; specifically, the method includes: real-time monitoring of keyboard input events to obtain an original input stream, and time stamp recording of each key event according to the original input stream to obtain a key time series and a release time series; difference calculation of the key time series and the release time series to obtain a key duration series; numbering the key codes according to the occurrence order of the key events to obtain an ordered key code sequence, and difference calculation of the timestamps of adjacent key events to obtain a key interval series; calculating the input speed according to the key interval series and the number of keys to obtain a dynamic input speed series, and performing statistical analysis on the key duration series to obtain a key force estimation value; counting the same characters input continuously according to the ordered key code sequence to obtain a repeated key pattern series; combining the key time series, the release time series, the ordered key code series, the dynamic input speed series, the key interval series and the key number series to obtain a dynamic input speed series; and performing statistical analysis on the key duration series to obtain a key force estimation value. The sequence, the key interval sequence, the key force estimation value and the repeated key pattern sequence are structured and integrated to obtain the original data set; the original data set is subjected to adaptive length sliding window analysis to obtain a variable length data segment sequence, and each segment is subjected to fast Fourier transform according to the variable length data segment sequence to obtain a frequency domain feature matrix; the frequency domain feature matrix is subjected to wavelet decomposition to obtain a multi-scale time-frequency feature representation, and a principal component analysis is performed according to the multi-scale time-frequency feature representation to obtain a reduced dimension feature vector; the reduced dimension feature vector is subjected to kernel density estimation to obtain a probability distribution feature, and the original data set is resampled according to the probability distribution feature to obtain an enhanced data set; the enhanced data set is subjected to word vector processing to obtain an initial word vector representation, and a word embedding analysis is performed according to the initial word vector representation to obtain a word embedding vector; the word embedding vector is subjected to feature compression to obtain a compressed semantic feature, and feature fusion is performed according to the compressed semantic feature and the multi-scale time-frequency feature representation to obtain a semantic feature vector; Inputting the semantic feature vector into a multi-layer recursive attention network for iterative training and adversarial learning to obtain an initial information generation model, and calculating a model optimization index of the initial information generation model; According to the model optimization index and keyboard input environment information, the initial information generation model is subjected to structural pruning and knowledge distillation to obtain a target information generation model; A real-time data set is acquired, initial keyboard dynamic information is output through a target information generation model, and incremental learning and elastic weight integration are performed on the initial keyboard dynamic information and user personalized configuration information to output target keyboard dynamic information.
2. The method for generating keyboard dynamic information based on deep learning according to claim 1, characterized in that: The step of inputting the semantic feature vector into a multi-layer recursive attention network for iterative training and adversarial learning to obtain an initial information generation model, and calculating a model optimization index of the initial information generation model includes: Normalizing the semantic feature vector to obtain standardized input data, and constructing a multi-layer recursive neural network based on the standardized input data to obtain a basic network model; Applying a self-attention mechanism to each layer of the basic network model to obtain an attention-enhanced network structure, and designing residual connections based on the attention-enhanced network structure to obtain a deep trainable recursive attention network; Dynamically adjusting the learning rate of the recursive attention network to obtain an adaptive learning strategy, and performing forward propagation and reverse gradient update on the recursive attention network according to the adaptive learning strategy to obtain an initial training model; An adversarial sample generator is introduced into the initial training model to obtain an adversarial learning framework, and the generator and the discriminator are alternately optimized according to the adversarial learning framework to obtain an adversarially enhanced model; Performing integrated learning on the adversarial enhanced model to obtain a multi-model fusion structure, and performing cross-validation and early stopping strategy according to the multi-model fusion structure to obtain an initial information generation model; The initial information generation model is subjected to random sampling and rule post-processing to obtain a model optimization index.
3. The method for generating keyboard dynamic information based on deep learning according to claim 2, characterized in that: The random sampling and rule post-processing of the initial information generation model to obtain the model optimization index includes: Randomly sampling the initial information generation model to obtain multiple groups of candidate output sequences, and calculating sequence entropy values according to the multiple groups of candidate output sequences to obtain a diversity evaluation index; Processing the multiple groups of candidate output sequences through an n-gram language model to obtain language fluency scores; sorting the multiple groups of candidate output sequences according to the language fluency scores to obtain a target output sequence set, and performing rule-based post-processing on the target output sequence set to obtain a grammatically corrected sequence set; Calculating the edit distance between the grammatically corrected sequence set and the original input to obtain a similarity index, and performing sentiment analysis on the grammatically corrected sequence set to obtain a sentiment consistency score; Constructing a multi-objective optimization function according to the similarity index and the sentiment consistency score to obtain a comprehensive evaluation index, and performing adaptive threshold screening on the comprehensive evaluation index to obtain an optimized output sequence; According to the difference between the optimized output sequence and the output of the initial information generation model, the adjustment gradient of the initial information generation model is calculated to obtain a model optimization index.
4. The method for generating keyboard dynamic information based on deep learning according to claim 1, characterized in that: The method of performing structural pruning and knowledge distillation on the initial information generation model according to the model optimization index and the keyboard input environment information to obtain a target information generation model includes: Performing sensitivity analysis on the model optimization index to obtain an importance score, and performing progressive pruning processing on the initial information generation model according to the importance score to obtain a sparse network structure; Re-parameterizing the sparse network structure to obtain compressed model parameters; Acquire keyboard input environment information, and perform feature extraction and feature encoding on the keyboard input environment information to obtain an environment feature vector; Performing conditional batch normalization on the compressed model parameters and the environmental feature vector to obtain an adaptive model structure; Designing a teacher network and a student network according to the adaptive model structure to obtain a knowledge distillation framework, and performing soft label transfer on the knowledge distillation framework to obtain a knowledge transfer loss function; Optimizing and training the student network according to the knowledge transfer loss function to obtain a preliminary distillation model, and performing quantization-aware training on the preliminary distillation model to obtain a low-bit weight representation; The initial information generation model is compared and verified according to the low bit weight representation to obtain a target information generation model.
5. The method for generating keyboard dynamic information based on deep learning according to claim 1, characterized in that: The real-time data set is acquired, initial keyboard dynamic information is output through a target information generation model, and incremental learning and elastic weight integration are performed on the initial keyboard dynamic information and user personalized configuration information to output target keyboard dynamic information, including: Acquire a real-time data set, and perform online feature extraction on the real-time data set to obtain a real-time feature vector; According to the real-time feature vector, forward reasoning is performed through the target information generation model to obtain initial keyboard dynamic information, and dynamic time warping is performed on the initial keyboard dynamic information to obtain aligned sequence data; Acquire user personalized configuration information, generate user feature embedding according to the user personalized configuration information, and perform feature fusion on the aligned sequence data and the user feature embedding to obtain personalized enhanced features; Designing an incremental learning module according to the personalized enhancement features to obtain an updateable model structure, and elastically integrating weights of the updateable model structure to obtain a dynamically adjusted parameter space; Gradient accumulation and batch update are performed through the dynamically adjusted parameter space to obtain an incrementally optimized model; The incrementally optimized model is processed with a knowledge forgetting suppression mechanism to obtain a representation of balanced new and old knowledge, and the real-time data set is reasoned again based on the representation of balanced new and old knowledge to output target keyboard dynamic information.
6. A keyboard dynamic information generation system based on deep learning, characterized in that: Used to execute the keyboard dynamic information generation method based on deep learning according to any one of claims 1-5, the system comprises: The acquisition module is used to acquire the original data set of user keyboard input, and perform feature extraction and vector mapping on the original data set to obtain a semantic feature vector; specifically comprising: real-time monitoring of keyboard input events to obtain an original input stream, and time-stamp recording of each key event according to the original input stream to obtain a key time sequence and a release time sequence; performing difference calculation on the key time sequence and the release time sequence to obtain a key duration sequence; numbering key codes according to the occurrence order of the key events to obtain an ordered key code sequence, and performing difference calculation on the timestamps of adjacent key events to obtain a key interval sequence; calculating the input speed according to the key interval sequence and the number of keys to obtain a dynamic input speed sequence, and performing statistical analysis on the key duration sequence to obtain a key force estimation value; counting the same characters input continuously according to the ordered key code sequence to obtain a repeated key pattern sequence; combining the key time sequence, the release time sequence, the ordered key code sequence, the dynamic input The input speed sequence, the key interval sequence, the key force estimation value and the repeated key pattern sequence are structured and integrated to obtain an original data set; the original data set is subjected to adaptive length sliding window analysis to obtain a variable length data segment sequence, and each segment is subjected to fast Fourier transform according to the variable length data segment sequence to obtain a frequency domain feature matrix; the frequency domain feature matrix is subjected to wavelet decomposition to obtain a multi-scale time-frequency feature representation, and a principal component analysis is performed according to the multi-scale time-frequency feature representation to obtain a reduced dimension feature vector; the reduced dimension feature vector is subjected to kernel density estimation to obtain a probability distribution feature, and the original data set is resampled according to the probability distribution feature to obtain an enhanced data set; the enhanced data set is subjected to word vector processing to obtain an initial word vector representation, and a word embedding analysis is performed according to the initial word vector representation to obtain a word embedding vector; the word embedding vector is subjected to feature compression to obtain a compressed semantic feature, and feature fusion is performed according to the compressed semantic feature and the multi-scale time-frequency feature representation to obtain a semantic feature vector; A training module, used for inputting the semantic feature vector into a multi-layer recursive attention network for iterative training and adversarial learning to obtain an initial information generation model, and calculating a model optimization index of the initial information generation model; A processing module, used to perform structural pruning and knowledge distillation on the initial information generation model according to the model optimization index and keyboard input environment information to obtain a target information generation model; The output module is used to obtain a real-time data set, output initial keyboard dynamic information through a target information generation model, perform incremental learning and elastic weight integration on the initial keyboard dynamic information and user personalized configuration information, and output target keyboard dynamic information.
7. A keyboard dynamic information generation device based on deep learning, characterized in that: The keyboard dynamic information generation device based on deep learning includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor calls the instructions in the memory so that the deep learning-based keyboard dynamic information generation device executes the deep learning-based keyboard dynamic information generation method as described in any one of claims 1-5.
8. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the method for generating keyboard dynamic information based on deep learning as described in any one of claims 1-5 is implemented.
