Model construction method, alertness assessment method, device, equipment and product

By constructing sliding window segment data based on ECG sample data and reaction time sample data, the alertness assessment model is trained, which solves the problem of insufficient sensitivity and accuracy of alertness assessment in the existing technology and achieves more efficient alertness. monitor.

CN118312883BActive Publication Date: 2024-08-23SOUTH CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410726882.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-08-23
Estimated Expiration
2044-06-06

AI Technical Summary

Technical Problem

Existing ECG-based alertness assessment technology has problems such as insufficient sensitivity to short-term alertness changes and high subjectivity of training labels, which affects its accuracy and real-time performance.

Method used

By acquiring ECG sample data and reaction time sample data based on a preset sliding window, extracting segment data, and determining the true alertness category based on the reaction duration of the reaction time sample segment, the preset alertness assessment network is trained to build a high-precision Alertness assessment model.

Benefits of technology

The accuracy and real-time performance of the alertness assessment model are improved, short-term alertness fluctuations can be captured more accurately, and the sensitivity and objectivity of alertness assessment are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118312883B
    Figure CN118312883B
Patent Text Reader

Abstract

The present application proposes a model construction method, alertness assessment method, device, equipment and product. The model construction method includes: obtaining alertness sample data, the alertness sample data includes ECG sample segments and reaction time sample segments obtained by extracting segment data from ECG sample data and reaction time sample data based on a preset sliding window; determining the real alertness category corresponding to the reaction time sample segment based on the reaction time corresponding to the reaction time sample segment; using a preset alertness assessment network to conduct alertness assessment on the ECG sample segment to obtain the predicted alertness category corresponding to the ECG sample segment; based on the difference between the predicted alertness category corresponding to the ECG sample segment and the real alertness category corresponding to the reaction time sample segment, converging the preset alertness assessment network to obtain an alertness assessment model. The alertness assessment model trained by the above scheme can improve the accuracy and real-time performance of alertness assessment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of alertness assessment, and in particular to a model construction method, alertness assessment method, device, equipment and product. Background Art

[0002] Alertness refers to an individual's ability to maintain attention on a specific target and respond in a timely manner, and is the basis of a variety of complex cognitive activities. When alertness is low, it is easy to cause problems such as drowsiness and distraction, which in turn lead to production safety accidents and traffic accidents. Therefore, it is very important to monitor the alertness of individuals.

[0003] In today's society, people's work and study pressures are increasing, and entertainment methods are diversified, leading to widespread problems such as staying up late and lack of sleep. This directly affects the individual's daytime alertness, causing drowsiness and distraction, and increasing the risk of production safety accidents and traffic accidents. In order to solve this problem, people have begun to pay attention to alertness assessment methods based on machine learning.

[0004] As the demand for alertness monitoring increases in various fields, alertness assessment methods based on machine learning have gained widespread attention. These methods assess alertness by training alertness prediction models. However, the training labels of current alertness assessment models are usually derived from self-assessment scales, which are highly subjective, resulting in baseline errors in the trained models, which in turn affects the accuracy of alertness assessment. In addition, they are not sensitive enough to short-term changes in alertness, resulting in low real-time performance of alertness assessment. Summary of the invention

[0005] Based on the above technical status, this application proposes a model construction method, alertness assessment method, device, equipment and product.

[0006] In order to achieve the above technical objectives, this application specifically proposes the following technical solutions:

[0007] In a first aspect, the present application proposes a method for constructing an alertness assessment model, comprising: obtaining alertness sample data, the alertness sample data comprising ECG sample segments and reaction time sample segments obtained by extracting segment data from ECG sample data and reaction time sample data based on a preset sliding window, the reaction time sample segments comprising reaction durations reflecting alertness; determining a real alertness category corresponding to the reaction time sample segments based on the reaction durations corresponding to the reaction time sample segments; and training a preset alertness assessment network based on the real alertness categories corresponding to the ECG sample segments and the reaction time sample segments to obtain an alertness assessment model.

[0008] The second aspect of the present application proposes an alertness assessment method, comprising: obtaining target ECG data of a target user; extracting segment data of the target ECG data based on a preset sliding window to obtain at least one target ECG segment corresponding to the target ECG data; using an alertness assessment model to perform alertness assessment based on at least one of the target ECG segments to obtain an alertness assessment result, the alertness assessment result including a segment alertness assessment result for each target ECG segment output at each interval of a preset duration, wherein the preset duration is a preset step length of the sliding window; wherein the alertness assessment model is a model obtained by using the method for constructing the alertness model described in the first aspect.

[0009] In a third aspect, the present application proposes a device for constructing an alertness assessment model, comprising: an acquisition unit, used to acquire alertness sample data, the alertness sample data comprising ECG sample segments and reaction time sample segments obtained by extracting segment data from ECG sample data and reaction time sample data based on a preset sliding window, the reaction time sample segments comprising a reaction time reflecting alertness; an alertness category determination unit, used to determine a real alertness category corresponding to the reaction time sample segment based on the reaction time corresponding to the reaction time sample segment; using a preset alertness assessment network to perform alertness assessment on the ECG sample segment to obtain a predicted alertness category corresponding to the ECG sample segment; an alertness training unit, used to converge the preset alertness assessment network based on the difference between the predicted alertness category corresponding to the ECG sample segment and the real alertness category corresponding to the reaction time sample segment to obtain an alertness assessment model.

[0010] The fourth aspect of the present application proposes an alertness assessment device, comprising: an acquisition unit, used to acquire target ECG data of a target user; a segment data extraction unit, used to extract segment data of the target ECG data based on a preset sliding window, and obtain at least one target ECG segment corresponding to the target ECG data; an alertness assessment unit, used to perform alertness assessment based on at least one of the target ECG segments using an alertness assessment model, and obtain an alertness assessment result, wherein the alertness assessment result includes a segment alertness assessment result for each of the target ECG segments output at each preset time interval; wherein the alertness assessment model is a model obtained by using the method for constructing the alertness model described in the second aspect.

[0011] In a fifth aspect, the present application proposes an electronic device, comprising a memory and a processor; the memory is connected to the processor and is used to store programs; the processor is used to implement the method for constructing an alertness assessment model described in the first aspect and any one of the implementation methods of the first aspect, or implement the alertness assessment method proposed in the second aspect, by running the program in the memory.

[0012] In a sixth aspect, the present application proposes a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for constructing an alertness assessment model as described in the first aspect and any one of the implementation methods of the first aspect is implemented, or the alertness assessment method proposed in the second aspect is implemented.

[0013] In a seventh aspect, the present application proposes a computer program product, comprising computer program instructions, which, when executed by a processor, enable the processor to implement the method for constructing an alertness assessment model as described in the first aspect and any one of the implementation methods of the first aspect, or implement the alertness assessment method proposed in the second aspect.

[0014] In the technical solutions of the model construction method, alertness assessment method, device, equipment and product proposed in the present application, in the model construction method, on the one hand, since the alertness sample data includes the extraction of fragment data from the electrocardiogram sample data and the reaction time sample data through a preset sliding window, and the alertness category corresponding to the reaction time sample segment is determined based on the reaction time of the reaction time sample segment corresponding to the reaction time sample data, the identification of the alertness category can be subdivided into each fragment data, and the short-term fluctuation of alertness can be captured, thereby improving the accuracy of the alertness category of the reaction time sample data, and the alertness assessment model obtained based on its training can also improve the real-time performance of the alertness assessment model when performing alertness assessment; on the other hand, the reaction time sample data included in the alertness sample data can more objectively express the different mental states of the user, and the objective alertness corresponding to the electrocardiogram sample data is determined based on the objective reaction time sample data, and used for the training of the alertness assessment model, which can make the trained alertness assessment model more accurate in alertness assessment. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0016] Figure 1 A flowchart of a method for constructing an alertness assessment model provided in an embodiment of the present application.

[0017] Figure 2 A schematic diagram of the test process of the PVT test task provided in an embodiment of the present application.

[0018] Figure 3 A schematic diagram of the clustering results provided in an embodiment of the present application.

[0019] Figure 4 A schematic diagram of a process for determining target heart rate variability sample characteristics provided in an embodiment of the present application.

[0020] Figure 5 A schematic diagram of a process for determining heart rate variability characteristics provided in an embodiment of the present application.

[0021] Figure 6 A schematic diagram of the principle of the backtracking judgment mechanism provided in an embodiment of the present application.

[0022] Figure 7 A pattern diagram of target heart rate variability sample characteristics provided in an embodiment of the present application.

[0023] Figure 8 A schematic diagram of a flow chart of a method for assessing alertness provided in an embodiment of the present application.

[0024] Fig. 9 A framework diagram of a real-time alertness assessment method based on sliding window electrocardiogram analysis provided in an embodiment of the present application.

[0025] Fig.10 A schematic diagram of the structure of a device for constructing an alertness assessment model provided in an embodiment of the present application.

[0026] Fig.11 A schematic diagram of the structure of the alertness assessment device provided in an embodiment of the present application.

[0027] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The technical solution proposed in the embodiment of the present application is suitable for alertness assessment application scenarios. By adopting the technical solution of the embodiment of the present application, the accuracy of constructing the alertness assessment model can be improved, thereby improving the accuracy of the alertness assessment.

[0029] At present, alertness assessment methods based on physiological signals such as EEG and ECG or facial features have attracted much attention. Among them, ECG-based alertness monitoring has the advantages of accuracy and convenience. Since ECG characteristics are closely related to alertness, functional changes of the autonomic nervous system under different states can be directly reflected in the heart rate. For example, when the physiological arousal level or alertness is high, the sympathetic nerves play a leading role, causing the heart rate to rise; and when the human body is in a sleepy state, the parasympathetic nerves are activated to slow down the heartbeat activity and increase the heart rate variability. Since the prefrontal lobe of the central nervous system and the vagus nerve of the peripheral nervous system have structural and functional connections, this "brain-heart" interaction mechanism also causes the heart activity to be affected by the activity of the cerebral cortex at the same time, which can indirectly reflect the changes in the alertness of the central system. Therefore, ECG monitoring technology can accurately reflect the changes in individual alertness.

[0030] However, there are still some problems with the current ECG-based alertness assessment technology. First, the existing methods take a long time to extract and calculate heart rate features, while fluctuations in individual attention may occur within a dozen seconds. Therefore, the existing methods are not sensitive enough to such state fluctuations and cannot provide timely feedback on the problem of decreased alertness. Secondly, the training labels of existing alertness prediction models usually rely on subjective self-assessment scales, which are easily affected by individual differences and emotions, resulting in errors in the training model, affecting the generalization ability and having a high risk of underreporting.

[0031] In order to solve the above problems, it is necessary to further study and improve the ECG-based alertness assessment technology to improve its real-time and accuracy, so as to better apply it to the fields of production safety and transportation to ensure task performance and personal safety.

[0032] Specifically, the embodiment of the present application proposes a new method for constructing an alertness assessment model, which aims to train the alertness assessment model through the scheme, thereby improving the alertness assessment accuracy of the alertness assessment model to meet the demand for high-precision alertness assessment. In addition, the embodiment of the present application also proposes an alertness assessment method that can improve the accuracy and efficiency of alertness assessment.

