Prototype-enhanced multi-instance learning-based brain disease ai prediction method and system

By using a prototype-enhanced multi-instance learning method, the problem of imprecise annotation of small-sample EEG data is solved, improving the accuracy and robustness of brain disease identification and achieving efficient brain disease prediction.

CN121747990BActive Publication Date: 2026-05-29HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)
Filing Date
2026-02-27
Publication Date
2026-05-29

Smart Images

  • Figure CN121747990B_ABST
    Figure CN121747990B_ABST
Patent Text Reader

Abstract

The application provides a brain disease AI prediction method and system based on prototype enhanced multi-instance learning, comprising: regarding the electroencephalogram signal of each subject as a bag, regarding each slice segment in the bag as an electroencephalogram instance, inputting the electroencephalogram instance into an instance coding module, performing electroencephalogram instance microstate multi-scale time sequence feature detection and space-time domain joint representation, obtaining space-time domain joint representation features of the electroencephalogram instance, inputting into a cross-instance self-attention modulation module to obtain modulated instance representation, inputting into a prototype calibrated enhanced multi-instance aggregation module, using the constructed and updated prototype as a representative mode of the instance in the bag, calibrating and utilizing prototype guided aggregation to obtain aggregation features, inputting into a classification head and outputting subject level brain disease prediction probability. The application can predict brain diseases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of AI neurological disease analysis technology, and specifically refers to an AI prediction method and system for brain diseases based on prototype-enhanced multi-instance learning. Background Technology

[0002] Brain diseases are a group of neurological disorders that seriously affect cognitive, emotional, and behavioral functions, encompassing various types such as Alzheimer's disease (AD), Parkinson's disease, epilepsy, depression, and schizophrenia. Many of these diseases are characterized by insidious onset and gradual deterioration, with pathological changes often beginning years before the appearance of clinical symptoms. Therefore, developing early, non-invasive, and low-cost screening and monitoring methods is crucial for timely intervention and improved prognosis. In recent years, electroencephalography (EEG) has been widely used in the exploration of biomarkers for various brain diseases due to its millisecond-level temporal resolution, portability, low cost, and high sensitivity to neural oscillations and functional connectivity abnormalities. For example, AD patients often exhibit increased slow waves, decreased fast waves, functional network desynchronization, and dynamic abnormalities in microstates, while epilepsy presents with specific spike discharges, and depression and schizophrenia also have characteristic spectral and connectivity changes. However, EEG signals themselves are highly non-stationary, exhibit significant individual variability, and are susceptible to noise interference. In addition, high-quality clinical annotation relies on multimodal assessment and long-term follow-up, resulting in scarce and costly labeled data. Against this backdrop, traditional supervised learning methods (such as support vector machines, random forests, or deep neural networks) are limited by small sample sizes and annotation bottlenecks, making it difficult to build models with strong generalization capabilities, which severely restricts the practical application of EEG technology in real clinical scenarios. Summary of the Invention

[0003] To address the technical problems existing in the prior art, this invention provides a brain disease AI prediction method and system based on prototype-enhanced multi-instance learning, the technical solution of which is as follows:

[0004] On the one hand, a brain disease AI prediction method based on prototype-enhanced multi-instance learning is provided, which includes:

[0005] S1. Acquire and preprocess EEG signal data of multiple subjects, and slice the EEG signal data. Treat all EEG signal data of each subject as a bag, and each slice segment in the bag is called an EEG instance.

[0006] S2. Input the EEG instance into the instance encoding module. The instance encoding module includes a multi-scale temporal encoding module and a Transformer-based spatiotemporal joint representation module, which is used to perform multi-scale temporal feature detection and spatiotemporal joint representation of the EEG instance's microstates to obtain the spatiotemporal joint representation features of the EEG instance. ;

[0007] S3. Combine the spatiotemporal domain joint representation features The input cross-instance self-attention modulation module calculates the correlation between instances within the bag and updates their respective features based on the correlation. This allows the model to dynamically adjust the attention weights between different instances, thereby highlighting key instances and weakening the influence of irrelevant instances, resulting in a modulated instance representation. ;

