Electroencephalogram experiment starting control method and system

CN122986394APending Publication Date: 2026-10-27SHENZHEN SITUOWEI TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611316169.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

当设备检测阶段、检测结果保存阶段和正式采集阶段采用的增益配置发生差异时,设备准入判断所依据的脑电数据难以准确表征正式采集条件

Benefits of technology

本发明在脑电实验正式启动前,根据多通道脑电数据的饱和状态确定目标增益,在采集增益需要调整时通过候选增益进行探测,并在确定目标增益后按照目标增益重新取得预设检测时长的脑电数据,再依据重新采集的数据生成设备检测结果,使设备质量判断建立在正式选定增益对应的数据基础上。目标增益同时写入设备检测证据记录和被试增益配置,并由脑电记录器在脑电信号流启动前再次应用,使设备检测、增益配置和正式脑电采集采用相对应的信号量程,从而降低探测数据、正式检测数据和正式采集数据采用不同增益配置造成的设备准入判断偏差,提高脑电实验启动条件与正式采集条件之间的一致性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122986394A_ABST
    Figure CN122986394A_ABST
Patent Text Reader

Abstract

The present application relates to brain-computer interface, new generation information technology, artificial intelligence and electroencephalogram experiment automatic control technical field, especially relates to a kind of electroencephalogram experiment starting control method and system.Through equipment detection, target gain is determined, and target gain is used to reacquire detection data, and target gain is written into equipment detection evidence and subject gain configuration, consistency check is completed before formal electroencephalogram acquisition, and target gain is applied;Further, in combination with channel state and bridge risk determination, session channel quality benchmark, sample attrition risk and electrode contact risk monitoring and electroencephalogram state recognition reliability control, the whole process quality constraint from experiment starting, continuous acquisition to state recognition is realized, the consistency, reliability and operation safety of electroencephalogram experiment data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of brain-computer interfaces, next-generation information technology, artificial intelligence, and automated control technology for brain electrical experiments, and particularly to a method and system for initiating brain electrical experiments. Background Technology

[0002] Before formal EEG data acquisition, signal quality checks and parameter configurations of the EEG acquisition equipment are typically performed. US patent application US20120143020A1 discloses an EEG kit, whose specification specifically states: "

[0170] A calibration check can be performed ... determining the appropriate gain or filtering," and discloses the use of automatic gain control to adjust the amplitude of the EEG signal to obtain an appropriate acquisition dynamic range. US20230355156A1 further discloses a High resolution electroencephalograph signal acquisition system, whose specification specifically states: "

[0008] A programmable gain amplifier ... modifies the gain ... to impede it from saturation."

[0003] During EEG device testing, signal saturation may cause adjustments to the acquisition gain, and both the device quality evaluation results and the formal EEG acquisition data are affected by the signal range corresponding to the acquisition gain. When the gain configuration used in the device testing phase, the test result storage phase, and the formal acquisition phase differs, the EEG data on which the device admission judgment is based cannot accurately represent the formal acquisition conditions.

[0004] Therefore, improving the consistency between the quality test data of the EEG device after gain adjustment and the range of the actual EEG acquisition signal has become a technical problem that needs to be solved. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for controlling the initiation of EEG experiments, addressing the shortcomings of existing technologies. This method aims to improve the consistency between EEG device detection, acquisition gain configuration, and formal EEG acquisition conditions. By implementing quality constraints on the EEG experiment process from initiation and continuous acquisition to state recognition through initiation evidence verification, session pre-occupancy, EEG channel quality evaluation, continuous acquisition health monitoring, and EEG state recognition reliability control, the consistency, reliability, and operational safety of EEG experimental data are improved.

[0006] The present invention specifically adopts the following scheme: a method for initiating and controlling an electroencephalogram (EEG) experiment, comprising: The detection and acquisition process involves: acquiring multi-channel EEG data for a preset detection duration according to the detection gain; calculating channel quality, stability, and saturation indices based on the multi-channel EEG data to obtain the device detection results; determining the target gain based on the saturation indices from the detection gain and candidate gains lower than the detection gain; applying the candidate gains sequentially for a preset detection duration when the overall saturation rate reaches the first gain adjustment condition or the saturation rate of any EEG channel reaches the second gain adjustment condition; determining the candidate gains that satisfy both the overall saturation rate condition and the channel-by-channel saturation rate condition as the target gain; re-acquisition determination when the target gain is less than the detection gain; re-acquiring multi-channel EEG data for a preset detection duration according to the target gain; generating a device detection evidence record based on the re-acquisitioned multi-channel EEG data; locking the target gain in the device detection evidence record and the subject gain configuration; and verifying the start-up process before the formal EEG experiment begins by reading the device detection evidence record and the subject gain configuration. When the target gain in the device detection evidence record matches the target gain in the subject gain configuration, the target gain is written into the start-up configuration, and the EEG recorder applies the target gain before the EEG signal flow begins.

[0007] In a further proposed solution: during the detection and acquisition process, the equipment quality indicators include data integrity rate, number of available channels, number of stable channels, and overall saturation rate; when the data integrity rate reaches 90%, the number of available channels reaches 6, the number of stable channels reaches 6, and the overall saturation rate is less than or equal to 2%, the equipment quality is considered qualified; each EEG channel's quality status is determined based on its channel saturation rate, standard deviation, mean, and impedance.

[0008] In a further proposed solution, the detection and collection steps also include: Channel adaptation sub-step: The detected EEG data is rearranged according to the target channel table to generate a channel presence mask that represents the physical presence status of the target EEG channel, and a channel quality mask is generated based on the signal quality of each physically present EEG channel. Bridging determination sub-step: Determine candidate EEG channels from EEG channels that physically exist as represented by the channel existence mask and whose quality is available as represented by the channel quality mask. Establish bridging relationships based on the channel correlation degree and channel differential residual energy between candidate EEG channels. Determine the connected channel groups formed by the bridging relationships as representative channels and bridging risk channels. Update the channel quality mask based on the bridging risk channels. Detection and update sub-step: Based on the channel existence mask and the updated channel quality mask, redetermine the number of available channels and write the redetermined number of available channels into the device quality index.

[0009] In a further scheme: in the bridging determination sub-step: when the correlation coefficient of the candidate EEG channel pair reaches 0.985 and the differential residual energy ratio is less than 0.02, an undirected edge is established between the corresponding candidate EEG channels; the connected components of the bridging graph are obtained based on the undirected edge; for a connected component containing at least two candidate EEG channels, the candidate EEG channel with the largest standard deviation is determined as the representative channel, and the remaining candidate EEG channels in the same connected component are determined as bridging risk channels.

[0010] In a further scheme: In the gain determination step, candidate gains are selected sequentially from values ​​lower than the current gain in the order of 24x, 12x, 8x, 6x, 4x, 2x, and 1x. The preset detection duration is 8 seconds. The first gain adjustment condition corresponds to an overall saturation rate greater than 2%, and the second gain adjustment condition corresponds to a saturation rate greater than 5% for any EEG channel. In the resampling determination step, the preset detection duration is 30 seconds. If zero samples are obtained or the data shape is abnormal during resampling, resampling is performed again. When the number of resamplings reaches 3 and the data status remains abnormal, a device detection abnormality status is generated.

[0011] In a further proposed solution, the verification process also includes: Device evidence verification sub-step: Read the parsing status, creation time and serial port identifier of the device detection evidence record, form a time validity status based on the time interval between the creation time and the current time, and compare the serial port identifier in the device detection evidence record with the current serial port identifier to form a serial port matching status; Quality Coverage Sub-step: When the time validity status and serial port matching status meet the start conditions and the device quality status is in an abnormal state, the quality coverage instruction is received and the device quality status is converted to the admission status. The device evidence validity status, serial port matching status, volume calibration status, and gain consistency status continue to serve as the start verification conditions for the formal EEG experiment.

[0012] In a further proposed solution, the following steps are included before initiating the verification process: Volume calibration steps: Generate a 1000 Hz tone calibration signal, acquire the calibration signal through a loopback recording device or microphone, calculate the measured decibel value relative to full digital amplitude based on the root mean square value of the recorded signal, generate a volume calibration pass status when the absolute difference between the measured decibel value and the target decibel value is less than or equal to 3 dB, and generate a volume calibration evidence record containing the creation time, recording device identifier, measured decibel value, target decibel value, tolerance and volume calibration status; Volume Evidence Verification Sub-step: Generate volume evidence verification results based on the time interval between the creation time of the volume calibration evidence record and the current time, as well as the volume calibration status.