[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0034] The present application embodiment first proposes a method for constructing a vigilance assessment model, see Figure 1 As shown, the method includes steps S101 to S103:

[0035] S101. Obtain alertness sample data.

[0036] The alertness sample data includes ECG sample segments and reaction time sample segments obtained by extracting segment data from ECG sample data and reaction time sample data based on a preset sliding window, and the reaction time sample segments include reaction time reflecting alertness. There are many ways to obtain alertness sample data, which can be as follows:

[0037] In some embodiments, obtaining alertness sample data includes: obtaining reaction time sample data and its corresponding ECG sample data; extracting fragment data from the ECG sample data and the reaction time sample data based on a preset sliding window to obtain ECG sample fragments corresponding to the ECG sample data and reaction time sample fragments corresponding to the reaction time sample data.

[0038] In some embodiments, obtaining alertness sample data includes: obtaining reaction sample data and its corresponding ECG sample data, and extracting fragment data from the ECG sample data and the reaction sample data based on a preset sliding window, after obtaining the ECG sample fragments corresponding to the ECG sample data and the reaction sample fragments corresponding to the reaction sample data, storing the ECG sample fragments and the reaction sample fragments, and upon receiving a request for obtaining alertness sample data carrying a storage address, directly obtaining the alertness sample data from the storage area based on the storage address.

[0039] The reaction time sample data and the ECG sample data can be obtained through a vigilance test task, which can include a test task that can evaluate sustained attention performance, such as a mental vigilance motor test (PVT), a continuous performance task (Continuous Performance Task), a sustained attention to response task (Sustained Attention to Response Task, SART), and a gradual-onset continuous performance task (gradCPT).

[0040] Specifically, the above-mentioned alertness test task requires the subject to continuously focus on a specific area, and obtains reaction time sample data based on the reaction time of the subject to a randomly appearing target, and obtains ECG sample data by collecting the subject's ECG signal during the alertness test task through an ECG acquisition device. Optionally, the ECG acquisition device can be an activity watch, a wearable ECG monitoring vest, or a wristband ECG sensor, etc., which can collect ECG signals without interference.

[0041] For example, in the SART task, subjects are asked to respond to a series of numbers, usually by pressing a key to respond to all but one specific number. This test can assess sustained attention and inhibitory control. For example, in the progressive serial performance task, subjects are asked to respond to target and non-target stimuli in a gradually changing sequence of images. The images appear slowly one after another and gradually merge visually, requiring the subject to maintain a high level of attention to distinguish them.

[0042] The subjects can be healthy adults with good sleep quality (Pittsburgh Sleep Quality Index ≤ 7) screened by a professional questionnaire. These subjects can be healthy adults whose basic information is within the preset range, and the basic information may include age, body mass index, and sleep quality index.

[0043] In this embodiment, both the ECG sample data and the reaction time sample data are sample data collected under different mental states. Specifically, the ECG sample data are sample data collected from the subject under different mental states, representing the changes in his heart rate. The reaction time sample data are sample data collected from the subject under different mental states, representing his objective alertness or alertness performance.

[0044] Different mental states can be mental states that characterize the level of alertness of the subject after different sleep states. Different mental states can include a state of adequate sleep and a state of insufficient sleep. For example, compared with 8 hours of normal sleep, the subject will experience more drowsiness and decreased alertness after 24 hours of sleep deprivation or long hours of work. 24 hours of sleep deprivation can amplify the sleep pressure of individuals in daily situations such as staying up late, working shifts, and sleep restriction, induce strong psychological fatigue and alertness fluctuations, and help obtain behavioral samples that are representative of the span of alertness states for individuals from full energy to extreme fatigue.

[0045] This task can obtain the reaction time sample data and ECG sample data of the subjects in different mental states by testing their alertness and recording ECG signals synchronously under different mental states. Among them, 8 hours of normal sleep can be the time period from 23:00 to 7:00, or the time period from 22.30 to 6.30, or other sleep time periods that can ensure a good mental state. The alertness test task is explained below with attached figures and specific examples:

[0046] Figure 2 A schematic diagram of the test process of the PVT test task provided in the embodiment of the present application. Figure 2As shown in the figure, the test duration of this task is 10 minutes. It requires the subject to continuously focus on a specific stimulus (such as a box) and press the button immediately when the target appears (such as the box color changes, the timer appears and starts running seconds). The time interval between the target appearances is random within 2 to 10 seconds, including about 100 trials. Each trial corresponds to a reaction time, and each subject corresponds to a reaction time sample data.

[0047] That is to say, the alertness sample data in this embodiment includes a plurality of reaction time sample data and a plurality of ECG sample data of a plurality of subjects in different mental states. Each subject in a mental state may correspond to a reaction time sample data and an ECG sample data.

[0048] The alertness sample data collected in this embodiment are sample data of the subjects in different mental states, which can more objectively express the alertness state of the subjects during the performance of cognitive tasks. The reaction time sample data can more truly and objectively reflect the current real-time alertness level of the subjects. The alertness category determined thereby is also more objective and more accurate.

[0049] In order to accurately capture short-term fluctuations in objective alertness, after obtaining the reaction time sample data and its ECG sample data, the present embodiment may further use a preset sliding window to extract fragment data from the ECG sample data and the reaction time sample data respectively, thereby obtaining ECG sample fragments corresponding to the ECG sample data, and reaction time sample fragments corresponding to the reaction time sample data.

[0050] It should be noted that the reaction time sample data and the ECG sample data are sample data under different mental states, respectively. Therefore, the preset sliding window is to extract fragment data from the reaction time sample data under different mental states, thereby obtaining reaction time sample fragments under different mental states. And, extract fragment data from the ECG sample data under different mental states, thereby obtaining ECG sample fragments under different mental states. For example, different mental states include a state of sufficient sleep and a state of insufficient sleep, and the reaction time sample fragments under different mental states include a reaction time sample fragment under a state of sufficient sleep and a reaction time sample fragment under a state of insufficient sleep.

[0051] The preset sliding window may be a rectangular window, which corresponds to properties such as a window length W and a sliding step length S. The window length W may be 15-120 seconds, such as 20 seconds, 30 seconds or 60 seconds, etc. The sliding step length S may be 5-20 seconds, such as 5 seconds, 10 seconds, 12 seconds or 15 seconds, etc. When the sliding window acts on the ECG sample data and the reaction time sample data, the segment data is extracted in units of the window length, and the sliding step length S is used as the sliding unit to gradually slide backward on the sequence of the ECG sample data and the reaction time sample data. Each time the sliding window slides backward, segment data of length W can be obtained.

[0052] It is understandable that both ECG sample data and reaction time sample data are sampled data, which have corresponding sampling frequencies. Therefore, the number of sampling points within each window length and each sliding step can be determined based on the window length, sliding step and sampling frequency. For example, for ECG sample data x with a sampling rate of fs, the total number of sampling points within each window length is W*fs; the total number of sampling points corresponding to each sliding step S is S*fs. In order to facilitate the distinction of the extracted fragment data, these fragment data can be recorded in the form of indexes. Specifically, assuming that the starting index of the i-th sliding window is I i , then I i =S*i. Each sliding window W i The corresponding data index is x[I i :I i +W-1].

[0053] Taking ECG sample data as an example, the sampling frequency is 250Hz. Assuming the window length is 30 seconds, each window length includes 7500 sampling points. In other words, the preset sliding window slides forward by one-third of its length each time. For each subject, 58 ECG sample segments and 58 reaction time sample segments can be obtained in a 10-minute test task.

[0054] Among them, the ECG sample data and the reaction time sample data are collected in the same task time period. Therefore, segment data are extracted from the ECG sample data and the reaction time sample data respectively, and the obtained ECG sample segments and reaction time sample segments are also one-to-one corresponding. In other words, for any of the different mental states, the ECG sample data and the reaction time sample data are sequence data in the same time period. The two sequence data are cut into the same number of segment data by sliding windows, and each window length corresponds to one ECG sample segment and one reaction time sample segment.

[0055] Each reaction time sample segment represents the reaction time or reaction speed of the subject to the vigilance task, which can reflect the behavioral reaction time of the subject's objective vigilance.

[0056] Since the subject may have different alertness states in a single mental state, for example, in a state of sufficient sleep, the subject may be in an alert state and a sleepy state, and in a state of insufficient sleep, the subject may also be in an alert state and a sleepy state. Therefore, in some embodiments, the ECG sample data and reaction time sample data may also be sample data collected by the subject in a single mental state.

[0057] In this embodiment, the sliding window technology is used to extract the segment data. In this technical solution, the selection of the preset window length W and the sliding step length S not only ensures that each segment data extraction can obtain sufficient data length to facilitate the analysis of the heart rate variability characteristics, but also ensures the flexibility and coverage of data processing, avoiding the problem of insufficient information caused by too short segment data. Especially when processing ECG signals that rely on longer time series data to obtain robust feature analysis, selecting a window length of 15 to 120 seconds can cover multiple heartbeat cycles, thereby improving the accuracy of extracting heart rate variability features. Taking a sliding step length of 5-20 seconds can allow the system to extract and analyze ECG signals more efficiently, capture subtle changes in ECG features, and thus improve the accuracy of alertness assessment. At the same time, the sliding step length of 5-20 seconds also improves the utilization rate of data in the modeling stage and the time resolution of sampling, so that the alertness assessment model can evaluate alertness under real-time conditions, thereby improving the prediction efficiency and practicality of the entire system.

[0058] The sliding window technology can efficiently process a large number of continuous ECG signals without sacrificing data quality, ensuring that each ECG sample segment can provide sufficient information for subsequent feature analysis and support complex algorithm operations, thereby improving the overall performance and accuracy of the alertness assessment model. In addition, the dynamic window sliding mechanism allows the system to quickly adapt to changes in user status, effectively capture and analyze ECG features under different physiological and psychological states, and enhance the applicability and robustness of the system in a changing environment.

[0059] Continue reading Figure 1 After step S101, the method for constructing the alertness model of this embodiment may further include the following step S102.

[0060] S102: Determine a real alertness category corresponding to the reaction time sample segment based on the reaction time corresponding to the reaction time sample segment.

[0061] As mentioned above, multiple subjects are tested on the alertness task, and multiple reaction time sample data and multiple ECG sample data can be obtained. That is to say, in any state of different mental states, each subject has a reaction time sample data and an ECG sample data corresponding to the state. For example, different mental states include a good sleep state and a lack of sleep state. For each subject, it can correspond to the reaction time sample data and ECG sample data in the good sleep state, and the reaction time sample data and ECG sample data in the lack of sleep state. Unless otherwise specified below, the reaction time sample data and the ECG sample data refer to the sample data in a single state.

[0062] After extracting fragment data from each reaction time sample data based on a preset sliding window, each reaction time sample data may obtain at least one reaction time sample fragment.

[0063] As mentioned above, the window length and sliding step length of the preset sliding window are both greater than the time interval between two adjacent trials. In other words, each reaction time sample segment may include multiple trials. Each trial includes the reaction time of the subject to a randomly appearing target.