[0008] S4. Combine the spatiotemporal domain joint representation features and the characterization of the modulated instances The multi-instance aggregation module, enhanced by input prototype calibration, calibrates the spatiotemporal joint representation features by constructing and updating prototypes as representative patterns of instances within the bag. The spatiotemporal joint characterization features are represented by KL divergence. Align the distribution to the prototype of the corresponding predicted class, and apply the KL divergence loss function. The model parameters are adjusted during model training, and the modulated instance representation is guided by the prototype. The aggregation yields more robust and discriminative aggregation features. ;

[0009] S5, The aggregation feature Input a classification header, output the subject-level probability of brain disease prediction. Using the brain disease to predict probability Cross-entropy loss with the real label and the KL divergence loss function The model parameters were adjusted together to train the model, resulting in a trained overall AI model for predicting brain diseases, consisting of various modules.

[0010] S6. Using the trained AI model for predicting brain diseases, predict the brain diseases to be predicted and output the prediction results.

[0011] On the other hand, a brain disease AI prediction system based on prototype-enhanced multi-instance learning is provided, the system comprising:

[0012] The preprocessing slice acquisition module is used to acquire and preprocess EEG signal data from multiple subjects, and slice the EEG signal data. All EEG signal data of each subject are regarded as a bag, and each slice fragment in the bag is called an EEG instance.

[0013] An instance encoding module is used to input the EEG instance into the instance encoding module. The instance encoding module includes a multi-scale temporal encoding module and a Transformer-based spatiotemporal joint representation module, which is used to perform multi-scale temporal feature detection and spatiotemporal joint representation of the EEG instance's microstates to obtain the spatiotemporal joint representation features of the EEG instance. ;

[0014] A cross-instance self-attention modulation module is used to integrate the spatiotemporal joint representation features. The input cross-instance self-attention modulation module calculates the correlation between instances within the bag and updates their respective features based on the correlation. This allows the model to dynamically adjust the attention weights between different instances, thereby highlighting key instances and weakening the influence of irrelevant instances, resulting in a modulated instance representation. ;

[0015] The prototype calibration-enhanced multi-instance aggregation module is used to integrate the spatiotemporal joint representation features. and the characterization of the modulated instances The multi-instance aggregation module, enhanced by input prototype calibration, calibrates the spatiotemporal joint representation features by constructing and updating prototypes as representative patterns of instances within the bag. The spatiotemporal joint characterization features are represented by KL divergence. Align the distribution to the prototype of the corresponding predicted class, and apply the KL divergence loss function. The model parameters are adjusted during model training, and the modulated instance representation is guided by the prototype. The aggregation yields more robust and discriminative aggregation features. ;

[0016] The training module is used to aggregate the features. Input a classification header, output the subject-level probability of brain disease prediction. Using the brain disease to predict probability Cross-entropy loss with the real label and the KL divergence loss function The model parameters were adjusted together to train the model, resulting in a trained overall AI model for predicting brain diseases, consisting of various modules.

[0017] The prediction module is used to predict the brain disease to be predicted using the trained brain disease prediction AI model and output the prediction result.

[0018] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the above-described AI prediction method for brain diseases based on prototype-enhanced multi-instance learning.

[0019] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, the at least one instruction being loaded and executed by a processor to implement the above-described AI prediction method for brain diseases based on prototype-enhanced multi-instance learning.

[0020] The beneficial effects of the technical solution provided by this invention include at least the following:

[0021] This invention designs an efficient instance encoding module by combining EEG microstate characteristics to obtain high-dimensional embedded representations. Based on this, a spatiotemporal joint representation module is designed to achieve efficient representation of EEG signals. Furthermore, in data analysis scenarios with imprecise labeling at the subject level, all EEG segments for each subject are treated as a bag, with each slice within the bag called an EEG instance. Multi-instance learning constructs a bag-level aggregated representation, improving label accuracy. Simultaneously, in practical scenarios of long-term brain disease data analysis, multi-instance aggregated representation and prototype enhancement improve the model's training and inference efficiency, align the model's representation space, and mitigate instance selection bias. Moreover, representative instances can be derived based on attention scores during inference, effectively improving the interpretability of model inference. This innovative end-to-end framework enables more efficient and accurate brain disease identification, overcoming the limitations of inaccurate long-term EEG data slice labeling in existing technologies, and improving the effectiveness and robustness of disease identification.