[0013] In a further proposed solution: after the initial verification step, the solution includes: a session pre-occupancy step: retrieving the output path based on the subject identifier and session identifier and reading the session registration form; performing device evidence verification, volume evidence verification, and gain evidence verification when the output path is in a createable state and the session registration state is idle; after the device evidence verification, volume evidence verification, and gain evidence verification are completed, reading the session registration form again; writing the subject identifier, session identifier, current time, and host identifier while the session registration state remains idle; and creating a formal EEG experiment after the session registration is completed.

[0014] A further proposed solution includes the following steps prior to the detection and data collection process: Operating mode determination steps: Obtain the current EEG experiment operating mode; Test isolation steps: When the current EEG experiment operation mode is development test mode, set the device detection access control and volume calibration access control to test access status, set the EEG acquisition enable status to the off status, perform input security checks, historical output checks and session management, and start the development test process based on the test access status and the check results of input security checks, historical output checks and session management. During the execution of the development test process, keep the EEG acquisition enable status in the off state.

[0015] In a further proposed solution: after the initial verification step, specifically after the formal EEG experiment begins, it also includes: a data acquisition and monitoring step, a baseline establishment step, and a recognition and control step. Among these: Data Acquisition and Monitoring Steps: Based on the examination cycle, determine the theoretical number of new samples according to the EEG sampling rate and examination interval. Generate sample loss risk based on the degree of missing samples relative to the theoretical number of new samples. Identify abnormal EEG channels by comparing the standard deviation, absolute maximum amplitude, and maximum adjacent sampling difference of each EEG channel within the current examination window with the quality benchmark of the conversation channel. Generate electrode contact risk based on the number of abnormal EEG channels. Establish the first and second duration cumulative values ​​corresponding to the sample loss risk and electrode contact risk, respectively. Update the corresponding duration cumulative values ​​based on the sample loss risk and electrode contact risk. Generate normal acquisition health status, downgraded acquisition health status, or rejected acquisition health status based on the corresponding duration cumulative values.

[0016] The baseline establishment steps are as follows: acquire the baseline signals of each EEG channel during the first formal baseline phase of the current EEG acquisition session, generate the flatness threshold, saturation threshold and jump threshold of each EEG channel based on the robust statistics of the baseline signals of each EEG channel and the analog-to-digital conversion range corresponding to the current session gain, and form the session channel quality benchmark; use the session channel quality benchmark as a quality reference for channel quality mask updates and electrode contact risk assessment during continuous EEG acquisition.

[0017] The identification and control steps are as follows: For the EEG window generation channel, an existence mask and a channel quality mask are used. The quality state of the EEG window is determined based on these masks and the risk of bridging the channel. The EEG window quality state and the acquired healthy state are fused according to reliability levels (normal, degraded, and rejection). The state with the lowest reliability level forms the pre-model-call quality state. When the pre-model-call quality state is normal or degraded, the EEG state recognition model is invoked to obtain the state classification probability, and a model uncertainty state is generated based on this probability. The final identification state is determined based on the reliability level defined by the pre-model-call quality state and the model uncertainty state. When the final identification state is rejection, a downstream control blocking command is generated.

[0018] A brainwave experiment initiation control system, comprising: The device detection module receives the detection gain and acquires multi-channel EEG data for a preset detection duration. Based on the multi-channel EEG data, it outputs channel quality indicators, stability indicators, and saturation indicators. The automatic gain detection and resampling module receives the saturation indicator and determines the target gain from the detection gain and candidate gains lower than the detection gain. When the saturation indicator reaches the gain adjustment condition, it sequentially applies candidate gains to perform detection acquisition. When the target gain is less than the detection gain, it re-acquires multi-channel EEG data for a preset detection duration according to the target gain and outputs the device detection evidence record based on the re-acquired multi-channel EEG data. The subject gain locking module receives the target gain and writes the target gain into the device detection evidence record and the subject gain configuration. The evidence verification module receives the device detection evidence record and the subject gain configuration and outputs the target gain consistency status. The startup configuration generation module receives the target gain consistency status. When the target gain consistency status meets the startup condition, it writes the target gain into the startup configuration and outputs the startup configuration to the EEG recorder, enabling the EEG recorder to apply the target gain before the EEG signal flow starts.

[0019] A further solution includes: a channel state determination module, a bridging determination module, a session quality benchmark module, a health monitoring module, a state recognition module, and a state fusion module; the channel state determination module generates channel presence masks and channel quality masks based on the target channel table and EEG data; the bridging determination module forms bridging connected channel groups based on the channel correlation and channel differential residual energy between candidate EEG channels, and updates the channel quality masks based on the bridging connected channel groups; the session quality benchmark module generates session channel quality benchmarks based on the baseline signals of each EEG channel in the first formal baseline stage of the current EEG acquisition session and the analog-to-digital conversion range corresponding to the current session gain; and a quality rating module. The receiving channel has a mask and an updated channel quality mask. The EEG window quality state is generated based on the number of target channels and the number of available channels. The health monitoring module generates the acquisition health state based on the cumulative duration of the sample loss risk and electrode contact risk. The state recognition module receives the EEG window and generates the state classification probability and model uncertainty state based on the EEG window when the EEG window quality state and the acquisition health state meet the model calling conditions. The state fusion module generates the final recognition state based on the EEG window quality state, the acquisition health state, and the model uncertainty state. When the final recognition state is rejection, it outputs a downstream control blocking command to the control output terminal.

[0020] The beneficial effects of this invention are: This invention determines a target gain based on the saturation state of multi-channel EEG data before the formal initiation of an EEG experiment. When gain adjustment is needed, candidate gains are used for detection. After determining the target gain, EEG data for a preset detection duration is reacquired according to the target gain. Device detection results are then generated based on the reacquired data, ensuring that device quality judgment is based on data corresponding to the formally selected gain. The target gain is simultaneously written into the device detection evidence record and the subject's gain configuration, and is applied again by the EEG recorder before the EEG signal flow begins. This ensures that device detection, gain configuration, and formal EEG acquisition use corresponding signal ranges, thereby reducing device admission judgment bias caused by different gain configurations for probe data, formal detection data, and formal acquisition data, and improving the consistency between EEG experiment initiation conditions and formal acquisition conditions.

[0021] Based on the aforementioned initiation control, physical absence and signal quality abnormalities of EEG channels are recorded through channel presence and channel quality status, respectively. Furthermore, the correlation between EEG channels and differential residual energy are used to identify bridging relationships. This allows pseudo-synchronous channels formed by electrode bridging to participate in the judgment of the number of available channels and the quality of the EEG window, further improving the accuracy of device access and window quality evaluation. After the formal EEG experiment is initiated, a session channel quality benchmark is established using the locked session gain corresponding to the analog-to-digital conversion range and the initial formal baseline. Then, the risk of sample loss and electrode contact are monitored separately, and a healthy acquisition status is formed according to the duration. This allows continuous transmission abnormalities and continuous electrode abnormalities, which are difficult to reflect by a single window, to enter the reliability control chain. The healthy acquisition status is further integrated with the EEG window quality status and model uncertainty status according to reliability levels. This ensures that even when the initiation conditions are met and a single EEG window is temporarily normal but the continuous acquisition status has deteriorated, the reliability level of the EEG status recognition result can still be limited. Simultaneously, the concentration of model classification probability cannot improve the already reduced input reliability level. Finally, the rejection status further blocks downstream automatic feedback or stimulus control. This forms a reliability control chain for EEG experiments with layer-by-layer constraints, from "reliable equipment and gain before startup, reliable acquisition process after startup, reliable current EEG window, and reliable model recognition results." It also takes into account volume calibration, session pre-occupancy, and development and testing isolation, thereby improving the data consistency, quality controllability, and operational safety of EEG experiments from startup and acquisition to state recognition. Attached Figure Description

[0022] Figure 1 This is a schematic diagram of the overall process of automatically starting the access control system according to the present invention.

[0023] Figure 2 This is a schematic diagram of the device detection and gain closed-loop of the present invention.

[0024] Figure 3 This is a schematic diagram illustrating the chain of evidence for initiation and test isolation in this invention.

[0025] Figure 4 This is a schematic diagram illustrating the process of generating and using the session channel quality benchmark according to the present invention.

[0026] Figure 5 This is a schematic diagram of the dual-risk data collection, health status generation, and quality fusion process of the present invention.

[0027] Figure 6 This is a schematic diagram of the overall process of EEG state recognition according to the present invention.

[0028] Figure 7 This is a schematic diagram of the channel status and bridging determination process of the present invention.

[0029] Figure 8 This is a schematic block diagram illustrating the steps of the method of the present invention. Detailed Implementation

[0030] The technical solutions in the embodiments of the present invention will now be clearly and completely described in conjunction with the accompanying drawings.