[0064] Therefore, step S102 includes: for each reaction time sample segment in multiple reaction time sample segments of each reaction time sample data, determining the mean reaction time of each trial in the reaction time sample segment as the target reaction time corresponding to the reaction time sample segment; for the reaction time sample segments of each subject in different mental states, setting the real alertness category corresponding to the reaction time sample segment with a target reaction time less than a first preset reaction time as the alertness category, and setting the real alertness category corresponding to the reaction time sample segment with a target reaction time greater than a second preset reaction time as the sleepiness category.

[0065] That is to say, in this embodiment, for each reaction time sample segment in multiple reaction time sample segments corresponding to the reaction time sample data of each subject in each mental state, based on the average of the reaction time of each trial in the reaction time sample segment, the target reaction time of the reaction time sample segment is determined; the target reaction time of the reaction time sample segments of each subject in different mental states are merged to obtain the reaction time sample segments of each subject in different mental states; for the reaction time sample segments of each subject in different mental states, the alertness category corresponding to the reaction time sample segment with a target reaction time less than a first preset reaction time is set as the alertness category, and the alertness category corresponding to the reaction time sample segment with a target reaction time greater than a second preset reaction time is set to the sleepiness category.

[0066] There are multiple ways to determine the target reaction time of each reaction time sample segment, which can be specifically as follows:

[0067] In some embodiments, based on the average reaction time of each trial in the reaction time sample segment, determining the target reaction time of the reaction time sample segment includes: for each reaction time sample segment in the reaction time sample segment, determining the average reaction time of each trial in the reaction time sample segment, and determining the average as the target reaction time of the reaction time sample segment.

[0068] Each trial in the reaction time sample segment is recorded as N trials, and the reaction time of the N trials is recorded as {RT1, RT2, RT3, ..., RT N}, then the mean reaction time of each trial is It can be determined using the following formula:

[0069] ;

[0070] Where i is the trial number; N is the total number of trials; RTi is the reaction time corresponding to the i-th trial.

[0071] It should be noted that, after determining the target reaction time of each reaction time sample segment, this embodiment needs to merge the reaction time sample segments of each subject under different mental states to form a reaction time distribution at the individual level, and then set the alertness category based on the reaction time distribution at the individual level.

[0072] In some embodiments, after obtaining the reaction time distribution at the individual level, the reaction time distribution at the individual level can also be processed to eliminate the dimensionality effect, and the reaction time after the dimensionality elimination process is used as the target reaction time of the reaction time sample segment, so that the modeled sample is more in line with the actual alertness. Among them, the process of eliminating the dimensionality effect includes normalization, standardization or Z score conversion, etc. Taking normalization as an example, the normalization process can be expressed as the following formula:

[0073] ;

[0074] In the formula, represents the normalized result, i.e., the target reaction time; It represents the maximum reaction time after merging the reaction time sample segments of each subject in different mental states; It represents the minimum reaction time after merging the reaction time sample segments of each subject in different mental states.

[0075] In this embodiment, the purpose of normalization is to reduce the differences in the reaction time feature space of the reaction time sample segments of each subject under different mental states, thereby reducing the impact on the subsequent determination of alertness, and further reducing the impact on the accuracy of model training.

[0076] Among them, each subject includes multiple reaction time sample segments under different mental states, and based on the target reaction time corresponding to the reaction time sample segments of each subject under different mental states, the alertness category is set for the reaction time sample segment, including: for each subject under multiple reaction time sample segments under different mental states, determining that among the reaction time sample segments, a reaction time sample segment with a target reaction time less than a first preset reaction time is a first reaction time sample segment; and determining that among the reaction time sample segments, a reaction time sample segment with a target reaction time greater than a second preset reaction time is a second reaction time sample segment; setting the alertness category corresponding to the first reaction time sample segment to the alertness category, and setting the alertness category corresponding to the second reaction time sample segment to the sleepiness category.

[0077] There are many implementation methods for determining the first reaction time sample fragment and the second reaction time sample fragment, which may be specifically as follows:

[0078] In some embodiments, determining a first reaction time sample segment and a second reaction time sample segment includes: clustering the target reaction times of the reaction time sample segments of each subject under different mental states using a clustering algorithm to obtain clustering results; and determining the first reaction time sample segment and the second reaction time sample segment based on the clustering results.

[0079] Taking the K-means clustering algorithm as an example, the specific implementation process of clustering can be as follows:

[0080] a1) Randomly select K target reaction times as the initial centroids {C1, C2, ...C k}, the K centroids are used as the center points of the K clusters to be established, and the value range of K is 2-10.

[0081] a2) When traversing the remaining target reactions, calculate their Euclidean distances to the K centroids and assign them to the cluster with the centroid with the minimum Euclidean distance.

[0082] a3) Update the centroid of each cluster and repeat the above steps a1) and a2) until the centroid and cluster no longer change or the maximum number of iterations is reached, and the clustering result is obtained.

[0083] a4) Based on the clustering results, determine the error square sum SSE (error square sum) under different clustering K values, and determine the optimal number of clusters and classification threshold accordingly. The determination process of SSE is as follows:

[0084] ;

[0085] In the formula, C K represents the Kth cluster; x i represents the reaction time of the i-th target in the K-th cluster; u kis the centroid of the Kth cluster.

[0086] It should be noted that in order to ensure that the final number of clusters is consistent with the number of alertness categories, this can be achieved by pre-setting the number of clusters, or after obtaining the number of clusters, the reaction time sample segment corresponding to the smallest classification threshold is used as the first reaction time sample segment, and the reaction time sample segment corresponding to the largest classification threshold is used as the second reaction time sample segment. Optionally, the reaction time sample segments corresponding to the remaining reaction time sample segments can also be used as the third reaction time sample segment. Among them, the alertness category corresponding to the first reaction time sample segment is the alertness category, the alertness category corresponding to the second reaction time sample segment is the sleepiness category, and the alertness category corresponding to the third reaction time sample segment is the general state category. The implementation process is explained below with reference to the accompanying drawings:

[0087] Figure 3 Schematic diagram of clustering results provided in the embodiment of the present application. Figure 3 As shown, assuming that the optimal number of clusters is 3, the first classification threshold and the second classification threshold are 0.399 and 0.597 respectively, which means that the proportions of different alertness categories in the entire sample data are 39.85%, 19.80% and 40.35% respectively, which correspond to the alertness category with higher alertness (reaction speed is roughly in the top 40% of the overall performance level), the intermediate state category with average alertness (reaction speed is 40%~60% of the individual's overall performance level), and the drowsiness category with low alertness (reaction speed is roughly in the bottom 40% of the individual's total level).

[0088] Based on this, the clustering results of reaction time sample segments with higher alertness can be determined as reaction time sample segments with target reaction time less than the first preset reaction time, and the reaction time sample segments with lower alertness can be determined as reaction time sample segments with target reaction time greater than the second preset reaction time.

[0089] In some embodiments, determining a first reaction time sample segment and a second reaction time sample segment includes: for each subject, sorting the target reaction times of the reaction time sample segments of the subject in different mental states in order from small to large to obtain a sorting result; determining the top M reaction time sample segments in the sorting result as reaction time sample segments with target reaction times less than a first preset reaction time, and determining the bottom N reaction time sample segments in the sorting result as reaction time sample segments with target reaction times greater than the second preset reaction time, where M and N are both positive integers.

[0090] In some embodiments, determining a first reaction time sample segment and a second reaction time sample segment includes: for each subject, sorting the target reaction times of the reaction time sample segments of the subject in different mental states in order from large to small to obtain a sorting result; determining the top N reaction time sample segments in the sorting result as reaction time sample segments with target reaction times greater than the second preset reaction time, and determining the bottom M reaction time sample segments in the sorting result as reaction time sample segments with target reaction times less than the first preset reaction time.

[0091] Among them, the first preset duration and the second preset duration can be determined according to manual experience, for example, the first preset duration and the second preset duration can be set to 323ms and 966ms, 300ms and 900ms, 500ms and 1500ms respectively. The first preset duration and the second preset duration can also be determined based on the classification threshold in the clustering result obtained by the clustering algorithm in the above embodiment, for example, the first preset duration can be determined based on the first classification threshold in the clustering result, and the second preset duration can be determined based on the second classification threshold in the clustering result. In addition, the first preset duration and the second preset duration can also be replaced by the first reaction speed and the second reaction speed. Similarly, the first reaction speed and the second reaction speed can also be determined according to manual experience, for example, the first reaction speed and the second reaction speed can be set to 3.1 times / second and 1.04 times / second respectively. Or the first reaction speed and the second reaction speed are determined based on the reaction speed corresponding to the classification threshold in the clustering result obtained by the clustering algorithm in the above embodiment, and this embodiment does not make specific restrictions on this.

[0092] Continue reading Figure 1 After step S102, the method for constructing the alertness assessment model of this embodiment may further include the following step S103.

[0093] S103: Based on the real alertness categories corresponding to the ECG sample segments and the reaction time sample segments, a preset alertness assessment network is trained to obtain an alertness assessment model.

[0094] In this embodiment, the ECG sample segments are used as training samples, and the real alertness categories corresponding to the reaction time sample segments are used as training labels to train the preset alertness assessment network, thereby obtaining an alertness assessment model. When training the alertness assessment network, it is necessary to determine the target heart rate variability characteristics based on the ECG sample segments, and use the target heart rate variability characteristics to train the alertness assessment network. The process of determining the target heart rate variability characteristics is described in detail below in conjunction with the accompanying drawings:

[0095] Figure 4 A schematic diagram of a process for determining target heart rate variability sample characteristics provided in an embodiment of the present application. Figure 4 As shown, step S103 may include the following steps S401-S403:

[0096] S401, determining a plurality of heart rate variability sample features corresponding to an electrocardiogram sample segment and their corresponding alertness contribution.

[0097] In this embodiment, R wave (i.e., QRS complex wave) can be obtained by performing R wave detection on the ECG sample segment; then, the RR interval sequence corresponding to the ECG sample segment is determined based on the R wave, and multiple heart rate variability sample features corresponding to the ECG sample segment are determined based on the RR interval sequence.

[0098] Among them, determining multiple heart rate variability sample features corresponding to the ECG sample segments can include three parts: initial R wave detection, R wave missed detection, and determining the heart rate variability sample features based on the detection results of the first two. Each part is explained in turn in conjunction with the accompanying drawings:

[0099] In some embodiments, by performing R wave detection on an ECG sample segment, an initial R wave and an initial RR interval sequence corresponding to the ECG sample segment can be obtained. The following is a detailed introduction to the process of determining the characteristics of the heart rate variability sample in conjunction with the accompanying drawings:

[0100] Figure 5 A schematic diagram of a process for determining heart rate variability characteristics provided in an embodiment of the present application. Figure 5 As shown, the R wave detection is performed on the ECG sample segment to obtain the R wave, and the implementation process includes the following steps b1)-b4):

[0101] b1) Filtering.

