Seizure event detection method, apparatus, device, and storage medium
By constructing a matching cost matrix and alignment loss function for EEG-video feature sequences, the problems of video occlusion and EEG artifacts in rodent epilepsy detection are solved, achieving high sensitivity and low false alarm detection results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINESE INST FOR BRAIN RES BEIJING
- Filing Date
- 2026-05-21
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies struggle to effectively address the simultaneous occurrence of video occlusion and EEG artifacts in rodent epileptic seizure scenarios, leading to decreased detection sensitivity and increased false alarm rates.
By constructing a matching cost matrix between EEG feature sequences and video feature sequences, a cross-modal correspondence constraint mechanism is established. Through joint iterative optimization using alignment loss function and classification loss function, EEG representation and video representation optimized by alignment constraint are obtained, thus realizing an explicit alignment path.
While maintaining high detection sensitivity, the false alarm rate was reduced, ensuring stable detection output even in the presence of video occlusion and EEG artifacts.
Smart Images

Figure CN122440131A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of biomedical signal processing technology, and in particular to a method, apparatus, device and storage medium for detecting epileptic seizure events. Background Technology
[0002] In rodent epilepsy research, simultaneous recording of EEG (electroencephalogram) and continuous video monitoring is generally considered the gold standard for assessing epileptic seizures. Existing technologies, such as Chinese patent CN118557145B, disclose an automatic epilepsy signal recognition system and method based on multimodal information fusion. This approach simultaneously acquires EEG and video signals, extracts multi-scale features from EEG, multi-scale features from video, and optical flow features from video, maps these different modal features to a unified feature space, and then uses modality weight learning and a classification network to complete epilepsy identification. This technology has demonstrated that combining EEG and video can improve epilepsy detection performance.
[0003] On the other hand, Chinese patent CN119940465A discloses a method for training an EEG model. This type of approach primarily optimizes the EEG model by masking EEG segments, encoding visible segments, performing frequency domain reconstruction, and incorporating classification loss, thereby improving the stability and reconstructive ability of EEG signal representation. This technique has demonstrated that constructing single-modal EEG representations on large amounts of unlabeled EEG data helps obtain more stable EEG representations.
[0004] While existing technologies have made some progress in multimodal epilepsy detection and EEG monomodal representation construction, rodent epileptic seizure scenarios differ significantly from ordinary multimodal classification scenarios. During a seizure, animals often experience violent twitching, rapid changes in posture, and occlusion from cage walls and bedding, leading to localized occlusion and unstable target boundaries on the video side. Simultaneously, artifacts caused by violent movements are easily superimposed on the EEG image. Although existing solutions incorporate multimodal information, they lack targeted constraint mechanisms and explicit alignment paths for establishing fine-grained correspondences between EEG and video, making it difficult to handle scenarios where video occlusion and EEG artifacts occur simultaneously. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for detecting epileptic seizure events. The purpose is to establish a cross-modal correspondence constraint mechanism and explicit alignment path for rodent EEG-video combined epilepsy detection tasks, reduce false alarms while maintaining high detection sensitivity, and maintain more stable detection output in the presence of video occlusion, background interference, or EEG artifacts.
[0006] In a first aspect, embodiments of this application provide a method for detecting epileptic seizure events, including:
[0007] Construct a matching cost matrix between EEG feature sequences and video feature sequences;
[0008] Based on the matching cost matrix, an alignment loss function is constructed between the EEG feature sequence and the video feature sequence;
[0009] The EEG feature sequence and the video feature sequence are jointly iteratively optimized based on the alignment loss function and the classification loss function to obtain the alignment-constrained optimized EEG representation and video representation.
[0010] Obtain the epileptic seizure event identification results that match the EEG representation and the video representation.
[0011] Optionally, constructing the matching cost matrix between the EEG feature sequence and the video feature sequence includes:
[0012] The EEG feature sequence and the video feature sequence are respectively mapped to a feature space to obtain a shared space EEG sequence and a shared space video sequence.
[0013] The matching cost matrix is constructed based on the representation difference distance between the shared space EEG sequence and the shared space video sequence.
[0014] Optionally, the step of performing feature space mapping on the EEG feature sequence and the video feature sequence respectively to obtain a shared-space EEG sequence and a shared-space video sequence includes:
[0015] The EEG feature sequence and the video feature sequence are respectively input into the spatial mapping layer to obtain the shared spatial EEG sequence and the shared spatial video sequence output by the spatial mapping layer;
[0016] The spatial mapping layer has 2 to 8 layers and is used to perform dimension allocation mapping and distribution adjustment mapping.
[0017] Optionally, constructing the matching cost matrix based on the representation difference distance between the shared spatial EEG sequence and the shared spatial video sequence includes:
[0018] Calculate the representation difference distance and construct the original cost matrix from the representation difference distance;
[0019] The original cost matrix is subjected to adaptive threshold constraints to obtain the matching cost matrix.
[0020] Optionally, constructing the alignment loss function between the EEG feature sequence and the video feature sequence based on the matching cost matrix includes:
[0021] Calculate the target transmission matrix based on the matching cost matrix;
[0022] The alignment loss function is constructed based on the matching cost matrix and the target transmission matrix.
[0023] Optionally, constructing the alignment loss function based on the matching cost matrix and the target transfer matrix includes:
[0024] According to the matching cost matrix and the target transmission matrix Construct the alignment loss function ,in, This represents the alignment loss weight.
[0025] Optionally, after obtaining the epileptic seizure event identification results matching the EEG representation and the video representation, the method further includes:
[0026] Obtain the event interval time between each adjacent target seizure event in the epileptic seizure event identification results;
[0027] The target outbreak events whose event interval is less than a preset merging threshold are merged into a new target outbreak event;
[0028] Obtain the duration of each of the target outbreak events;
[0029] Target seizure events whose duration is less than a preset event duration threshold are filtered out to update the epileptic seizure event identification results.
[0030] Secondly, embodiments of this application provide an epileptic seizure event detection device, comprising:
[0031] The matching cost module is used to construct the matching cost matrix between EEG feature sequences and video feature sequences.
[0032] The alignment loss module is used to construct an alignment loss function between the EEG feature sequence and the video feature sequence based on the matching cost matrix.
[0033] The joint optimization module is used to perform joint iterative optimization of the EEG feature sequence and the video feature sequence based on the alignment loss function and the classification loss function to obtain the EEG representation and video representation optimized by alignment constraints.
[0034] An event recognition module is used to obtain epileptic seizure event recognition results that match the EEG representation and the video representation.
[0035] Thirdly, embodiments of this application provide an epileptic seizure event detection device, comprising:
[0036] One or more processors;
[0037] Memory, used to store one or more programs;
[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement the epileptic seizure event detection method as provided in any embodiment of this application.
[0039] Fourthly, embodiments of this application provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the epileptic seizure event detection method provided in any embodiment of this application.
[0040] This application provides a method, apparatus, device, and storage medium for detecting epileptic seizure events. It constructs a matching cost matrix between EEG feature sequences and video feature sequences, calculates an alignment loss function based on the matching cost matrix, and performs joint iterative optimization of the EEG and video feature sequences based on the alignment loss function and classification loss function. This yields alignment-constrained optimized EEG and video representations, thereby obtaining matching epileptic seizure event recognition results. This solves the problem of insufficient ability of existing technologies to simultaneously handle video occlusion and EEG artifacts. It establishes a cross-modal correspondence constraint mechanism and explicit alignment path for rodent EEG-video joint epilepsy detection tasks, reducing false alarms while maintaining high detection sensitivity, and maintaining more stable detection output even in the presence of video occlusion, background interference, or EEG artifacts. Attached Figure Description
[0041] Figure 1 A flowchart of a method for detecting epileptic seizure events provided in Embodiment 1 of this application;
[0042] Figure 2 A flowchart of an EEG encoder pre-training process provided in Embodiment 1 of this application;
[0043] Figure 3 A schematic diagram of the model structure of an epileptic seizure event detection method provided in Embodiment 1 of this application;
[0044] Figure 4 This is a schematic diagram of the structure of an epileptic seizure event detection device provided in Embodiment 2 of this application;
[0045] Figure 5 This is a schematic diagram of the structure of an epileptic seizure event detection device provided in Embodiment 3 of this application. Detailed Implementation
[0046] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present application are shown in the drawings, not the entire structure.
[0047] Example 1
[0048] Figure 1 This is a flowchart of a method for detecting epileptic seizure events provided in Embodiment 1 of this application. This embodiment is applicable to the automatic detection of epileptic seizure events in rodents based on joint analysis of EEG and video. The method can be executed by an epileptic seizure event detection device, which can be implemented by hardware and / or software and is generally integrated into an electronic device, such as a computer device. The method specifically includes:
[0049] Step 110: Construct the matching cost matrix between EEG feature sequences and video feature sequences.
[0050] The EEG feature sequence can be a sequence of feature vectors representing epilepsy-related EEG patterns in preprocessed EEG time-series signals collected from rodent subjects for a task of detecting epileptic seizures. The video feature sequence can be a sequence of feature vectors representing changes in animal posture and behavior in preprocessed behavioral monitoring video data collected synchronously from the same subject. The matching cost matrix can be a matrix constructed based on the differences in the representation of EEG features and video features by the EEG feature sequence and video feature sequence, respectively. It is used to quantify the cost of cross-modal feature matching, and its matrix elements can be the cross-modal feature matching costs between each element of the EEG feature sequence and each element of the video feature sequence.
[0051] Specifically, the EEG feature sequences and video feature sequences are obtained from pre-acquired and pre-processed monitoring video data of EEG signals. Optionally, the matching cost matrix between the EEG feature sequences and video feature sequences may also include rodent subjects for epileptic seizure event detection tasks, with simultaneous acquisition of EEG signals and behavioral monitoring video data to obtain the EEG and video feature sequences. Preferably, the acquired raw EEG signals and raw video data can be pre-processed through filtering, downsampling, baseline correction, and time synchronization to suppress noise interference, reduce computational load, and maintain a strict temporal correspondence.
[0052] In an optional implementation, this embodiment acquires EEG and video signals from rodents, preferably mouse or rat epilepsy models. The EEG signal is first bandpass filtered at 1-50Hz, then notched at 50Hz to suppress power frequency interference, and subsequently corrected for baseline drift using median filtering subtraction. The original video is preferably at 25 FPS, and can be downsampled based on computing resources and target behavior frequency. Preferably, one frame is taken every four frames, reducing the effective frame rate to 6.25 FPS, or the effective frame rate can be set in the range of 4-10 FPS. Subsequently, the EEG and video can be divided into synchronized time windows using a unified timestamp. The length of this time window can be set according to the animal's seizure rhythm, sampling frequency, and detection granularity requirements, for example, in the range of 2-30 seconds. An overlap ratio of 50%-90% can be set between adjacent time windows; in a preferred implementation, the sliding step size is set to 1 second; then, a time window is only identified as a positive seizure sample if the entire time window falls within the manually labeled epileptic seizure interval.
[0053] Furthermore, by performing time-frequency feature extraction on the preprocessed EEG signal, an EEG feature sequence can be obtained; similarly, by performing spatiotemporal feature extraction on the surveillance video data, a video feature sequence can be obtained. Specifically, time-frequency feature extraction refers to extracting the time-domain and frequency-domain features of the EEG signal within each time window and fusing them to obtain the EEG feature sequence. Spatiotemporal feature extraction refers to extracting the time-domain variation features and spatial image features of the surveillance video data within each time window and fusing them to obtain the video feature sequence.
[0054] In an optional implementation, extracting time-frequency features from the EEG signal to obtain an EEG feature sequence may include: performing time-domain feature extraction mapping and frequency-domain feature extraction mapping on the EEG signal respectively; jointly embedding the time-domain feature extraction mapping results and the frequency-domain feature extraction mapping results, and then superimposing them with the position code to obtain the EEG feature sequence; specifically, it can be expressed as:
[0055]
[0056]
[0057]
[0058] in, This represents the temporal feature extraction mapping. This represents the frequency domain feature extraction mapping. Indicates a joint embedding operation. This indicates location encoding. Specifically, optionally, time-frequency feature extraction can be performed on the EEG signal to obtain an EEG feature sequence. This can be achieved using a one-dimensional convolutional network, a Transformer network, a hybrid network combining convolution and Transformer, or other networks capable of extracting epilepsy-related EEG temporal patterns. Further optionally, Figure 2 This is a flowchart illustrating the pre-training of an EEG encoder as provided in Embodiment 1 of this application. Figure 2 As shown, a masked representation construction can be performed on the EEG feature sequence. Specifically, this can include randomly masking a portion of the EEG feature sequence, inputting only the visible portion of the sequence into the encoder, and then using the decoder to reconstruct the masked portion of the sequence. The reconstruction error of the masked portion is then used as the optimization objective to iteratively optimize the constructed EEG feature sequence. This optimization objective can be specifically expressed as:
[0059]
[0060] in, The set of sequences representing the masked portion. For sequence The true representation, For sequence The predicted reconstruction is represented.
[0061] In one optional implementation, spatiotemporal feature extraction is performed on the surveillance video data to obtain a video feature sequence. This can be achieved using a video coding network, specifically a 3D convolutional network, a spatiotemporal Transformer network, a video mask modeling network, or other spatiotemporal feature extraction networks capable of extracting rhythmic motion, subtle tremors, and posture changes. In a preferred implementation, the video coding network can utilize a spatiotemporal backbone network trained on an existing video task. In this case, the video feature sequence output by the video coding network can directly enter subsequent processes without requiring the explicit optical flow vector to be used as a separate input branch.
[0062] Furthermore, since EEG feature sequences and video feature sequences represent EEG features and video features respectively, the corresponding representation differences can be calculated based on the EEG feature sequences and video feature sequences to obtain the matching cost matrix between them. This matrix can represent the cross-modal matching relationship between the EEG feature sequences and video feature sequences. In subsequent processes, the EEG feature sequences and video feature sequences can be explicitly matched and aligned based on the matching cost matrix.
[0063] In an optional implementation, a matching cost matrix is constructed between the EEG feature sequence and the video feature sequence, including: performing feature space mapping on the EEG feature sequence and the video feature sequence respectively to obtain a shared space EEG sequence and a shared space video sequence; and constructing a matching cost matrix based on the representation difference distance between the shared space EEG sequence and the shared space video sequence.
[0064] Feature space mapping refers to the operation of unifying the dimensions and adjusting the distribution of features across modalities through lightweight mapping corresponding to the modality. Shared space EEG sequences and shared space video sequences can refer to feature sequences located in a unified shared feature space, obtained by performing corresponding lightweight mappings on EEG feature sequences and video feature sequences, respectively.
[0065] Specifically, since EEG feature sequences and video feature sequences have significant differences in signal morphology, feature distribution and semantic space, they need to be mapped into a unified shared representation space and scale matched through feature space mapping, so as to obtain shared space EEG sequences and shared space video sequences with the same dimension and distribution, and then calculate the representation differences.
[0066] In an optional implementation, feature space mapping is performed on the EEG feature sequence and the video feature sequence to obtain a shared space EEG sequence and a shared space video sequence, including: inputting the EEG feature sequence and the video feature sequence into the space mapping layer to obtain the shared space EEG sequence and the shared space video sequence output by the space mapping layer.
[0067] The spatial mapping layer consists of 2 to 8 layers and is used to perform dimension assignment mapping and distribution adjustment mapping. Dimension assignment mapping can refer to a linear or nonlinear projection operation that maps the original features of different modalities to a unified dimension, while distribution adjustment mapping can refer to a projection adjustment operation that reshapes the feature distribution to adapt to cross-modal alignment.
[0068] Specifically, the spatial mapping layer can adopt a linear mapping structure, a bottleneck mapping structure, a projection structure with nonlinear activation, or other lightweight structures that can achieve dimension matching and distribution adjustment. The number of mapping layers can preferably be four.
[0069] Furthermore, representational difference distance can be a distance metric used to measure the similarity between two feature vectors and reflect the reliability of cross-modal matching. Specifically, based on the shared-space EEG sequences and shared-space video sequences with uniform dimensions and identical distribution obtained from feature space mapping, the representational difference distance between them can be calculated to describe the degree of matching and difference between the EEG feature sequences and video feature sequences, thus constructing a matching cost matrix.
[0070] In one optional implementation, a matching cost matrix is constructed based on the representation difference distance between the shared spatial EEG sequence and the shared spatial video sequence, including: calculating the representation difference distance and constructing the representation difference distance as the original cost matrix; and applying an adaptive threshold constraint to the original cost matrix to obtain the matching cost matrix.
[0071] Specifically, the distance representing the difference can be a cosine distance, an Euclidean distance, or other distances that can represent the relative differences between cross-modal feature sequences; in this embodiment, the cosine distance is preferred.
[0072] Furthermore, based on the calculated representation difference distance, an original cost matrix is constructed. The interference of high-noise and low-reliability matching on the alignment process can be further mitigated by applying an adaptive threshold constraint to the original cost matrix. Specifically, optionally, an adaptive threshold constraint is applied to the original cost matrix to obtain the matching cost matrix, including: calculating the constraint threshold based on the minimum and maximum costs in the original cost matrix. ,in, This represents the minimum cost in the original cost matrix. This represents the maximum cost in the original cost matrix. This represents the threshold control coefficient, which can preferably be set to 0.1; based on the constraint threshold, a truncation transformation is performed on the original cost matrix to form a constrained matching cost matrix. ,in, Represents the first element in the original cost matrix. The shared space EEG sequence and the first Cost term among shared spatial video sequences This represents the cost item after constraints. Through the above processing, low-cost, high-reliability cross-modal matching will be compressed to zero or near-zero cost, while higher-cost cross-modal matching will remain as a penalty item, thus allowing subsequent processes to prioritize allocation along the low-cost correspondence.
[0073] Step 120: Construct an alignment loss function between EEG feature sequences and video feature sequences based on the matching cost matrix.
[0074] The alignment loss function can be constructed based on the cross-modal matching cost between the EEG feature sequence and the video feature sequence represented by the matching cost matrix, and is used to supervise the formation of an accurate correspondence between the EEG feature sequence and the video feature sequence.
[0075] Specifically, the matching cost matrix represents the cross-modal matching cost and correspondence between EEG feature sequences and video feature sequences. Thus, the transmission cost and alignment loss of EEG feature sequences and video feature sequences under any correspondence can be determined based on the matching cost matrix, thereby obtaining the alignment loss function. This alignment loss function can be used to constrain the finally determined correspondence between EEG feature sequences and video feature sequences.
[0076] In an optional implementation, an alignment loss function is constructed between the EEG feature sequence and the video feature sequence based on the matching cost matrix, including: calculating the target transmission matrix based on the matching cost matrix; and constructing the alignment loss function based on the matching cost matrix and the target transmission matrix.
[0077] The target transport matrix can be a matrix that describes the best correspondence between the EEG feature sequence and the video feature sequence obtained by solving the matching cost matrix; optionally, the target transport matrix can be an optimal transport plan matrix, preferably obtained by the IPOT (Iterative Proportional Optimal Transport) algorithm.
[0078] Specifically, based on the matching cost matrix, the optimal correspondence between the EEG feature sequence and the video feature sequence can be determined first, thereby obtaining the target transfer matrix corresponding to this correspondence. Furthermore, based on the matching cost matrix, the alignment loss function corresponding to the correspondence described in the target transfer matrix can be constructed.
[0079] In an optional implementation, constructing an alignment loss function based on the matching cost matrix and the target transfer matrix includes: based on the matching cost matrix... and target transmission matrix Constructing the alignment loss function ,in, This represents the alignment loss weight.
[0080] Based on the above implementation method, the correspondence between EEG feature sequences and video feature sequences can be explicitly constrained, reducing cross-modal mismatches.
[0081] Step 130: Perform joint iterative optimization of the EEG feature sequence and video feature sequence based on the alignment loss function and the classification loss function to obtain the alignment-constrained optimized EEG representation and video representation.
[0082] The classification loss function can be a loss function used to supervise the accurate determination of whether an epileptic seizure event has occurred within any time window. Joint iterative optimization can be a process of iteratively optimizing the EEG feature sequences and video feature sequences by using both alignment loss and classification loss as optimization objectives. The EEG and video representations optimized by alignment constraints can then be EEG and video feature sequences that minimize both alignment loss and classification loss, thereby ensuring accurate correspondence between cross-modal features and accurate determination of epileptic seizure events.
[0083] Specifically, by incorporating both the alignment loss function and the classification loss function into the optimization objective, joint iterative optimization of EEG feature sequences and video feature sequences can be performed, leading to a more stable cross-modal correspondence between the two sequences. After training, alignment-constrained EEG and video representations can be obtained.
[0084] Step 140: Obtain the results of epileptic seizure event identification that match the EEG and video representations.
[0085] The epileptic seizure event identification result can refer to the identification result of epileptic seizure events within each time window obtained based on aligned EEG and video representations; optionally, it can be the predicted probability of epileptic seizures within each time window. Specifically, based on EEG and video representations, it can be further determined whether a rodent subject experiences an epileptic seizure within each time window, thus obtaining the epileptic seizure event identification result.
[0086] In an optional implementation, obtaining the epileptic seizure event identification result matching the EEG representation and video representation may include: matching, weighting, aggregating, or otherwise jointly representing the EEG and video representations, and inputting the combined representations into a classification head to obtain the window-level epileptic seizure probability output by the classification head, which serves as the epileptic seizure event identification result. The classification head can be a multilayer perceptron, a gated multilayer perceptron, or other network structure capable of binary classification, preferably a Gated MLP (Gated Multilayer Perceptron) structure.
[0087] In an optional implementation, after obtaining the epileptic seizure event identification results that match the EEG representation and video representation, the method further includes: obtaining the event interval time between each adjacent target seizure event in the epileptic seizure event identification results; merging target seizure events with an event interval time less than a preset merging threshold into a new target seizure event; obtaining the event duration of each target seizure event; and filtering out target seizure events with an event duration less than a preset event duration threshold to update the epileptic seizure event identification results.
[0088] The target seizure event can refer to a seizure event that can be identified in the current seizure event identification results. The event interval time can refer to the time interval between the end time of the previous event and the start time of the next event in adjacent target seizure events. The preset merging threshold can be a critical value for determining whether adjacent events are close enough in the time domain to be considered as belonging to the same seizure; optionally, it can be preset in the range of 1 to 15 seconds, preferably set to 5 seconds.
[0089] Specifically, if the time interval between any two adjacent target seizure events is less than a preset merging threshold, it can be concluded that the adjacent events belong to the same consecutive seizure, and they can be merged into a new target seizure event.
[0090] Furthermore, the event duration can refer to the total duration of the target seizure event from start to finish. The preset event duration threshold can refer to the shortest duration of a valid seizure event; optionally, it can be preset within the range of 2 to 30 seconds, preferably set to 10 seconds. If the event duration of any isolated target seizure event is less than the preset event duration threshold, it indicates that the event is unlikely to constitute a valid seizure event and can be identified as a false positive. In this case, it can be filtered out from the current target seizure event identification results of the epileptic seizure event identification results.
[0091] Further optionally, after filtering out target seizure events whose duration is less than a preset event duration threshold to update the epileptic seizure event identification results, the method further includes: shifting the event start time of the target seizure event forward in the time domain by a preset extension time and shifting the event end time backward in the time domain by a preset extension time to update the epileptic seizure event identification results.
[0092] The event start time and event end time can refer to the time points when the seizure begins and ends, respectively. The preset extension duration can refer to the adjustment duration used to correct the seizure boundary; optionally, it can be preset within the range of 1 to 15 seconds, preferably 7.5 seconds. Specifically, shifting the event start time of the target seizure event forward in the time domain by a preset extension duration and shifting the event end time backward in the time domain by a preset extension duration can extend the time boundary of the target seizure event, eliminate time delay errors in signal acquisition, transmission, and processing, and more accurately cover the actual seizure start and end interval.
[0093] The above implementation further introduces an event-level post-processing enhancement mechanism for the identification results of epileptic seizure events.
[0094] The technical solution of this embodiment constructs a matching cost matrix between EEG feature sequences and video feature sequences, calculates an alignment loss function between the EEG feature sequences and video feature sequences based on the matching cost matrix, and performs joint iterative optimization of the EEG feature sequences and video feature sequences based on the alignment loss function and classification loss function to obtain EEG representations and video representations optimized by alignment constraints. This allows for the acquisition of matching epileptic seizure event recognition results, solving the problem of insufficient ability of existing technologies to simultaneously deal with video occlusion and EEG artifacts. It realizes the establishment of a cross-modal correspondence constraint mechanism and explicit alignment path for rodent EEG-video joint epilepsy detection tasks, which can reduce false alarms while maintaining high detection sensitivity and maintain more stable detection output in the presence of video occlusion, background interference, or EEG artifacts.
[0095] Specifically, compared with existing technologies, this application, in the rodent EEG-video combined epilepsy detection task, can reduce false alarms while maintaining high detection sensitivity, and maintain relatively stable detection output even in the presence of video occlusion, background interference, or EEG artifacts. The improvements at the result level are mainly reflected in two aspects: firstly, by constructing a shared representation space and cross-modal optimal transmission alignment, erroneous matching between irrelevant EEG segments and video segments is reduced; secondly, by directly involving the video spatiotemporal feature sequence and subsequent window-level detection output, the dependence on independent optical flow engineering paths can be reduced, making the overall detection process more compact.
[0096] In one exemplary implementation, Figure 3 This is a schematic diagram of the model structure for a method for detecting epileptic seizure events provided in Embodiment 1 of this application. In this example, the experimental data comes from a mouse epilepsy model, involving 15 mice and a total of 93 consecutive 24-hour synchronous EEG-video recording sessions. Figure 3As shown, EEG was recorded using a dual-channel setup, with the recording pole positioned above the olfactory bulb and the reference and ground poles positioned above the cerebellum. Video was acquired at 25 FPS and downsampled to 6.25 FPS. Synchronous data was segmented into 10-second time windows with a 1-second sliding step, using the window falling entirely within the epileptic seizure interval as the positive sample criterion. Furthermore, this invention was evaluated in a cross-subject scenario, employing a leave-one-subject cross-validation strategy. This involved using all data from one mouse not participating in training as the test set, with the model trained on the remaining mouse data. Experimental results show that this example achieves approximately 96.89% balance accuracy, an event sensitivity of 1.0000 in event-level detection, and reduces the false alarm rate to approximately 1.0083 times / hour. In a random session segmentation scenario, this example also achieves approximately 98.72% balance accuracy, an event sensitivity of 1.0000, and an event false alarm rate of approximately 2.2083 times / hour. The above results demonstrate that the shared representation space construction and optimal transmission alignment path proposed in this application can effectively suppress false alarms while maintaining high sensitivity.
[0097] Example 2
[0098] Figure 4 This is a schematic diagram of the structure of an epileptic seizure event detection device provided in Embodiment 2 of this application, as shown below. Figure 4 As shown, the epileptic seizure event detection device includes: a matching cost module 410, an alignment loss module 420, a joint optimization module 430, and an event recognition module 440, wherein,
[0099] Matching cost module 410 is used to construct the matching cost matrix between EEG feature sequences and video feature sequences;
[0100] Alignment loss module 420 is used to construct an alignment loss function between the EEG feature sequence and the video feature sequence based on the matching cost matrix;
[0101] The joint optimization module 430 is used to perform joint iterative optimization of the EEG feature sequence and the video feature sequence based on the alignment loss function and the classification loss function to obtain the EEG representation and video representation optimized by alignment constraints.
[0102] The event recognition module 440 is used to obtain the epileptic seizure event recognition results that match the EEG representation and the video representation.
[0103] The technical solution of this embodiment constructs a matching cost matrix between EEG feature sequences and video feature sequences, calculates an alignment loss function between the EEG feature sequences and video feature sequences based on the matching cost matrix, and performs joint iterative optimization of the EEG feature sequences and video feature sequences based on the alignment loss function and classification loss function to obtain EEG representations and video representations optimized by alignment constraints. This allows for the acquisition of matching epileptic seizure event recognition results, solving the problem of insufficient ability of existing technologies to simultaneously deal with video occlusion and EEG artifacts. It realizes the establishment of a cross-modal correspondence constraint mechanism and explicit alignment path for rodent EEG-video joint epilepsy detection tasks, which can reduce false alarms while maintaining high detection sensitivity and maintain more stable detection output in the presence of video occlusion, background interference, or EEG artifacts.
[0104] Optionally, the matching cost module 420 includes: a spatial mapping unit, used to perform feature space mapping on the EEG feature sequence and the video feature sequence respectively to obtain a shared space EEG sequence and a shared space video sequence; and a representation difference unit, used to construct the matching cost matrix based on the representation difference distance between the shared space EEG sequence and the shared space video sequence.
[0105] Optionally, the spatial mapping unit is specifically configured to: input the EEG feature sequence and the video feature sequence to the spatial mapping layer respectively, to obtain the shared spatial EEG sequence and the shared spatial video sequence output by the spatial mapping layer; wherein, the spatial mapping layer has 2 to 8 layers and is used to perform dimension allocation mapping and distribution adjustment mapping.
[0106] Optionally, the representation difference unit is specifically configured to: calculate the representation difference distance and construct the representation difference distance into an original cost matrix; apply an adaptive threshold constraint to the original cost matrix to obtain the matching cost matrix.
[0107] Optionally, the alignment loss module 430 includes: a transmission matrix unit for calculating a target transmission matrix based on the matching cost matrix; and a loss construction unit for constructing the alignment loss function based on the matching cost matrix and the target transmission matrix.
[0108] Optionally, the loss construction unit is specifically configured to: based on the matching cost matrix and the target transmission matrix Construct the alignment loss function ,in, This represents the alignment loss weight.
[0109] Optionally, the epileptic seizure event detection device further includes: an event post-processing module, configured to acquire the event interval time between each adjacent target seizure event in the epileptic seizure event identification result; merge the target seizure events with the event interval time less than a preset merging threshold into a new target seizure event; acquire the event duration of each target seizure event; and filter out the target seizure events with the event duration less than a preset event duration threshold to update the epileptic seizure event identification result.
[0110] The epileptic seizure event detection device provided in this application embodiment can execute the epileptic seizure event detection method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of executing the method.
[0111] Example 3
[0112] Figure 5 This is a schematic diagram of the structure of an epileptic seizure event detection device provided in Embodiment 3 of this application, as shown below. Figure 5 As shown, the epileptic seizure event detection device includes a processor 510, a memory 520, an input device 530, and an output device 540; the number of processors 510 in the epileptic seizure event detection device can be one or more. Figure 5 Taking a processor 510 as an example; the processor 510, memory 520, input device 530, and output device 540 in the epileptic seizure event detection device can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.
[0113] The memory 520, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the epileptic seizure event detection method in the embodiments of this application (e.g., the feature acquisition module 410, matching cost module 420, alignment loss module 430, joint optimization module 440, and event recognition module 450 in the epileptic seizure event detection device). The processor 510 executes various functional applications and data processing of the epileptic seizure event detection device by running the software programs, instructions, and modules stored in the memory 520, thereby realizing the aforementioned epileptic seizure event detection method.
[0114] The memory 520 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 520 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory, or other non-volatile solid-state storage device. In some instances, the memory 520 may further include memory remotely located relative to the processor 510, which can be connected to the seizure event detection device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0115] Input device 530 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the epileptic seizure event detection device. Output device 540 may include a display device such as a display screen.
[0116] Example 4
[0117] Embodiment 4 of this application also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a method for detecting epileptic seizure events, including:
[0118] Construct a matching cost matrix between EEG feature sequences and video feature sequences;
[0119] Based on the matching cost matrix, an alignment loss function is constructed between the EEG feature sequence and the video feature sequence;
[0120] The EEG feature sequence and the video feature sequence are jointly iteratively optimized based on the alignment loss function and the classification loss function to obtain the alignment-constrained optimized EEG representation and video representation.
[0121] Obtain the epileptic seizure event identification results that match the EEG representation and the video representation.
[0122] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the method operations described above, but can also perform related operations in the epileptic seizure event detection method provided in any embodiment of this application.
[0123] Based on the above description of the implementation methods, those skilled in the art can clearly understand that this application can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0124] It is worth noting that in the embodiments of the epileptic seizure event detection device described above, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of this application.
[0125] Although this application has been described in detail above with general descriptions, specific embodiments, and experiments, some modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of this application fall within the scope of protection claimed in this application.
Claims
1. A method for detecting epileptic seizure events, characterized in that, include: Construct a matching cost matrix between EEG feature sequences and video feature sequences; Based on the matching cost matrix, an alignment loss function is constructed between the EEG feature sequence and the video feature sequence; The EEG feature sequence and the video feature sequence are jointly iteratively optimized based on the alignment loss function and the classification loss function to obtain the alignment-constrained optimized EEG representation and video representation. Obtain the epileptic seizure event identification results that match the EEG representation and the video representation.
2. The method according to claim 1, characterized in that, The construction of the matching cost matrix between the EEG feature sequence and the video feature sequence includes: The EEG feature sequence and the video feature sequence are respectively mapped to a feature space to obtain a shared space EEG sequence and a shared space video sequence. The matching cost matrix is constructed based on the representation difference distance between the shared space EEG sequence and the shared space video sequence.
3. The method according to claim 2, characterized in that, The step of performing feature space mapping on the EEG feature sequence and the video feature sequence respectively to obtain a shared-space EEG sequence and a shared-space video sequence includes: The EEG feature sequence and the video feature sequence are respectively input into the spatial mapping layer to obtain the shared spatial EEG sequence and the shared spatial video sequence output by the spatial mapping layer; The spatial mapping layer has 2 to 8 layers and is used to perform dimension allocation mapping and distribution adjustment mapping.
4. The method according to claim 2, characterized in that, The process of constructing the matching cost matrix based on the representation difference distance between the shared spatial EEG sequence and the shared spatial video sequence includes: Calculate the representation difference distance and construct the original cost matrix from the representation difference distance; The original cost matrix is subjected to adaptive threshold constraints to obtain the matching cost matrix.
5. The method according to claim 1, characterized in that, The step of constructing the alignment loss function between the EEG feature sequence and the video feature sequence based on the matching cost matrix includes: Calculate the target transmission matrix based on the matching cost matrix; The alignment loss function is constructed based on the matching cost matrix and the target transmission matrix.
6. The method according to claim 5, characterized in that, The step of constructing the alignment loss function based on the matching cost matrix and the target transfer matrix includes: According to the matching cost matrix and the target transmission matrix Construct the alignment loss function ,in, This represents the alignment loss weight.
7. The method according to claim 1, characterized in that, After obtaining the epileptic seizure event identification results that match the EEG representation and the video representation, the method further includes: Obtain the event interval time between each adjacent target seizure event in the epileptic seizure event identification results; The target outbreak events whose event interval is less than a preset merging threshold are merged into a new target outbreak event; Obtain the duration of each of the target outbreak events; Target seizure events whose duration is less than a preset event duration threshold are filtered out to update the epileptic seizure event identification results.
8. A device for detecting epileptic seizure events, characterized in that, include: The matching cost module is used to construct the matching cost matrix between EEG feature sequences and video feature sequences. The alignment loss module is used to construct an alignment loss function between the EEG feature sequence and the video feature sequence based on the matching cost matrix. The joint optimization module is used to perform joint iterative optimization of the EEG feature sequence and the video feature sequence based on the alignment loss function and the classification loss function to obtain the EEG representation and video representation optimized by alignment constraints. An event recognition module is used to obtain epileptic seizure event recognition results that match the EEG representation and the video representation.
9. A device for detecting epileptic seizure events, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for detecting epileptic seizure events as described in any one of claims 1-7.
10. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the epileptic seizure event detection method as described in any one of claims 1-7.