[0031] like Figures 1-8 As shown, this invention provides a method and system for controlling the initiation of an EEG experiment. Before the formal synchronous EEG experiment begins, it sequentially verifies operational dependencies, input safety, historical output, device detection status, EEG channel quality, acquisition gain, volume calibration status, and session occupancy status. When there is a risk of EEG signal saturation, it automatically determines a target gain, reacquires complete device detection data using the target gain, and writes the target gain into the device detection evidence record and the subject's gain configuration. The target gain is then verified and applied again before the formal EEG signal flow begins. After the formal EEG experiment begins, it can also establish a session channel quality benchmark based on the initial formal baseline, continuously monitor sample loss risk and electrode contact risk, and combine the channel presence status, channel quality status, bridging risk, and model uncertainty of the EEG window to form a reliable control for EEG state recognition.

[0032] In this embodiment, the automatic EEG experiment initiation refers to the system automatically reading previously generated device detection evidence records and volume calibration evidence records after receiving a start command. It then performs consistency checks on evidence existence, timeliness, object binding relationships, and key parameters according to a preset initiation sequence, and generates a formal initiation configuration when all initiation conditions are met. The device detection process and volume calibration process are independent pre-processes executed before the start command. The initiation process corresponding to the start command reads the result data generated by the aforementioned pre-processes, without re-executing the complete device detection and volume calibration within the same initiation process corresponding to the start command. The EEG experiment initiation control system includes a runtime dependency check module, an input normalization and safety path module, a historical output and session registration conflict check module, a device detection module, a channel quality and stability evaluation module, an automatic gain detection and re-acquisition module, a volume calibration module, an evidence verification module, a subject gain locking module, a session key pre-occupancy module, a formal acquisition test isolation module, and an initiation configuration generation module. After the formal EEG experiment is initiated, the system may also include a channel state determination module, a bridging determination module, a session quality benchmark module, an acquisition health monitoring module, a state recognition module, a state fusion module, and a control output module.

[0033] The runtime dependency check module checks the integrity of runtime files and libraries before the system enters an available state in the formal startup interface. During system startup, it first establishes or confirms the data acquisition directory, device detection directory, and device detection data directory. The input normalization and security path module constructs the output path based on the normalized subject identifier and session identifier, and limits the constructed output path to a specified output directory. In source code execution mode, the runtime dependency check module at least checks whether the device detection script exists, whether the Python dependency packages can be imported, and whether the corresponding dynamic libraries of the Python dependency packages exist; in packaged execution mode, it at least checks whether the Python dynamic library, the EEG acquisition device control module, and the device detection script are loadable. If any critical startup dependency is missing, the runtime dependency check module generates a list of missing dependencies and keeps the formal startup state closed. When the volume calibration process uses the Sounddevice audio input / output component, if the Sounddevice component is unavailable in normal formal acquisition mode, the volume calibration state remains unavailable, and the formal startup state remains closed.

[0034] Upon receiving the start command, the input normalization and security path module normalizes the subject name, session identifier, and serial port identifier. The subject name undergoes character validation using a preset set of secure characters; the session identifier consists of letters, numbers, underscores, and hyphens; and the serial port identifier is validated according to the COM port format. After normalization, the system uses the normalized subject identifier, session identifier, and serial port identifier as data indexes for historical output checks, device evidence verification, gain evidence verification, and session pre-emption.

[0035] The device testing process is executed according to the following steps: detection and acquisition, gain determination, resampling determination, and gain locking. In the detection and acquisition step, the device testing module acquires multi-channel EEG data for a preset detection duration according to the detection gain, and generates EEG channel quality indicators, stability indicators, and saturation indicators based on the acquired data.

[0036] In one specific embodiment, the device detection duration is 30 seconds, the number of EEG channels is 8, and the EEG sampling rate is 250 Hz. The 30-second detection duration can be divided into three 10-second detection phases to collect EEG data in a static state, a blinking state, and a slight movement state, respectively, to compare the repeatability of EEG signals under different movement states. The device detection evidence record includes at least the creation time, subject identifier, serial port identifier, data integrity rate, number of available channels, number of stable channels, overall saturation rate, channel-by-channel saturation rate, electrode impedance, target gain, analog-to-digital conversion range, and detection data output file identifier.

[0037] The channel quality and stability evaluation module calculates the mean, standard deviation, minimum, maximum, and saturation rate of each EEG channel. When the EEG channel data is empty or contains non-finite values, the corresponding EEG channel is designated as unusable. When the EEG channel saturation rate is greater than 5%, the corresponding EEG channel is designated as unusable. When the standard deviation of an EEG channel is less than 1 microvolt, the corresponding EEG channel is designated as unusable. Further analysis of electrode impedance is used to determine the cause of the anomaly: electrode impedance greater than 500 kilohms indicates electrode detachment; electrode impedance less than or equal to 500 kilohms indicates a flat state; a standard deviation greater than 3000 microvolts indicates excessive noise; and an absolute value of the EEG channel mean greater than 100,000 microvolts indicates an abnormal offset.

[0038] When the electrode impedance of an EEG channel is greater than 500 kΩ and the standard deviation of the EEG channel reaches 1 μV, a high impedance alarm state is formed, and the corresponding EEG channel remains usable. When the standard deviation of the EEG channel reaches 1 μV but is less than 5 μV, a weak signal alarm state is formed, and the corresponding EEG channel remains usable. When the saturation rate of the EEG channel is greater than 1% but less than or equal to 5%, an occasional saturation alarm state is formed, and the corresponding EEG channel remains usable. The remaining EEG channels that meet the quality conditions are in a normal usable state. Thus, high impedance and low standard deviation are used together to determine the electrode detachment state, and EEG channels with high impedance and still exhibiting EEG fluctuations are retained in a usable alarm state.

[0039] In the stability assessment, the channel quality and stability evaluation module first calculates the first-order difference sequence for each EEG channel, and then calculates the median of the differences and the absolute median difference of the differences. The jump rate is obtained according to the following formula: ; in, The jump rate represents the proportion of samples whose first-order difference sequence deviates from the median of the difference by 8 times the absolute median difference. This is the first-order difference sequence of the current EEG channel; The median of the differences; This is the absolute median difference.

[0040] The channel quality and stability evaluation module further segments the current EEG channel data into 1-second windows, calculates the standard deviation of each 1-second window, and calculates the coefficient of variation of the standard deviation based on the standard deviation of each window. When the jump rate is less than 0.02 and the coefficient of variation of the standard deviation is less than 0.8, the current EEG channel is determined as a stable channel. The device detection module determines the theoretical number of samples according to the preset sampling plan and determines the data integrity rate based on the actual number of EEG samples obtained. In a specific embodiment, when the data integrity rate reaches 90%, the number of stable channels reaches 6, the number of usable channels reaches 6, and the overall saturation rate is less than or equal to 2%, a qualified device quality status is generated.

[0041] See Figure 2 After the detection and acquisition steps are completed, the system determines whether to perform the gain determination step based on the overall saturation rate and the channel-by-channel saturation rate. When the overall saturation rate is less than or equal to 2% and the saturation rate of each EEG channel is less than or equal to 5%, the current detected gain is determined as the target gain; when the overall saturation rate is greater than 2% or the saturation rate of any EEG channel is greater than 5%, the automatic gain detection and resampling module enters the candidate gain detection process.

[0042] In the gain determination step, candidate gains are arranged in the order of 24x, 12x, 8x, 6x, 4x, 2x, and 1x, and are probed sequentially starting with candidate gains lower than the currently detected gain. After each candidate gain is selected, it is applied to the eight EEG channels, the old data cached before the candidate gain application is refreshed, and new multi-channel EEG data is collected for an 8-second probe duration. The overall saturation rate and channel-specific saturation rate are then recalculated. When the overall saturation rate corresponding to the candidate gain is less than or equal to 2% and the saturation rate of all EEG channels is less than or equal to 5%, the current candidate gain is determined as the target gain, and the candidate gain traversal ends.

[0043] In one specific embodiment, the approximate bipolar analog-to-digital converter (A / D) range corresponding to a gain of 24 is ±187,500 microvolts; the approximate bipolar A / D range corresponding to a gain of 12 is ±375,000 microvolts; the approximate bipolar A / D range corresponding to a gain of 8 is ±562,500 microvolts; the approximate bipolar A / D range corresponding to a gain of 6 is ±750,000 microvolts; the approximate bipolar A / D range corresponding to a gain of 4 is ±1,125,000 microvolts; the approximate bipolar A / D range corresponding to a gain of 2 is ±2,250,000 microvolts; and the approximate bipolar A / D range corresponding to a gain of 1 is ±4,500,000 microvolts.