[0022] This innovative technology applies multi-instance learning to EEG analysis of brain diseases, effectively addressing performance bottlenecks in real-world scenarios where EEG data is small in scale and lacks fine labeling. It provides a new technical approach for the early diagnosis of brain diseases and holds broad promise for application to other neurodegenerative diseases. This solution not only effectively overcomes technical limitations such as small EEG data scale, scarcity of high-quality labeled data, incomplete and inaccurate labeling information, and limited generalization ability across patients, but also holds significant value in improving the accuracy, robustness, and interpretability of early diagnosis. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is an overall block diagram of a brain disease AI prediction method based on prototype-enhanced multi-instance learning provided by an embodiment of the present invention;

[0025] Figure 2 This is a block diagram of the spatiotemporal joint representation module based on Transformer provided in an embodiment of the present invention;

[0026] Figure 3 This is a block diagram of the cross-instance self-attention modulation module and the prototype calibration-enhanced multi-instance aggregation module provided in the embodiments of the present invention;

[0027] Figure 4 This is a block diagram of a brain disease AI prediction system based on prototype-enhanced multi-instance learning provided by an embodiment of the present invention;

[0028] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0029] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0030] This invention provides an AI prediction method for brain diseases based on prototype-enhanced multi-instance learning. This method can be implemented by an electronic device, which can be a terminal or a server. Figure 1 The diagram shown is an overall block diagram of the method. The processing flow may include the following steps:

[0031] S1. Acquire and preprocess EEG signal data of multiple subjects, and slice the EEG signal data. Treat all EEG signal data of each subject as a bag, and each slice segment in the bag is called an EEG instance.

[0032] This invention employs a multi-channel EEG device to acquire electroencephalogram (EEG) signals, with each channel recording the electrical activity of different brain regions. The acquired EEG signals are defined as two-dimensional data, denoted as... ,in For the number of EEG channels, This represents the number of time frames. This representation effectively captures the dynamic changes of EEG signals over time and the spatial information between different electrode channels. EEG signals are weak and subject to noise interference; therefore, data filtering is performed. In this embodiment, a bandpass filter of 0.5–50 Hz is used to remove high-frequency and low-frequency noise, and the data is uniformly resampled to 200Hz.

[0033] Electroencephalogram (EEG) signals are typically long-term time series lasting hours or even days, containing massive amounts of data and rich information. However, directly inputting the entire time series into a model can lead to excessive computational demands. This invention treats EEG signals as two-dimensional data, using slicing to better capture local features within the EEG signals. Specifically, EEG signals... All leads are simultaneously divided into multiple fixed-length time windows. Each time window can be viewed as a segment of an EEG instance containing several time frames, represented as follows: ,in It is the duration of the time window (e.g., 10s, 8s, etc.). This represents the number of leads in the EEG data. To effectively capture dynamic changes in the signal, instances are typically non-overlapping, with a stride of [missing value]. This refers to the offset of the cut start position of each instance relative to the previous time window. Through this block-based segmentation method, each EEG sample is divided into... A segment, denoted as A fragment.

[0034] Each EEG instance contains localized changes in EEG signals over a specific time period, helping to capture short-term brain activity patterns. Furthermore, the subject ID corresponding to each EEG instance is recorded for subsequent multi-instance aggregation learning.

[0035] S2. Input the EEG instance into the instance encoding module. The instance encoding module includes a multi-scale temporal encoding module and a Transformer-based spatiotemporal joint representation module, which is used to perform multi-scale temporal feature detection and spatiotemporal joint representation of the EEG instance's microstates to obtain the spatiotemporal joint representation features of the EEG instance. ;

[0036] Efficient feature detection and representation of EEG instances is the foundation for subsequent multi-instance learning. The instance encoding module encodes EEG instances into EEG features and consists of a multi-scale temporal encoding module and a Transformer-based spatiotemporal joint representation module.

[0037] Optionally, the multi-scale temporal coding module is used to capture the multi-scale temporal features of EEG signals in the time dimension, including: 3 temporal scale convolutions and 2 temporal dilatation convolutions;