[0102] The filtering includes: filtering the ECG sample segments to obtain filtered ECG sample segments. The filtering includes denoising and enhancing the R wave signal, which can be specifically referred to in the following steps b11)-b14):

[0103] b11) Denoising.

[0104] Denoising can remove high-frequency noise and baseline drift. In order to effectively capture the frequency characteristics of the R wave, a third-order bandpass filter can be used for filtering, and the cutoff frequency of the filter is 5Hz to 11Hz. The normalized cutoff frequency array is:

[0105] ;

[0106] Where fs is the sampling rate of the ECG sample segment; fs / 2 is the Nyquist frequency.

[0107] The specific filtering formula is: y(n)=filtfilt(a,b,x(n)), where a and b can be obtained through the Butterworth filter design function "butter", specifically: .

[0108] Among them, enhancing the R wave signal includes steps b12) to b14).

[0109] b12) Performing a derivative operation on the filtered ECG sample segment y(n) to highlight the slope of the QRS wave. The formula for the derivative operation is as follows:

[0110]

[0111] b13) After the derivative operation Performing the square operation, we get , to enhance the characteristics of the QRS wave.

[0112] b14) after square Apply a moving average filter to obtain a signal that emphasizes the QRS region :

[0113]

[0114] In this embodiment, a third-order bandpass filter is used to filter the ECG sample segments, which can adapt to short-range ECG sample segments to better filter out the noise signals therein. The bandpass filter range is set to 5-15Hz, which can highly conform to the frequency range corresponding to the QRS wave. The lower limit setting of the filter (5Hz) is intended to attenuate the influence of baseline drift caused by breathing, displacement and other reasons on signal detection. The upper limit setting of the filter (15Hz) is conducive to eliminating biological artifacts caused by 15-30Hz electromyographic activity, and also has a certain attenuation effect on the interference signal caused by high-frequency mains (50Hz). Then, derivative operation, square operation and moving average filter are used to process the filtered ECG sample segments respectively, gradually amplifying and highlighting the QRS wave, so that the characteristics of the QRS wave of the final filtered ECG sample segment are more obvious, so as to facilitate the subsequent QRS wave detection.

[0115] Continue reading Figure 5 After filtering the ECG sample segments, peak detection and initial R wave detection using an adaptive threshold algorithm can be performed, specifically including steps b2) to b3):

[0116] b2) using a peak detection algorithm to perform peak point (PEAK) detection on the filtered ECG sample segment to obtain a peak point corresponding to the filtered ECG sample segment, wherein the peak point corresponds to an amplitude and a peak time.

[0117] Optionally, the findpeaks function of MATLAB can be used to obtain the peak point of the ECG sample segment. The peak point is the local maximum value identified after the ECG sample segment is processed by the above filtering, which represents the possible QRS wave amplitude.

[0118] Due to the physiological refractory period (recovery period after ventricular depolarization) in the ECG signal, the interval between two QRS peaks is usually around 200ms. Therefore, the 'MINPEAKDISTANCE' parameter of the findpeaks function can be set to round(0.2*fs) to ensure that the minimum distance between the detected peak points is 200ms. In other words, if a peak point is detected again within 200 milliseconds after the previous peak point, the re-detected peak point will be considered invalid, thereby avoiding incorrect marking of peak points during the refractory period.

[0119] The peak point detected in this step can be regarded as a candidate R wave. Furthermore, the final R wave (including the initial R wave and the missed R wave described later) can be determined based on the candidate R waves.

[0120] b3) Performing initial R wave detection on the filtered ECG sample segment.

[0121] The QRS wave is the core characteristic wave in the ECG activity that can reflect each heartbeat. Based on the QRS wave, the RR interval corresponding to the ECG sample segment can be determined, and then based on the RR interval, multiple heart rate variability sample features corresponding to the ECG sample segment can be determined.

[0122] Since there may be a relatively large T wave or electromagnetic interference on the ECG sample segment, there may be a noise signal on the ECG sample segment. However, there is an obvious difference between the ECG signal and the noise signal in the peak value. Therefore, this embodiment can determine whether the signal corresponding to each peak point is an ECG signal or a noise signal based on the peak value of each peak point.

[0123] Specifically, the peak points of the filtered ECG sample segment include multiple peak points, and initial R wave detection is performed on the peak points of the filtered ECG sample segment, including: for each peak point among the multiple peak points, if the peak value of the peak point exceeds the signal threshold (THRSIG), the peak point is determined as the initial R wave; if the peak value of the peak point is between the noise threshold (THRNOISE) and the signal threshold (THRSIG), the peak point is determined to be noise.

[0124] Furthermore, when the peak point is determined to be the initial R wave, the signal level (Signal Level, SIGLEV), signal threshold (Signal Threshold, THRSIG) and noise threshold (THRNOISE) at the peak moment may also be updated; and when the peak point is determined to be noise, the noise level (NOISELEV), signal threshold (Signal Threshold, THRSIG) and noise threshold (THRNOISE) at the peak moment may also be updated.

[0125] The following describes the update process of the four parameters corresponding to the peak point:

[0126] The signal level (SIGLEV) of the peak point can be understood as the strength of the ECG signal, which is used to capture the change in the amplitude of the QRS wave in the ECG signal. It is updated according to the newly detected PEAK value. If the new PEAK value exceeds the signal threshold THRSIG, it indicates that the PEAK is a potential QRS wave, so SIGLEV will be adjusted according to the PEAK value to better reflect the current amplitude of the QRS wave. The update process is as follows:

[0127] SIGLEV=k*PEAK+(1-k)*SPKI;

[0128] Wherein, SPKI is the historical signal level, which represents the signal level corresponding to the peak time point of the last detected initial R wave before the current peak point; k is the weight coefficient, which is used to adjust the relative weight of the peak value of the current peak point and the peak value of the historical peak point in the signal area calculation process; the value range of k is between 0.1 and 0.5; the larger the k value, the greater the proportion of the current peak point in the estimation of the signal-to-noise level, and the signal estimation is more sensitive to the current information; the smaller the k value, the greater the proportion of the historical signal level in the estimation of the signal-to-noise level. Therefore, the k value can be set to 0.125.

[0129] The updating process of the noise level (NOISELEV) at the peak point is as follows:

[0130] NOISELEV=k*NOISE+(1-k)*NPKI;

[0131] Where NPKI is the historical noise level, which represents the noise level corresponding to the peak time point of the last detected noise point before the current peak point.

[0132] The signal threshold corresponding to the peak point is used to determine whether a peak point is large enough to distinguish the true QRS wave from other bioelectric noise (such as T wave or electrode interference). The update process is as follows:

[0133] THRSIG=NOISELEV+γ1*(SIGLEV-NOISELEV);

[0134] Wherein, γ1 is the proportional coefficient used to adjust the signal threshold THRSIG. A larger γ1 value will make the signal threshold more sensitive to the fluctuation of the signal level (QRS peak) during dynamic adjustment, which helps to quickly adapt to signal mutations, but may also increase the risk of falsely reporting noise as a signal. A smaller γ1 value will make the threshold adjustment more conservative and reduce the false detection rate, but may cause it to be less sensitive to changes in the ECG signal. Therefore, γ1 can be set to 0.25 to take the above phenomena into account.

[0135] The noise threshold corresponding to the peak point is: THRNOISE=THRSIG*γ2;

[0136] Where γ2 is the proportional coefficient of the noise threshold adjustment, which determines the position of the noise threshold relative to the noise threshold. Only peak points that are significantly higher than the noise level will be determined as possible QRS waves. γ2 can be set to 0.5.

[0137] For example, suppose that 4 peak points are detected, namely P1, P2, P3 and P4, and their peak values ​​are P1=1, P2=1, P3=2, and P4=0.4 respectively. Assume that the historical signal level of the initial R wave corresponding to the moment P1 is 1, the historical noise level is 0.2, the signal threshold is 0.4, and the noise threshold is 0.1. At this time, the PEAK2 corresponding to the next moment P2 is judged to be the initial R wave signal (abbreviated as R2) because the peak value is 1, which exceeds the signal threshold of 0.4. Then the signal level will be updated to SIGLEV==0.125*1+(1-0.125)*1=1; when the next initial R wave signal point appears, the SKPI in the formula used to update SIGLEV. At this time, the noise level NOISELEV remains unchanged (still 0.2). The signal threshold is updated to: THRSIG= 0.2+0.25*(1-0.2)=0.4. Next, P3 is judged. Since its peak value is 1, it still exceeds the signal threshold of 0.4, so it is still judged as the initial R wave signal (abbreviated as R3). At this time, the signal level corresponding to P2 is updated to SIGLEV== 0.125*2+(1-0.125)*1=1.125; NOISELEV remains unchanged (still 0.2); the signal threshold is updated to: THRSIG= 0.2+0.25*(1.125-0.2)=0.43125. Then when P4 is judged, since its peak value is 0.4, it does not exceed the signal threshold of 0.43125, so it is judged as noise. At this time, the signal level still maintains 1.125 corresponding to the previous R wave time point. The noise level needs to be updated to: NOISELEV= 0.125*0.4+0.875*0.2=0.225. Assuming that there is P5 later, if it is judged as a signal, when the signal level is updated, SPKI is still 1.125 corresponding to the P3 moment (because P4 is not a signal, the signal level is not updated, and SPKI is the signal level corresponding to the most recent signal moment). If it is judged as noise, the noise level is updated, and the NPKI in the formula during the update is 0.225 corresponding to the P4 moment (the noise level corresponding to the most recent noise moment).

[0138] Since the peak value of a person's heartbeat is relatively stable over a period of time, this embodiment updates the signal level and noise level of the current peak point based on the historical signal level and the historical noise level, respectively, so that the signal threshold and the noise threshold will not fluctuate greatly. As the number of accumulated R waves increases, the accuracy of R wave detection during this period will also be higher. In ECG signal analysis, especially in short-term monitoring, signals are often affected by a variety of interference factors, such as baseline drift caused by muscle tremor, electrical noise or breathing. This embodiment effectively distinguishes between real QRS waves and interference noise by updating the signal threshold (THRSIG) and the noise threshold (THRNOISE) through real-time monitoring of the signal-to-noise level. This dynamic threshold adjustment strategy allows the ECG monitoring system to respond quickly to sudden signal changes, reduces false detections caused by transient noise, and enhances the system's anti-interference ability.

[0139] By combining real-time updates of signal and noise levels with historical data, it can not only adapt to the continuous changes in individual ECG characteristics, but also effectively suppress environmental interference factors. For example, when the ECG signal is suddenly interfered by external electromagnetic interference, the threshold adjustment mechanism can quickly adjust to prevent the interference from being mistaken for a heartbeat signal, thereby ensuring the accuracy and continuity of ECG analysis.

[0140] Therefore, the dynamic threshold adjustment strategy provided in this embodiment can significantly improve the reliability of short-term ECG monitoring, and is also highly applicable to applications that require ECG monitoring in changing environments, such as in wearable devices used during exercise or outside medical environments.