[0044] When the target gain is lower than the detection gain, a resampling decision step is executed. Eight seconds of candidate gain detection data are used to determine the target gain, and the complete device quality assessment uses the reacquired data corresponding to the target gain. The automatic gain detection and resampling module applies the target gain to all eight EEG channels, refreshes the data generated during the detection phase, and then reacquires multi-channel EEG data according to a 30-second detection duration.

[0045] If zero samples or abnormal data shape are obtained after re-acquisition, the automatic gain detection and re-acquisition module performs re-acquisition again, with a maximum of 3 complete re-acquisitions in a specific embodiment. If zero samples or abnormal data shape are still obtained after 3 consecutive re-acquisitions, the device detects an abnormal state.

[0046] After successful re-acquisition, the channel quality and stability evaluation module recalculates the mean, standard deviation, saturation rate, channel quality status, stability status, data completeness, number of available channels, number of stable channels, and overall saturation rate for each EEG channel based on the complete detection data corresponding to the target gain. It then generates a device detection evidence record based on the recalculated device quality indicators. The detection data file, device detection metadata, and target gain all correspond to the same batch of complete target gain detection data.

[0047] In the gain locking step, the subject gain locking module writes the target gain into the subject gain configuration according to the subject identifier, and writes the target gain and the gain auto-saved status into the device detection evidence record. In a specific software implementation, the subject gain configuration data object is subject_gain_config, the target gain field is selected_gain, and the gain auto-saved status field is gain_auto_saved.

[0048] The volume calibration step is performed independently before the formal start command. The volume calibration module generates a 1000Hz window function tone pulse with a total duration of 2.4 seconds using a 44100Hz audio sampling rate, and acquires the actual played audio signal through the audio loopback input or microphone. When the audio system has a WASAPI loopback input that matches the default output device, the volume calibration module selects the corresponding WASAPI loopback input; when the loopback input is unavailable, the volume calibration module selects an available microphone or the default audio input device.

[0049] The root mean square value of the recorded signal is obtained according to the following formula: ; in, This is the root mean square value of the recorded signal; This is a sequence of audio signal samples; These are positive numbers used to maintain numerical stability.

[0050] The digital full-scale relative decibel value is obtained using the following formula: ; in, This is the relative decibel value at full scale. This is the root mean square value of the recorded signal; This is the lower limit for logarithmic calculation.

[0051] In one specific embodiment, the target digital full-amplitude relative decibel value is -21 dB, with a tolerance of ±3 dB. When the absolute difference between the measured digital full-amplitude relative decibel value and the target digital full-amplitude relative decibel value is less than or equal to 3 dB, a volume calibration pass status is generated; when the measured value is lower than the allowable range, an adjustment prompt to increase the system master volume is generated; when the measured value is higher than the allowable range, an adjustment prompt to decrease the system master volume is generated.

[0052] Volume calibration evidence records should include at least the creation time, recording mode, recording device identifier, measured relative decibel level at full digital amplitude, target relative decibel level at full digital amplitude, tolerance, difference between the measured and target values, volume calibration status, and volume level. In a specific software implementation, the creation time is represented by the `created_at` field, the volume calibration status by the `passed` field, and the volume level by the `level` field. The formal startup process uses volume calibration evidence records whose creation time is less than or equal to 30 minutes from the current time and whose volume calibration status is "passed".

[0053] like Figure 1 As shown, the startup verification steps are executed in the following order after the system receives the start command: historical output check, session registration conflict pre-check, device evidence verification, quality coverage processing, volume evidence verification, gain consistency verification, session pre-occupancy, and startup configuration generation.

[0054] During the historical output check, the historical output and session registration conflict checking module retrieves existing output files based on the normalized subject identifier and session identifier. If a session output corresponding to the same subject identifier and session identifier already exists, a historical output conflict state is formed, and the module remains in the officially started state but is turned off.

[0055] In the pre-detection of session registration conflicts, a session key is formed by combining the subject identifier and the session identifier, and the session registration table is read. In a specific software implementation, the session registration table uses a `_session_registry` data object. If the same session key already exists in the session registration table, the host identifier and creation time corresponding to the original registration are read and displayed, indicating a session registration conflict. When multiple offline computers are used to collect EEG data, the same session key can be used to identify the risk of duplicate data collection.

[0056] In the device evidence verification sub-step, the evidence verification module reads the device detection evidence record. In a specific software implementation, the device detection evidence record uses the `last_device_check` data object. The evidence verification module sequentially confirms that the device detection evidence record is in a readable and parseable state, that the device detection evidence record has a creation time, that the creation time is less than or equal to 30 minutes from the current time, and compares the serial port identifier in the device detection evidence record with the current normalized serial port identifier. If the above conditions are met, it continues to read the device quality status.

[0057] When the device detection evidence record is in an unreadable state, an unparseable state, a missing creation time or an abnormal time format, a creation time that is more than 30 minutes from the current time, or a serial port identifier in the device detection evidence record that is inconsistent with the current serial port identifier, the startup configuration generation module remains in the formal startup state and is shut down.

[0058] The quality coverage sub-step handles situations where device evidence exists, the device evidence time is valid, and the serial port identifier matches, but the device quality status does not meet the device access conditions. When the quality coverage interface receives a return adjustment instruction, the system returns to the device adjustment or re-testing process; upon receiving a quality coverage instruction, it only changes the device quality status to the start access state and continues to perform volume evidence verification and gain consistency verification. The existence status, parsing status, time validity status, and serial port matching status of the device detection evidence record retain their original verification results and continue to participate in start control. The quality coverage process can also record the quality coverage personnel identification, quality coverage time, and device quality failure indicators.

[0059] In the volume evidence verification sub-step, the evidence verification module checks the status of the audio input / output components, the existence status of the volume calibration evidence record, the creation time, and the volume calibration status. A volume evidence pass status is formed when the audio input / output components are in an available state, the volume calibration evidence record is in a readable state, the creation time is less than or equal to 30 minutes from the current time, and the volume calibration status is "passed."

[0060] During gain consistency verification, the subject gain locking module reads the device detection evidence record and the subject gain configuration, and sequentially checks whether the subject identifier in the device detection evidence record matches the current subject identifier, whether the target gain belongs to the gain set consisting of 1x, 2x, 4x, 6x, 8x, 12x, and 24x, whether the gain auto-save status is complete, whether the subject gain configuration exists, whether the gain configuration corresponding to the current subject identifier exists, and whether the target gain in the subject gain configuration matches the target gain in the device detection evidence record. If the above conditions are met, the target gain is written to the launch configuration. In a specific software implementation, the launch configuration uses a LaunchConfig data object, and the target gain is written to the required_gain field.

[0061] The EEG recorder reads the target gain from the startup configuration before initiating the EEG signal flow, then applies the target gain to all EEG channels, and initiates the EEG signal flow after the gain application is complete. Thus, the target gain is sequentially passed between the device's evidence recording, the subject's gain configuration, the startup configuration, and the EEG recorder.

[0062] The session pre-registration step is executed after device evidence verification, volume evidence verification, and gain consistency verification are completed. The session key pre-registration module reads the session registration table again; if the same session key is still in an idle state, it writes the subject identifier, session identifier, current time, host identifier, and pre-registration start status into the session registration table. In a specific software implementation, the pre-registration start status is represented by the reserved_at_start field. If the session registration write fails or the second read finds that the same session key is already in an occupied state, the formal start status remains off.

[0063] The second check and write of the session key occurs after the time-consuming evidence verification is completed and before the formal experiment is created. When multiple processes need to be able to create EEG experiments concurrently, the unique occupancy of the session key can be achieved through file locks, unique database indexes, or atomic file creation mechanisms.

[0064] Once all startup conditions are met and session pre-booking is successful, the startup configuration generation module generates the formal startup configuration. The formal startup configuration includes at least the subject identifier, session identifier, experiment type, experiment language, serial port identifier, and target gain. After the startup configuration is generated, the system enters the synchronous EEG experiment process.

[0065] like Figure 3 As shown, the formal acquisition mode and the development and testing mode use distinct acquisition enable states. The formal acquisition mode sequentially verifies the device detection status, volume calibration status, gain consistency status, and session occupancy status, and initiates synchronous EEG acquisition only after the startup conditions are met.

[0066] During the test isolation process, in development test mode, the device detection access control and volume calibration access control are set to test access status, and the test process is allowed to use an empty serial port configuration, while the EEG acquisition enable status is set to the off state. Development test mode can run abbreviated interface tests, input boundary tests, and process tests, and outputs an EEG acquisition off status on the interface. Development test mode continues to perform input security checks, historical output checks, and session management, and can distinguish test data using independent test session identifiers.