[0038] The temporal scale convolution, designed based on the physiological characteristics of EEG microstates, achieves multi-field feature extraction. It consists of a one-dimensional convolutional layer. The kernel sizes of the three temporal scale convolutions are 15, 21, and 27, respectively, which correspond to a microstate scale of about 100ms for EEG data with a sampling rate of 200Hz.

[0039] The temporal dilated convolution is used to achieve multi-resolution feature extraction. It is also composed of a one-dimensional convolutional layer. The two temporal dilated convolutions are set with dilation parameters of 2 and 3 respectively, based on a convolutional kernel of 21.

[0040] Each convolutional layer is followed by a batch normalization layer and a GELU activation function to obtain the encoded features corresponding to the EEG instance: ,in Indicates the number of feature channels. Indicates the characteristic length;

[0041] The EEG instance was further divided into blocks for processing, with a length of... Instances that do not overlap are segmented into A length of smaller fragments, (Can be set) The corresponding time length is 1 second), and finally the encoded features of each EEG instance are re-represented as strength features. .

[0042] In order for the model to fully understand the temporal and spatial information of the instance embedding, this embodiment of the invention extracts two aspects of features through a Transformer-based spatiotemporal joint representation module.

[0043] Optionally, such as Figure 2 As shown, the Transformer-based spatiotemporal joint representation module is used to extract both temporal and spatial features from the EEG instance embedding and perform joint representation. The processing includes:

[0044] First, the instance features Transform the input into a spatial domain perspective through matrix transformation. The data is then input into the Transformer encoder to obtain a spatial domain perspective representation; the instance features are then processed. Transform the input to the time domain perspective using matrix transformation. Then it is input into the Transformer encoder to obtain a temporal perspective representation;

[0045] The multi-head attention module of the Transformer encoder processes the spatial domain viewpoint inputs respectively. and temporal perspective input To implement the dot product attention mechanism, a normalization layer is added to the query and key before the dot product attention mechanism to avoid excessively large attention logic values. The formula is as follows:

[0046]

[0047]

[0048] in It has In multi-head attention, the dimension of one head is represented by LN, which indicates layer normalization for spatial domain perspective representation. , , All set to For representation from a time-domain perspective, , , All set to The query matrix Q and key matrix K, after being normalized by the layer, are multiplied by a dot product to obtain their correlation. The dot product result is then scaled to stabilize the computation. Finally, the results are applied... The function transforms the correlation into a probability distribution, representing the importance of each position. Then, these weights are applied to the value matrix V to obtain a weighted sum, thereby generating a new representation for each position.

[0049] The representations of multiple heads are concatenated and summed with the original input, then fed into the feedforward network and normalized again to form the final output features;

[0050] The output features, after being represented in the time and spatial domains by the Transformer module, are then subjected to a matrix transformation to spatial representation. Then, they are added together to obtain the spatiotemporal joint representation features. (A bag containing n EEG instances is represented as) ).

[0051] S3. Combine the spatiotemporal domain joint representation features The input cross-instance self-attention modulation module calculates the correlation between instances within the bag and updates their respective features based on the correlation. This allows the model to dynamically adjust the attention weights between different instances, thereby highlighting key instances and weakening the influence of irrelevant instances, resulting in a modulated instance representation. ;

[0052] Optionally, such as Figure 3 As shown, the processing procedure of the cross-instance self-attention modulation module includes:

[0053] Spatiotemporal joint representation features of different EEG instances within a bag , The self-attention modulation between them is calculated using the following formula:

[0054]

[0055] query matrix Bond matrix Perform a dot product to obtain the correlation between them, then scale the dot product result to stabilize the computation, and then apply... The function transforms the correlation into a probability distribution representing the importance of each position, and then applies these weights to the value matrix. The weighted summation is then used to generate a new representation for each location. This process enables the model to capture dependencies between high-dimensional representations of different EEG instances and update the features of each EEG instance, achieving in-bag cross-instance level self-attention modulation. The resulting modulated instance representation is denoted as... .