[0141] In this embodiment, the signal level (SIGLEV), noise level (NOISELEV), signal threshold (THRSIG) and noise threshold (THRNOISE) corresponding to each peak point will be updated in real time so as to be applied to the QRS wave detection of the next peak point. This dynamic adjustment strategy can make R wave detection better adapt to the rapid changes of ECG signals in a short time window.

[0142] It should be noted that, for the first peak point of the ECG sample segment, the signal threshold of the first peak point can be determined based on the first preset multiple of the maximum peak value within the first preset duration at the start of the ECG sample segment. Taking the first preset duration as 2 seconds and the first preset multiple as 1 / 3 as an example, the signal threshold of the first peak point is It can be expressed as the following formula:

[0143] ;

[0144] And, the noise threshold of the first peak point is determined based on the second preset multiple of the peak value average value of all peak points within the second preset time length of the signal start time of the ECG sample segment. Taking the second preset time length as 2 seconds and the second preset multiple as 1 / 2 as an example, the noise threshold of the first peak point is It can be expressed as the following formula:

[0145] ;

[0146] Continue reading Figure 5 , after step b3), it may further include step b4):

[0147] b4) performing R wave missed detection on the ECG sample segment after the initial R wave detection, and determining the missed R waves in the ECG sample segment.

[0148] In this embodiment, R wave missed detection is performed on the ECG sample segment after the initial R wave detection to determine the missed R wave in the ECG sample segment, including: determining the retrospective time period of the ECG sample segment; performing R wave missed detection based on the peak point of the ECG sample segment in the retrospective time period to obtain the missed R wave corresponding to the ECG sample segment.

[0149] Among them, determining the retrospective time period of the ECG sample segment includes: determining a time period of a preset length after the first initial RR interval of the ECG sample segment, or a time period of a preset multiple of the average value of the previous initial R wave detection moment to the currently detected initial RR interval as the retrospective time period of the ECG sample segment.

[0150] In some embodiments, the first initial RR interval can be determined based on the time interval between the first two initial R waves detected in the ECG sample segment. For example, assuming the preset duration is 2 seconds, the 2 seconds after the first initial RR interval of the ECG sample segment is the retrospective time period.

[0151] In some embodiments, it is assumed that the previous initial R wave detection time is T i , the current average of the initial RR intervals detected is RR Mean , the preset multiple is d, then the lookback period is [T i :T i +d*RR Mean ]. Where d can be taken as 1.5.

[0152] Among them, the currently detected initial RR interval mean RR MeanThe initial RR interval mean can be calculated based on all the peak points currently judged as the initial R wave. For example, the initial RR interval mean is calculated starting from the second peak point judged as the initial R wave. If there are two initial R waves currently detected, the initial RR interval mean is the initial RR mean 1 = RR1; if there are three initial R waves currently detected, the initial RR interval mean is RR mean 2 = (RR1 + RR2) / 2 (i.e., the mean of the first two initial RR intervals), and so on, to obtain the current detected initial RR interval mean RR Mean After that, you can use the preset multiple of RR Mean As a lookback time period.

[0153] After determining the retrospective time period of the ECG sample segment, the R wave missed detection can be performed on the ECG sample segment based on the retrospective time period to obtain the missed R wave corresponding to the ECG sample segment. Specifically:

[0154] For the case where the retrospective time period is a time period of preset length after the first initial RR interval, determine the time difference between the current peak point to be traced back and the previous initial R wave; determine the signal neglect period based on the average value of the RR interval corresponding to the initial R wave before the current peak point to be traced back; when it is determined that the time difference is less than the preset time and greater than the signal neglect period, determine whether the current peak point is a missed R wave based on the peak value between the current peak point and the previous initial R wave.

[0155] Among them, the current peak point to be traced back is T i+1 The initial R wave T i The time difference between them is: ∆T=T i+1 -T i .

[0156] In some embodiments, the signal ignoring period is determined based on the average value of the RR interval corresponding to the initial R wave before the current peak point to be traced back, which can be expressed as the following formula:

[0157] ;

[0158] In the formula, is the signal ignoring period; is the adjustment coefficient for the signal ignoring period, which is used to adjust the RR interval average corresponding to the initial R wave before the current peak point. The deviation from 1000ms adjusts the refractory period so that it can be adjusted adaptively according to the speed of the heart rate. Can be set to 0.2.

[0159] Considering that the physiological refractory period may be relatively shorter when the heart rate is faster and relatively longer when the heart rate is slower, and that a second heartbeat will not occur soon after a heartbeat is completed, that is, there will be a certain amount of time between two adjacent heartbeats, therefore, when the signal ignoring period determined by the above formula is applied to R wave missed detection, the accuracy of R wave missed detection can be improved.

[0160] After determining the signal neglect period, it is possible to determine whether the current peak point is a missed R wave based on the peak value of the current peak point and the previous initial R wave when it is determined that the time difference is less than the preset time and greater than the signal neglect period. This process may specifically include the following situations:

[0161] (1) Determine that the time difference is less than a preset time and greater than a signal ignoring period, and that the peak value of the current peak point is greater than a preset multiple of the peak value of the previous initial R wave, and determine that the current peak point is a missed R wave.

[0162] Right now In the case of a missed R wave, the peak value of the current peak point is compared with the peak value of the previous initial R wave. If it is determined that the peak value of the current peak point is greater than a preset multiple of the peak value of the previous initial R wave, the current peak point is determined to be a missed R wave; if it is determined that the peak value of the current peak point is less than or equal to a preset multiple of the peak value of the previous initial R wave, the current peak point is determined to be noise.

[0163] (2) When the time difference is less than or equal to the signal ignoring period, the current peak point pair is determined to be noise.

[0164] Right now In this case, it is determined that the signal corresponding to the current peak point is noise.

[0165] (3) When the time difference is greater than the preset time, the current peak point is determined to be a missed R wave.

[0166] Optionally, the preset time may be 360ms. In this case, the current peak point is determined as a missed R wave.

[0167] It should be noted that when the time difference is equal to the preset time, the current peak point can be determined as a missed R wave, or when it is determined that the time difference is less than or equal to the preset time and greater than the signal ignoring period, and the peak value of the current peak point is greater than a preset multiple of the peak value of the previous initial R wave, the current peak point can be determined as a missed R wave.

[0168] The following is an introduction to the backtracking judgment mechanism in conjunction with the attached drawings:

[0169] Figure 6 The schematic diagram of the principle of the backtracking judgment mechanism provided in the embodiment of the present application. Figure 6As shown in FIG. 1 , firstly, the average value of the existing RR interval sequence is adjusted around 200ms to obtain the signal neglect period; then, an adaptive dual-threshold R wave detection algorithm is used to detect the R wave. Figure 6 It can be seen that the x marked on the peak in the figure represents the peak point judged as the R wave (i.e., signal); after performing R wave detection on the peak point based on the signal threshold and the noise threshold, it can be seen that some peak points have peak values ​​between the signal threshold and the noise threshold (the peak point between 13 seconds and 15 seconds in the figure), and the time interval between the peak points on the left and right sides of the peak point is large. Therefore, this time period can be used as a retrospective time period, and a retrospective judgment mechanism can be used to determine whether it is a missed R wave.

[0170] For details on the backtracking judgment mechanism, please refer to Figure 6 As shown on the right side of the figure, it can be seen that this embodiment performs a backtracking search for the peak point whose peak range is between the current signal threshold and the current noise threshold corresponding to the current peak point (PEAKi). The backtracking judgment process can be as follows:

[0171] When the time interval between the peak point to be traced back (the first peak point after PEAKi in the figure) and PEAKi is less than or equal to the signal ignoring period, it is judged as noise.

[0172] When the time interval between the peak point to be traced back (the second peak point after PEAKi in the figure) and PEAKi is greater than a preset time, such as 360ms, it is determined to be a missed R wave.

[0173] When the time interval between the peak point to be traced back and PEAKi is greater than the signal ignoring period but less than or equal to the preset time (360ms), it can be further determined whether it is a missed R wave based on the peak value. Specifically, when the peak value PEAK' of the peak point to be traced back is greater than half of the peak value of PEAKi, it is determined to be a missed R wave (R peak signal); when the peak value PEAK' of the peak point to be traced back is less than or equal to half of the peak value of PEAKi, it is determined to be noise.

[0174] After obtaining the initial R wave and the missed R wave corresponding to the ECG sample segment, the RR interval corresponding to the ECG sample segment can be determined based on the initial R wave and the missed R wave, and the corresponding multiple heart rate variability sample features can be determined based on the RR interval.

[0175] The initial R wave and the missed R wave are collectively referred to as the R wave. At this point, the R wave detection is completed.

[0176] Continue reading Figure 5 After completing the R wave detection in step b4), the method may further include steps b5) to b8) to determine the target heart rate variability characteristics:

[0177] b5) RR interval calculation

[0178] Specifically, the RR interval may be determined based on the time difference between two adjacent and continuous R waves.

[0179] b6) Feature calculation

[0180] Specifically, the feature calculation is performed based on the RR interval. The RR interval corresponding to the ECG sample segment is recorded as {RR1, RR2, ...RR N}. Multiple heart rate variability sample features include 8 HRV time domain features and nonlinear features. The 8 HRV time domain features include:

[0181] (1) Average heart rate.

[0182] Specifically, the average heart rate Mean HR can be determined using the following formula: ;

[0183] In the formula, NN i It is the time difference between the peaks of adjacent normal sinus main waves. The NN interval sequence is the RR sequence with abnormal RR interval values ​​removed (usually the standard is to remove the RR intervals that exceed 3 to 4 standard deviations in the RR interval sequence). Therefore, it is called the time difference sequence between normal sinus peaks. In most cases, the NN interval sequence and the RR interval sequence are exactly the same. There may be differences for some individuals with irregular heartbeats.

[0184] (2) Average normal heart rate.

[0185] Specifically, the average normal heartbeat period Mean NN can be determined using the following formula:

[0186] ;

[0187] In the formula, NN i It indicates that the RR intervals outside 4 standard deviations are excluded.

[0188] (3) Standard deviation of normal heart beat interval.

[0189] Specifically, the standard deviation SDNN of normal heartbeat intervals can be determined using the following formula:

[0190] ;

[0191] (4) The root mean square of the difference between adjacent NN intervals.

[0192] The root mean square of the difference between adjacent NN intervals, rMSSD, can be determined using the following formula:

[0193]

[0194] (5) The difference between adjacent NN intervals is greater than 50 ms (NN50).

[0195]

[0196] (6) The proportion of NN50 in the total number of NN intervals.

[0197]

[0198] (7) The variation range of NN interval within the ECG sample segment.

[0199] The variation range of the NN interval within the ECG sample segment can be determined by the following formula: NNmax-min=NNmax-NNmin.

[0200] (8) The range of heart rate variation in the ECG sample segments.

[0201] The variation range of the heart rate in the ECG sample segment can be determined by the following formula: HRmax-min=RRmax-RRmin.

[0202] (9) The nonlinear feature includes the sample entropy reflecting the nonlinear feature of the heart rate change of the ECG sample segment.

[0203]