[0067] like Figure 2 As shown, in the device detection, quality access, and automatic gain closed loop, the detection acquisition step first obtains complete detection data according to the detection gain; when the saturation index reaches the gain adjustment condition, the gain determination step sequentially uses lower candidate gains for short-term detection; the candidate gain that meets the saturation rate condition becomes the target gain; after the target gain changes, the re-acquisition judgment step re-acquires multi-channel EEG data for the complete detection duration according to the target gain, and regenerates the channel quality index, stability index, and saturation index; the gain locking step writes the target gain into the device detection evidence record and the subject gain configuration respectively; the start verification step compares the two target gains again and transmits the consistent target gain to the EEG recorder.

[0068] like Figure 1As shown, the automatic access control startup process uses a start command as the startup trigger condition. Historical output checks are performed before device evidence verification. Session registration conflict pre-check runs before external evidence verification. After device evidence verification, the system determines whether to enter the normal access path or the quality coverage path based on the device quality status. Then, volume evidence verification and gain consistency verification are performed. After the external evidence passes, the session registration status is read again, and session pre-occupancy is performed while the session key remains idle, finally generating the formal startup configuration.

[0069] like Figure 3 As shown, the initiation evidence chain includes device detection evidence, volume calibration evidence, subject gain configuration, and session registration data. Device detection evidence is at least linked to the creation time, subject identifier, serial port identifier, device quality indicators, and target gain; volume calibration evidence is at least linked to the creation time, recording device, measured digital full-amplitude relative decibel value, and calibration status; subject gain configuration is linked to the subject identifier and target gain; and session registration data is linked to the subject identifier, session identifier, host identifier, and reserved time. The formal acquisition path establishes an initiation state based on the above evidence, while the development test path executes the test procedure with synchronous EEG acquisition disabled.

[0070] After the formal EEG experiment is initiated, the conversation quality baseline module performs a baseline establishment step. In this step, the sample count at the current EEG acquisition end is recorded before the first formal baseline begins. The first formal baseline includes an open-eye baseline phase and a closed-eye baseline phase. In one specific embodiment, the open-eye baseline phase lasts 180 seconds, and the closed-eye baseline phase lasts 180 seconds.

[0071] The conversation quality baseline module determines the number of new EEG samples based on the sample count before the initial formal baseline and the current sample count. When the number of new EEG samples reaches 15,000, the corresponding baseline EEG signal is acquired and the conversation channel quality baseline calculation is performed; at an EEG sampling rate of 250 Hz, 15,000 EEG samples correspond to 60 seconds of EEG data. If the number of new samples is less than 15,000, the EEG data matrix shape is abnormal, or there is no valid EEG channel, the conversation channel quality baseline remains in an unready state. During the unready state, sample loss risk detection continues, and electrode contact risk detection based on the conversation channel quality baseline waits for the conversation channel quality baseline to enter a ready state.

[0072] The median of the baseline signal for each effective EEG channel was calculated: ; The median of the baseline signal; This is the baseline signal sample sequence of the currently effective EEG channels.

[0073] The absolute median difference is obtained by the following formula: ; in, This is the absolute median difference; This is the baseline signal sample sequence of the currently effective EEG channel; This represents the median of the baseline signal.

[0074] The robustness metric is obtained according to the following formula: in, For robustness; This is the absolute median difference; This is the lower bound of the robustness scale.

[0075] The conversation quality benchmark module also calculates the 95th and 99th percentiles of the absolute deviation of the baseline signal from the median of the baseline signal, and saves the median, absolute median difference, robust scale, 95th percentile, and 99th percentile as the baseline statistics corresponding to the current EEG channel.

[0076] The flatness threshold is obtained according to the following formula: ; in, The flat standard deviation threshold is expressed in microvolts. For robustness.

[0077] The saturation threshold is obtained according to the following formula: ; in, The absolute value threshold for saturation; This is the analog-to-digital conversion range corresponding to the current session gain.

[0078] The transition threshold is obtained using the following formula: ; in, The threshold value is expressed in microvolts. For robustness.

[0079] The current session gain uses the target gain actually applied by the EEG recorder before the EEG signal flow is initiated. The session quality benchmark module determines the saturation threshold based on the analog-to-digital conversion range corresponding to the target gain. After the session channel quality benchmark is generated, the baseline statistics, flatness threshold, saturation threshold, jump threshold, and baseline source of each EEG channel are saved to the current session data object.

[0080] like Figure 4As shown, the process for generating and using the conversation channel quality benchmark includes initial formal baseline acquisition, baseline sample size determination, robust statistic calculation, flatness threshold generation, saturation threshold generation, jump threshold generation, and conversation channel quality benchmark saving. The generated conversation channel quality benchmark is used for electrode contact risk detection during continuous acquisition and can be used for evaluating the quality status of EEG window channels.

[0081] During the data collection and monitoring process, the health monitoring module periodically performs health checks within the message display process, countdown process, scale process, text input process, and behavioral task loop. The time interval between two consecutive valid health checks is at least 1 second; if the check call interval is less than 1 second, the current cumulative risk result is retained.

[0082] The theoretical new sample size is obtained according to the following formula: ; in, To increase the theoretical sample size; EEG sampling rate; This refers to the time interval between two consecutive valid health checks.

[0083] The actual number of new samples is obtained by comparing the current EEG sample count with the EEG sample count corresponding to the previous valid health check, and the sample attrition rate is calculated: ; The percentage of samples lost; This represents the actual number of newly added samples; This adds a new sample size to the theoretical estimate.

[0084] When the sample attrition rate is greater than 0.10, the cumulative amount of the first duration and the cumulative amount of the second duration of sample attrition risk are increased simultaneously; when the sample attrition rate is greater than 0.05 and less than or equal to 0.10, the cumulative amount of the first duration of sample attrition risk is increased, and the cumulative amount of the second duration of sample attrition risk is restored to the initial value; when the sample attrition rate is less than or equal to 0.05, the cumulative amount of the first duration and the cumulative amount of the second duration of sample attrition risk are restored to the initial value.

[0085] After the conversation channel quality benchmark enters the ready state, the health monitoring module acquires the most recent EEG signal of approximately 1 second. Once the actual acquired recent EEG signal reaches 0.5 seconds, the recent standard deviation, absolute maximum amplitude, and maximum adjacent sample difference are calculated for each valid EEG channel, and compared with the corresponding EEG channel's flatness threshold, saturation threshold, and jump threshold. A flatness abnormality is identified when the recent standard deviation is below the flatness threshold; a saturation abnormality is identified when the absolute maximum amplitude reaches the saturation threshold; and a jump abnormality is identified when the maximum adjacent sample difference reaches the jump threshold.

[0086] Electrode contact risk detection uses acquisition fault characteristics corresponding to flatness, saturation, and jump, while normal low-frequency EEG amplitude changes caused by fatigue are treated as changes in EEG physiological state.

[0087] When the number of abnormal EEG channels reaches 2, the cumulative first duration of electrode contact risk is increased; when the number of abnormal EEG channels reaches 4, the cumulative first duration and the cumulative second duration of electrode contact risk are increased simultaneously; when the number of abnormal EEG channels is less than 2, the cumulative first duration and the cumulative second duration of electrode contact risk are restored to their initial values.

[0088] When the cumulative duration of the second electrode contact risk reaches 6 seconds, a severe electrode contact state is generated; when the cumulative duration of the second sample loss risk reaches 10 seconds, a severe sample loss state is generated; when the cumulative duration of the first electrode contact risk reaches 3 seconds, an electrode contact warning state is generated; when the cumulative duration of the first sample loss risk reaches 3 seconds, a sample loss warning state is generated; all other states generate a normal collection health state. Collection health states are determined in the following order: severe electrode contact state, severe sample loss state, electrode contact warning state, sample loss warning state, and normal collection health state. The normal collection health state corresponds to the normal reliability level, the electrode contact warning state and the sample loss warning state correspond to the degraded reliability level, and the severe electrode contact state and the severe sample loss state correspond to the rejection reliability level.

[0089] like Figure 5 As shown, the dual-risk data acquisition health status generation and quality fusion process includes sample loss risk detection, electrode contact risk detection, cumulative sample loss duration, cumulative electrode contact duration, and health status determination. Sample loss risk represents the deviation between the actual EEG data growth and the theoretical data growth, while electrode contact risk represents the situation where the EEG channel is continuously in a flat, saturated, or abrupt state. The duration of each type of risk is accumulated separately.

[0090] During the formal EEG experiment, the identification and control steps retrieve EEG windows from continuous EEG signals according to a preset window duration, and generate channel presence and quality masks using the channel state determination module. In one specific embodiment, the target number of EEG channels is 8, the target sampling rate is 250 Hz, the EEG window lasts for 5 seconds, and the EEG window corresponds to 1250 time points.