[0056] S4. Combine the spatiotemporal domain joint representation features and the characterization of the modulated instances The multi-instance aggregation module, enhanced by input prototype calibration, calibrates the spatiotemporal joint representation features by constructing and updating prototypes as representative patterns of instances within the bag. The spatiotemporal joint characterization features are represented by KL divergence. Align the distribution to the prototype of the corresponding predicted class, and apply the KL divergence loss function. The model parameters are adjusted during model training, and the modulated instance representation is guided by the prototype. The aggregation yields more robust and discriminative aggregation features. ;

[0057] In brain disease diagnosis, available datasets are often small. With small samples and weak annotations, deep learning models are highly likely to learn unwanted features, leading to model representation bias. This bias directly affects instance selection during the aggregation phase of multi-instance learning, resulting in performance degradation. Traditional methods such as attention mechanisms or max pooling often fail to capture the complex relationships and data distribution characteristics between instances. Attention mechanisms, due to their loss function being defined at the "bag" level, tend to focus only on the few most easily identifiable key instances, neglecting other difficult but important ones. Simple pooling operations fail to capture these complex relationships. Therefore, the prototype calibration-enhanced multi-instance aggregation module of this invention introduces a prototype as the semantic center or representative pattern of instances within the bag, aligns the early representations of instances through a calibration mechanism, and uses the prototype to guide more robust and discriminative feature aggregation. Specifically, this module consists of prototype construction and updating, prototype calibration of instance representations, and prototype-enhanced instance aggregation.

[0058] Optionally, the process of building and updating the prototype includes:

[0059] Initial prototype generation:

[0060] Maintain a learnable prototype vector for each predicted category. In the initial training iteration, the corresponding category is calculated as follows: The average value of the features of the instances within the bag is used as the corresponding first... The initial prototype of the category Therefore, the number of prototypes is set to the number of categories;

[0061] Prototype update:

[0062] During the training phase, the aggregated features of the bag will be calculated each time. The prototype is updated using momentum updates, and the specific calculations for the prototype update are as follows:

[0063]

[0064] in Set to 0.001.

[0065] Optionally, the KL divergence loss function The calculation method is as follows:

[0066] .

[0067] Optionally, the instance characterization guided by the prototype is... The aggregation yields more robust and discriminative aggregation features. Specifically, it includes:

[0068] First, the modulated instance representations of each EEG instance within the bag were analyzed. Similarity index calculated with the prototype The similarity is calculated as follows:

[0069]

[0070] Then the similarity index The input instance scoring module consists of a two-layer multilayer sensing mechanism, and its parameters are as follows: , Finally, a score is obtained for each EEG instance. The calculation method is as follows:

[0071]

[0072] After obtaining the scores, the scores are weighted and aggregated into the modulated instance representations of each EEG instance. The characterization of the bag is obtained, and the specific calculations are as follows:

[0073]

[0074]

[0075] in, For the first The aggregation representation of bags introduces a Dropout strategy to avoid overlearning of typical instances during instance learning. That is, it ignores the similarity index of specific prototypes with a certain probability and selects instances for subsequent analysis to avoid over-focusing on specific instances.

[0076] S5, The aggregation feature Input a classification header, output the subject-level probability of brain disease prediction. Using the brain disease to predict probability and real labels Cross-entropy loss and the KL divergence loss function The model parameters were adjusted together to train the model, resulting in a trained overall AI model for predicting brain diseases, consisting of various modules.

[0077] The cross-entropy loss :

[0078]

[0079] Ultimately, through and To adjust the model parameters:

[0080]

[0081] in {0,1} represents the true labels of the participants. This represents the total number of subjects in the current training batch.

[0082] S6. Using the trained AI model for predicting brain diseases, predict the brain diseases to be predicted and output the prediction results.

[0083] like Figure 4 As shown, this embodiment of the invention also provides a brain disease AI prediction system based on prototype-enhanced multi-instance learning, the system comprising:

[0084] The preprocessing slice acquisition module 410 is used to acquire and preprocess the EEG signal data of multiple subjects, and slice the EEG signal data. All the EEG signal data of each subject are regarded as a bag, and each slice fragment in the bag is called an EEG instance.

