Epilepsy detection method, device, equipment and medium
By deploying a micro-machine learning epilepsy detection model on a microcontroller and using historical physiological data for real-time detection, the problem that traditional methods are difficult to apply in resource-constrained environments is solved, and the rapid and accurate detection of the status of epilepsy patients is achieved.
Patent Information
- Application Number
- CN202411059895.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-12
AI Technical Summary
Traditional epilepsy detection methods are difficult to widely use in resource-constrained environments, especially in remote areas and low-income groups, and there is a lack of low-cost, low-power consumption, real-time and effective detection solutions.
By micro-machine learning and deploying the epilepsy detection model on a microcontroller, a training data set is generated using historical physiological data such as EEG, EKG and electrocutaneous activity data to achieve rapid and accurate detection of the physical status of epilepsy patients.
It effectively reduces the operating power consumption of the epilepsy detection model, realizes rapid and accurate detection of the physical status of epilepsy patients, and is suitable for resource-constrained environments.
Smart Images

Figure CN118924252A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to an epilepsy detection method, device, equipment and medium. Background Art
[0002] Epilepsy is a common neurological disease with a very complex pathogenesis, suddenness and unpredictability. Traditional epilepsy detection methods usually rely on electroencephalogram monitoring and require professional medical equipment and personnel for real-time monitoring and diagnosis. However, due to equipment costs and operational complexity, traditional methods are difficult to be widely used in resource-constrained environments, especially in remote areas and low-income groups.
[0003] Therefore, there is an urgent need for a low-cost, low-power, real-time and effective epilepsy detection solution to achieve convenient and intelligent monitoring and prediction of epileptic seizures. Summary of the invention
[0004] The present application provides an epilepsy detection method, apparatus, device and medium. By performing micro-machine learning on an epilepsy detection model and deploying it on a microcontroller, the operating power consumption of the epilepsy detection model is effectively reduced, thereby achieving rapid and accurate detection of the physical state of epilepsy patients.
[0005] According to one aspect of the present application, a method for detecting epilepsy is provided, the method comprising:
[0006] Acquire historical physiological data of the target group, and generate a training data set based on the historical physiological data; wherein the historical physiological data includes at least one of electroencephalogram data, electrocardiogram data, skin electrical activity data, and epileptic seizure time data;
[0007] Using the training data set to train a preset epilepsy detection model to obtain a trained initial epilepsy detection model, and performing micro-machine learning on the initial epilepsy detection model to deploy it to a microcontroller;
[0008] Based on the microcontroller, the physiological data to be detected of the object to be detected in the current time period is detected to determine the current physical state of the object to be detected.
[0009] According to another aspect of the present application, there is provided an epilepsy detection device, the device comprising:
[0010] A data acquisition module, used to acquire historical physiological data of a target group and generate a training data set based on the historical physiological data; wherein the historical physiological data includes at least one of electroencephalogram data, electrocardiogram data, and skin electrical activity data, as well as epileptic seizure time data;
[0011] A model deployment module, used to train a preset epilepsy detection model using the training data set to obtain a trained initial epilepsy detection model, and perform micro-machine learning on the initial epilepsy detection model to deploy it to a microcontroller;
[0012] The epilepsy detection module is used to detect the physiological data to be detected of the object to be detected in the current time period based on the microcontroller, and determine the current physical state of the object to be detected.
[0013] According to another aspect of the present application, an electronic device is provided, the device comprising:
[0014] At least one processor; and a memory in communication with the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the epilepsy detection method described in any embodiment of the present application.
[0015] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the epilepsy detection method described in any embodiment of the present application when executed.
[0016] The technical solution provided by the present application obtains the historical physiological data of the target group and generates a training data set based on the historical physiological data; wherein the historical physiological data includes at least one of electroencephalogram data, electrocardiogram data, and skin electrical activity data, as well as epileptic seizure time data; uses the training data set to train the preset epilepsy detection model to obtain the trained initial epilepsy detection model, and performs micro-machine learning on the initial epilepsy detection model to deploy it to a microcontroller; based on the microcontroller, the physiological data to be tested of the object to be tested in the current time period is tested to determine the current physical state of the object to be tested. The present technical solution effectively reduces the operating power consumption of the epilepsy detection model by performing micro-machine learning on the epilepsy detection model to deploy it on the microcontroller, and realizes rapid and accurate detection of the physical state of epilepsy patients.
[0017] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A flowchart of an epilepsy detection method provided in Example 1 of the present application;
[0020] Figure 2 A flowchart of an epilepsy detection method provided in Example 2 of the present application;
[0021] Figure 3 A schematic diagram of the structure of an epilepsy detection device provided in Example 3 of the present application;
[0022] Figure 4 It is a structural schematic diagram of a device for implementing an epilepsy detection method according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "history", "current", "target", "to be tested", "initial", "intermediate", "update", "candidate", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] Embodiment 1
[0026] Figure 1This is a flow chart of an epilepsy detection method provided in the first embodiment of the present application. This embodiment is applicable to the case of detecting an epileptic seizure state. The method can be performed by an epilepsy detection device. The epilepsy detection device can be implemented in the form of hardware and / or software. The epilepsy detection device can be configured in a device with data processing capabilities. Figure 1 As shown, the method includes:
[0027] S110, acquiring historical physiological data of the target group, and generating a training data set based on the historical physiological data, wherein the historical physiological data includes at least one of electroencephalogram data, electrocardiogram data, and skin electrical activity data, and epileptic seizure time data.
[0028] The target group may be a group of patients diagnosed with epilepsy. Specifically, the target group that meets the preset conditions may be screened based on the patient's age group, gender, seizure frequency, seizure mechanism, seizure duration or symptom severity. For example, the target group may be women diagnosed with epilepsy between the ages of 18 and 45.
[0029] Historical physiological data can be information related to epilepsy conditions generated by the target group during a historical period of time. Specifically, it can include electroencephalogram data, electrocardiogram data, skin electrical activity data, blood biochemical data, imaging data, magnetoencephalogram data, and epilepsy attack time data. It should be noted that historical physiological data is data collected with the consent of the target group.
[0030] Since epilepsy is characterized by sudden abnormal discharges of brain neurons, resulting in transient brain dysfunction, epileptic seizures can last for a certain period of time. Therefore, epileptic seizure time data can be the start and end time of the epileptic seizure. Specifically, epileptic seizure time data can be recorded by epileptic patients or their families, or collected and recorded by cameras in the patient's daily living environment, or recorded by medical staff.
[0031] The EEG data, ECG data and skin electrical activity data can be collected in real time by wearable devices embedded with multimodal sensors (such as smart bracelets, head-mounted devices, etc.). Among them, the multimodal sensor may include an EEG sensor, an ECG sensor and a skin electrical activity sensor. In order to obtain sufficiently delicate signal features, data acquisition must ensure high sampling rate and high resolution. In this application, the physiological data collected by the multimodal sensor can also be converted into a digital signal by an analog signal conversion unit.
[0032] In addition to obtaining a large amount of historical physiological data from epilepsy patients, existing public epilepsy datasets can also be combined, such as the Boston Children's Hospital-Massachusetts Institute of Technology (CHB-MIT Scalp EEG Dataset), to expand the data and ensure that the training dataset has sufficient sample size and diversity to cover epileptic seizures of different types and causes.
[0033] After obtaining a large amount of historical physiological data, the historical physiological data can be sorted, preprocessed and labeled so that it can be used for training of machine learning or other data analysis methods.
[0034] Optionally, a training data set is generated based on the historical physiological data, including: segmenting the electroencephalogram data, the electrocardiogram data and the skin electrode activity data according to a preset time window, and taking each segmentation result as a data sample; labeling each data sample according to the epileptic seizure time data to generate a training data set; wherein the labeled information includes before the seizure, during the seizure, after the seizure and before the seizure.
[0035] In order to convert a large amount of continuous data into multiple relatively small data units with a certain degree of time independence for subsequent analysis and processing, the EEG data, ECG data and skin electrical activity data can be segmented according to the preset time window. For example, if the preset time window is 10 seconds, then a 60-second EEG data will be segmented into 6 data samples of 10 seconds in length.
[0036] The data samples may be electroencephalogram data, electrocardiogram data, and skin electrical activity data collected within a certain segmented time period.
[0037] Furthermore, each data sample is labeled according to the epileptic seizure time data, and the epileptic seizure state of each data sample can be labeled. For example, it is known that an epileptic seizure starts at 10:00 and lasts for 5 minutes. When a 10-second data sample is between 9:55-10:00, it is labeled as "before the seizure", when it is between 10:00-10:05, it is labeled as "during the seizure", and when it is between 10:05-10:10, it is labeled as "after the seizure"; and if this data segment is at other times, such as 9:40-9:50, it is labeled as "no seizure".
[0038] Through the above-mentioned segmentation and labeling, the data can have clear category information, which helps the subsequent machine learning model to learn the characteristic patterns of physiological data under different states, thereby realizing the prediction and diagnosis of epileptic seizure states.
[0039] Optionally, before segmenting the EEG data, the ECG data and the skin electrical activity data according to a preset time window and taking each segmentation result as a data sample, the method also includes: performing regularization processing on the EEG data, the ECG data and the skin electrical activity data.
[0040] Since different sensors generate different signal amplitudes and acquisition frequencies, the data needs to be normalized. Specifically, the signal amplitude can be standardized to the same range, such as 0 to 1 or -1 to 1, for subsequent processing of the model.
[0041] In addition, to further improve the generalization ability of the model, data enhancement technology can be used to process data samples, such as adding random noise, signal time drift, signal flipping, etc., so that the model can cope with more diverse actual situations. Digital filtering technology can also be used to filter noise from physiological signals, such as low-pass filtering, high-pass filtering, and band-pass filtering, to remove irrelevant frequency components and ensure the purity of the signal.
[0042] Finally, the preprocessed data is stored in a local storage device, such as an SD card or EEPROM, in time series to facilitate subsequent data calls and model training.
[0043] S120, using the training data set to train a preset epilepsy detection model to obtain a trained initial epilepsy detection model, and performing micro-machine learning on the initial epilepsy detection model to deploy it to a microcontroller.
[0044] The preset epilepsy detection model can be established based on a neural network architecture suitable for epilepsy detection tasks, such as a convolutional neural network and / or a long short-term memory network, etc. The convolutional neural network can capture the spatiotemporal features in physiological signals, while the long short-term memory network can process time series data and capture long-term dependencies.
[0045] In this application, the training data set can be divided into a training set, a validation set, and a test set, and the ratio can generally be 8:1:1 to ensure that the preset epilepsy detection model can be fully trained and verified. Specifically, a deep learning framework, such as TensorFlow or Keras, can be used to build a neural network model; define an optimizer, a loss function, and an evaluation index; and finally, iterative training is performed based on the divided training set, validation set, and test set, and the model parameters are continuously adjusted to obtain an initial epilepsy detection model.
[0046] Micro machine learning is a machine learning technology that runs on resource-constrained devices, such as microcontrollers, sensors, or edge devices. Resource-constrained devices usually have low computing power, memory, and energy supply. Micro machine learning can achieve efficient model training and reasoning under limited conditions. For example, in smart watches, micro machine learning can be used to achieve simple activity recognition, such as determining whether the user is walking, running, or standing still.
[0047] To achieve micro machine learning, optimizations can be made in algorithm design, model architecture selection, and hardware optimization.
[0048] For example, using lightweight neural network architectures such as the MobileNet network architecture or the SqueezeNet network architecture; or using hardware acceleration technologies such as dedicated AI chips or digital signal processors.
[0049] In this application, the model can also be compressed and quantized to reduce the number of model parameters and the amount of computation while maintaining its epilepsy detection performance as much as possible. For example, model compression, knowledge distillation, and extraction of representative and discriminative features can reduce the storage requirements and computational complexity of the model.
[0050] The initial epilepsy detection model performs micro-machine learning to be deployed on a microcontroller, such as being embedded in a wearable device, which can timely monitor the patient's physiological data and make analysis and judgments, providing the patient with timely warnings or related assistance.
[0051] S130. Based on the microcontroller, detect the physiological data of the subject to be detected in the current time period to determine the current physical state of the subject to be detected.
[0052] The physiological data to be measured may be data corresponding to the type of historical physiological data. For example, if the historical physiological data includes electroencephalogram data, electrocardiogram data, and skin electrical activity data, the physiological data to be measured should be at least one of the electroencephalogram data, electrocardiogram data, and skin electrical activity data; for another example, if the historical physiological data includes electroencephalogram data and electrocardiogram data, the physiological data to be measured should be at least one of the electroencephalogram data and electrocardiogram data.
[0053] Specifically, the physiological data to be tested can be collected by the sensor module of the embedded device, and the collected data can be preprocessed and regularized to ensure the format consistency of the data input model; and the processed data can be transmitted to the microcontroller through an interface connected to the microcontroller, so that the microcontroller can detect the physiological data to be tested.
[0054] The physical state can be physical symptoms related to epileptic seizures, which are consistent with the data labels used in model training. For example, the physical state can be possible seizure, in the process of seizure, just finished seizure, or no seizure. For another example, the physical state can be mild epilepsy, moderate epilepsy, or severe epilepsy.
[0055] In the present application, the microcontroller runs an epilepsy detection model that has been trained by micro-machine learning, predicts the physiological data to be tested that is input in real time based on the model, and outputs the current physical state of the object to be tested.
[0056] The embodiment of the present invention provides an epilepsy detection method, which obtains historical physiological data of a target group and generates a training data set based on the historical physiological data; wherein the historical physiological data includes electroencephalogram data, electrocardiogram data, skin electrical activity data, and epilepsy attack time data; uses the training data set to train a preset epilepsy detection model to obtain a trained initial epilepsy detection model, and performs micro-machine learning on the initial epilepsy detection model to deploy it to a microcontroller; based on the microcontroller, the physiological data to be tested of the object to be tested in the current time period is tested to determine the current physical state of the object to be tested. This technical solution effectively reduces the operating power consumption of the epilepsy detection model by performing micro-machine learning on the epilepsy detection model to deploy it on the microcontroller, and realizes rapid and accurate detection of the physical state of epilepsy patients.
[0057] Embodiment 2
[0058] Figure 2 This is a flow chart of an epilepsy detection method provided in Example 2 of the present application. This embodiment is optimized based on the above embodiment. Figure 2 As shown, the method of this embodiment specifically includes the following steps:
[0059] S210, acquiring historical physiological data of the target group, and generating a training data set based on the historical physiological data, wherein the historical physiological data includes at least one of electroencephalogram data, electrocardiogram data, and skin electrical activity data, and epileptic seizure time data.
[0060] S220: Using the training data set to train a preset epilepsy detection model to obtain a trained initial epilepsy detection model.
[0061] S230: compress the initial epilepsy detection model to obtain an intermediate epilepsy detection model.
[0062] Compression processing can be a processing method for reducing the amount of calculation and / or the number of parameters of the model, so that the model can be more easily applied in resource-constrained environments, such as mobile devices, embedded systems, etc., while maintaining certain performance. Common compression processing methods include pruning, quantization, and knowledge distillation. The embodiment of the present application does not limit the compression processing method. One or more of these methods can be selected according to actual needs to compress the initial epilepsy detection model to obtain an intermediate epilepsy detection model.
[0063] Optionally, the initial epilepsy detection model is quantized to obtain an intermediate epilepsy detection model, including: pruning the initial epilepsy detection model to obtain a pruned model; and quantizing the pruned model to obtain an intermediate epilepsy detection model.
[0064] Pruning refers to a method of reducing the size of a model by identifying and removing redundant parameters in the model. In a deep neural network, there are usually a large number of parameters, which may not be necessary during the training and reasoning process of the model, and some are even redundant. Therefore, by reducing the number of model parameters while ensuring model performance, the use of computing resources can be reduced, and the efficiency and reasoning speed of the model can be improved. Specifically, weight pruning and channel pruning can be used to improve the running efficiency of the model on embedded devices.
[0065] Exemplarily, pruning the initial epilepsy detection model may include the following steps: 1) Parameter importance evaluation: First, the weights or neurons in the initial epilepsy detection model are evaluated for importance to determine the weights or neurons that contribute less to the model performance or are redundant. 2) Parameter deletion: According to the evaluation results, the weights or neurons that are considered to be unimportant or redundant are deleted. 3) Parameter pruning: After deleting the parameters, the initial epilepsy detection model is retrained to correct the model performance after the parameters are deleted. In the process of retraining the model, the model learning rate can be adjusted or regularization methods can be used to avoid overfitting. 4) Fine-tuning and retraining: Fine-tune and retrain the pruned model to ensure the stability of the model and obtain a pruned model.
[0066] Quantization refers to the process of converting the weights and activation values of a model from high precision to low precision to reduce the model's storage space and computing resource requirements while maintaining the model's performance.
[0067] Specifically, the quantization technology of TensorFlow Lite can be used to convert the 32-bit floating-point weights in the pruned model into 8-bit integers to obtain an intermediate epilepsy detection model, thereby further compressing the size of the pruned model and improving the calculation speed. The quantized model has significantly improved the calculation efficiency on embedded devices, while having little impact on the prediction accuracy.
[0068] S240 , converting the format of the intermediate epilepsy detection model to obtain a target epilepsy detection model, and deploying the target epilepsy detection model to a microcontroller.
[0069] The format conversion may be to convert the representation of the intermediate epilepsy detection model architecture and parameters into a format suitable for operation by a microcontroller, which may be determined, for example, based on factors such as the computing power, memory limitations, and a specific instruction set architecture of the microcontroller.
[0070] In this application, the intermediate epilepsy detection model can be converted into the TensorFlow Lite format using the TensorFlow Lite converter, and the TensorFlow Lite format can be converted into a C language header file using the Linux command xxd -i to obtain the target epilepsy detection model so that it can be deployed to a resource-constrained microcontroller for operation.
[0071] Specifically, the generated C language header file is transplanted into the firmware of the microcontroller, the corresponding operation space is allocated, and the result array of the target epilepsy detection model is defined. The order of variables in the result array is the same as the labels assigned during model training.
[0072] After the target epilepsy detection model is deployed to the microcontroller, it is instantiated to ensure that the target epilepsy detection model can be normally loaded and run on the microcontroller.
[0073] S250: Based on the microcontroller, detect the physiological data of the subject to be detected in the current time period to determine the current physical state of the subject to be detected.
[0074] Optionally, after detecting the physiological data of the object to be detected in the current time period based on the microcontroller to determine the current physical state of the object to be detected, the method further includes: fine-tuning the target epilepsy detection model according to the current state and the physiological data corresponding to the current state to obtain an updated epilepsy detection model.
[0075] In this application, the seizure event records and corresponding physiological data of the subject to be detected can be stored in a local device or cloud server to provide data support for subsequent model updates. The collected feedback data can be used to fine-tune and retrain the existing target epilepsy detection model to improve the detection accuracy and robustness of the model.
[0076] Specifically, online learning or periodic batch updating can be used to fine-tune the target epilepsy detection model using the current state and the physiological data corresponding to the current state to obtain an updated epilepsy detection model, so that the model can continuously adapt to new data distributions and individual differences of patients.
[0077] The embodiment of the present invention provides an epilepsy detection method, which obtains historical physiological data of a target group and generates a training data set based on the historical physiological data; uses the training data set to train a preset epilepsy detection model to obtain an initial epilepsy detection model after training; compresses the initial epilepsy detection model to obtain an intermediate epilepsy detection model; performs format conversion on the intermediate epilepsy detection model to obtain a target epilepsy detection model, and deploys the target epilepsy detection model to a microcontroller; based on the microcontroller, detects the physiological data to be tested of the object to be detected in the current time period to determine the current physical state of the object to be detected. This technical solution compresses and converts the model so that the model can be deployed on the microcontroller, realizes low-power operation, and can detect epileptic seizures in a timely and effective manner.
[0078] On the basis of the above embodiments, optionally, after detecting the physiological data to be detected of the object to be detected in the current time period based on the microcontroller and determining the current physical state of the object to be detected, the method further includes: obtaining a candidate physical state of the object to be detected in at least one candidate time period; wherein the candidate time period and the current time period are continuous time periods; and determining the risk level of epileptic seizure of the object to be detected based on the current physical state and at least one candidate physical state.
[0079] During the process of collecting physiological data of the subject to be tested, it may be interfered by the external environment. For example, electromagnetic interference around the subject to be tested may affect the accuracy and reliability of the physiological data; for example, the subject's mood swings, fatigue level, time and dosage changes of the drug use during data collection may also cause fluctuations in physiological data.
[0080] Therefore, the physical state detection result of one time period is not enough to accurately reflect whether the subject to be detected has signs of epileptic seizure. The present application determines the risk level of epileptic seizure of the subject to be detected by comprehensively judging the physical state output in multiple consecutive time periods.
[0081] The candidate body state is obtained in the same manner as the current body state, specifically, based on a microcontroller, the physiological data to be tested of the object to be tested in the candidate time period is tested to obtain the candidate body state.
[0082] In the present application, the physiological data collected in multiple consecutive time periods are taken as a group of data, and the physical state corresponding to each time period in the same group is determined respectively, and finally the risk degree of epileptic seizure of the object to be detected is determined according to the physical state corresponding to each time period. For example, if the acquisition time of each time period is 10 seconds, and 5 time periods are a group, then the time periods are 9:55:00-9:55:10, 9:55:10-9:55:20, 9:55:20-9:55:30, 9:55:30-9:55:40 and 9:55:40-9:55:50 as a group, and so on, 9:55:10-9:55:20, 9:55:20-9:55:30, 9:55:30-9:55:40, 9:55:40-9:55:50 and 9:55:50-9:56:00 as a group.
[0083] Specifically, the risk level of epileptic seizure of the subject to be detected is determined according to the physical state corresponding to each time period. Different physical states can be assigned values, and the sum of the physical state scores in each time period is compared with a preset scoring threshold to determine the risk level of epileptic seizure.
[0084] When the risk level of epileptic seizure is determined to be high, an early warning can be issued through vibration, sound or visual signals to remind the subject to be tested or relevant caregivers to take necessary safety measures to prevent accidents.
[0085] Embodiment 3
[0086] Figure 3 This is a schematic diagram of the structure of an epilepsy detection device provided in Example 4 of the present application. Figure 3 As shown, the device comprises:
[0087] A data acquisition module 310 is used to acquire historical physiological data of a target group and generate a training data set based on the historical physiological data; wherein the historical physiological data includes at least one of electroencephalogram data, electrocardiogram data, and skin electrical activity data, as well as epileptic seizure time data;
[0088] A model deployment module 320 is used to train a preset epilepsy detection model using the training data set to obtain a trained initial epilepsy detection model, and perform micro-machine learning on the initial epilepsy detection model to deploy it to a microcontroller;
[0089] The epilepsy detection module 330 is used to detect the physiological data of the subject to be detected in the current time period based on the microcontroller, and determine the current physical state of the subject to be detected.
[0090] The embodiment of the present invention provides an epilepsy detection device, which obtains historical physiological data of a target group and generates a training data set based on the historical physiological data; wherein the historical physiological data includes electroencephalogram data, electrocardiogram data, skin electrical activity data, and epilepsy attack time data; uses the training data set to train a preset epilepsy detection model to obtain a trained initial epilepsy detection model, and performs micro-machine learning on the initial epilepsy detection model to deploy it to a microcontroller; based on the microcontroller, the physiological data to be tested of the object to be tested in the current time period is detected to determine the current physical state of the object to be tested. This technical solution effectively reduces the operating power consumption of the epilepsy detection model by performing micro-machine learning on the epilepsy detection model to deploy it on the microcontroller, and realizes rapid and accurate detection of the physical state of epilepsy patients.
[0091] Furthermore, the data acquisition module 310 includes:
[0092] A data segmentation unit, used to segment the electroencephalogram data, the electrocardiogram data and the skin electrical activity data according to a preset time window, and use each segmentation result as a data sample;
[0093] A data labeling unit is used to label each of the data samples according to the epileptic seizure time data to generate a training data set; wherein the labeled information includes before the seizure, during the seizure, after the seizure and before the seizure.
[0094] Furthermore, the data acquisition module 310 also includes:
[0095] A data processing unit is used to perform regularization processing on the EEG data, the ECG data and the skin electrical activity data before segmenting the EEG data, the ECG data and the skin electrical activity data according to a preset time window and taking each segmentation result as a data sample.
[0096] Furthermore, the model deployment module 320 includes:
[0097] A model compression unit, used for compressing the initial epilepsy detection model to obtain an intermediate epilepsy detection model;
[0098] The model conversion unit is used to convert the format of the intermediate epilepsy detection model to obtain a target epilepsy detection model, and deploy the target epilepsy detection model to the microcontroller.
[0099] Furthermore, the model compression unit comprises:
[0100] A model pruning subunit, used for pruning the initial epilepsy detection model to obtain a pruned model;
[0101] The model quantization subunit is used to quantize the pruned model to obtain an intermediate epilepsy detection model.
[0102] Furthermore, the model deployment module 320 also includes:
[0103] The model updating unit is used to detect the physiological data of the object to be detected in the current time period based on the microcontroller, determine the current physical state of the object to be detected, and then fine-tune the target epilepsy detection model according to the current state and the physiological data corresponding to the current state to obtain an updated epilepsy detection model.
[0104] Furthermore, the device also includes:
[0105] A state acquisition module, configured to detect the physiological data of the subject to be detected in the current time period based on the microcontroller, and after determining the current physical state of the subject to be detected, acquire the candidate physical state of the subject to be detected in at least one candidate time period; wherein the candidate time period and the current time period are continuous time periods;
[0106] The risk prediction module is used to determine the risk level of epileptic seizure of the subject to be detected based on the current physical state and at least one candidate physical state.
[0107] An epilepsy detection device provided in an embodiment of the present application can execute an epilepsy detection method provided in any embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution method.
[0108] Embodiment 4
[0109] Figure 4 A schematic diagram of a device 10 that can be used to implement an embodiment of the present application is shown. The device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0110] like Figure 4As shown, the device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the device 10 can also be stored. The processor 11, ROM 12 and RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0111] A number of components in the device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0112] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as an epilepsy detection method.
[0113] In some embodiments, the epilepsy detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the epilepsy detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the epilepsy detection method in any other suitable manner (e.g., by means of firmware).
[0114] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0115] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow charts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0116] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0117] To provide interaction with a user, the systems and techniques described herein can be implemented on a device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0118] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0119] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0120] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.
[0121] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A method for detecting epilepsy, characterized in that: The method comprises: Acquire historical physiological data of the target group, and generate a training data set based on the historical physiological data; wherein the historical physiological data includes at least one of electroencephalogram data, electrocardiogram data, skin electrical activity data, and epileptic seizure time data; Using the training data set to train a preset epilepsy detection model to obtain a trained initial epilepsy detection model, and performing micro-machine learning on the initial epilepsy detection model to deploy it to a microcontroller; Based on the microcontroller, the physiological data to be detected of the object to be detected in the current time period is detected to determine the current physical state of the object to be detected.
2. The method according to claim 1, characterized in that Generating a training data set based on the historical physiological data includes: Segmenting the electroencephalogram data, the electrocardiogram data, and the skin electrical activity data according to a preset time window, and taking each segmentation result as a data sample; According to the epileptic seizure time data, each of the data samples is labeled to generate a training data set; wherein the labeled information includes before seizure, during seizure, after seizure and before seizure.
3. The method according to claim 2, characterized in that Before segmenting the electroencephalogram data, the electrocardiogram data, and the skin electrical activity data according to a preset time window and taking each segmentation result as a data sample, the method further includes: Regularization processing is performed on the electroencephalogram data, the electrocardiogram data, and the skin electrical activity data.
4. The method according to claim 1, characterized in that: Deploying the target epilepsy detection model to a microcontroller through micro-machine learning, including: compressing the initial epilepsy detection model to obtain an intermediate epilepsy detection model; The intermediate epilepsy detection model is format-converted to obtain a target epilepsy detection model, and the target epilepsy detection model is deployed to a microcontroller.
5. The method according to claim 4, characterized in that The initial epilepsy detection model is quantized to obtain an intermediate epilepsy detection model, including: Pruning the initial epilepsy detection model to obtain a pruned model; The pruned model is quantized to obtain an intermediate epilepsy detection model.
6. The method according to claim 4, characterized in that After detecting the physiological data of the subject to be detected in the current time period based on the microcontroller and determining the current physical state of the subject to be detected, the method further includes: The target epilepsy detection model is fine-tuned according to the current state and the physiological data corresponding to the current state to obtain an updated epilepsy detection model.
7. The method according to claim 1, characterized in that After detecting the physiological data of the subject to be detected in the current time period based on the microcontroller and determining the current physical state of the subject to be detected, the method further includes: Acquire a candidate physical state of the subject to be detected in at least one candidate time period; wherein the candidate time period and the current time period are continuous time periods; The epileptic seizure risk level of the subject to be detected is determined according to the current physical state and at least one candidate physical state.
8. An epilepsy detection device, characterized in that: The device comprises: A data acquisition module, used to acquire historical physiological data of a target group and generate a training data set based on the historical physiological data; wherein the historical physiological data includes at least one of electroencephalogram data, electrocardiogram data, and skin electrical activity data, as well as epileptic seizure time data; A model deployment module, used to train a preset epilepsy detection model using the training data set to obtain a trained initial epilepsy detection model, and perform micro-machine learning on the initial epilepsy detection model to deploy it to a microcontroller; The epilepsy detection module is used to detect the physiological data of the object to be detected in the current time period based on the microcontroller, and determine the current physical state of the object to be detected.
9. An electronic device, characterized in that: The device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the epilepsy detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the epilepsy detection method according to any one of claims 1 to 7 when executed.
Citation Information
Cited By
Multi-mode intelligent massage chair system based on SSVEP and MI
CN119781322A