[0204] In the formula, m represents the embedding dimension, which can be set to 2; r is the tolerance rate for calculating the judgment threshold, which can be set to 0.1.

[0205] Afterwards, the above 9 heart rate variability features are summarized at the individual level to obtain the individual feature matrix. For example, for subject k, its feature matrix Fk can be expressed as:

[0206] ;

[0207] Where J is all ECG sample segments of subject k.

[0208] Continue reading Figure 5 In order to eliminate the dimensional influence between different features, after step b6), step b7) may be used to eliminate the dimensional influence:

[0209] b7) Eliminating dimension processing on the feature matrix of each subject at the individual level to obtain the original feature set. The dimension elimination processing may be to normalize the feature matrix of each subject using a max-min algorithm. Specifically, the normalization processing may be implemented using the following formula:

[0210] ;

[0211] In the formula, Represents the normalized value of the jth feature in the i-th ECG sample segment; is the original value of the jth feature in the i-th ECG sample segment; is the maximum value of the jth feature in all ECG sample segments; The minimum value of the jth feature in all ECG sample segments.

[0212] By merging the normalized feature matrices of all subjects, the heart rate variability features corresponding to multiple ECG sample data can be obtained, that is, the original feature set.

[0213] Continue reading Figure 4 , after step S401, step S402 may also be included.

[0214] S402: based on the alertness contribution corresponding to each of the plurality of heart rate variability features, select a target heart rate variability sample feature whose alertness contribution is greater than a preset contribution from the plurality of heart rate variability features.

[0215] Since the multiple heart rate variability features determined in step S401 have different contributions to alertness recognition, in order to reduce the amount of training data and improve training efficiency, this embodiment can use the LASSO regression model to screen features, thereby obtaining the optimal feature subset (i.e., the target heart rate variability feature). Figure 5 , after step b7), it may further include step b8):

[0216] b8) Feature screening

[0217] The LASSO regression model can be used to determine the alertness contribution corresponding to multiple heart rate variability features, and the target heart rate variability sample features with alertness contribution greater than the preset contribution can be screened out from the multiple heart rate variability features, which can then be applied to subsequent model training. This not only helps reduce the risk of overfitting of the model, but also reduces the amount of training data to improve the training efficiency of the model.

[0218] Specifically, multiple heart rate variability features corresponding to each ECG sample segment and their corresponding alertness categories can be input into the LASSO model, and feature screening can be performed by minimizing the following objective function:

[0219] ;

[0220] Where N is the total number of ECG sample segments of all subjects in different mental states, M is the total number of heart rate variability features of ECG sample segments of all subjects in different mental states; y iis the alertness category of the i-th ECG sample segment; x ij is the characteristic value of the jth heart rate variability feature of the i-th ECG sample segment; β j is the coefficient of the jth heart rate variability feature; λ is the regularization parameter that controls the degree of coefficient compression.

[0221] In the feature screening stage, the regularization parameter λ value can be determined by 20-fold cross validation and 1 standard error (1SE) criterion, aiming to balance the complexity and prediction performance of the model and prevent overfitting while ensuring a small prediction error.

[0222] After determining the optimal λ, the LASSO regression model will automatically perform the feature screening process. It will reduce the coefficients of the heart rate variability features whose contribution to the prediction of alertness is less than the preset contribution to 0. The remaining heart rate variability features with non-zero coefficients are the target heart rate variability features whose contribution to the prediction of alertness is greater than the preset contribution.

[0223] In this embodiment, the target heart rate variability features may include the mean heart rate (Mean HR) of the ECG sample segment, the mean normal heart beat interval (Mean NN), the standard deviation of the normal heart beat interval (SDNN), the root mean square difference between adjacent NN intervals (RMSSD), the range of NN interval variation within the segment (NNmax-min) and the range of heart rate variation (HRmax-min), and the nonlinear domain sample entropy (SampEn) reflecting short-term heart rate variability. These 7 features are the target heart rate variability features for modeling, and their characteristic patterns presented in different mental states are as follows: Figure 7 shown. Figure 7 In the radar chart of the target heart rate variability feature shown in , each point in the radar chart is the average value of each feature under each category according to different alert category labels (3 categories).

[0224] Continue reading Figure 4 , after step S402, the method for constructing the alertness assessment model of this embodiment may further include step S403.

[0225] S403: Use a preset alertness assessment network to perform alertness assessment on the target heart rate variability feature to obtain a predicted alertness category corresponding to the ECG sample segment.

[0226] Specifically, the target heart rate variability feature can be input into a preset alertness assessment network, so that the preset alertness assessment network predicts alertness based on the target heart rate variability feature and outputs the predicted alertness category corresponding to the ECG sample segment.

[0227] Optionally, the preset alertness assessment network can be a support vector machine classifier (SVC), K nearest neighbor (KNN), random forest (RF) and AdaBoost (AB) based on Gaussian kernel. In this embodiment, SVC can be used, which introduces a kernel function when dealing with nonlinear problems. The kernel function can map the target heart rate variability feature from the original feature space to a high-dimensional feature space, so that it can find a linearly separable hyperplane in the high-dimensional feature space, and has a strong assessment ability even for complex data patterns of small sample sets. SVC is an algorithm with high prediction accuracy and high robustness among many machine learning algorithms. It has good generalization ability, can overcome the problems of overfitting and dimensionality disaster, and can further improve the accuracy of alertness assessment.

[0228] Continue reading Figure 4 After step S403, the method for constructing an alertness assessment model of this embodiment may further include step S404.

[0229] S404: Based on the difference between the predicted alertness category corresponding to the ECG sample segment and the actual alertness category corresponding to the reaction time sample segment, converge the preset alertness assessment network to obtain an alertness assessment model.

[0230] Among them, step S404 can be achieved by traversing within a preset model parameter search range, and predicting the alertness of the ECG sample segment under the model parameters corresponding to each traversal result to obtain a predicted alertness category, and then determining the prediction accuracy based on the difference between the predicted alertness category corresponding to the ECG sample segment and the actual alertness category corresponding to the reaction time sample segment, and determining the optimal model parameters based on the prediction accuracy under the model parameters corresponding to each traversal result, thereby achieving convergence of the preset alertness assessment network and obtaining the alertness assessment model.

[0231] Specifically, step S404 may include the following steps c1) to c3):

[0232] c1) Determine a search range for network parameters of a preset alertness assessment network.

[0233] The network parameters include the penalty parameter c and the Gaussian kernel parameter g. The penalty parameter c is used to control the alertness classification error during the training process. The Gaussian kernel parameter g is used to control the feature space distribution of the ECG sample data.

[0234] Optionally, the search range of the penalty parameter is log2c[−8,8]. The search range of the Gaussian kernel parameter g is log2g[−8,8].

[0235] c2) A grid search method based on k-fold cross validation is used to search the search range of network parameters to obtain the target network parameters.

[0236] Taking the grid search method of five-fold cross-validation as an example, the target heart rate variability features of the multiple ECG sample data obtained above are used as sample data sets. After that, the sample data set is divided into five parts, four of which are taken as training sample sets each time, and the remaining one is taken as the test sample set, so that five groups of sample data sets can be obtained. At the same time, the search ranges of the above two network parameters can also be combined. Assuming that the penalty parameter c has U possible values ​​and the Gaussian kernel parameter g has V possible values, the combination parameters can have L=U*V combinations. For each training, four training sample sets in each group of sample data sets are trained based on each combination parameter of the L combination parameters, and the test sample set in the group of sample data sets is used to predict the training effect, and five groups of prediction accuracy are obtained; based on the average value of the five groups of prediction accuracy, the average accuracy corresponding to the group of combination parameters can be obtained.

[0237] After the above process, L average accuracies can be obtained for L combination parameters. Then, the network parameter combination corresponding to the maximum average accuracy can be selected from the L average accuracies as the final target network parameters.

[0238] c3) constructing an alertness assessment model based on target network parameters and target heart rate variability characteristics of multiple ECG sample data, and obtaining a classification decision function f(x) of the model.

[0239] Specifically, an alertness assessment model can be constructed based on the target network parameters, and the target heart rate variability characteristics of multiple ECG sample data can be input into the constructed alertness assessment model for alertness classification, thereby obtaining the model's classification decision function f(x) for the target heart rate variability characteristics of multiple ECG sample data.

[0240] Based on the alertness assessment model trained by the above alertness assessment model construction method, another embodiment of the present application further proposes an alertness assessment method, see Figure 8 As shown, the method includes:

[0241] S801. Obtain target ECG data of a target user.

[0242] In this embodiment, the target user refers to a user whose alertness is to be evaluated.

[0243] The target ECG data of the target user can be collected through a portable ECG monitoring device, which includes a wristband ECG sensor, a wearable ECG monitoring vest, and the like.

[0244] S802: Extract segment data from the target ECG data based on a preset sliding window to obtain at least one target ECG segment corresponding to the target ECG data.

[0245] Regarding the specific implementation process of extracting segment data from ECG data using a preset sliding window, please refer to the process of extracting segment data from ECG sample data using a preset sliding window in the embodiment of the method for constructing the alertness model mentioned above, which will not be repeated here.

[0246] S803: Use an alertness assessment model to perform alertness assessment based on at least one target ECG segment to obtain an alertness assessment result.

[0247] Among them, step S803 may include: for each target ECG segment in at least one target ECG segment, determining the target heart rate variability feature corresponding to the target ECG segment, and the contribution of the target heart rate variability feature to the alertness assessment is greater than a preset contribution; inputting the target heart rate variability feature corresponding to the at least one target ECG segment into the alertness assessment model to obtain an alertness index value; when it is determined that the alertness index value is less than a preset alertness threshold, determining that the alertness assessment result of the target user is an alertness category; when it is determined that the alertness index value is greater than the preset alertness threshold, determining that the alertness assessment result of the target user is a sleepiness category.

[0248] Here, the target heart rate variability features corresponding to the target ECG segment include: segment mean heart rate (Mean HR), mean normal heart beat interval (Mean NN), standard deviation of normal heart beat interval (SDNN), root mean square difference between adjacent NN intervals (RMSSD), variation range of NN intervals within the segment (NNmax-min) and variation range of heart rate (HRmax-min), as well as nonlinear domain sample entropy (SampEn) reflecting short-term heart rate variability.

[0249] Since the types of features that contribute most to alertness assessment have been determined during the model building process, there is no need to repeat feature screening here, and the target heart rate variability features of the target ECG segment can be directly determined.

[0250] After obtaining the target heart rate variability feature of at least one target ECG segment, the target heart rate variability feature of at least one target ECG segment can be directly input into the alertness assessment model to obtain the alertness index value D corresponding to each of the at least one target ECG segment output by the alertness assessment model. And based on the comparison between the alertness index value D corresponding to each of the at least one target ECG segment and the preset alertness threshold, the segment alertness assessment result corresponding to each of the at least one target ECG segment is determined. For example, for each target ECG segment in the at least one target ECG segment, the alertness index value D of the target ECG segment is compared with the preset alertness threshold, and when it is determined that the alertness index value D of the target ECG segment is greater than the preset alertness threshold, the alertness assessment result of the target ECG segment is obtained as the sleepiness category; and when it is determined that the alertness index value D of the target ECG segment is less than the preset alertness threshold, the alertness assessment result of the target ECG segment is obtained as the alertness category.