[0085] Instance encoding module 420 is used to input the EEG instance into the instance encoding module. The instance encoding module includes a multi-scale temporal encoding module and a Transformer-based spatiotemporal joint representation module, used to perform multi-scale temporal feature detection and spatiotemporal joint representation of the EEG instance microstates to obtain the spatiotemporal joint representation features of the EEG instance. ;

[0086] Cross-instance self-attention modulation module 430 is used to integrate the spatiotemporal joint representation features. The input cross-instance self-attention modulation module calculates the correlation between instances within the bag and updates their respective features based on the correlation. This allows the model to dynamically adjust the attention weights between different instances, thereby highlighting key instances and weakening the influence of irrelevant instances, resulting in a modulated instance representation. ;

[0087] The prototype calibration-enhanced multi-instance aggregation module 440 is used to integrate the spatiotemporal joint representation features. and the characterization of the modulated instances The multi-instance aggregation module, enhanced by input prototype calibration, calibrates the spatiotemporal joint representation features by constructing and updating prototypes as representative patterns of instances within the bag. The spatiotemporal joint characterization features are represented by KL divergence. Align the distribution to the prototype of the corresponding predicted class, and apply the KL divergence loss function. The model parameters are adjusted during model training, and the modulated instance representation is guided by the prototype. The aggregation yields more robust and discriminative aggregation features. ;

[0088] Training module 450 is used to train the aggregated features Input a classification header, output the subject-level probability of brain disease prediction. Using the brain disease to predict probability Cross-entropy loss with the real label and the KL divergence loss function The model parameters were adjusted together to train the model, resulting in a trained overall AI model for predicting brain diseases, consisting of various modules.

[0089] The prediction module 460 is used to predict the brain disease to be predicted using the trained brain disease prediction AI model and output the prediction result.

[0090] The present invention provides a brain disease AI prediction system based on prototype-enhanced multi-instance learning, the functional structure of which corresponds to the brain disease AI prediction method based on prototype-enhanced multi-instance learning provided in the present invention, and will not be described again here.

[0091] Figure 5 This is a schematic diagram of the structure of an electronic device 500 provided in an embodiment of the present invention. The electronic device 500 may vary considerably due to different configurations or performance. It may include one or more central processing units (CPUs) 501 and one or more memories 502. The memory 502 stores at least one instruction, which is loaded and executed by the processor 501 to implement the steps of the above-described brain disease AI prediction method based on prototype-enhanced multi-instance learning.

[0092] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions that can be executed by a processor in a terminal to complete the aforementioned AI prediction method for brain diseases based on prototype-enhanced multi-instance learning. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0093] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0094] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A brain disease AI prediction method based on prototype-enhanced multi-instance learning, characterized in that, The method includes: S1. Acquire and preprocess EEG signal data of multiple subjects, and slice the EEG signal data. Treat all EEG signal data of each subject as a bag, and each slice segment in the bag is called an EEG instance. S2. Input the EEG instance into the instance encoding module. The instance encoding module includes a multi-scale temporal encoding module and a Transformer-based spatiotemporal joint representation module, which is used to perform multi-scale temporal feature detection and spatiotemporal joint representation of the EEG instance microstate to obtain the spatiotemporal joint representation feature t of the EEG instance. S3. Input the spatiotemporal joint representation feature t into the cross-instance self-attention modulation module. By calculating the correlation between instances within the bag and updating their respective features based on the correlation, the model can dynamically adjust the attention weights between different instances to obtain the modulated instance representation. ; S4. Combine the spatiotemporal domain joint representation features and the characterization of the modulated instances The multi-instance aggregation module, enhanced by input prototype calibration, calibrates the spatiotemporal joint representation features by using the constructed and updated prototypes as representative patterns of instances within the bag. The spatiotemporal joint characterization features are represented by KL divergence. Align the distribution to the prototype of the corresponding predicted class, and apply the KL divergence loss function. The model parameters are adjusted during model training, and the modulated instance representation is guided by the prototype. The aggregation yields the aggregation characteristics. ; S5, the aggregation feature Input a classification header, output the subject-level probability of brain disease prediction. Using the brain disease to predict probability Cross-entropy loss with the real label and the KL divergence loss function The model parameters were adjusted together to train the model, resulting in a trained overall AI model for predicting brain diseases, consisting of various modules. S6. Using the trained brain disease prediction AI model, predict the brain disease to be predicted and output the prediction result. The processing procedure of the cross-instance self-attention modulation module includes: Spatiotemporal joint representation features of different EEG instances within a bag , The self-attention modulation between them is calculated using the following formula: ; in It has In the multi-head attention model, the dimension of one head is represented by LN, which indicates layer normalization. query matrix Bond matrix Perform a dot product to obtain the correlation between them, then scale the dot product result and apply... The function transforms the correlation into a probability distribution representing the importance of each position, and applies these weights to the value matrix. The weighted summation is then used to generate a new representation for each position, achieving cross-instance level self-attention modulation within the bag. The resulting modulated instance representation is denoted as... ; The process of building and updating the prototype includes: Initial prototype generation: Maintain a learnable prototype vector for each predicted category. In the initial training iteration, the corresponding category is calculated as follows: The average value of the features of the instances within the bag is used as the corresponding first... The initial prototype of the category Therefore, the number of prototypes is set to the number of categories; Prototype update: During the training phase, the aggregation features of the bags are calculated each time. The prototype is updated using momentum updates. The specific calculation for the prototype update is as follows: ; in Set to 0.