[0091] The channel presence mask is used to indicate the physical presence status of each target EEG channel in the current input device. When a target EEG channel exists in the input data, the corresponding channel presence mask element is set to 1; when a target EEG channel is missing, the corresponding element is set to 0, and a placeholder zero is filled in the corresponding target channel position.

[0092] The channel quality mask is used to represent the current quality state of a physically existing EEG channel. When the EEG channel meets the quality conditions, the corresponding channel quality mask element is set to 1; when the EEG channel is in a flat, saturated, abrupt, power frequency abnormal, or bridging risk state, the corresponding element is set to 0.

[0093] The channel status determination module can also calculate the standard deviation, absolute maximum amplitude, maximum adjacent sampling difference, and power frequency energy ratio of the EEG channels. The power frequency energy ratio is obtained according to the following formula: ; in, The power frequency energy ratio; The power of EEG signals in the 49 Hz to 51 Hz frequency band; The power of EEG signals in the frequency band from 1 Hz to 45 Hz.

[0094] In one specific embodiment, when the standard deviation of the EEG channel is less than 0.20 microvolts, the absolute maximum amplitude reaches 0.60 times the current analog-to-digital conversion range, the maximum adjacent sampling difference reaches 700 microvolts, or the power frequency energy ratio reaches 0.45, the corresponding EEG channel is written into the channel quality mask as an abnormal state. The channel quality threshold can also adopt the flatness threshold, saturation threshold, and jump threshold in the aforementioned conversation channel quality benchmark.

[0095] The bridging decision sub-step is executed between EEG channels where the channel presence mask represents physical presence and the channel quality mask represents usable quality. The bridging decision module calculates the correlation coefficient and differential residual energy ratio for candidate EEG channel pairs. The differential residual energy ratio is obtained according to the following formula: ; in, Candidate EEG channels and candidate EEG channels The difference residual energy ratio between them; Candidate EEG channels EEG signals; Candidate EEG channels EEG signals; It is a positive number used to maintain the stability of the denominator.

[0096] When the correlation coefficient of candidate EEG channel pairs reaches 0.985 and the difference residual energy ratio is less than 0.02, undirected edges are established between the corresponding candidate EEG channels. All undirected edges form a bridging graph, and the bridging determination module further determines the connected components of the bridging graph.

[0097] A bridging connectivity channel group is formed when a connected component contains at least two candidate EEG channels. The bridging determination module compares the standard deviations of each candidate EEG channel in the same bridging connectivity channel group, identifies the candidate EEG channel with the largest standard deviation as the representative channel, identifies the remaining candidate EEG channels in the same bridging connectivity channel group as bridging risk channels, and updates the channel quality mask based on the bridging risk channels.

[0098] The detection update sub-step can redetermine the number of available channels during device detection based on the channel presence mask and the updated channel quality mask, and write the redetermined number of available channels into the device quality index; similarly, during formal EEG experiment operation, it can determine the number of available channels in the current EEG window based on the updated channel status.

[0099] like Figure 7 As shown, the channel status and bridging determination process first establishes a channel existence mask based on the target channel table, then performs quality judgment on physically existing EEG channels to form a channel quality mask, and then establishes bridging relationships between physically existing and quality-available candidate EEG channels. Based on the bridging relationships, a bridging connected channel group is formed, and the current available channel set is updated using representative channels and bridging risk channels.

[0100] Let the target number of channels be The current number of available channels in the EEG window is The proportion of bad channels is obtained according to the following formula: ; in, The proportion of bad channels; The target number of channels; This represents the number of available channels.

[0101] The quality score is obtained using the following formula: ; in, Rate the quality; This represents the proportion of bad channels.

[0102] In the eight-channel embodiment, when the number of available channels is less than 4 or the proportion of bad channels reaches 0.50, a rejected EEG window quality state is generated; when the number of available channels reaches 4, the proportion of bad channels is less than 0.50, and the proportion of bad channels reaches 0.25 or the quality score is less than 0.70, a downgraded EEG window quality state is generated; the remaining EEG windows that meet the quality requirements are generated as normal EEG window quality states.

[0103] The state fusion module compares the quality state of the EEG window with the acquired healthy state according to three reliability levels: normal, degraded, and rejection. The state with the lowest reliability level is used as the quality state before model invocation. When the quality state before model invocation is rejection, the state recognition module keeps the EEG state recognition model invocation disabled, and the control output module generates a rejection result. When the quality state before model invocation is normal or degraded, the EEG window is input into the state recognition module.

[0104] The state recognition module can perform DC removal, 1 Hz to 40 Hz bandpass filtering, 50 Hz notch filtering, and robust normalization per EEG channel on the EEG window. The EEG state recognition model then outputs the classification probabilities corresponding to attention state, fatigue state, and stress state.

[0105] For each state task, the maximum classification probability among all classification probabilities is taken as the maximum confidence score for the corresponding state task. The average maximum confidence score for the three state tasks is obtained according to the following formula: ; in, The average maximum confidence level; To achieve maximum confidence in the state; The maximum confidence level for the fatigue state; This represents the maximum confidence level for the pressure state.

[0106] Status Task The corresponding normalized entropy is obtained according to the following formula: ; in, For state tasks The corresponding normalized entropy; For state tasks For category Output classification probabilities; This is a category index.

[0107] The average normalized entropy of the three-state task is obtained according to the following formula: ; in, The average normalized entropy; To note the state normalization entropy; The normalized entropy for the fatigue state; The normalized entropy is the pressure state.

[0108] When the average maximum confidence score is less than 0.50 or the average normalized entropy reaches 0.94, a rejection model uncertainty state is generated; when the average maximum confidence score reaches 0.50, the average normalized entropy is less than 0.94, and the average maximum confidence score is less than 0.58 or the average normalized entropy reaches 0.82, a downgraded model uncertainty state is generated; when the average maximum confidence score reaches 0.58 and the average normalized entropy is less than 0.82, a normal model uncertainty state is generated.

[0109] The state fusion module determines the final recognition state based on the pre-model quality state and the model uncertainty state. When the pre-model quality state is normal, the final recognition state can be normal, downgraded, or rejected. When the pre-model quality state is downgraded, the final recognition state remains downgraded or decreases to rejected. When the pre-model quality state is rejected, the final recognition state remains rejected. The state fusion process uses the state with the lower reliability level between the two states to determine the final recognition state. When the final recognition state is normal, the control output module outputs the EEG state category, state classification probability, and normal state. When the final recognition state is downgraded, the control output module outputs the EEG state category, state classification probability, and downgrade reason, and limits downstream control to the corresponding restricted feedback state. When the final recognition state is rejected, the control output module outputs the rejection reason and quality information, and generates a downstream control blocking command.

[0110] like Figure 6 As shown, the overall process of EEG state recognition includes EEG window acquisition, channel state determination, bridging determination, EEG window quality assessment, health state fusion, EEG state recognition, model uncertainty determination, final recognition state generation, and control output. The quality of the EEG window and the continuously acquired health states are first determined to assess the quality state before model invocation. After the state recognition model outputs the corresponding classification probability, the model uncertainty further reduces the final recognition reliability level.

[0111] In a normal startup embodiment, the device detection evidence record was created 20 minutes prior to the current time. The device quality status meets the admission criteria. The current serial port identifier is COM5, and the serial port identifier in the device detection evidence record is also COM5. The target gain is 12x, the gain auto-save status is complete, and the target gain in the subject gain configuration is also 12x. The volume calibration evidence record was created 10 minutes prior to the current time. The measured digital full-amplitude relative decibel value is -20.4 dB, the target digital full-amplitude relative decibel value is -21 dB, and the tolerance is ±3 dB. Historical output and session registration are both in an idle state. After the system completes external evidence verification and session pre-occupancy, it writes the 12x target gain into the formal startup configuration, and the EEG recorder applies the 12x target gain before the EEG signal flow starts.

[0112] In one embodiment of an anomaly in device evidence time, the quality indicators corresponding to the device detection data meet the device admission criteria, but the creation time of the device detection evidence record is 45 minutes from the current time. The evidence verification module establishes an anomaly in device evidence time based on the creation time and keeps it in a closed state while still in the officially started state. After re-executing the device detection and generating a new device detection evidence record within the valid time range, the verification process is restarted and executed again.

[0113] In one quality coverage embodiment, the device detection evidence record is within the valid time range and the serial port matches, but the number of stable channels is only 5. Therefore, the device quality status does not meet the device admission conditions. After receiving the continue command, the quality coverage interface converts the current device quality status to an admission status and continues to perform volume evidence verification. If the volume calibration evidence record exceeds the valid time range, the volume evidence verification still results in an abnormal state, and the formal startup state remains closed.