[0251] In this embodiment, the alertness evaluation result includes the segment alertness evaluation result for each target ECG segment output at each preset time interval, and the preset time interval is the preset step length of the sliding window. That is to say, after each target ECG segment is obtained in step S802, the target heart rate variability feature can be determined for the target ECG segment, and then the target heart rate variability feature can be input into the alertness evaluation model to obtain the alertness index value corresponding to the target ECG segment, and the alertness evaluation result corresponding to the target ECG segment is determined based on the alertness index value.

[0252] Still taking the window length (30s) and sliding step size (10s) of the sliding window introduced above as an example, the alertness assessment model of this embodiment can output an alertness assessment result every 10 seconds after the first alertness assessment result is output after 30 seconds.

[0253] The alertness assessment result can be output in the form of text display, voice, etc. Among them, the alertness assessment result of each target ECG segment can be continuously output, or the alertness assessment results of multiple target ECG segments collected can be output at intervals. Still taking the window length (30s) and sliding step length (10s) of the sliding window introduced above as an example, the alertness assessment model of this embodiment can output the alertness assessment result every 10 seconds after the first alertness assessment result is output after 30 seconds. It can also be output after collecting multiple 10-second alertness assessment results after the first alertness assessment result is output after 30 seconds, and this embodiment does not limit this.

[0254] Optionally, when the alertness assessment result is output as drowsiness, an alarm message may also be output, wherein the outputting method of the alarm message may include displaying, sending or recording an alarm prompt.

[0255] In summary, the beneficial effects of the method for constructing the alertness assessment model and the method for assessing alertness provided by the present application are as follows:

[0256] (1) This application uses sliding window technology to extract ECG sample segments suitable for short-term analysis, which effectively improves the accuracy of alertness assessment and the timeliness of prediction. This allows this application to rely on a simple ECG sensor device to continuously monitor and provide timely feedback on the level of alertness. It can be widely used in real-life scenarios such as long-distance driving, air traffic control, and classroom teaching, providing strong technical support for improving performance and public safety.

[0257] (2) This application uses sliding window technology to collect behavioral data of subjects completing sustained attention tests under different sleep conditions, and defines classification criteria based on the individual's actual performance level (reaction time distribution) to form a modeling sample with state representativeness. The alertness assessment model constructed based on this can not only accurately capture the short-term fluctuations of objective alertness, but also effectively accommodate individuals with different performance levels, ensuring that the assessment results are highly consistent with the individual's actual objective alertness in the alert-sleepy state. This improves the accuracy and practicality of the alertness assessment system.

[0258] It should be noted that this solution aims to solve the problem of low accuracy of alertness assessment by combining sliding window technology to extract ECG segments suitable for short-term analysis for alertness assessment, and proposes a real-time alertness assessment framework based on sliding window ECG analysis. The framework mainly includes six parts:

[0259] like Fig. 9 As shown, the framework may include the following steps d1)-d4):

[0260] d1) Data collection.

[0261] This embodiment collects ECG sample data and reaction time sample data of multiple subjects in different mental states, wherein the different mental states may include a normal sleep state and a sleep-deprived state.

[0262] d2) Extracting fragment data based on sliding window technology.

[0263] In this embodiment, a sliding window with a window length of 30 seconds and a step length of 10 seconds can be used to extract fragment data from the ECG sample data and reaction time sample data under different mental states, thereby obtaining the ECG sample fragments corresponding to the ECG sample data under different mental states and the reaction time sample fragments corresponding to the reaction time sample data.

[0264] d3) Calculate objective alertness.

[0265] In this embodiment, the average reaction time (i.e., the aforementioned target reaction time) of each reaction time sample segment is first calculated, and the reaction time sample segments of each subject in different mental states are summarized to obtain the reaction time distribution after individual level summary. Afterwards, for each subject's reaction time sample segment, the alertness category of the reaction time sample segment with an average reaction time less than the first preset reaction time is set as the alertness category, and the alertness category of the reaction time sample segment with an average reaction time greater than the second preset reaction time is set as the sleepiness category. The second preset reaction time is greater than the first preset reaction time.

[0266] For example, the reaction time sample segments of each subject in different mental states can be sorted in ascending order according to the average reaction time, and the alertness category corresponding to the top 40% of the reaction time sample segments in the sorting results is set to the alertness category, and the alertness category corresponding to the bottom 40% of the reaction time sample segments in the sorting results is set to the sleepiness category.

[0267] At this point, the alertness categories of the reaction time sample segments corresponding to the reaction time sample data of all subjects can be used as a label set.

[0268] d4) Feature extraction and screening.

[0269] Among them, feature extraction and screening include: R wave peak detection, calculation of HRV time domain, nonlinear domain features, normalization of feature values ​​and screening of optimal features.

[0270] For the specific implementation process of each sub-step included in the feature extraction and screening process, please refer to the introduction of the above embodiment, which will not be repeated here. The feature set can be obtained through step d4).

[0271] d5) Establish a vigilance assessment model.

[0272] In this embodiment, the parameters are adjusted by a grid search method based on k-fold cross-validation to obtain the optimal parameter combination, and an alertness assessment model is constructed based on the optimal parameter combination. Then, the classification decision function of the alertness assessment model is obtained based on the feature set and the optimal parameter combination.

[0273] d6) Conduct alertness assessment based on the alertness assessment model.

[0274] When the target ECG data of a new user is received, segment data extraction can be performed on the target ECG data of the new user based on the sliding window technology. After that, feature extraction can be performed based on the extracted target ECG segments to obtain target ECG variability features, and alertness assessment can be performed based on the target ECG variability features and the constructed alertness assessment model, thereby obtaining the alertness assessment result of the new user, i.e., alertness or sleepiness.

[0275] In summary, this embodiment proposes a real-time alertness assessment scheme based on sliding window ECG analysis, which uses sliding window segmentation technology to dynamically extract ECG sample data and reaction time sample data during the alertness test task, and performs R wave detection based on the extracted ECG sample fragments, and calculates the RR interval sequence in each sliding window, from which the time domain and nonlinear domain features of heart rate variability are extracted; the objective alertness is evaluated by using the reaction time distribution at the individual level, so as to obtain an objective alertness classification label that is highly consistent with the individual's actual alertness level; and the LASSO regression algorithm is used to screen the objective alertness. The target heart rate variability features with a large correlation with the classification label are used as the feature set for modeling; the support vector machine classification algorithm is used to build an alertness assessment model, and the same sliding window processing and feature extraction technology is applied to the target ECG data of new users, which is input into the constructed alertness assessment model to achieve alertness assessment every 10 seconds, thereby overcoming the problems of insufficient real-time and low accuracy of alertness assessment in traditional ECG monitoring technology, thereby improving the accuracy and timeliness of alertness assessment, and the detection rate (sensitivity) of short-term drowsiness is as high as 92.8%.

[0276] Corresponding to the above-mentioned method for constructing an alertness assessment model, the present embodiment also proposes a device for constructing an alertness assessment model, such as Fig.10 As shown, the device includes: an acquisition unit 1001, used to acquire alertness sample data, the alertness sample data includes ECG sample segments and reaction time sample segments obtained by extracting segment data from ECG sample data and reaction time sample data based on a preset sliding window, and the reaction time sample segments include reaction time reflecting alertness; an alertness category determination unit 1002, used to determine the real alertness category corresponding to the reaction time sample segment based on the reaction time corresponding to the reaction time sample segment; an alertness training unit 1003, used to perform alertness evaluation on the ECG sample segment using a preset alertness evaluation network to obtain a predicted alertness category corresponding to the ECG sample segment; and based on the difference between the predicted alertness category corresponding to the ECG sample segment and the real alertness category corresponding to the reaction time sample segment, converge the preset alertness evaluation network to obtain an alertness evaluation model.

[0277] In some embodiments, the ECG sample data is sample data collected under different mental states and represents changes in heart rate; the reaction time sample data is sample data collected under different mental states and represents the duration of alertness reaction.

[0278] In some embodiments, the reaction time sample data includes multiple, each reaction time sample data includes multiple reaction time sample segments; each reaction time sample segment includes multiple reaction time lengths of trials, and the alertness category determination unit 1002 determines the real alertness category corresponding to the reaction time sample segment based on the reaction time lengths corresponding to the reaction time sample segment, including for each reaction time sample data: for each reaction time sample segment in the multiple reaction time sample segments, determining the average of the reaction time lengths of each trial in the reaction time sample segment as the target reaction time corresponding to the reaction time sample segment; setting the real alertness category corresponding to the reaction time sample segment whose target reaction time is less than the first preset reaction time as the alertness category, and setting the real alertness category corresponding to the reaction time sample segment whose target reaction time is greater than the second preset reaction time as the sleepiness category.

[0279] In some embodiments, the alertness training unit 1003 uses a preset alertness assessment network to perform alertness assessment on an ECG sample segment to obtain a predicted alertness category corresponding to the ECG sample segment, including: determining multiple heart rate variability sample features corresponding to the ECG sample segment and their corresponding alertness contributions; based on the alertness contributions corresponding to the multiple heart rate variability features, screening out a target heart rate variability sample feature whose alertness contribution is greater than a preset contribution from the multiple heart rate variability features; using a preset alertness assessment network to perform alertness assessment on the target heart rate variability feature to obtain a predicted alertness category corresponding to the ECG sample segment.

[0280] In some embodiments, the alertness training unit 1003 determines multiple heart rate variability sample features corresponding to the ECG sample segment, including: performing R wave detection on the ECG sample segment to obtain the initial R wave and initial RR interval sequence corresponding to the ECG sample segment; determining the retrospective time period of the ECG sample segment, and performing R wave missed detection detection on the ECG sample segment within the retrospective time period to obtain the missed R wave corresponding to the ECG sample segment, the retrospective time period being a time period with a preset time length from the first initial RR interval, or a time period with a preset multiple of the average value of the current detected initial RR interval from the previous R wave detection moment; based on the initial R wave and missed R wave corresponding to the ECG sample segment, determining the heart rate variability sample features corresponding to each ECG sample segment.

[0281] In some embodiments, the retrospective time period includes multiple peak points, and the alertness training unit 1003 determines the retrospective time period of the ECG sample segment, and performs R wave missed detection detection on the ECG sample segment within the retrospective time period to obtain the missed R wave corresponding to the ECG sample segment, including: determining the time difference between the current peak point to be retrospected and the previous initial R wave for the case where the retrospective time period is after a time period of a preset time length from the first initial RR interval; determining the signal neglect period based on the average value of the RR interval corresponding to the initial R wave before the current peak point to be retrospective; determining that the time difference is less than the preset time and greater than the signal neglect period, and the peak value of the current peak point is greater than a preset multiple of the peak value of the previous initial R wave, determining that the current peak point is a missed R wave; determining that when the time difference is less than or equal to the signal neglect period, determining that the signal corresponding to the current peak point is noise; determining that when the time difference is greater than the preset time, determining that the signal corresponding to the current peak point is a missed R wave.