001.

2. The method according to claim 1, characterized in that, The multi-scale temporal coding module is used to capture the multi-scale temporal features of EEG signals in the time dimension, including: 3 temporal scale convolutions and 2 temporal dilatation convolutions. The temporal scale convolution, designed based on the physiological characteristics of EEG microstates, achieves multi-field feature extraction. It consists of a one-dimensional convolutional layer. The kernel sizes of the three temporal scale convolutions are 15, 21, and 27, respectively, which correspond to a 100ms microstate scale for EEG data with a sampling rate of 200Hz. The temporal dilated convolution is used to achieve multi-resolution feature extraction. It is also composed of a one-dimensional convolutional layer. The two temporal dilated convolutions are set with dilation parameters of 2 and 3 respectively, based on a convolutional kernel of 21. Each convolutional layer is followed by a batch normalization layer and a GELU activation function to obtain the encoded features corresponding to the EEG instance: ,in Indicates the number of feature channels. Indicates the characteristic length; The EEG instance was further divided into blocks for processing, with a length of... Instances that do not overlap are segmented into A length of smaller fragments, Ultimately, the encoded features of each EEG instance are re-represented as instance features. .

3. The method according to claim 2, characterized in that, The Transformer-based spatiotemporal joint representation module is used to extract both temporal and spatial features from the EEG instance embeddings and perform joint representation. The processing includes: First, the instance features Transform the input into a spatial domain perspective through matrix transformation. The data is then input into the Transformer encoder to obtain a spatial domain perspective representation; the instance features are then processed. Transform the input to the time domain perspective using matrix transformation. Then it is input into the Transformer encoder to obtain a temporal perspective representation; The multi-head attention module of the Transformer encoder processes the spatial domain viewpoint inputs respectively. and temporal perspective input Before implementing the dot product attention mechanism, a normalization layer is added to the query and key, as shown in the following formula: ; ; in It has In multi-head attention, the dimension of one head is represented by LN, which indicates layer normalization for spatial domain perspective representation. , , All set to For representation from a time-domain perspective, , , All set to The query matrix Q and the key matrix K, after being normalized by the layer, are multiplied by a dot product to obtain their correlation. Then, the dot product result is scaled and applied... The function converts the correlation into a probability distribution, which represents the importance of each position. These weights are applied to the value matrix V to obtain a weighted sum, thereby generating a new representation for each position. The representations of multiple heads are concatenated and summed with the original input, then fed into the feedforward network and normalized again to form the final output features; The output features, after being represented in the time and spatial domains by the Transformer module, are then subjected to a matrix transformation to spatial representation. Then, they are added together to obtain the spatiotemporal joint representation features. .