[0114] In one embodiment of automatic gain adjustment for saturation, the overall saturation rate corresponding to a 24x detection gain was 3.1%. The automatic gain detection and resampling module sequentially performed 8-second probes starting with candidate gains below 24x. In the probe data corresponding to a 12x candidate gain, the overall saturation rate dropped below 2%, and the saturation rates of all EEG channels were below 5%. Therefore, 12x was determined as the target gain. Subsequently, 30 seconds of complete device detection data were reacquired at the 12x target gain, and all device quality indicators were recalculated. After reacquisition, the 12x target gain was written into the device detection evidence record and the subject gain configuration. The EEG recorder applied the 12x target gain before the formal EEG signal flow was initiated.

[0115] In one instance of a gain evidence conflict, the target gain in the device detection evidence record is 8x and the automatic gain saving state is complete, while the target gain in the current subject gain configuration is 12x. The evidence verification module forms a target gain inconsistency state, and the formal startup state remains off. After re-executing the device detection and gain locking steps, the device detection evidence record and the subject gain configuration are made to have a consistent target gain.

[0116] In one embodiment of historical output conflict, a structured workbook or EEG data package generated with the same subject identifier and session identifier already exists in the data collection catalog. The historical output and session registration conflict checking module establishes a historical output conflict state before external evidence verification, and remains closed in the formal startup state.

[0117] In one development test embodiment, the system receives a development test mode selection command. The formal acquisition test isolation module sets the device detection access control and volume calibration access control to the test access state, sets the synchronous EEG acquisition enable state to the off state, and performs input security checks, historical output checks, and session management. The test process can run a shortened interface process and process test, while the EEG recorder remains in the formal synchronous EEG acquisition off state. The basic conditions and state relationships of the above seven types of startup embodiments are all described in the corresponding technical documents.

[0118] In one example of a conversation quality benchmark, the EEG recorder generates 8 channels of EEG data at a sampling rate of 250 Hz. The initial formal baseline with eyes open lasts for 180 seconds, and the initial formal baseline with eyes closed lasts for 180 seconds. After acquiring at least 15,000 new EEG samples, the conversation quality benchmark module generates flatness thresholds and jump thresholds based on the median, absolute median difference, and robustness scale of each EEG channel, and generates a saturation threshold based on the analog-to-digital conversion range corresponding to the target gain applied at the time of formal startup.

[0119] In a mild sample loss embodiment, during continuous health checks, the sample loss rate is consistently greater than 0.05 and less than or equal to 0.10, and the cumulative duration of the first sample loss risk reaches 3 seconds. The health monitoring module then downgrades the health status. When the current EEG window quality status is normal, the state fusion module uses the downgraded health status to form the quality status before the downgraded model is invoked.

[0120] In one embodiment of persistent electrode abnormality, if four EEG channels in the recent EEG signal are continuously in a flat, saturated, or abrupt abnormal state for 6 seconds, and the cumulative duration of the second electrode contact risk reaches 6 seconds, the health monitoring module will determine a rejection of the acquisition health state. Even if the current individual EEG window recovers to a better quality state at a local moment, the rejection of the acquisition health state will still participate in the quality state determination before model invocation.

[0121] In one bridging risk embodiment, all eight target EEG channels are physically present. Channels 2 and 3 meet the bridging criteria, as do channels 3 and 4. Channels 2, 3, and 4 form the same bridging connected channel group. The bridging determination module compares the standard deviations of the three EEG channels, selects the EEG channel with the largest standard deviation as the representative channel, and designates the other two EEG channels as bridging risk channels. The channel quality mask is then updated based on the bridging risk channels.

[0122] In an embodiment where the quality of the EEG window is degraded but the model classification results are set, the quality state before the model is invoked is already degraded, while the average maximum confidence and average normalized entropy output by the state recognition model meet the conditions of normal model uncertainty state, and the state fusion module keeps the final recognition state as degraded.

[0123] In an embodiment where the EEG window quality is normal but the model uncertainty is high, the quality state before model invocation is normal, but the average maximum confidence is 0.48 or the average normalized entropy reaches 0.95. The state fusion module determines the final identification state as rejection, and the control output module generates a downstream control blocking instruction.

[0124] The validity period for device testing evidence and volume calibration evidence can be set to a preset validity period different from 30 minutes, depending on the EEG experimental protocol. Device quality evaluation can also add battery status, electrode impedance, wireless data packet loss rate, or device firmware version, and the added testing indicators, along with the creation time and device object identifier, are written into the device testing evidence record.

[0125] The automatic gain detection process can employ binary search, candidate gain search based on quality scores, or channel-by-channel gain control. When using channel-by-channel gain control, each EEG channel stores its corresponding gain and analog-to-digital conversion range; when using a unified gain across all channels, all EEG channels use the same target gain and the same corresponding analog-to-digital conversion range. Volume calibration can also use a sound pressure level meter, calibration microphone, or digital loopback to obtain audio measurement signals, and can use digital full-amplitude relative decibels, A-weighted sound pressure level, or preset frequency band energy as volume calibration indicators. Session registration data can be stored in structured files or databases. In a multi-process environment, unique database indexes, distributed locks, file locks, or atomic file creation methods can be used to ensure unique session key occupancy. The quality coverage process can further configure administrator credentials, secondary confirmation, and persistent audit logs.

[0126] Through the above implementation process, during the device testing phase, after the detection gain triggers saturation adjustment, candidate gain detection is used to select the target gain. The complete re-acquired data corresponding to the target gain is used for the final device quality evaluation. The device testing evidence record and the subject gain configuration each save the same target gain. Before the formal EEG signal flow is started, the EEG recorder actually applies the target gain, so that the analog-to-digital conversion range corresponding to the device testing data and the formal EEG acquisition range form a continuous correspondence. The startup process further checks the historical output, device testing evidence, volume calibration evidence, gain consistency status, and session occupancy status in sequence, and completes session pre-occupancy before the formal experiment is created. After the formal EEG experiment is started, the first formal baseline forms a session channel quality benchmark corresponding to the current session gain. The sample loss risk and electrode contact risk are accumulated over time to form the acquisition health status. The channel existence status, channel quality status, and bridging risk further form the EEG window quality status. The EEG window quality status, acquisition health status, and model uncertainty status jointly determine the final recognition status according to the reliability level, thus forming a continuous reliability control process from the device status before startup, the formal acquisition status to the EEG status recognition result.

[0127] Finally, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for initiating and controlling an electroencephalogram (EEG) experiment, characterized in that, Includes the following steps: Detection and acquisition steps: Collect multi-channel EEG data for a preset detection duration according to the detection gain, and calculate the saturation index based on the multi-channel EEG data; Gain determination steps: Based on the saturation index, the target gain is determined from the detection gain and the candidate gains below the detection gain. When the overall saturation rate reaches the first gain adjustment condition or the saturation rate of any EEG channel reaches the second gain adjustment condition, the candidate gains are applied sequentially to perform the acquisition for the preset detection duration. The candidate gains that meet the overall saturation rate condition and the channel-by-channel saturation rate condition are determined as the target gain. Resampling determination steps: When the target gain is less than the detection gain, multi-channel EEG data for a preset detection duration is re-acquired according to the target gain, and a device detection evidence record is generated based on the re-acquired multi-channel EEG data. Gain locking step: Write the target gain into the device detection evidence record and the subject gain configuration; Startup verification steps: Before the formal EEG experiment starts, read the device detection evidence record and the subject gain configuration. When the target gain in the device detection evidence record is consistent with the target gain in the subject gain configuration, write the target gain into the startup configuration. The EEG recorder applies the target gain before the EEG signal flow starts.

2. The EEG experiment initiation control method according to claim 1, characterized in that, In the detection and data acquisition process: equipment quality indicators include data integrity rate, number of available channels, number of stable channels, and overall saturation rate; when the data integrity rate reaches 90%, the number of available channels reaches 6, the number of stable channels reaches 6, and the overall saturation rate is less than or equal to 2%, the equipment quality is considered qualified. Each EEG channel is classified into channel quality status based on channel saturation rate, standard deviation, mean, and impedance; The detection and collection steps also include: Channel adaptation sub-step: The detected EEG data is rearranged according to the target channel table to generate a channel presence mask that represents the physical presence status of the target EEG channel, and a channel quality mask is generated based on the signal quality of each physically present EEG channel. Bridging determination sub-step: Determine candidate EEG channels from EEG channels that physically exist as represented by the channel existence mask and whose quality is available as represented by the channel quality mask. Establish bridging relationships based on the channel correlation degree and channel differential residual energy between candidate EEG channels. Determine the connected channel groups formed by the bridging relationships as representative channels and bridging risk channels. Update the channel quality mask based on the bridging risk channels. Detection and update sub-step: Based on the channel existence mask and the updated channel quality mask, redetermine the number of available channels and write the redetermined number of available channels into the device quality index.