[0282] The device for constructing the alertness assessment model provided in this embodiment belongs to the same application concept as the method for constructing the alertness assessment model provided in the above embodiments of this application, and can execute the method for constructing the alertness assessment model provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the method for constructing the alertness assessment model. For technical details not fully described in this embodiment, please refer to the specific processing content of the method for constructing the alertness assessment model provided in the above embodiments of this application, and will not be repeated here.

[0283] In another embodiment, a vigilance assessment device corresponding to the above-mentioned vigilance assessment method is also proposed, such as Fig.11 As shown, the device includes: an acquisition unit 1101, used to acquire the target ECG data of the target user; a segment data extraction unit 1102, used to extract segment data from the target ECG data based on a preset sliding window, and obtain at least one target ECG segment corresponding to the target ECG data; an alertness evaluation unit 1103, used to perform alertness evaluation based on at least one target ECG segment using an alertness evaluation model, and obtain an alertness evaluation result, wherein the alertness evaluation result includes a segment alertness evaluation result for each target ECG segment output at each preset time interval; wherein the alertness evaluation model is a model obtained by using the method for constructing the alertness model introduced in the above-mentioned embodiment.

[0284] In some embodiments, the alertness assessment unit 1103 uses an alertness assessment model to perform alertness assessment based on at least one target ECG segment to obtain an alertness assessment result, including: for each target ECG segment in the at least one target ECG segment, determining a target heart rate variability feature corresponding to the target ECG segment, wherein a contribution of the target heart rate variability feature to the alertness assessment is greater than a preset contribution; inputting the target heart rate variability feature corresponding to each of the at least one target ECG segments into the alertness assessment model to obtain an alertness index value; determining that the alertness assessment result of the target user is an alertness category when the alertness index value is less than a preset alertness threshold; determining that the alertness assessment result of the target user is a sleepiness category when the alertness index value is greater than the preset alertness threshold.

[0285] The alertness assessment device provided in this embodiment belongs to the same application concept as the alertness assessment method provided in the above embodiments of this application, and can execute the alertness assessment method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of executing the alertness assessment method. For technical details not fully described in this embodiment, please refer to the specific processing content of the alertness assessment method provided in the above embodiments of this application, and will not be repeated here.

[0286] The functions implemented by each unit in the above model training device and alertness assessment device can be implemented by the same or different processors respectively, and the embodiments of the present application are not limited thereto.

[0287] It should be understood that the units in the above alertness model construction device and the speaker recognition device can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the unit in the device can be implemented in the form of a hardware circuit, and the functions of some or all units can be realized by designing the hardware circuit. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all units above are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all units above. All units of the above device can be implemented in the form of a processor calling software, or in the form of a hardware circuit, or in the form of a processor calling software, and the remaining part can be implemented in the form of a hardware circuit.

[0288] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.

[0289] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.

[0290] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.

[0291] The present application also provides an electronic device, see Fig.12 As shown, the device includes: a memory 200 and a processor 210; wherein the memory 200 is connected to the processor 210 and is used to store programs; the processor 210 is used to implement the method for constructing a vigilance model or the method for evaluating vigilance disclosed in any of the above embodiments by running the program stored in the memory 200.

[0292] Specifically, the electronic device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .

[0293] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are interconnected via a bus, wherein the bus may include a path for transmitting information between various components of the computer system.

[0294] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0295] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.

[0296] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.

[0297] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.

[0298] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.

[0299] The communication interface 220 may include any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.

[0300] The processor 210 executes the program stored in the memory 200 and calls other devices, which can be used to implement each step of any alertness model construction method or alertness assessment method provided in the above embodiments of the present application.

[0301] An embodiment of the present application also proposes a chip, which includes a processor and a data interface. The processor reads and runs a program stored in a memory through the data interface to execute the method for constructing a vigilance model or the method for evaluating vigilance introduced in any of the above embodiments. The specific processing process and its beneficial effects can be found in the introduction to the embodiments of the method for constructing a vigilance model or the method for evaluating vigilance.

[0302] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method for constructing a vigilance model or the method for evaluating vigilance described in any of the above-mentioned embodiments of this specification.

[0303] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0304] In addition, an embodiment of the present application may also be a storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the method for constructing a vigilance model or the method for evaluating vigilance described in any of the above embodiments of this specification.

[0305] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0306] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0307] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.

[0308] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.

[0309] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0310] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0311] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.

[0312] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0313] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0314] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0315] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for constructing a vigilance assessment model, characterized in that: include: Acquire alertness sample data, wherein the alertness sample data includes an electrocardiogram sample segment and a reaction time sample segment obtained by extracting segment data from the electrocardiogram sample data and the reaction time sample data respectively based on a preset sliding window, wherein the reaction time sample segment includes a reaction time reflecting alertness; Determining a true alertness category corresponding to the reaction time sample segment based on the reaction time corresponding to the reaction time sample segment; Based on the multiple heart rate variability sample features corresponding to the electrocardiogram sample segments and the real alertness categories corresponding to the reaction time sample segments, a preset alertness assessment network is trained to obtain an alertness assessment model; The plurality of heart rate variability sample features corresponding to the ECG sample segment are obtained based on the R wave corresponding to the ECG sample segment, wherein the R wave includes an initial R wave and a missed R wave; the missed R wave is determined by the following steps: In the case where the retrospective time period is a time period of a preset length after the first initial RR interval, determining the time difference between the current peak point to be retrospected and the last initial R wave, wherein the retrospective time period includes multiple peak points; Determine the signal neglect period based on the average value of the RR interval corresponding to the initial R wave before the current peak point to be traced back; When it is determined that the time difference is less than the preset time and greater than the signal ignoring period, it is determined whether the current peak point is a missed R wave based on the peak values ​​of the current peak point and the previous initial R wave.

2. The method according to claim 1, characterized in that: The reaction time sample data includes multiple sample data collected from multiple subjects in different mental states, representing the vigilance reaction time; The ECG sample data are sample data collected under different mental states and represent changes in heart rate.

3. The method according to claim 2, characterized in that Each reaction time sample data includes a plurality of reaction time sample segments of each subject in a single mental state, and each of the reaction time sample segments includes the reaction time of a plurality of trials; The step of determining the real alertness category corresponding to the reaction time sample segment based on the reaction time corresponding to the reaction time sample segment includes: For each reaction time sample segment in the plurality of reaction time sample segments of each reaction time sample data, determining the average of the reaction time lengths of the trials in the reaction time sample segment as the target reaction time corresponding to the reaction time sample segment; For the reaction time sample segments of each subject in different mental states, the real alertness category corresponding to the reaction time sample segment whose target reaction time is less than the first preset reaction time is set as the alertness category, and the real alertness category corresponding to the reaction time sample segment whose target reaction time is greater than the second preset reaction time is set as the sleepiness category.

4. The method according to claim 1, characterized in that: The method of training a preset alertness assessment network based on the multiple heart rate variability sample features corresponding to the electrocardiogram sample segments and the real alertness categories corresponding to the reaction time sample segments to obtain an alertness assessment model includes: Determine the ECG sample segment corresponding to the segment and its corresponding alertness contribution; Based on the alertness contribution degrees corresponding to the plurality of heart rate variability features, a target heart rate variability sample feature having an alertness contribution degree greater than a preset contribution degree is selected from the plurality of heart rate variability features; Using a preset alertness assessment network to perform alertness assessment on the target heart rate variability feature to obtain a predicted alertness category corresponding to the ECG sample segment; Based on the difference between the predicted alertness category corresponding to the electrocardiogram sample segment and the real alertness category corresponding to the reaction time sample segment, the preset alertness assessment network is converged to obtain an alertness assessment model.

5. The method according to claim 4, characterized in that The multiple heart rate variability sample features corresponding to the ECG sample segment are determined by the following steps: performing R wave detection on the ECG sample segment to obtain an initial R wave and an initial RR interval sequence corresponding to the ECG sample segment; Based on the initial R wave corresponding to the ECG sample segment and the missed R wave, determining the heart rate variability sample features corresponding to each ECG sample segment; The retrospective time period is a time period of a preset duration from the first initial RR interval, or a time period of a preset multiple of the average value of the currently detected initial RR interval from the previous R wave detection moment.

6. The method according to claim 5, characterized in that The step of determining whether the current peak point is a missed R wave based on the peak values ​​of the current peak point and the last initial R wave includes: Determine that the time difference is less than a preset time and greater than the signal ignoring period, and the peak value of the current peak point is greater than a preset multiple of the peak value of the previous initial R wave, and determine that the current peak point is a missed R wave; When it is determined that the time difference is less than or equal to the signal ignoring period, determining that the signal corresponding to the current peak point is noise; When it is determined that the time difference is greater than the preset time, it is determined that the signal corresponding to the current peak point is a missed R wave.

7. A method for assessing alertness, characterized in that: include: Obtain target ECG data of target users; Extracting segment data from the target ECG data based on a preset sliding window to obtain at least one target ECG segment corresponding to the target ECG data; Using an alertness assessment model to perform alertness assessment based on at least one of the target ECG segments to obtain an alertness assessment result, wherein the alertness assessment result includes a segment alertness assessment result for each of the target ECG segments output at each interval of a preset duration; Wherein, the alertness assessment model is a model obtained by using the method for constructing an alertness model according to any one of claims 1-6.

8. The method according to claim 7, characterized in that The step of using the alertness assessment model to perform alertness assessment based on at least one of the target ECG segments to obtain an alertness assessment result includes: For each target ECG segment in at least one of the target ECG segments, determining a target heart rate variability feature corresponding to the target ECG segment, wherein a contribution of the target heart rate variability feature to alertness assessment is greater than a preset contribution; Inputting the target heart rate variability feature corresponding to at least one of the target ECG segments into the alertness assessment model to obtain an alertness index value; When it is determined that the alertness index value is less than a preset alertness threshold, determining that the alertness evaluation result of the target user is an alertness category; When it is determined that the alertness index value is greater than a preset alertness threshold, it is determined that the alertness assessment result of the target user is a drowsiness category.

9. A device for assessing alertness, characterized in that: include: An acquisition unit, used for acquiring target ECG data of a target user; A segment data extraction unit, configured to extract segment data from the target ECG data based on a preset sliding window to obtain at least one target ECG segment corresponding to the target ECG data; an alertness assessment unit, configured to perform alertness assessment based on at least one of the target ECG segments using an alertness assessment model to obtain an alertness assessment result, wherein the alertness assessment result includes a segment alertness assessment result for each of the target ECG segments output at intervals of a preset duration, wherein the preset duration is a preset step length of the sliding window; Wherein, the alertness assessment model is a model obtained by using the method for constructing an alertness model according to any one of claims 1-6.

10. An electronic device, characterized in that: including memory and processor; The memory is connected to the processor and is used to store programs; The processor is configured to implement the method according to any one of claims 1 to 8 by running the program in the memory.

11. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor, cause the processor to implement the method as claimed in any one of claims 1 to 8.