4. The method according to claim 1, characterized in that, The KL divergence loss function The calculation method is as follows: 。 5. The method according to claim 4, characterized in that, The instance characterization using the prototype-guided modulation The aggregation yields more robust and discriminative aggregation features. Specifically, it includes: First, the modulated instance representations of each EEG instance within the bag were analyzed. Similarity index calculated with the prototype The similarity is calculated as follows: ; Then the similarity index The input instance scoring module consists of a two-layer multilayer sensing mechanism, and its parameters are as follows: Finally, a score is obtained for each EEG instance. The calculation method is as follows: ; After obtaining the scores, the scores are weighted and aggregated into the modulated instance representations of each EEG instance. The characterization of the bag is obtained, and the specific calculations are as follows: ; ; in, For the first The aggregated representation of bags is used to introduce a Dropout strategy to avoid overlearning of typical instances during instance learning.

6. A brain disease AI prediction system based on prototype-enhanced multi-instance learning, characterized in that, The system includes: The preprocessing slice acquisition module is used to acquire and preprocess EEG signal data from multiple subjects, and slice the EEG signal data. All EEG signal data of each subject are regarded as a bag, and each slice fragment in the bag is called an EEG instance. An instance encoding module is used to input the EEG instance into the instance encoding module. The instance encoding module includes a multi-scale temporal encoding module and a Transformer-based spatiotemporal joint representation module, which is used to perform multi-scale temporal feature detection and spatiotemporal joint representation of the EEG instance microstate to obtain the spatiotemporal joint representation feature t of the EEG instance. A cross-instance self-attention modulation module is used to integrate the spatiotemporal joint representation features. The input cross-instance self-attention modulation module calculates the correlation between instances within the bag and updates their respective features based on the correlation, allowing the model to dynamically adjust the attention weights between different instances to obtain the modulated instance representation. ; The prototype calibration-enhanced multi-instance aggregation module is used to integrate the spatiotemporal joint representation features. and the characterization of the modulated instances The multi-instance aggregation module, enhanced by input prototype calibration, calibrates the spatiotemporal joint representation features by using the constructed and updated prototypes as representative patterns of instances within the bag. The spatiotemporal joint characterization features are represented by KL divergence. Align the distribution to the prototype of the corresponding predicted class, and apply the KL divergence loss function. The model parameters are adjusted during model training, and the modulated instance representation is guided by the prototype. The aggregation yields the aggregation characteristics. ; The training module is used to aggregate the features. Input a classification header, output the subject-level probability of brain disease prediction. Using the brain disease to predict probability Cross-entropy loss with the real label and the KL divergence loss function The model parameters were adjusted together to train the model, resulting in a trained overall AI model for predicting brain diseases, consisting of various modules. The prediction module is used to predict the brain disease to be predicted using the trained brain disease prediction AI model and output the prediction result. The processing procedure of the cross-instance self-attention modulation module includes: Spatiotemporal joint representation features of different EEG instances within a bag , The self-attention modulation between them is calculated using the following formula: ; in It has In the multi-head attention model, the dimension of one head is represented by LN, which indicates layer normalization. query matrix Bond matrix Perform a dot product to obtain the correlation between them, then scale the dot product result and apply... The function transforms the correlation into a probability distribution representing the importance of each position, and applies these weights to the value matrix. The weighted summation is then used to generate a new representation for each position, achieving cross-instance level self-attention modulation within the bag. The resulting modulated instance representation is denoted as... ; The process of building and updating the prototype includes: Initial prototype generation: Maintain a learnable prototype vector for each predicted category. In the initial training iteration, the corresponding category is calculated as follows: The average value of the features of the instances within the bag is used as the corresponding first... The initial prototype of the category Therefore, the number of prototypes is set to the number of categories; Prototype update: During the training phase, the aggregation features of the bags are calculated each time. The prototype is updated using momentum updates. The specific calculation for the prototype update is as follows: ; in Set to 0.

001.

7. An electronic device comprising a processor and a memory, wherein the memory stores at least one instruction, characterized in that, The at least one instruction is loaded and executed by the processor to implement the brain disease AI prediction method based on prototype-enhanced multi-instance learning as described in any one of claims 1-5.

8. A computer-readable storage medium storing at least one instruction, characterized in that, The at least one instruction is loaded and executed by the processor to implement the brain disease AI prediction method based on prototype-enhanced multi-instance learning as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Visual content retrieval method based on electroencephalogram signals

    CN121502027A