3. The EEG experiment initiation control method according to claim 2, characterized in that, In the bridging determination sub-step: when the correlation coefficient of the candidate EEG channel pair reaches 0.985 and the differential residual energy ratio is less than 0.02, an undirected edge is established between the corresponding candidate EEG channels; the connected components of the bridging graph are obtained based on the undirected edge; for a connected component containing at least two candidate EEG channels, the candidate EEG channel with the largest standard deviation is determined as the representative channel, and the remaining candidate EEG channels in the same connected component are determined as bridging risk channels; In the gain determination step: candidate gains are selected sequentially from values ​​lower than the current gain in the order of 24x, 12x, 8x, 6x, 4x, 2x and 1x. The preset detection duration is 8 seconds. The first gain adjustment condition corresponds to an overall saturation rate greater than 2%, and the second gain adjustment condition corresponds to a saturation rate greater than 5% for any EEG channel. In the resampling determination step, the preset detection duration is 30 seconds. If zero samples are obtained or the data shape is abnormal after resampling, resampling is performed again. When the number of resampling reaches 3 and the data status remains abnormal, a device detection abnormality status is generated.

4. The EEG experiment initiation control method according to claim 3, characterized in that, The verification process also includes: Device evidence verification sub-step: Read the parsing status, creation time and serial port identifier of the device detection evidence record, form a time validity status based on the time interval between the creation time and the current time, and compare the serial port identifier in the device detection evidence record with the current serial port identifier to form a serial port matching status; Quality Coverage Sub-step: When the time validity status and serial port matching status meet the start conditions and the device quality status is in an abnormal state, the quality coverage instruction is received and the device quality status is converted to the admission status. The device evidence validity status, serial port matching status, volume calibration status, and gain consistency status continue to serve as the start verification conditions for the formal EEG experiment.

5. The EEG experiment initiation control method according to claim 4, characterized in that, The following steps are included before starting the verification process: Volume calibration steps: Generate a tone calibration signal, collect the calibration signal through a loopback recording device or microphone, calculate the measured decibel value relative to full digital amplitude based on the root mean square value of the recorded signal, generate a volume calibration pass status when the absolute difference between the measured decibel value and the target decibel value is less than or equal to 3 decibels, and generate a volume calibration evidence record containing the creation time, recording device identifier, measured decibel value, target decibel value, tolerance and volume calibration status; Volume Evidence Verification Sub-step: Generate volume evidence verification results based on the time interval between the creation time of the volume calibration evidence record and the current time, as well as the volume calibration status; The verification process also includes the following steps: Session pre-registration steps: Retrieve the output path based on the subject identifier and session identifier and read the session registration form. When the output path is in a createable state and the session registration state is idle, perform device evidence verification, volume evidence verification, and gain evidence verification. After the device evidence verification, volume evidence verification, and gain evidence verification are completed, read the session registration form again. While the session registration state remains idle, write the subject identifier, session identifier, current time, and host identifier, and create the formal EEG experiment after the session registration is completed. The baseline establishment steps are as follows: acquire the baseline signals of each EEG channel during the first formal baseline phase of the current EEG acquisition session, generate the flatness threshold, saturation threshold and jump threshold of each EEG channel based on the robust statistics of the baseline signals of each EEG channel and the analog-to-digital conversion range corresponding to the current session gain, and form the session channel quality benchmark; use the session channel quality benchmark as a quality reference for channel quality mask updates and electrode contact risk assessment during continuous EEG acquisition.

6. The EEG experiment initiation control method according to claim 5, characterized in that, The benchmarking process also includes the following steps before: Data Acquisition and Monitoring Steps: Based on the examination cycle, determine the theoretical number of new samples according to the EEG sampling rate and examination interval. Generate sample loss risk based on the degree of missing samples relative to the theoretical number of new samples. Identify abnormal EEG channels by comparing the standard deviation, absolute maximum amplitude, and maximum adjacent sampling difference of each EEG channel within the current examination window with the quality benchmark of the conversation channel. Generate electrode contact risk based on the number of abnormal EEG channels. Establish the first and second duration cumulative values ​​corresponding to the sample loss risk and electrode contact risk, respectively. Update the corresponding duration cumulative values ​​based on the sample loss risk and electrode contact risk. Generate normal acquisition health status, downgraded acquisition health status, or rejected acquisition health status based on the corresponding duration cumulative values.

7. The EEG experiment initiation control method according to claim 6, characterized in that, Following the benchmark establishment step are: The identification and control steps are as follows: For the EEG window generation channel, an existence mask and a channel quality mask are used. Based on these, the quality state of the EEG window is determined, along with the risk of bridging the channel. The EEG window quality state and the acquired health state are fused according to reliability levels (normal, degraded, and rejection). The state with the lowest reliability level forms the pre-model-call quality state. When the pre-model-call quality state is normal or degraded, the EEG state recognition model is invoked to obtain the state classification probability, and a model uncertainty state is generated based on this probability. The final identification state is determined based on the reliability level defined by the pre-model-call quality state and the model uncertainty state. When the final identification state is rejection, a downstream control blocking command is generated. The data acquisition and monitoring step is continuously executed during the identification and control step.

8. The EEG experiment initiation control method according to claim 7, characterized in that, The following steps are included before the detection and collection process: Operating mode determination steps: Obtain the current EEG experiment operating mode; Test isolation steps: When the current EEG experiment operation mode is development test mode, set the device detection access control and volume calibration access control to test access status, set the EEG acquisition enable status to the off status, perform input security checks, historical output checks and session management, and start the development test process based on the test access status and the check results of input security checks, historical output checks and session management. During the execution of the development test process, keep the EEG acquisition enable status in the off state.

9. A brainwave experiment initiation control system, characterized in that, include: The device detection module is used to receive detection gain and collect multi-channel EEG data for a preset detection duration, and output channel quality indicators, stability indicators and saturation indicators based on the multi-channel EEG data; The automatic gain detection and resampling module is used to receive saturation index and determine target gain from detection gain and candidate gains below detection gain. When the saturation index reaches the gain adjustment condition, candidate gains are applied sequentially to perform detection acquisition. When the target gain is less than the detection gain, multi-channel EEG data with a preset detection duration is reacquired according to the target gain. The device detection evidence record is output based on the reacquired multi-channel EEG data. The subject gain locking module is used to receive the target gain and write the target gain into the device detection evidence record and the subject gain configuration; The evidence verification module is used to receive the device detection evidence records and the subject gain configuration, and output the target gain consistency status. The startup configuration generation module is used to receive the target gain consistency status. When the target gain consistency status meets the startup conditions, the target gain is written into the startup configuration and the startup configuration is output to the EEG recorder, so that the EEG recorder applies the target gain before the EEG signal flow starts.

10. The EEG experiment activation control system according to claim 9, characterized in that, Also includes: The conversation quality benchmark module is used to generate a conversation channel quality benchmark based on the baseline signals of each EEG channel during the first formal baseline phase of the current EEG acquisition conversation and the analog-to-digital conversion range corresponding to the current conversation gain. The channel status determination module is used to receive the target channel table, EEG window and conversation channel quality benchmark, generate a channel presence mask based on the target channel table and EEG window, and generate a channel quality mask based on the conversation channel quality benchmark. The bridging determination module is used to receive the channel presence mask, channel quality mask, and EEG window. It forms a bridging connected channel group based on the channel correlation degree and channel differential residual energy between candidate EEG channels, determines the bridging risk channel based on the bridging connected channel group, and updates the channel quality mask based on the bridging risk channel. The quality assessment module is used to receive the channel presence mask and the updated channel quality mask, and generate the EEG window quality status based on the number of target channels and the number of available channels. The health monitoring module is used to receive the conversation channel quality benchmark and continuous EEG acquisition data, and generate the acquisition health status based on the cumulative results of the duration corresponding to the sample loss risk and electrode contact risk. The state recognition module is used to receive the EEG window and generate state classification probability and model uncertainty state based on the EEG window when the quality state of the EEG window and the acquired health state meet the model calling conditions. as well as The state fusion module is used to receive the EEG window quality state, the acquired health state, and the model uncertainty state, generate the final recognition state based on the EEG window quality state, the acquired health state, and the model uncertainty state, and output a downstream control blocking command to the control output terminal when the final recognition state is a rejection state.

Citation Information

Patent Citations

  • EEG kit

    US20120143020A1

  • High resolution electroencephalograph signal acquisition system

    US20230355156A1