CN111638803B - EEG data processing method, device, equipment and medium based on federated migration - Google Patents
EEG data processing method, device, equipment and medium based on federated migration Download PDFInfo
- Publication number
- CN111638803B CN111638803B CN202010570925.5A CN202010570925A CN111638803B CN 111638803 B CN111638803 B CN 111638803B CN 202010570925 A CN202010570925 A CN 202010570925A CN 111638803 B CN111638803 B CN 111638803B
- Authority
- CN
- China
- Prior art keywords
- eeg data
- processing
- brain activity
- loss value
- recognition model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/011—Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
- G06F3/015—Input arrangements based on nervous system activity detection, e.g. brain waves [EEG] detection, electromyograms [EMG] detection, electrodermal response detection
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/72—Signal processing specially adapted for physiological signals or for diagnostic purposes
- A61B5/7235—Details of waveform analysis
- A61B5/7264—Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems
- A61B5/7267—Classification of physiological signals or data, e.g. using neural networks, statistical classifiers, expert systems or fuzzy systems involving training the classification device
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Medical Informatics (AREA)
- Molecular Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Signal Processing (AREA)
- Biophysics (AREA)
- Pathology (AREA)
- Physiology (AREA)
- Heart & Thoracic Surgery (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Surgery (AREA)
- Animal Behavior & Ethology (AREA)
- Psychiatry (AREA)
- Public Health (AREA)
- Veterinary Medicine (AREA)
- Dermatology (AREA)
- Neurology (AREA)
- Neurosurgery (AREA)
- Human Computer Interaction (AREA)
- Fuzzy Systems (AREA)
- Computing Systems (AREA)
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
Abstract
本发明公开了一种基于联邦迁移的脑电数据处理方法、装置、设备及介质,该方法包括:获取多组脑电数据,并将多组所述脑电数据分别传输到本地终端内的各特征映射模型进行映射处理,生成标准脑电数据;将标准脑电数据传输到本地终端内的脑活动识别模型进行处理,生成模型参数传输到预设公共服务器进行聚合;接收经聚合返回的更新参数,对脑活动识别模型更新,并基于更新的脑活动识别模型对各特征映射模型重新映射处理得到的标准脑电数据进行处理,直到脑活动识别模型生成的总损失值小于预设值,完成基于联邦迁移对多组脑电数据的处理。本发明实现了在充分保护用户隐私的前提下对脑电数据进行处理,且避免以各种方式去获取脑电数据,提高了处理效率。
The invention discloses a method, device, device and medium for processing EEG data based on federation migration. The method includes: acquiring multiple sets of EEG data, and transmitting the multiple sets of EEG data to each of the local terminals respectively. The feature mapping model performs mapping processing to generate standard EEG data; the standard EEG data is transmitted to the brain activity recognition model in the local terminal for processing, and the generated model parameters are transmitted to the preset public server for aggregation; the updated parameters returned by the aggregation are received , update the brain activity recognition model, and process the standard EEG data obtained by remapping each feature mapping model based on the updated brain activity recognition model, until the total loss value generated by the brain activity recognition model is less than the preset value, and complete the process based on Federated transfer processing of multiple sets of EEG data. The present invention realizes the processing of EEG data on the premise of fully protecting the user's privacy, avoids obtaining EEG data in various ways, and improves the processing efficiency.
Description
技术领域technical field
本发明涉及金融科技(Fintech)技术领域,尤其涉及一种基于联邦迁移的脑电数据处理方法、装置、设备及介质。The present invention relates to the technical field of financial technology (Fintech), in particular to a federated migration-based EEG data processing method, device, equipment and medium.
背景技术Background technique
随着金融科技(Fintech),尤其是互联网科技金融的不断发展,越来越多的技术(如大数据、云存储、机器学习等)应用在金融领域,但金融业也对各类技术提出了更高的要求,如要求通过机器学习来对脑电数据进行处理,以反映用户的心理状态、精神状态等。With the continuous development of financial technology (Fintech), especially Internet technology finance, more and more technologies (such as big data, cloud storage, machine learning, etc.) Higher requirements, such as requiring machine learning to process EEG data to reflect the user's psychological state, mental state, etc.
当前EEG(Electroencephalogram,脑电图)被认为是实现非侵入式脑机接口(Brain-computer interface,BCI)的理想途径,研究者不断尝试从EEG信号中分析复杂的大脑活动。而机器学习作为一种典型的解决方法,可通过对人工收集的大量EEG数据(即脑电数据)进行处理训练,来实现根据EEG信号数据识别多种脑活动。但是,单个脑电设备使用者在一定时间内很难产生足够的用于机器学习处理训练的所需数据,使得用于处理训练的EEG数据存在稀缺性的问题。Currently, EEG (Electroencephalogram, electroencephalogram) is considered to be an ideal way to realize a non-invasive brain-computer interface (Brain-computer interface, BCI). Researchers continue to try to analyze complex brain activities from EEG signals. As a typical solution, machine learning can realize the recognition of various brain activities based on EEG signal data by processing and training a large amount of EEG data (ie EEG data) collected manually. However, it is difficult for a single EEG device user to generate enough required data for machine learning processing and training within a certain period of time, so that there is a problem of scarcity of EEG data for processing and training.
同时,脑电数据类型因采集设备的电极数量,电极位置,电极种类(干电极、湿电极),采样率等因素的不同而不同,导致了脑电数据因设备不同而出现异质性。而针对异质性的不同类型的脑电数据往往需要单独处理训练不同的机器学习模型,如此一来,又因异质性加剧了用于处理训练的数据的稀缺性。At the same time, the type of EEG data is different due to the number of electrodes, electrode positions, electrode types (dry electrodes, wet electrodes), sampling rate and other factors of the acquisition equipment, resulting in heterogeneity of EEG data due to different equipment. Different types of EEG data for heterogeneity often need to be processed separately to train different machine learning models. In this way, the scarcity of data used for processing training is exacerbated by heterogeneity.
此外,脑电数据具有很强的个体差异性,可用于反映个体的疲劳度、惊恐度、警觉度、行为意图等信息;若原始的脑电数据遭受泄露与滥用,可能会导致严重的隐私侵犯,从而在通过机器学习对脑电数据处理的过程中需要慎重考虑脑电数据隐私敏感性问题。综上,由于脑电数据所具有的稀缺性、异质性和隐私性特征,需要以各种方式去获取大量脑电数据,导致了当前的机器学习方法对脑电数据的处理效率低,且难以在充分保护用户隐私的前提下处理脑电数据。In addition, EEG data has strong individual differences and can be used to reflect information such as individual fatigue, panic, alertness, and behavioral intentions; if the original EEG data is leaked and abused, it may lead to serious privacy violations , so that the privacy sensitivity of EEG data needs to be carefully considered in the process of processing EEG data through machine learning. To sum up, due to the scarcity, heterogeneity and privacy characteristics of EEG data, it is necessary to obtain a large amount of EEG data in various ways, resulting in low efficiency of processing EEG data by current machine learning methods, and It is difficult to process EEG data under the premise of fully protecting user privacy.
发明内容Contents of the invention
本发明的主要目的在于提供一种基于联邦迁移的脑电数据处理方法、装置、设备及介质,旨在解决现有技术中对脑电数据的处理效率低,且难以在充分保护用户隐私的前提下处理脑电数据的技术问题。The main purpose of the present invention is to provide a method, device, device, and medium for processing EEG data based on federated migration, aiming to solve the problem of low processing efficiency of EEG data in the prior art and the difficulty of fully protecting user privacy. Technical issues of processing EEG data.
为实现上述目的,本发明提供一种基于联邦迁移的脑电数据处理方法,所述基于联邦迁移的脑电数据处理方法包括以下步骤:In order to achieve the above object, the present invention provides a method for processing EEG data based on federated migration, which includes the following steps:
获取多组脑电数据,并将多组所述脑电数据分别传输到本地终端内,与多组所述脑电数据分别对应的特征映射模型进行映射处理,生成标准脑电数据;Obtaining multiple sets of EEG data, and transmitting the multiple sets of EEG data to the local terminal respectively, and performing mapping processing on feature mapping models respectively corresponding to the multiple sets of EEG data, to generate standard EEG data;
将所述标准脑电数据传输到本地终端内的脑活动识别模型进行处理,生成模型参数传输到预设公共服务器,以供所述预设公共服务器对所述模型参数和至少一个他方终端发送的其他模型参数进行聚合,生成更新参数;The standard EEG data is transmitted to the brain activity recognition model in the local terminal for processing, and the generated model parameters are transmitted to the preset public server, so that the preset public server can compare the model parameters and the information sent by at least one other terminal. Other model parameters are aggregated to generate update parameters;
接收所述更新参数,对所述脑活动识别模型进行更新,并基于更新的所述脑活动识别模型对各特征映射模型重新映射处理得到的标准脑电数据进行处理,直到所述脑活动识别模型所生成的总损失值小于预设值,完成基于联邦迁移对多组所述脑电数据的处理。receiving the update parameters, updating the brain activity recognition model, and processing the standard EEG data obtained by remapping each feature mapping model based on the updated brain activity recognition model until the brain activity recognition model The generated total loss value is less than the preset value, and the processing of multiple sets of EEG data based on federated migration is completed.
可选地,所述完成基于联邦迁移对多组所述脑电数据的处理的步骤之后,所述方法还包括:Optionally, after completing the step of processing multiple sets of EEG data based on federated migration, the method further includes:
当接收到待处理脑电数据时,调用所述特征映射模型进行映射处理;When the EEG data to be processed is received, the feature mapping model is called to perform mapping processing;
将映射处理的待处理脑电数据传输到脑活动识别模型进行分类处理,获得与所述待处理脑电数据对应的脑活动类型。The EEG data to be processed by mapping is transmitted to the brain activity recognition model for classification processing, and the brain activity type corresponding to the EEG data to be processed is obtained.
可选地,所述将多组所述脑电数据分别传输到本地终端内,与多组所述脑电数据分别对应的特征映射模型进行映射处理,生成标准脑电数据的步骤包括:Optionally, the multiple sets of EEG data are respectively transmitted to the local terminal, and the feature mapping models respectively corresponding to the multiple sets of EEG data are mapped, and the step of generating standard EEG data includes:
根据多组所述脑电数据的数据属性,对多组所述脑电数据进行预处理;Preprocessing the multiple sets of EEG data according to the data attributes of the multiple sets of EEG data;
将经预处理的多组所述脑电数据分别传输到本地终端内,并根据本地终端内与多组所述脑电数据分别对应的特征映射模型,对多组所述脑电数据分别进行映射处理,生成所述标准脑电数据。Transmitting the preprocessed multiple sets of EEG data to the local terminal respectively, and mapping the multiple sets of EEG data respectively according to the feature mapping models corresponding to the multiple sets of EEG data in the local terminal processing to generate the standard EEG data.
可选地,所述基于更新的所述脑活动识别模型对各特征映射模型重新映射处理得到的标准脑电数据进行处理的步骤之后,所述方法包括:Optionally, after the step of processing the standard EEG data obtained by remapping each feature mapping model based on the updated brain activity recognition model, the method includes:
获取更新后的所述脑活动识别模型对重新映射处理得到的标准脑电数据进行处理所生成的处理结果,并根据所述处理结果,确定经更新后所述脑活动识别模型对应的分类损失值;Obtain the processing result generated by processing the standard EEG data obtained by the remapping process with the updated brain activity recognition model, and determine the classification loss value corresponding to the updated brain activity recognition model according to the processing result ;
根据重新映射处理的标准脑电数据,确定与各所述特征映射模型对应的降维损失值;According to the standard EEG data processed by remapping, determine the dimensionality reduction loss value corresponding to each of the feature mapping models;
根据所述分类损失值和所述降维损失值,确定经更新后所述脑活动识别模型的总损失值。A total loss value of the updated brain activity recognition model is determined according to the classification loss value and the dimensionality reduction loss value.
可选地,所述根据所述处理结果,确定经更新后所述脑活动识别模型对应的分类损失值的步骤包括:Optionally, the step of determining the classification loss value corresponding to the updated brain activity recognition model according to the processing result includes:
读取所述标准脑电数据的参考结果,并在所述参考结果和所述处理结果之间进行相似度计算,生成第一相似度值;reading the reference result of the standard EEG data, and performing similarity calculation between the reference result and the processing result to generate a first similarity value;
根据所述第一相似度值,确定经更新后所述脑活动识别模型的分类损失值。A classification loss value of the updated brain activity recognition model is determined according to the first similarity value.
可选地,所述根据重新映射处理的标准脑电数据,确定与各所述特征映射模型对应的降维损失值的步骤包括:Optionally, the step of determining the dimensionality reduction loss value corresponding to each of the feature mapping models according to the standard EEG data processed by remapping includes:
根据重新映射处理的标准脑电数据与多组所述脑电数据之间的对应关系,将重新映射处理的标准脑电数据划分为多组标准子数据;According to the corresponding relationship between the remapped standard EEG data and multiple sets of the EEG data, the remapped standard EEG data is divided into multiple sets of standard sub-data;
对多组所述标准子数据进行两两组合,并对各所述组合中的每组标准子数据分别进行再现处理,生成各所述组合中的两组数据点;performing two-two combinations on multiple sets of standard sub-data, and performing reproduction processing on each set of standard sub-data in each combination to generate two sets of data points in each combination;
对各所述组合中每组数据点分别进行均值处理,生成各所述组合中每组数据点的平均值,并根据各所述组合中每组数据点的平均值,生成各所述组合的第二相似度值;Perform mean value processing on each group of data points in each described combination, generate the average value of each group of data points in each described combination, and generate the average value of each described combination according to the average value of each group of data points in each described combination second similarity value;
根据各所述组合的第二相似度值,确定各所述组合的组合降维损失值,并根据各所述组合降维损失值,生成与各所述特征映射模型对应的降维损失值。A combined dimensionality reduction loss value of each combination is determined according to the second similarity value of each combination, and a dimensionality reduction loss value corresponding to each feature mapping model is generated according to each combination dimensionality reduction loss value.
可选地,所述根据所述分类损失值和所述降维损失值,确定经更新后所述脑活动识别模型的总损失值的步骤之后,所述方法还包括:Optionally, after the step of determining the total loss value of the updated brain activity recognition model according to the classification loss value and the dimensionality reduction loss value, the method further includes:
判断所述总损失值是否在预设次数内均小于预设值,若在预设次数内均小于预设值,则判定经更新后所述脑活动识别模型所生成的总损失值小于预设值;judging whether the total loss value is less than a preset value within a preset number of times, and if it is less than a preset value within a preset number of times, it is determined that the total loss value generated by the brain activity recognition model after updating is less than a preset value value;
若未在预设次数内均小于预设值,则执行接收所述更新参数,对所述脑活动识别模型进行更新的步骤。If it is not less than the preset value within the preset times, the step of receiving the update parameters and updating the brain activity recognition model is performed.
进一步地,为实现上述目的,本发明还提供一种基于联邦迁移的脑电数据处理装置,所述基于联邦迁移的脑电数据处理装置包括:Further, in order to achieve the above purpose, the present invention also provides an EEG data processing device based on federated migration, the EEG data processing device based on federated migration includes:
获取模块,用于获取多组脑电数据,并将多组所述脑电数据分别传输到本地终端内,与多组所述脑电数据分别对应的特征映射模型进行映射处理,生成标准脑电数据;The acquiring module is used to acquire multiple sets of EEG data, and transmit the multiple sets of EEG data to the local terminal respectively, perform mapping processing on feature mapping models corresponding to the multiple sets of EEG data, and generate standard EEG data data;
生成模块,用于将所述标准脑电数据传输到本地终端内的脑活动识别模型进行处理,生成模型参数传输到预设公共服务器,以供所述预设公共服务器对所述模型参数和至少一个他方终端发送的其他模型参数进行聚合,生成更新参数;A generating module, configured to transmit the standard EEG data to the brain activity recognition model in the local terminal for processing, and transmit the generated model parameters to a preset public server, so that the preset public server can compare the model parameters and at least Aggregate other model parameters sent by another terminal to generate updated parameters;
更新模块,用于接收所述更新参数,对所述脑活动识别模型进行更新,并基于更新的所述脑活动识别模型对各特征映射模型重新映射处理得到的标准脑电数据进行处理,直到所述脑活动识别模型所生成的总损失值小于预设值,完成基于联邦迁移对多组所述脑电数据的处理。An update module, configured to receive the update parameters, update the brain activity recognition model, and process the standard EEG data obtained by remapping each feature mapping model based on the updated brain activity recognition model until the The total loss value generated by the brain activity recognition model is less than a preset value, and the processing of multiple sets of EEG data based on federated migration is completed.
进一步地,为实现上述目的,本发明还提供一种基于联邦迁移的脑电数据处理设备,所述基于联邦迁移的脑电数据处理设备包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的基于联邦迁移的脑电数据处理程序,所述基于联邦迁移的脑电数据处理程序被所述处理器执行时实现如上述所述的基于联邦迁移的脑电数据处理方法的步骤。Further, in order to achieve the above purpose, the present invention also provides an EEG data processing device based on federated migration, which includes a memory, a processor, and a memory stored on the memory and can be The federated migration-based EEG data processing program running on the processor, when the federated migration-based EEG data processing program is executed by the processor, implements the federated migration-based EEG data processing method as described above A step of.
进一步地,为实现上述目的,本发明还提供一种介质,所述介质上存储有基于联邦迁移的脑电数据处理程序,所述基于联邦迁移的脑电数据处理程序被处理器执行时实现如上所述的基于联邦迁移的脑电数据处理方法的步骤。Further, in order to achieve the above object, the present invention also provides a medium, on which a federated migration-based EEG data processing program is stored, and when the federated migration-based EEG data processing program is executed by a processor, the above The steps of the EEG data processing method based on federated migration.
本发明的基于联邦迁移的脑电数据处理方法,将由多个设备获取的多组脑电数据分别传输到本地终端内,与多个设备连接的特征映射模型进行映射处理,生成本地终端的标准脑电数据;此后,将该标准脑电数据传输到本地终端内的脑活动识别模型进行处理,生成模型参数传输到预设公共服务器进行联邦迁移训练,预设公共服务器该模型参数和至少来自于一个他方终端的其他模型参数进行聚合,生成更新参数返回到本地终端;通过接收到更新参数对脑活动识别模型更新,脑活动识别模型更新过程中,多个特征映射模型也分别在对各自的脑电数据重新映射处理,得到标准脑电数据,基于更新的脑活动识别模型对该重新映射处理的标准脑电数据进行处理,直到脑活动识别模型所生成的总损失值小于预设值,表征脑活动识别模型收敛,具有较好的处理效果,才完成基于联邦迁移对多组脑电数据的处理。因多组脑电数据由多个设备获取而来,避免了脑电数据所存在的稀缺性问题;同时通过对各组脑电数据进行映射处理,使得各脑电数据符合处理的要求,避免因各组脑电数据所来自的设备不同而出现异质性的问题;进而通过联邦迁移学习对各终端的标准脑电数据进行处理,因联邦迁移学习过程中各终端的标准脑电数据保留在终端本地,以此避免了隐私信息的泄露。因此,实现了在充分保护用户隐私的前提下对脑电数据进行处理,且因脑电数据不存在稀缺性和异质性的问题,不需要以各种方式去获取大量脑电数据,使得处理效率大大提高。The EEG data processing method based on federated migration of the present invention transmits multiple sets of EEG data acquired by multiple devices to the local terminal respectively, performs mapping processing with the feature mapping model connected to multiple devices, and generates a standard EEG data of the local terminal. After that, the standard EEG data is transmitted to the brain activity recognition model in the local terminal for processing, and the generated model parameters are transmitted to the preset public server for federated migration training. The model parameters of the preset public server and at least come from one The other model parameters of the other terminal are aggregated, and the updated parameters are generated and returned to the local terminal; the brain activity recognition model is updated by receiving the update parameters. Data remapping processing to obtain standard EEG data, based on the updated brain activity recognition model to process the remapped standard EEG data until the total loss value generated by the brain activity recognition model is less than the preset value, representing brain activity The recognition model converges and has a good processing effect before completing the processing of multiple sets of EEG data based on federated migration. Because multiple sets of EEG data are acquired by multiple devices, the scarcity problem of EEG data is avoided; at the same time, by mapping and processing each set of EEG data, each EEG data meets the processing requirements, avoiding the Each group of EEG data comes from different devices, resulting in the problem of heterogeneity; then, the standard EEG data of each terminal is processed through federated transfer learning, because the standard EEG data of each terminal in the process of federated transfer learning is retained in the terminal Local, so as to avoid the leakage of private information. Therefore, it is possible to process EEG data under the premise of fully protecting user privacy, and because EEG data does not have the problems of scarcity and heterogeneity, it is not necessary to obtain a large amount of EEG data in various ways, making the processing Efficiency is greatly improved.
附图说明Description of drawings
图1为本发明基于联邦迁移的脑电数据处理设备实施例方案涉及的设备硬件运行环境的结构示意图;FIG. 1 is a schematic structural diagram of the device hardware operating environment involved in the embodiment scheme of the federated migration-based EEG data processing device of the present invention;
图2为本发明基于联邦迁移的脑电数据处理方法第一实施例的流程示意图;FIG. 2 is a schematic flow chart of the first embodiment of the federated migration-based EEG data processing method of the present invention;
图3为本发明基于联邦迁移的脑电数据处理装置较佳实施例的功能模块示意图。FIG. 3 is a schematic diagram of functional modules of a preferred embodiment of the federated migration-based EEG data processing device of the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose of the present invention, functional characteristics and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
本发明提供一种基于联邦迁移的脑电数据处理设备,参照图1,图1为本发明基于联邦迁移的脑电数据处理设备实施例方案涉及的设备硬件运行环境的结构示意图。The present invention provides an EEG data processing device based on federated migration. Referring to FIG. 1 , FIG. 1 is a schematic structural diagram of the hardware operating environment of the device involved in the embodiment of the federated migration-based EEG data processing device of the present invention.
如图1所示,该基于联邦迁移的脑电数据处理设备可以包括:处理器1001,例如CPU,通信总线1002、用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储设备。As shown in FIG. 1 , the federated migration-based EEG data processing device may include: a
本领域技术人员可以理解,图1中示出的基于联邦迁移的脑电数据处理设备的硬件结构并不构成对基于联邦迁移的脑电数据处理设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the hardware structure of the federated migration-based EEG data processing device shown in FIG. 1 does not constitute a limitation to the federated migration-based EEG data processing device, and may include more or more Fewer components, or combinations of certain components, or different arrangements of components.
如图1所示,作为一种介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及基于联邦迁移的脑电数据处理程序。其中,操作系统是管理和控制基于联邦迁移的脑电数据处理设备与软件资源的程序,支持网络通信模块、用户接口模块、基于联邦迁移的脑电数据处理程序以及其他程序或软件的运行;网络通信模块用于管理和控制网络接口1004;用户接口模块用于管理和控制用户接口1003。As shown in FIG. 1 , the
在图1所示的基于联邦迁移的脑电数据处理设备硬件结构中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信;处理器1001可以调用存储器1005中存储的基于联邦迁移的脑电数据处理程序,并执行以下操作:In the hardware structure of the EEG data processing device based on federated migration shown in Figure 1, the
获取多组脑电数据,并将多组所述脑电数据分别传输到本地终端内,与多组所述脑电数据分别对应的特征映射模型进行映射处理,生成标准脑电数据;Obtaining multiple sets of EEG data, and transmitting the multiple sets of EEG data to the local terminal respectively, and performing mapping processing on feature mapping models respectively corresponding to the multiple sets of EEG data, to generate standard EEG data;
将所述标准脑电数据传输到本地终端内的脑活动识别模型进行处理,生成模型参数传输到预设公共服务器,以供所述预设公共服务器对所述模型参数和至少一个他方终端发送的其他模型参数进行聚合,生成更新参数;The standard EEG data is transmitted to the brain activity recognition model in the local terminal for processing, and the generated model parameters are transmitted to the preset public server, so that the preset public server can compare the model parameters and the information sent by at least one other terminal. Other model parameters are aggregated to generate update parameters;
接收所述更新参数,对所述脑活动识别模型进行更新,并基于更新的所述脑活动识别模型对各特征映射模型重新映射处理得到的标准脑电数据进行处理,直到所述脑活动识别模型所生成的总损失值小于预设值,完成基于联邦迁移对多组所述脑电数据的处理。receiving the update parameters, updating the brain activity recognition model, and processing the standard EEG data obtained by remapping each feature mapping model based on the updated brain activity recognition model until the brain activity recognition model The generated total loss value is less than the preset value, and the processing of multiple sets of EEG data based on federated migration is completed.
进一步地,所述完成基于联邦迁移对多组所述脑电数据的处理的步骤之后,处理器1001可以调用存储器1005中存储的基于联邦迁移的脑电数据处理程序,并执行以下操作:Further, after the step of processing multiple sets of EEG data based on federated migration is completed, the
当接收到待处理脑电数据时,调用所述特征映射模型进行映射处理;When the EEG data to be processed is received, the feature mapping model is called to perform mapping processing;
将映射处理的待处理脑电数据传输到脑活动识别模型进行分类处理,获得与所述待处理脑电数据对应的脑活动类型。The EEG data to be processed by mapping is transmitted to the brain activity recognition model for classification processing, and the brain activity type corresponding to the EEG data to be processed is obtained.
进一步地,所述将多组所述脑电数据分别传输到本地终端内,与多组所述脑电数据分别对应的特征映射模型进行映射处理,生成标准脑电数据的步骤包括:Further, the step of transmitting the plurality of sets of EEG data to the local terminal respectively, performing mapping processing on feature mapping models corresponding to the plurality of sets of EEG data, and generating standard EEG data includes:
根据多组所述脑电数据的数据属性,对多组所述脑电数据进行预处理;Preprocessing the multiple sets of EEG data according to the data attributes of the multiple sets of EEG data;
将经预处理的多组所述脑电数据分别传输到本地终端内,并根据本地终端内与多组所述脑电数据分别对应的特征映射模型,对多组所述脑电数据分别进行映射处理,生成所述标准脑电数据。Transmitting the preprocessed multiple sets of EEG data to the local terminal respectively, and mapping the multiple sets of EEG data respectively according to the feature mapping models corresponding to the multiple sets of EEG data in the local terminal processing to generate the standard EEG data.
进一步地,所述基于更新的所述脑活动识别模型对各特征映射模型重新映射处理得到的标准脑电数据进行处理的步骤之后,处理器1001可以调用存储器1005中存储的基于联邦迁移的脑电数据处理程序,并执行以下操作:Further, after the step of processing the standard EEG data obtained by remapping each feature mapping model based on the updated brain activity recognition model, the
获取更新后的所述脑活动识别模型对重新映射处理得到的标准脑电数据进行处理所生成的处理结果,并根据所述处理结果,确定经更新后所述脑活动识别模型对应的分类损失值;Obtain the processing result generated by processing the standard EEG data obtained by the remapping process with the updated brain activity recognition model, and determine the classification loss value corresponding to the updated brain activity recognition model according to the processing result ;
根据重新映射处理的标准脑电数据,确定与各所述特征映射模型对应的降维损失值;According to the standard EEG data processed by remapping, determine the dimensionality reduction loss value corresponding to each of the feature mapping models;
根据所述分类损失值和所述降维损失值,确定经更新后所述脑活动识别模型的总损失值。A total loss value of the updated brain activity recognition model is determined according to the classification loss value and the dimensionality reduction loss value.
进一步地,所述根据所述处理结果,确定经更新后所述脑活动识别模型对应的分类损失值的步骤包括:Further, the step of determining the classification loss value corresponding to the updated brain activity recognition model according to the processing result includes:
读取所述标准脑电数据的参考结果,并在所述参考结果和所述处理结果之间进行相似度计算,生成第一相似度值;reading the reference result of the standard EEG data, and performing similarity calculation between the reference result and the processing result to generate a first similarity value;
根据所述第一相似度值,确定经更新后所述脑活动识别模型的分类损失值。A classification loss value of the updated brain activity recognition model is determined according to the first similarity value.
进一步地,所述根据重新映射处理的标准脑电数据,确定与各所述特征映射模型对应的降维损失值的步骤包括:Further, the step of determining the dimensionality reduction loss value corresponding to each of the feature mapping models according to the standard EEG data processed by remapping includes:
根据重新映射处理的标准脑电数据与多组所述脑电数据之间的对应关系,将重新映射处理的标准脑电数据划分为多组标准子数据;According to the corresponding relationship between the remapped standard EEG data and multiple sets of the EEG data, the remapped standard EEG data is divided into multiple sets of standard sub-data;
对多组所述标准子数据进行两两组合,并对各所述组合中的每组标准子数据分别进行再现处理,生成各所述组合中的两组数据点;performing two-two combinations on multiple sets of standard sub-data, and performing reproduction processing on each set of standard sub-data in each combination to generate two sets of data points in each combination;
对各所述组合中每组数据点分别进行均值处理,生成各所述组合中每组数据点的平均值,并根据各所述组合中每组数据点的平均值,生成各所述组合的第二相似度值;Perform mean value processing on each group of data points in each described combination, generate the average value of each group of data points in each described combination, and generate the average value of each described combination according to the average value of each group of data points in each described combination second similarity value;
根据各所述组合的第二相似度值,确定各所述组合的组合降维损失值,并根据各所述组合降维损失值,生成与各所述特征映射模型对应的降维损失值。A combined dimensionality reduction loss value of each combination is determined according to the second similarity value of each combination, and a dimensionality reduction loss value corresponding to each feature mapping model is generated according to each combination dimensionality reduction loss value.
进一步地,所述根据所述分类损失值和所述降维损失值,确定经更新后所述脑活动识别模型的总损失值的步骤之后,处理器1001可以调用存储器1005中存储的基于联邦迁移的脑电数据处理程序,并执行以下操作:Further, after the step of determining the total loss value of the updated brain activity recognition model according to the classification loss value and the dimensionality reduction loss value, the
判断所述总损失值是否在预设次数内均小于预设值,若在预设次数内均小于预设值,则判定经更新后所述脑活动识别模型所生成的总损失值小于预设值;judging whether the total loss value is less than a preset value within a preset number of times, and if it is less than a preset value within a preset number of times, it is determined that the total loss value generated by the brain activity recognition model after updating is less than a preset value value;
若未在预设次数内均小于预设值,则执行接收所述更新参数,对所述脑活动识别模型进行更新的步骤。If it is not less than the preset value within the preset times, the step of receiving the update parameters and updating the brain activity recognition model is performed.
本发明基于联邦迁移的脑电数据处理设备的具体实施方式与下述基于联邦迁移的脑电数据处理方法各实施例基本相同,在此不再赘述。The specific implementation of the federated migration-based EEG data processing device of the present invention is basically the same as the following embodiments of the federated migration-based EEG data processing method, and will not be repeated here.
本发明还提供一种基于联邦迁移的脑电数据处理方法。The invention also provides a federated migration-based EEG data processing method.
参照图2,图2为本发明基于联邦迁移的脑电数据处理方法第一实施例的流程示意图。Referring to FIG. 2 , FIG. 2 is a schematic flowchart of a first embodiment of a method for processing EEG data based on federated migration in the present invention.
本发明实施例提供了基于联邦迁移的脑电数据处理方法的实施例,需要说明的是,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。具体地,本实施例中的基于联邦迁移的脑电数据处理方法包括:The embodiment of the present invention provides an embodiment of the EEG data processing method based on federated migration. It should be noted that although the logical order is shown in the flow chart, in some cases, the order may be different from that here. Perform the steps shown or described. Specifically, the federated migration-based EEG data processing method in this embodiment includes:
步骤S10,获取多组脑电数据,并将多组所述脑电数据分别传输到本地终端内,与多组所述脑电数据分别对应的特征映射模型进行映射处理,生成标准脑电数据。Step S10, acquiring multiple sets of EEG data, and transmitting the multiple sets of EEG data to the local terminal, and performing mapping processing on the feature mapping models corresponding to the multiple sets of EEG data, to generate standard EEG data.
本实施例中的基于联邦迁移的脑电数据处理方法应用于联邦迁移的本地终端,适用于通过本地终端借助联邦迁移学习联合至少一个他方终端对脑电数据进行处理。因本地终端内部和他方终端内部对脑电数据的处理过程相似,本实施例优先以本地终端为例说明该内部处理过程。其中,脑电(EEG)是指头皮脑电,是采用安放在头皮的电极记录并通过信号放大器放大得到的电信号,是大脑皮层的神经细胞集群发生同步化放电的突触活动而产生电位变化在头皮的总体反映。EEG含有丰富的大脑活动信息,当人处于较高警觉性并进行较高难度的任务时,脑电活动的主要成分会趋向于幅度较低、频率较高的β波;当人处于清醒但较低的警觉性时,α波活动增强;当人处于困倦状态时,θ波明显增强。一般认为,心理压力、思维活跃和注意都会促使脑电活动向较高频段移动并且抑制α波的活动。即EEG可用于反映个体的疲劳度、惊恐度、警觉度、行为意图等信息。The federated migration-based EEG data processing method in this embodiment is applied to federated-migrated local terminals, and is suitable for processing EEG data in cooperation with at least one other terminal through the local terminal through federated migration learning. Since the processing process of the EEG data inside the local terminal is similar to that inside the terminal of the other party, this embodiment first uses the local terminal as an example to describe the internal processing process. Among them, electroencephalogram (EEG) refers to scalp electroencephalogram, which is an electrical signal recorded by electrodes placed on the scalp and amplified by a signal amplifier. It is the synaptic activity of synchronous discharge of nerve cell clusters in the cerebral cortex to produce potential changes. General reflection on the scalp. EEG contains a wealth of brain activity information. When a person is in a state of high alertness and performing tasks of high difficulty, the main components of brain electrical activity tend to be β waves with lower amplitude and higher frequency; When alertness is low, the alpha wave activity is enhanced; when the person is sleepy, theta wave is significantly enhanced. It is generally believed that psychological stress, active thinking and attention will promote the movement of brain electrical activity to higher frequency bands and inhibit the activity of alpha waves. That is, EEG can be used to reflect information such as individual fatigue, panic, alertness, and behavioral intentions.
本实施例中本地终端连接有多种可对脑电数据进行采集的采集设备,如传感器、记录仪等,以通过各种采集设备来采集脑电数据,即EEG数据。对采集的脑电数据按照各采集设备进行分组,将由同一个采集设备采集的EEG数据作为一组脑电数据。因同一采集设备所采集的EEG数据的类型相同,使得每组脑电数据的数据类型相同,而不同组之间的脑电数据类型不同。如某一采集设备包含两个电极,用于采集在闭眼和呼吸状态下的EEG数据,则由该采集设备采集EEG数据所形成的脑电数据,均表征闭眼和呼吸状态下的数据,属于同一数据类型;另一采集设备包含两个电极,用于采集在声刺激和光刺激状态下的EEG数据,则由该采集设备采集EEG数据所形成的脑电数据,均表征光刺激和声刺激状态下的数据,属于同一数据类型。In this embodiment, the local terminal is connected with various acquisition devices capable of collecting EEG data, such as sensors, recorders, etc., so as to collect EEG data, ie, EEG data, through various acquisition devices. The collected EEG data are grouped according to each collection device, and the EEG data collected by the same collection device are regarded as a group of EEG data. Because the types of EEG data collected by the same collection device are the same, the data types of each group of EEG data are the same, but the types of EEG data between different groups are different. If a collection device includes two electrodes for collecting EEG data in the state of eyes closed and breathing, the EEG data formed by collecting EEG data from the collection device represent the data in the state of eyes closing and breathing, belong to the same data type; the other collection device contains two electrodes for collecting EEG data under the state of sound stimulation and light stimulation, and the EEG data formed by collecting EEG data by the collection device both represent light stimulation and sound stimulation The data in the state, belong to the same data type.
进一步地,本地终端内设置有多个特征映射模型,且每个特征映射模型均与一个采集设备连接,将各组脑电数据按照采集设备所连接的特征映射模型进行传输,传输到各自连接的特征映射模型中进行映射处理。其中映射处理其实质为格式上的标准化处理,经处理得到各终端的标准脑电数据,以使得各采集设备所采集的脑电数据在格式上具有一致性,便于通过联邦迁移学习对具有相同格式的脑电数据进行处理。具体地,将多组脑电数据分别传输到本地终端内,与多组脑电数据分别对应的特征映射模型进行映射处理,生成标准脑电数据的步骤包括:Further, multiple feature mapping models are set in the local terminal, and each feature mapping model is connected to an acquisition device, and each group of EEG data is transmitted according to the feature mapping model connected to the acquisition device, and transmitted to the respective connected The mapping process is carried out in the feature mapping model. The essence of the mapping process is the standardized processing of the format. After processing, the standard EEG data of each terminal is obtained, so that the EEG data collected by each acquisition device are consistent in format, and it is convenient to use federated transfer learning to pair the EEG data with the same format. EEG data are processed. Specifically, the multiple sets of EEG data are respectively transmitted to the local terminal, and the feature mapping models corresponding to the multiple sets of EEG data are mapped, and the steps of generating standard EEG data include:
步骤S11,根据多组所述脑电数据的数据属性,对多组所述脑电数据进行预处理;Step S11, performing preprocessing on multiple sets of EEG data according to data attributes of multiple sets of EEG data;
步骤S12,将经预处理的多组所述脑电数据分别传输到本地终端内,并根据本地终端内与多组所述脑电数据分别对应的特征映射模型,对多组所述脑电数据分别进行映射处理,生成所述标准脑电数据。Step S12, transmitting the preprocessed multiple sets of EEG data to the local terminal respectively, and according to the feature mapping models in the local terminal corresponding to the multiple sets of EEG data, for multiple sets of the EEG data Mapping processing is performed respectively to generate the standard EEG data.
可理解地,不同采集设备所采集的脑电数据具有不同的属性,可能是电流数据,也可能是电压数据,或者是电磁波数据;且经采集的原始脑电数据可能具有不适合直接处理的因素,而需要进行预处理。该预处理的方式依据属性的不同而不同,至少包括两部分,第一部分的预处理包括前置放大、高通滤波、低通滤波、后级放大、电平迁移等,此后的第二部分预处理包括A/D采样、50HZ陷波和基线漂移等信号处理方式。在采集到多组脑电数据后,依据每组脑电数据中各脑电数据的数据属性进行预处理,直到各组脑电数据中的所有脑电数据均预处理完成,才传输到各自的终端中进行映射处理。Understandably, the EEG data collected by different acquisition devices have different attributes, which may be current data, voltage data, or electromagnetic wave data; and the collected raw EEG data may have factors that are not suitable for direct processing , but preprocessing is required. The way of this preprocessing is different according to different properties, and it includes at least two parts. The first part of preprocessing includes pre-amplification, high-pass filtering, low-pass filtering, post-stage amplification, level shifting, etc., and the second part of preprocessing Including A/D sampling, 50HZ notch and baseline drift and other signal processing methods. After collecting multiple sets of EEG data, preprocessing is carried out according to the data attributes of each EEG data in each set of EEG data, until all the EEG data in each set of EEG data have been pre-processed before being transmitted to their respective The mapping process is performed in the terminal.
进一步地,本地终端内所设置的多个特征映射模型其实质为全联接的神经网络,可以是两层、也可以是三层或者是更多层,每一层均设置有诸如ReLU之类的激活函数。在前一层的向量经加权计算得到计算结果后,通过该激活函数激活,将计算结果传输到下一层继续计算,直到各层均计算完成。通过本地终端内与每个采集设备分别连接的特征映射模型,对传输到其中经预处理的脑电数据进行降维映射处理,筛选出干扰数据,或者不符合要求的脑电数据,以降维减少对不必要数据的处理;同时对必要的脑电数据进行映射,使其符合处理标准。Further, the multiple feature mapping models set in the local terminal are essentially fully connected neural networks, which can be two layers, three layers or more layers, and each layer is equipped with such as ReLU activation function. After the vectors of the previous layer are weighted and calculated to obtain the calculation results, the activation function is activated to transmit the calculation results to the next layer to continue the calculation until the calculation of each layer is completed. Through the feature mapping model connected to each acquisition device in the local terminal, the dimensionality reduction mapping process is performed on the preprocessed EEG data transmitted to it, and the interference data or EEG data that does not meet the requirements are screened out to reduce dimensionality. The processing of unnecessary data; at the same time, the necessary EEG data is mapped to meet the processing standards.
需要说明的是,本地终端中作为特征映射模型的神经网络的输出层维度相同,以使得各组脑电数据经各特征映射模型处理后,具有相同维度的标准脑电数据,便于借助联邦迁移学习对各标准脑电数据处理维度的一致性,有利于处理结果的准确性。It should be noted that the output layer dimension of the neural network used as the feature mapping model in the local terminal is the same, so that after each group of EEG data is processed by each feature mapping model, it has standard EEG data of the same dimension, which is convenient for federated transfer learning. The consistency of processing dimensions of standard EEG data is conducive to the accuracy of processing results.
此外,为了便于实现映射,可在本地终端中设置公共特征子空间,各特征映射模型将经映射处理的各组脑电数据映射到该公共特征子空间中;通过公共特征子空间表征各组经映射处理的数据均具有符合处理标准的公共特征。在本地终端均对传输到其中的各组脑电数据均处理完成后,即得到本地终端的标准脑电数据。进而可借助联邦迁移学习对该标准脑电数据进行处理,以得到用于识别脑活动的脑活动识别模型的模型参数,使脑活动识别模型对脑活动的识别更为准确。In addition, in order to facilitate the realization of mapping, a public feature subspace can be set in the local terminal, and each feature mapping model maps each group of EEG data after mapping to the public feature subspace; The data processed by the mapping all have common characteristics that meet the processing standards. After the local terminal finishes processing each group of EEG data transmitted thereto, the standard EEG data of the local terminal is obtained. Furthermore, the standard EEG data can be processed by means of federated transfer learning to obtain the model parameters of the brain activity recognition model used to recognize brain activity, so that the brain activity recognition model can identify brain activity more accurately.
步骤S20,将所述标准脑电数据传输到本地终端内的脑活动识别模型进行处理,生成模型参数传输到预设公共服务器,以供所述预设公共服务器对所述模型参数和至少一个他方终端发送的其他模型参数进行聚合,生成更新参数;Step S20, the standard EEG data is transmitted to the brain activity recognition model in the local terminal for processing, and the generated model parameters are transmitted to the preset public server, so that the preset public server can compare the model parameters with at least one other party The other model parameters sent by the terminal are aggregated to generate update parameters;
随着科技的发展,“机器学习”已成为人工智能的核心研究领域之一,而如何在保护数据隐私、满足合法合规要求的前提下继续进行机器学习,是机器学习领域现在关注的一个趋势,在此背景下,人们研究提出了“联邦学习”的概念。联邦学习利用技术算法加密建造的模型,联邦双方在不用给出己方数据的情况下,也可进行模型训练得到模型参数,联邦学习通过加密机制下的参数交换方式保护用户数据隐私,数据和模型本身不会进行传输,也不能反猜对方数据,因此在数据层面不存在泄露的可能,也不违反更严格的数据保护法案如GDPR(General Data Protection Regulation,《通用数据保护条例》)等,能够在较高程度保持数据完整性的同时,保障数据隐私。With the development of science and technology, "machine learning" has become one of the core research fields of artificial intelligence, and how to continue machine learning on the premise of protecting data privacy and meeting legal and compliance requirements is a trend that the field of machine learning is now concerned about , In this context, people have proposed the concept of "federated learning". Federated learning uses technical algorithms to encrypt the built model. Both sides of the federation can also conduct model training to obtain model parameters without giving their own data. Federated learning protects user data privacy through parameter exchange under the encryption mechanism, data and the model itself It will not be transmitted, nor can it guess the other party's data, so there is no possibility of leakage at the data level, and it will not violate stricter data protection laws such as GDPR (General Data Protection Regulation, "General Data Protection Regulation"), etc. While maintaining a high degree of data integrity, data privacy is guaranteed.
本实施例的联邦迁移学习是联邦学习的一种类型,是指在至少两个数据集的用户与用户特征重叠都较少的情况下,不对数据进行切分,而利用迁移学习来克服数据或标签不足的情况。本实施在将经获取的多组脑电数据分别传输到不同特征映射模型进行映射处理,得到本地终端的标准脑电数据后,本地终端的标准脑电数据即形成数据集,可通过联邦迁移学习对其进行处理,生成用于对本地终端中脑活动识别模型进行更新的更新参数;通过将采集的大量脑电数据作为脑活动识别模型的更新依据,可使得脑活动识别模型对脑活动的识别更为准确。The federated transfer learning in this embodiment is a type of federated learning, which refers to the use of transfer learning to overcome data or Insufficient labeling. In this implementation, multiple sets of acquired EEG data are transferred to different feature mapping models for mapping processing. After obtaining the standard EEG data of the local terminal, the standard EEG data of the local terminal forms a data set, which can be learned through federated transfer learning. Process it to generate update parameters for updating the brain activity recognition model in the local terminal; by using a large amount of collected EEG data as the basis for updating the brain activity recognition model, the brain activity recognition model can recognize brain activity more accurate.
进一步地,本地终端内的多个特征映射模型均与本地终端内的脑电识别模型连接,在借助联邦迁移学习对本地终端的标准脑电数据处理的过程中,先将经映射处理的标准脑电数据传输到本地终端中的脑电识别模型,由脑电识别模型进行处理,得到本地终端中脑电识别模型的模型参数。该模型参数其实质为用于对脑电识别模型的参数进行更新优化的模型梯度,以使得脑电识别更为准确。Furthermore, multiple feature mapping models in the local terminal are connected to the EEG recognition model in the local terminal. In the process of processing the standard EEG data of the local terminal with the help of federated transfer learning, the mapped standard EEG The electrical data is transmitted to the EEG recognition model in the local terminal, and processed by the EEG recognition model to obtain model parameters of the EEG recognition model in the local terminal. The model parameters are essentially model gradients used to update and optimize the parameters of the EEG recognition model, so as to make the EEG recognition more accurate.
需要说明的是,各组脑电数据在经预处理之后,采用人工干预的方式对各组脑电数据进行标注,再将该携带有标注信息的脑电数据分别映射到公共特征子空间。通过将公共特征子空间中的各项数据以及各自对应的标注信息,传输到脑电识别模型进行处理,来实现对脑电识别模型的训练,生成对脑电识别模型优化更新的更新参数。It should be noted that after the preprocessing of each group of EEG data, manual intervention is used to label each group of EEG data, and then the EEG data carrying the labeled information are mapped to the common feature subspace respectively. By transmitting various data in the public feature subspace and their corresponding labeling information to the EEG recognition model for processing, the training of the EEG recognition model is realized, and update parameters for optimizing and updating the EEG recognition model are generated.
更进一步地,本地终端和他方终端均与预先设置的预设公共服务器连接,本地终端在对其内部标准脑电数据进行处理,生成模型参数的同时,他方终端也在对其内部的标准脑电数据进行处理,生成他方终端的其他模型参数。本地终端将生成的模型参数进行加密处理,该加密方式可选用诸如Paillier’sscheme此类的加法同态加密,并将经加密的模型参数传输到预设公共服务器,在预设公共服务器中采用针对各终端所预先设置的权重值,对该模型参数以及至少来源于一个其他终端的模型参数进行加权聚合,生成对脑活动识别模型的参数进行更新的更新参数。Furthermore, both the local terminal and the other party’s terminal are connected to the pre-set preset public server. While the local terminal is processing its internal standard EEG data to generate model parameters, the other party’s terminal is also processing its internal standard EEG data. The data is processed to generate other model parameters of other terminals. The local terminal encrypts the generated model parameters. The encryption method can be an additive homomorphic encryption such as Paillier's scheme, and transmits the encrypted model parameters to the preset public server. The weight value preset by each terminal performs weighted aggregation on the model parameters and model parameters from at least one other terminal to generate update parameters for updating the parameters of the brain activity recognition model.
步骤S30,接收所述更新参数,对所述脑活动识别模型进行更新,并基于更新的所述脑活动识别模型对各特征映射模型重新映射处理得到的标准脑电数据进行处理,直到所述脑活动识别模型所生成的总损失值小于预设值,完成基于联邦迁移对多组所述脑电数据的处理。Step S30, receiving the updated parameters, updating the brain activity recognition model, and processing the standard EEG data obtained by remapping each feature mapping model based on the updated brain activity recognition model until the brain activity The total loss value generated by the activity recognition model is less than a preset value, and the processing of multiple sets of EEG data based on federated migration is completed.
进一步地,预设公共服务器将所生成的更新参数分别下发到各个终端,本地终端在接收到更新参数后,通过其对本地终端内脑活动识别模型的参数进行更新,以此实现脑活动识别模型的更新。此后,针对更新后的脑活动识别模型进行总损失值计算,设定判定总损失值大小的预设值;将计算的总损失值和该预设值对比,判断总损失值是否小于预设值。若小于预设值,则说明依据大量脑电数据更新后的脑活动识别模型,对脑电数据处理的损失值较小;判定脑活动识别模型训练结束,完成对多种脑电数据的处理。若不小于预设值,则说明对脑电数据处理的损失值较大,需要继续训练。其中,脑活动识别模型在更新过程中,多个特征映射模型也分别在对各自的脑电数据重新映射处理,得到标准脑电数据。继续训练时,基于更新的脑活动识别模型对该重新映射处理的标准脑电数据进行处理,生成新的模型参数传输到预设公共服务器,得到更新参数对脑活动识别模型进行更新,如此循环,直到更新后的脑活动识别模型所生成的总损失值小于预设值,完成基于联邦迁移对多组脑电数据的处理。Further, the preset public server sends the generated update parameters to each terminal respectively, and after receiving the update parameters, the local terminal uses it to update the parameters of the brain activity recognition model in the local terminal, so as to realize brain activity recognition Model updates. Thereafter, calculate the total loss value for the updated brain activity recognition model, and set a preset value for determining the size of the total loss value; compare the calculated total loss value with the preset value, and determine whether the total loss value is less than the preset value . If it is less than the preset value, it means that the brain activity recognition model updated based on a large amount of EEG data has a small loss value for EEG data processing; it is determined that the training of the brain activity recognition model is completed, and the processing of various EEG data is completed. If it is not less than the preset value, it means that the loss value of the EEG data processing is relatively large, and training needs to be continued. Among them, during the update process of the brain activity recognition model, multiple feature mapping models are also remapping their respective EEG data to obtain standard EEG data. When continuing training, process the remapped standard EEG data based on the updated brain activity recognition model, generate new model parameters and transmit them to the preset public server, obtain updated parameters to update the brain activity recognition model, and so on. Until the total loss value generated by the updated brain activity recognition model is less than the preset value, the processing of multiple sets of EEG data based on federated migration is completed.
更进一步地,在训练结束得到用于对脑活动分类识别的脑活动识别模型后,若接收到需要进行脑活动分类识别的脑电数据,则将该脑电数据作为待处理脑电数据。调用本地终端内的特征映射模型进行映射处理,并将经映射处理的待处理脑电数据传输到脑活动识别模型进行分类,得到脑活动类型,体现待处理脑电数据所反映的脑活动。Furthermore, after the training is completed to obtain the brain activity recognition model for the classification and recognition of brain activity, if the EEG data that needs to be classified and recognized is received, the EEG data is used as the EEG data to be processed. The feature mapping model in the local terminal is called for mapping processing, and the EEG data to be processed after mapping is transmitted to the brain activity recognition model for classification, and the type of brain activity is obtained to reflect the brain activity reflected by the EEG data to be processed.
本发明的基于联邦迁移的脑电数据处理方法,将由多个设备获取的多组脑电数据分别传输到本地终端内,与多个设备连接的特征映射模型进行映射处理,生成本地终端的标准脑电数据;此后,将该标准脑电数据传输到本地终端内的脑活动识别模型进行处理,生成模型参数传输到预设公共服务器进行联邦迁移训练,预设公共服务器该模型参数和至少来自于一个他方终端的其他模型参数进行聚合,生成更新参数返回到本地终端;通过接收到更新参数对脑活动识别模型更新,脑活动识别模型更新过程中,多个特征映射模型也分别在对各自的脑电数据重新映射处理,得到标准脑电数据,基于更新的脑活动识别模型对该重新映射处理的标准脑电数据进行处理,直到脑活动识别模型所生成的总损失值小于预设值,表征脑活动识别模型收敛,具有较好的处理效果,才完成基于联邦迁移对多组脑电数据的处理。因多组脑电数据由多个设备获取而来,避免了脑电数据所存在的稀缺性问题;同时通过对各组脑电数据进行映射处理,使得各脑电数据符合处理的要求,避免因各组脑电数据所来自的设备不同而出现异质性的问题;进而通过联邦迁移学习对各终端的标准脑电数据进行处理,因联邦迁移学习过程中各终端的标准脑电数据保留在终端本地,以此避免了隐私信息的泄露。因此,实现了在充分保护用户隐私的前提下对脑电数据进行处理,且因脑电数据不存在稀缺性和异质性的问题,不需要以各种方式去获取大量脑电数据,使得处理效率大大提高。The EEG data processing method based on federated migration of the present invention transmits multiple sets of EEG data acquired by multiple devices to the local terminal respectively, performs mapping processing with the feature mapping model connected to multiple devices, and generates a standard EEG data of the local terminal. After that, the standard EEG data is transmitted to the brain activity recognition model in the local terminal for processing, and the generated model parameters are transmitted to the preset public server for federated migration training. The model parameters of the preset public server and at least come from one The other model parameters of the other terminal are aggregated, and the updated parameters are generated and returned to the local terminal; the brain activity recognition model is updated by receiving the update parameters. Data remapping processing to obtain standard EEG data, based on the updated brain activity recognition model to process the remapped standard EEG data until the total loss value generated by the brain activity recognition model is less than the preset value, representing brain activity The recognition model converges and has a good processing effect before completing the processing of multiple sets of EEG data based on federated migration. Because multiple sets of EEG data are acquired by multiple devices, the scarcity problem of EEG data is avoided; at the same time, by mapping and processing each set of EEG data, each EEG data meets the processing requirements, avoiding the Each group of EEG data comes from different devices, resulting in the problem of heterogeneity; then, the standard EEG data of each terminal is processed through federated transfer learning, because the standard EEG data of each terminal in the process of federated transfer learning is retained in the terminal Local, in order to avoid the leakage of private information. Therefore, it is possible to process EEG data under the premise of fully protecting user privacy, and because EEG data does not have the problems of scarcity and heterogeneity, it is not necessary to obtain a large amount of EEG data in various ways, making the processing Efficiency is greatly improved.
进一步地,基于本发明基于联邦迁移的脑电数据处理方法的第一实施例,提出本发明基于联邦迁移的脑电数据处理方法第二实施例。Further, based on the first embodiment of the federated migration-based EEG data processing method of the present invention, a second embodiment of the federated migration-based EEG data processing method of the present invention is proposed.
所述基于联邦迁移的脑电数据处理方法第二实施例与所述基于联邦迁移的脑电数据处理方法第一实施例的区别在于,所述基于更新的所述脑活动识别模型对各特征映射模型重新映射处理得到的标准脑电数据进行处理的步骤之后,还包括:The difference between the second embodiment of the federated migration-based EEG data processing method and the federated migration-based EEG data processing method in the first embodiment is that the updated brain activity recognition model based on each feature map After the step of processing the standard EEG data obtained by the model remapping process, it also includes:
步骤a1,获取更新后的所述脑活动识别模型对重新映射处理得到的标准脑电数据进行处理所生成的处理结果,并根据所述处理结果,确定经更新后各所述脑活动识别模型对应的分类损失值;Step a1, obtaining the processing result generated by processing the standard EEG data obtained by the remapping process with the updated brain activity recognition model, and according to the processing result, determine the corresponding brain activity recognition model after the update. The classification loss value;
步骤a2,根据重新映射处理的标准脑电数据,确定与各所述特征映射模型对应的降维损失值;Step a2, according to the standard EEG data processed by remapping, determine the dimensionality reduction loss value corresponding to each of the feature mapping models;
本实施例在通过更新参数对脑活动识别模型进行更新后,还对经更新的脑活动识别模型所对应具有的总损失值进行计算。该总损失值至少包括两个方面;其一为脑活动识别模型对各脑电数据进行分类处理所得到的预测分类结果,与各脑电数据的真实分类结果之间的分类损失值;其二为特征映射模型对各脑电数据进行降维映射,所导致的降维损失值。In this embodiment, after the brain activity recognition model is updated by updating parameters, the total loss value corresponding to the updated brain activity recognition model is also calculated. The total loss value includes at least two aspects; one is the classification loss value between the predicted classification result obtained by the brain activity recognition model for classifying each EEG data and the actual classification result of each EEG data; Dimensionality reduction mapping is performed on each EEG data for the feature mapping model, resulting in the dimensionality reduction loss value.
进一步地,本地终端在通过预设公共服务器返回的更新参数对其中的脑活动识别模型进行更新的同时,本地终端的特征映射模型也在进行其自身的训练更新。各特征映射模型以不同的映射方式对传输到其中经预处理的各组脑电数据进行映射,以优化经各次映射所得到的标准脑电数据。因此,更新的脑活动识别模型对重新映射处理得到的标准脑电数据进行分类识别处理,生成处理结果,进而通过该处理结果与真实的参考结果之间的损失,来确定经更新后脑活动识别模型所对应具有的分类损失值。对于对多组脑电数据重新映射所得到的标准脑电数据,若各组脑电数据之间经映射的标准脑电数据所具有的相似程度越高,则说明各特征映射模型之间的映射越相似,降维损失值越小。从而可通过多组脑电数据经重新映射所得到的标准脑电数据之间的相似度高低,来确定各特征映射模型对脑电数据进行映射处理所对应的降维损失值。Further, while the local terminal is updating the brain activity recognition model therein by preset update parameters returned by the public server, the feature mapping model of the local terminal is also updating its own training. Each feature mapping model maps each group of preprocessed EEG data transmitted to it in different mapping ways, so as to optimize the standard EEG data obtained through each mapping. Therefore, the updated brain activity recognition model classifies and recognizes the standard EEG data obtained by the remapping process, generates processing results, and then determines the updated brain activity recognition model through the loss between the processing results and the real reference results The corresponding classification loss value. For the standard EEG data obtained by remapping multiple sets of EEG data, if the similarity of the mapped standard EEG data between each set of EEG data is higher, it means that the mapping between each feature mapping model The more similar, the smaller the dimensionality reduction loss. Therefore, the dimensionality reduction loss value corresponding to the mapping process of the EEG data by each feature mapping model can be determined through the similarity between the standard EEG data obtained by remapping multiple sets of EEG data.
其中,所述根据所述处理结果,确定经更新后所述脑活动识别模型对应的分类损失值的步骤包括:Wherein, the step of determining the classification loss value corresponding to the updated brain activity recognition model according to the processing result includes:
步骤a11,读取所述标准脑电数据的参考结果,并在所述参考结果和所述处理结果之间进行相似度计算,生成第一相似度值;Step a11, reading the reference result of the standard EEG data, and performing similarity calculation between the reference result and the processing result to generate a first similarity value;
步骤a12,根据所述第一相似度值,确定经更新后所述脑活动识别模型的分类损失值。Step a12, according to the first similarity value, determine the classification loss value of the brain activity recognition model after updating.
进一步地,本地终端中更新的脑活动识别模型,对重新映射的标准脑电数据进行分类识别,生成分类结果,该分类结果即为处理结果。在获取到该处理结果后,依据标准脑电数据所携带的标注信息来确定标准脑电数据的真实分类结果,并将该真实分类结果作为标准脑电数据的参考结果进行读取。进而对参考结果和处理结果进行相似度计算,生成第一相似度值,以通过该第一相似度值来表征本地终端对其中标准脑电数据进行分类,所得到的分类结果与真实的分类结果之间的差异性,即本地终端中脑活动识别模型分类的准确性。Further, the updated brain activity recognition model in the local terminal classifies and recognizes the remapped standard EEG data to generate a classification result, which is the processing result. After obtaining the processing result, the real classification result of the standard EEG data is determined according to the annotation information carried by the standard EEG data, and the real classification result is read as a reference result of the standard EEG data. Further, the similarity calculation is performed on the reference result and the processing result to generate a first similarity value, so as to represent that the local terminal classifies the standard EEG data through the first similarity value, and the obtained classification result is consistent with the real classification result The difference between, that is, the classification accuracy of the local terminal midbrain activity recognition model.
更进一步地,处理结果和参考结果之间的相似度表征了脑活动识别模型分类的准确性,两者相似程度越高说明分类越准确,表征经分类所造成的分类损失值越小;反之若相似程度越低说明分类越不准确,表征经分类所造成的分类损失值越大。从而为了通过相似程度的高低来表征分类损失值的大小,可预先设置相似值与分类损失值之间的对应关系。在生成本地终端的第一相似度值后,将该第一相似度值和对应关系对比,确定其在对应关系中所对应的分类损失值,该对应的分类损失值即为本地终端中经更新的脑活动识别模型的分类损失值。Furthermore, the similarity between the processing results and the reference results represents the accuracy of the classification of the brain activity recognition model. The higher the similarity between the two, the more accurate the classification, and the smaller the classification loss caused by the classification; otherwise, if The lower the similarity, the more inaccurate the classification, and the greater the classification loss value caused by the classification. Therefore, in order to represent the size of the classification loss value by the degree of similarity, the corresponding relationship between the similarity value and the classification loss value can be preset. After generating the first similarity value of the local terminal, compare the first similarity value with the corresponding relationship to determine the corresponding classification loss value in the corresponding relationship, and the corresponding classification loss value is the updated value of the local terminal. The classification loss value of the brain activity recognition model.
进一步地,所述根据重新映射处理的标准脑电数据,确定与各所述特征映射模型对应的降维损失值的步骤包括:Further, the step of determining the dimensionality reduction loss value corresponding to each of the feature mapping models according to the standard EEG data processed by remapping includes:
步骤a21,根据重新映射处理的标准脑电数据与多组所述脑电数据之间的对应关系,将重新映射处理的标准脑电数据划分为多组标准子数据;Step a21, dividing the remapped standard EEG data into multiple sets of standard sub-data according to the correspondence between the remapped standard EEG data and multiple sets of the EEG data;
步骤a22,对多组所述标准子数据进行两两组合,并对各所述组合中的每组标准子数据分别进行再现处理,生成各所述组合中的两组数据点;Step a22, combining multiple sets of standard sub-data in pairs, and reproducing each set of standard sub-data in each combination to generate two sets of data points in each combination;
步骤a23,对各所述组合中每组数据点分别进行均值处理,生成各所述组合中每组数据点的平均值,并根据各所述组合中每组数据点的平均值,生成各所述组合的第二相似度值;Step a23, performing mean value processing on each group of data points in each of the combinations, generating the average value of each group of data points in each of the combinations, and generating the average value of each group of data points in each of the combinations. The second similarity value of the combination;
步骤a24,根据各所述组合的第二相似度值,确定各所述组合的组合降维损失值,并根据各所述组合降维损失值,生成与各所述特征映射模型对应的降维损失值。Step a24: Determine the combined dimensionality reduction loss value of each combination according to the second similarity value of each combination, and generate a dimensionality reduction value corresponding to each feature mapping model according to each combination dimensionality reduction loss value loss value.
本实施例为了反映多组脑电数据间经重新映射的标准脑电数据所具有的相似程度高低,依据重新映射处理所得到的标准脑电数据与处理前原始的多组脑电数据之间的对应关系,将重新映射处理的标准脑电数据划分为多组标准子数据,一组标准子数据对应由一组脑电数据生成。此后对各组标准子数据进行两两排列组合,得到均包含两组标准子数据的多个组合。如所涉及到的三组标准子数据A、B、C,则对三者进行两两排列组合,所得到的组合包括AB、AC和BC。此后,对每个组合中的每组标准子数据通过诸如核希尔伯特空间此类的方式分别进行再现处理,通过特征映射将其中包含的各个标准脑电数据从公共特征子空间再现到核希尔伯特子空间,实现将标准脑电数据再现为数据点,以此得到组合中两组数据点。如对于上述组合BC,其中两组标准子数据B和C包含的标准脑电数据分别为[b1、b2、b3、b4、b5]和[c1、c2、c3、c4、c5],则经过再现出来,得到两组数据点[m1、m2、m3、m4、m5]和[n1、n2、n3、n4、n5]。In order to reflect the degree of similarity of the remapped standard EEG data among multiple sets of EEG data, this embodiment is based on the difference between the standard EEG data obtained through remapping processing and the original multiple sets of EEG data before processing. The corresponding relationship is to divide the remapped standard EEG data into multiple sets of standard sub-data, and a set of standard sub-data is correspondingly generated by a set of EEG data. Thereafter, each group of standard sub-data is permuted and combined in pairs to obtain a plurality of combinations each including two groups of standard sub-data. For the three sets of standard sub-data A, B, and C involved, the three are arranged and combined in pairs, and the resulting combination includes AB, AC, and BC. Thereafter, each group of standard sub-data in each combination is reproduced separately through a method such as the kernel Hilbert space, and each standard EEG data contained in it is reproduced from the common feature subspace to the kernel through the feature map. The Hilbert subspace realizes the reproduction of standard EEG data as data points, so as to obtain two sets of data points in the combination. For example, for the above-mentioned combination BC, where the standard EEG data contained in the two sets of standard sub-data B and C are [b1, b2, b3, b4, b5] and [c1, c2, c3, c4, c5] respectively, after reproduction Come out and get two sets of data points [m1, m2, m3, m4, m5] and [n1, n2, n3, n4, n5].
进一步地,对各组合中的每组数据点分别进行均值处理,生成各组合中每组数据点的平均值;进而对各组合中的两组数据点的平均值进行相似度计算,生成各组合中的第二相似度值。其中,对每组数据点的均值处理其实质为计算每组所包含各数据点的质心点,与此相适应,平均值的相似度计算则为计算两个质心点之间的距离远近。如对于上述组合BC,计算标准子数据B的数据点[m1、m2、m3、m4、m5]的质心点m,标准子数据C的数据点[n1、n2、n3、n4、n5]的质心点n,通过m和n之间的距离远近来表征标准子数据B和C之间的第二相似度值。Further, mean value processing is performed on each group of data points in each combination to generate the average value of each group of data points in each combination; and then the similarity calculation is performed on the average values of the two groups of data points in each combination to generate each combination The second similarity value in . Among them, the essence of the mean value processing for each group of data points is to calculate the centroid points of each data point contained in each group, and accordingly, the similarity calculation of the average value is to calculate the distance between two centroid points. For the above combination BC, calculate the centroid point m of the data points [m1, m2, m3, m4, m5] of the standard sub-data B, and the centroid of the data points [n1, n2, n3, n4, n5] of the standard sub-data C Point n represents the second similarity value between standard sub-data B and C through the distance between m and n.
更进一步地,在各组合均生成第二相似度值之后,由各个第二相似度值可表征各组合中经各自的特征映射模型对脑电数据映射所得到的标准子数据的相似程度高低。组合的第二相似度值越高,表征该组合对应的特征映射模型对脑电数据映射处理的相似程度越高,该组合的组合降维损失值越小;反之则表征对脑电数据映射处理的相似程度越低,该组合的组合降维损失值越大。从而为了通过相似程度的高低来表征组合降维损失值的大小,可预先设置相似值与组合降维损失值之间的对应关系。在生成各组合的第二相似度值后,将该第二相似度值和对应关系对比,确定其在对应关系中所对应的组合降维损失值,该对应的组合降维损失值即为组合所对应特征映射模型对各自脑电数据进行降维映射所造成的组合降维损失值。以此,可得到各个组合的组合降维损失值。进而将各个组合降维损失值进行加和处理,得到表征各个特征映射模型对脑电数据进行映射处理在整体上所造成损失的降维损失值,即与本地终端进行映射处理所对应的降维损失值。Furthermore, after each combination generates the second similarity value, each second similarity value can represent the degree of similarity of the standard sub-data obtained by mapping the EEG data through the respective feature mapping models in each combination. The higher the second similarity value of the combination, the higher the similarity of the feature mapping model corresponding to the combination to the EEG data mapping processing, and the smaller the combined dimensionality reduction loss value of the combination; otherwise, it represents the EEG data mapping processing. The lower the similarity of , the greater the combined dimensionality reduction loss value of the combination. Therefore, in order to characterize the magnitude of the combined dimensionality reduction loss value through the degree of similarity, the corresponding relationship between the similarity value and the combined dimensionality reduction loss value can be preset. After generating the second similarity value of each combination, compare the second similarity value with the corresponding relationship to determine the corresponding combination dimensionality reduction loss value in the correspondence relationship, and the corresponding combination dimensionality reduction loss value is the combination The combined dimensionality reduction loss value caused by the corresponding feature mapping model performing dimensionality reduction mapping on the respective EEG data. In this way, the combined dimensionality reduction loss value of each combination can be obtained. Furthermore, the combined dimensionality reduction loss values are added and processed to obtain the dimensionality reduction loss value representing the overall loss caused by each feature mapping model in the mapping process of EEG data, that is, the dimensionality reduction loss value corresponding to the mapping process with the local terminal. loss value.
步骤S33,根据所述分类损失值和所述降维损失值,确定经更新后所述脑活动识别模型的总损失值。Step S33, according to the classification loss value and the dimensionality reduction loss value, determine the total loss value of the brain activity recognition model after updating.
进一步地,在生成本地终端中经更新后的脑活动识别模型的分类损失值,以及表征整体上的降维损失值后,对该分类损失值和降维损失值进行加和处理,生成经更新后各脑活动识别模型的总损失值,表征当前对脑活动识别模型更新后,脑活动识别模型对脑电数据进行分类,所得到的分类结果与真实结果之间相似程度的高低。其中总损失值越小,表征相似程度越高,脑活动识别模型的分类越准确;反之则表征分类越不准确,需要继续更新训练,直到总损失值较小,而表征分类准确。Further, after generating the classification loss value of the updated brain activity recognition model in the local terminal, and representing the overall dimensionality reduction loss value, the classification loss value and the dimensionality reduction loss value are summed to generate an updated The total loss value of each brain activity recognition model after the current brain activity recognition model is updated, the brain activity recognition model classifies the EEG data, and the degree of similarity between the obtained classification result and the real result is high or low. The smaller the total loss value, the higher the similarity of the representation, and the more accurate the classification of the brain activity recognition model; otherwise, the less accurate the classification of the representation is, and it is necessary to continue to update the training until the total loss value is smaller and the classification of the representation is accurate.
本实施通过与脑活动识别模型对应的分类损失值,以及与特征映射模型对应的降维损失值,来反映脑活动识别模型的总损失值。充分考虑了特征映射模型对脑电数据进行映射所得到的标准脑电数据,所造成的脑活动识别模型对该标准脑电数据分类准确性的影响,以及脑活动识别模型本身对标准脑电数据分类准确性的影响。使得总损失值的生成更为准确,依据总损失值来完成对标准脑电数据的处理,结束脑活动识别模型的训练的时机更为准确,有利于提升脑活动识别模型对脑电数据的分类准确性。In this implementation, the classification loss value corresponding to the brain activity recognition model and the dimensionality reduction loss value corresponding to the feature mapping model reflect the total loss value of the brain activity recognition model. Fully consider the standard EEG data obtained by mapping the EEG data with the feature mapping model, the impact of the resulting brain activity recognition model on the classification accuracy of the standard EEG data, and the impact of the brain activity recognition model itself on the standard EEG data. impact on classification accuracy. It makes the generation of the total loss value more accurate, completes the processing of standard EEG data according to the total loss value, and ends the training of the brain activity recognition model more accurately, which is conducive to improving the classification of EEG data by the brain activity recognition model accuracy.
进一步地,基于本发明基于联邦迁移的脑电数据处理方法的第二实施例,提出本发明基于联邦迁移的脑电数据处理方法第三实施例。Further, based on the second embodiment of the federated migration-based EEG data processing method of the present invention, a third embodiment of the federated migration-based EEG data processing method of the present invention is proposed.
所述基于联邦迁移的脑电数据处理方法第三实施例与所述基于联邦迁移的脑电数据处理方法第二实施例的区别在于,所述根据所述分类损失值和所述降维损失值,确定经更新后所述脑活动识别模型的总损失值的步骤之后,还包括:The difference between the third embodiment of the federated migration-based EEG data processing method and the second embodiment of the federated migration-based EEG data processing method is that according to the classification loss value and the dimensionality reduction loss value , after the step of determining the total loss value of the updated brain activity recognition model, further comprising:
步骤S34,判断所述总损失值是否在预设次数内均小于预设值,若在预设次数内均小于预设值,则判定经更新后所述脑活动识别模型所生成的总损失值小于预设值;Step S34, judging whether the total loss value is less than the preset value within the preset number of times, if it is less than the preset value within the preset number of times, then determine the total loss value generated by the brain activity recognition model after the update less than the preset value;
步骤S35,若未在预设次数内均小于预设值,则执行接收所述更新参数,对所述脑活动识别模型进行更新的步骤。Step S35, if not less than the preset value within the preset times, execute the step of receiving the update parameters and updating the brain activity recognition model.
本实施例中,为了确保脑活动识别模型分类准确的稳定性,排除偶然因素的影响,设置有预设次数内判定总损失值是否均小于预设值的机制。其中,预设次数优选为连续次数,也可设置为较少间隔的次数内,如设定预设次数为5次,则优选设定为连续5次内所生成的总损失值均小于预设值,也可设定为在连续6次所生成的总损失值内,存在5次的总损失值小于预设值。In this embodiment, in order to ensure the stability of the accurate classification of the brain activity recognition model and eliminate the influence of accidental factors, a mechanism is provided to determine whether the total loss value is less than the preset value within a preset number of times. Among them, the preset number of times is preferably a continuous number of times, and can also be set to a number of times with fewer intervals. If the preset number of times is set to 5 times, then it is preferably set so that the total loss value generated within 5 consecutive times is less than the preset time. The value may also be set such that among the total loss values generated for six consecutive times, there are five total loss values that are less than the preset value.
进一步地,本地终端中的脑活动识别模型在经更新并生成总损失值后,调用预设值和该总损失值进行对比,判断总损失值是否小于预设值;若小于预设值,则进行累加计数,得到计数值。进而通过判断计数值是否大于或等于预设次数,来判断总损失值是否在预设次数内均小于预设值;若计数值大于或等于预设次数,则说明更新后的脑活动识别模型具有分类准确的特性,判定总损失值在预设次数内均小于预设值。进而判定经更新后的脑活动识别模型所生成的总损失值小于预设值,完成对多组脑电数据的处理,结束基于联邦迁移对脑活动识别模型的训练。后续通过该经更新的脑活动识别模型对各脑电数据进行分类,即可达到准确分类的目的。Further, after the brain activity recognition model in the local terminal is updated and generates the total loss value, it calls the preset value and compares it with the total loss value to determine whether the total loss value is less than the preset value; if it is less than the preset value, then Perform cumulative counting to obtain the count value. Furthermore, by judging whether the count value is greater than or equal to the preset number of times, it is judged whether the total loss value is less than the preset value within the preset number of times; if the count value is greater than or equal to the preset number of times, it means that the updated brain activity recognition model has The characteristic of accurate classification, it is determined that the total loss value is less than the preset value within the preset number of times. Then it is determined that the total loss value generated by the updated brain activity recognition model is less than the preset value, the processing of multiple sets of EEG data is completed, and the training of the brain activity recognition model based on federated migration is ended. Subsequently, the updated brain activity recognition model is used to classify each EEG data, so as to achieve the purpose of accurate classification.
更进一步地,若计数值小于预设次数,判定总损失值值未在预设次数内均小于预设值,不足以说明更新后的脑活动识别模型具有分类准确的特性。此时,判定总损失值未在预设次数内均小于预设值,需要通过脑活动识别模型继续依据联邦迁移学习,接收预设公共服务器返回的更新参数,对脑活动识别模型进行更新,并对标准脑电数据进行处理,以训练脑活动识别模型,直到所生成的总损失值在预设次数内均小于预设值。Furthermore, if the count value is less than the preset number of times, it is determined that the total loss value is not less than the preset value within the preset number of times, which is not enough to show that the updated brain activity recognition model has the characteristics of accurate classification. At this time, it is determined that the total loss value is not less than the preset value within the preset number of times, and the brain activity recognition model needs to continue to be based on federated transfer learning, receive the update parameters returned by the preset public server, update the brain activity recognition model, and The standard EEG data is processed to train the brain activity recognition model until the generated total loss value is less than the preset value within the preset times.
需要说明的是,在对标准脑电数据进行继续处理时,因各特征映射模型会对各组脑电数据以不同的映射方式进行映射处理,使得对标准脑电数据的继续处理其实质为对以新的映射方式所映射得到的标准脑电数据进行处理。以此实现在数据量较小的情况下,通过不同的映射方式得到大量的标准脑电数据,进而实现通过大量的标准脑电数据对脑活动识别模型进行训练,使得经训练得到的脑活动识别模型对脑电数据的处理更为准确。It should be noted that when continuing to process standard EEG data, since each feature mapping model will map each group of EEG data in different ways, the essence of continuing processing of standard EEG data is to The standard EEG data mapped by the new mapping method are processed. In this way, in the case of a small amount of data, a large amount of standard EEG data can be obtained through different mapping methods, and then the brain activity recognition model can be trained through a large amount of standard EEG data, so that the brain activity recognition obtained after training The model is more accurate in processing EEG data.
本实施例通过设定持续更新的脑活动识别模型生成的总损失值均小于预设值,才完成对脑电数据处理的机制,确保了脑活动识别模型准确分类的稳定性,排除了偶然因素对分类的影响,有利于脑活动识别模型对脑电数据的准确分类。In this embodiment, the mechanism for processing EEG data is completed by setting the total loss value generated by the continuously updated brain activity recognition model to be less than the preset value, ensuring the stability of accurate classification of the brain activity recognition model and eliminating accidental factors The impact on classification is beneficial to the accurate classification of EEG data by the brain activity recognition model.
本发明还提供一种基于联邦迁移的脑电数据处理装置。The invention also provides an EEG data processing device based on federation migration.
参照图3,图3为本发明基于联邦迁移的脑电数据处理装置第一实施例的功能模块示意图。所述基于联邦迁移的脑电数据处理装置包括:Referring to FIG. 3 , FIG. 3 is a schematic diagram of functional modules of the first embodiment of the federated migration-based EEG data processing device of the present invention. The EEG data processing device based on federation migration includes:
获取模块10,用于获取多组脑电数据,并将多组所述脑电数据分别传输到本地终端内,与多组所述脑电数据分别对应的特征映射模型进行映射处理,生成标准脑电数据;The acquiring
生成模块20,用于将所述标准脑电数据传输到本地终端内的脑活动识别模型进行处理,生成模型参数传输到预设公共服务器,以供所述预设公共服务器对所述模型参数和至少一个他方终端发送的其他模型参数进行聚合,生成更新参数;The generating
更新模块30,用于接收所述更新参数,对所述脑活动识别模型进行更新,并基于更新的所述脑活动识别模型对各特征映射模型重新映射处理得到的标准脑电数据进行处理,直到所述脑活动识别模型所生成的总损失值小于预设值,完成基于联邦迁移对多组所述脑电数据的处理。The
进一步地,所述基于联邦迁移的脑电数据处理装置还包括:Further, the EEG data processing device based on federation migration also includes:
调用模块,用于当接收到待处理脑电数据时,调用所述特征映射模型进行映射处理;A calling module, configured to call the feature mapping model for mapping processing when receiving the EEG data to be processed;
处理模块,用于将映射处理的待处理脑电数据传输到脑活动识别模型进行分类处理,获得与所述待处理脑电数据对应的脑活动类型。The processing module is configured to transmit the EEG data to be processed through the mapping process to the brain activity recognition model for classification processing, and obtain the brain activity type corresponding to the EEG data to be processed.
进一步地,所述获取模块10包括:Further, the
预处理单元,用于根据多组所述脑电数据的数据属性,对多组所述脑电数据进行预处理;A preprocessing unit, configured to preprocess multiple sets of EEG data according to data attributes of multiple sets of EEG data;
映射单元,用于将经预处理的多组所述脑电数据分别传输到本地终端内,并根据本地终端内与多组所述脑电数据分别对应的特征映射模型,对多组所述脑电数据分别进行映射处理,生成所述标准脑电数据。The mapping unit is used to transmit the preprocessed multiple sets of EEG data to the local terminal, and according to the feature mapping models corresponding to the multiple sets of EEG data in the local terminal, to multiple sets of the EEG data. The electrical data are respectively subjected to mapping processing to generate the standard EEG data.
进一步地,所述更新模块30还包括:Further, the
获取单元,用于获取更新后的所述脑活动识别模型对重新映射处理得到的标准脑电数据进行处理所生成的处理结果,并根据所述处理结果,确定经更新后所述脑活动识别模型对应的分类损失值;An acquisition unit, configured to acquire a processing result generated by processing the standard EEG data obtained through remapping processing with the updated brain activity recognition model, and determine the updated brain activity recognition model according to the processing result The corresponding classification loss value;
第一确定单元,用于根据重新映射处理的标准脑电数据,确定与各所述特征映射模型对应的降维损失值;The first determination unit is configured to determine the dimensionality reduction loss value corresponding to each of the feature mapping models according to the standard EEG data processed by remapping;
第二确定单元,用于根据所述分类损失值和所述降维损失值,确定经更新后所述脑活动识别模型的总损失值。The second determining unit is configured to determine a total loss value of the brain activity recognition model after updating according to the classification loss value and the dimensionality reduction loss value.
进一步地,所述获取单元还用于:Further, the acquisition unit is also used for:
读取所述标准脑电数据的参考结果,并在所述参考结果和所述处理结果之间进行相似度计算,生成第一相似度值;reading the reference result of the standard EEG data, and performing similarity calculation between the reference result and the processing result to generate a first similarity value;
根据所述第一相似度值,确定经更新后所述脑活动识别模型的分类损失值。A classification loss value of the updated brain activity recognition model is determined according to the first similarity value.
进一步地,所述第一确定单元还用于:Further, the first determination unit is also used for:
根据重新映射处理的标准脑电数据与多组所述脑电数据之间的对应关系,将重新映射处理的标准脑电数据划分为多组标准子数据;According to the corresponding relationship between the remapped standard EEG data and multiple sets of the EEG data, the remapped standard EEG data is divided into multiple sets of standard sub-data;
对多组所述标准子数据进行两两组合,并对各所述组合中的每组标准子数据分别进行再现处理,生成各所述组合中的两组数据点;performing two-two combinations on multiple sets of standard sub-data, and performing reproduction processing on each set of standard sub-data in each combination to generate two sets of data points in each combination;
对各所述组合中每组数据点分别进行均值处理,生成各所述组合中每组数据点的平均值,并根据各所述组合中每组数据点的平均值,生成各所述组合的第二相似度值;Perform mean value processing on each group of data points in each described combination, generate the average value of each group of data points in each described combination, and generate the average value of each described combination according to the average value of each group of data points in each described combination second similarity value;
根据各所述组合的第二相似度值,确定各所述组合的组合降维损失值,并根据各所述组合降维损失值,生成与各所述特征映射模型对应的降维损失值。A combined dimensionality reduction loss value of each combination is determined according to the second similarity value of each combination, and a dimensionality reduction loss value corresponding to each feature mapping model is generated according to each combination dimensionality reduction loss value.
进一步地,所述更新模块30还包括:Further, the
判断单元,用于判断所述总损失值是否在预设次数内均小于预设值,若在预设次数内均小于预设值,则判定经更新后所述脑活动识别模型所生成的总损失值小于预设值;a judging unit, configured to judge whether the total loss value is less than a preset value within a preset number of times; The loss value is less than the preset value;
执行单元,用于若未在预设次数内均小于预设值,则执行接收所述更新参数,对所述脑活动识别模型进行更新的步骤。The execution unit is configured to execute the step of receiving the update parameters and updating the brain activity recognition model if the values are not less than the preset value within the preset times.
本发明基于联邦迁移的脑电数据处理装置具体实施方式与上述基于联邦迁移的脑电数据处理方法各实施例基本相同,在此不再赘述。The specific implementation of the federated migration-based EEG data processing device of the present invention is basically the same as the above embodiments of the federated migration-based EEG data processing method, and will not be repeated here.
此外,本发明实施例还提出一种介质。In addition, the embodiment of the present invention also proposes a medium.
介质上存储有基于联邦迁移的脑电数据处理程序,基于联邦迁移的脑电数据处理程序被处理器执行时实现如上所述的基于联邦迁移的脑电数据处理方法的步骤。A federated migration-based EEG data processing program is stored on the medium, and when the federated migration-based EEG data processing program is executed by the processor, the steps of the federated migration-based EEG data processing method described above are implemented.
本发明介质可以是计算机可读存储介质,其具体实施方式与上述基于联邦迁移的脑电数据处理方法各实施例基本相同,在此不再赘述。The medium of the present invention may be a computer-readable storage medium, and its specific implementation manners are basically the same as the embodiments of the federated migration-based EEG data processing method described above, which will not be repeated here.
上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,这些均属于本发明的保护之内。Embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementations, and the above-mentioned specific implementations are only illustrative, rather than restrictive, and those of ordinary skill in the art will Under the enlightenment of the present invention, without departing from the gist of the present invention and the scope of protection of the claims, many forms can also be made, and any equivalent structure or equivalent process transformation made by using the description and drawings of the present invention, or Directly or indirectly used in other related technical fields, these all belong to the protection of the present invention.
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010570925.5A CN111638803B (en) | 2020-06-19 | 2020-06-19 | EEG data processing method, device, equipment and medium based on federated migration |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010570925.5A CN111638803B (en) | 2020-06-19 | 2020-06-19 | EEG data processing method, device, equipment and medium based on federated migration |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111638803A CN111638803A (en) | 2020-09-08 |
| CN111638803B true CN111638803B (en) | 2023-04-07 |
Family
ID=72332573
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010570925.5A Active CN111638803B (en) | 2020-06-19 | 2020-06-19 | EEG data processing method, device, equipment and medium based on federated migration |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111638803B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114664434A (en) * | 2022-03-28 | 2022-06-24 | 上海韶脑传感技术有限公司 | Cerebral apoplexy rehabilitation training system for different medical institutions and training method thereof |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111134667A (en) * | 2020-01-19 | 2020-05-12 | 中国人民解放军战略支援部队信息工程大学 | EEG-based time-migration emotion recognition method and system |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CA2923979C (en) * | 2012-09-14 | 2023-06-20 | Interaxon Inc. | Systems and methods for collecting, analyzing, and sharing bio-signal and non-bio-signal data |
| FR3039773A1 (en) * | 2015-08-04 | 2017-02-10 | Dreem | METHODS AND SYSTEMS FOR ACOUSTIC STIMULATION OF CEREBRAL WAVES. |
| CN111259761B (en) * | 2020-01-13 | 2024-06-07 | 东南大学 | EEG emotion recognition method and device based on transferable attention neural network |
-
2020
- 2020-06-19 CN CN202010570925.5A patent/CN111638803B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111134667A (en) * | 2020-01-19 | 2020-05-12 | 中国人民解放军战略支援部队信息工程大学 | EEG-based time-migration emotion recognition method and system |
Non-Patent Citations (1)
| Title |
|---|
| Federated Transfer Learning for EEG Signal Classification;Ce Ju等;《https://arxiv.org/pdf/2004.12321v1.pdf》;20200426;第1-6页 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111638803A (en) | 2020-09-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Werner de Vargas et al. | Imbalanced data preprocessing techniques for machine learning: a systematic mapping study | |
| CN107981858B (en) | Automatic recognition and classification method of electrocardiogram and heartbeat based on artificial intelligence | |
| CN113295702B (en) | Electrical equipment fault diagnosis model training method and electrical equipment fault diagnosis method | |
| US20230101539A1 (en) | Physiological electric signal classification processing method and apparatus, computer device and storage medium | |
| Li et al. | Medical data stream distribution pattern association rule mining algorithm based on density estimation | |
| CN110070105A (en) | Brain electricity Emotion identification method, the system quickly screened based on meta learning example | |
| CN113069117A (en) | Electroencephalogram emotion recognition method and system based on time convolution neural network | |
| CN118332034B (en) | Data mining model construction method and system based on machine learning | |
| CN109512390A (en) | Sleep stage method and wearable device based on EEG time domain various dimensions feature and M-WSVM | |
| CN114343635A (en) | A method and device for emotion recognition based on variational phase-amplitude coupling | |
| CN114424941A (en) | Fatigue detection model construction method, fatigue detection method, device and equipment | |
| CN118035816A (en) | Electroencephalogram signal classification method, device and storage medium | |
| CN116383618A (en) | A method and device for evaluating learning concentration based on multimodal data | |
| CN115954019A (en) | Environmental noise identification method and system integrating self-attention and convolution operation | |
| CN118228129B (en) | Motor imagery electroencephalogram signal classification method based on deep migration learning | |
| CN116831594A (en) | An epilepsy EEG classification method based on iterative graph convolutional neural network | |
| CN111638803B (en) | EEG data processing method, device, equipment and medium based on federated migration | |
| CN115170049A (en) | Credibility scoring method, credibility scoring device, electronic equipment, storage medium and program product | |
| CN117708682A (en) | Intelligent brain wave acquisition and analysis system and method | |
| CN115337037B (en) | A heart sound monitoring system based on federated learning | |
| CN112052874A (en) | Physiological data classification method and system based on generation countermeasure network | |
| CN117390531B (en) | An automatic identification method for depression based on IEEMD electroencephalogram signal decomposition | |
| CN118845010A (en) | An emotion recognition method based on PDC Rich Club dynamic brain network | |
| CN117009095A (en) | Privacy data processing model generation method, device, terminal equipment and medium | |
| CN109147938A (en) | A kind of disease intelligent diagnostics device and equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |