Intelligent vision detection method and system based on noninvasive brain-computer interface technology
Through non-invasive brain-computer interface technology, EEG signals and machine learning algorithms are used to build a vision prediction model, which solves the subjectivity and static limitations of traditional vision test charts and realizes objective, dynamic evaluation and real-time detection of people with visual impairments.
Patent Information
- Application Number
- CN202510868138.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-10-10
AI Technical Summary
Traditional vision test charts rely on subjective feedback from subjects, have biased test results, and cannot fully reflect dynamic visual functions. In particular, their applicability and accuracy are limited for people with low vision or special needs.
It uses non-invasive brain-computer interface technology, presents visual stimulation of a specific frequency, uses EEG equipment to collect EEG signals, and combines machine learning algorithms to build a vision prediction model to achieve objective and dynamic vision assessment.
It avoids the bias of subjective feedback and is suitable for the evaluation of complex visual tasks, especially for children, the elderly or people with cognitive impairment, providing more comprehensive visual function evaluation and real-time detection.
Smart Images

Figure CN120753581A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical diagnosis, and in particular to an intelligent vision detection method and system based on non-invasive brain-computer interface technology. Background Art
[0002] Vision health is crucial to people's daily lives. However, global vision problems have become an increasingly serious public health challenge.
[0003] Although traditional vision test charts (such as the Snellen vision chart) are widely used in vision testing, they still have some limitations. First, the vision test chart relies on the subjective feedback of the subjects and is easily affected by factors such as individual comprehension ability, psychological state, and ambient light, which may lead to deviations in the test results. Secondly, the vision test chart can only provide static vision assessment and cannot fully reflect dynamic visual functions or visual performance under complex visual tasks. In addition, for people with low vision or special populations (such as children, the elderly or those with cognitive impairment), the applicability and accuracy of the vision test chart may be further limited. Therefore, the vision test method that combines EEG signals and machine learning technology can make up for the subjectivity and static limitations of traditional vision test charts through objective physiological signals and data analysis, and provide a more comprehensive and accurate vision assessment, especially in real-time detection and dynamic visual function analysis. It has significant advantages.
[0004] The vision detection method that combines electroencephalogram (EEG) signals and deep learning technology is an innovative vision assessment method based on physiological signals and data-driven. This method uses EEG equipment to collect the EEG signals generated by the subjects under visual stimulation by presenting visual stimulation of a specific frequency (such as a flashing E-shaped sight mark), especially the steady-state visual evoked potential (SSVEP), which can reflect the brain's response characteristics to visual stimulation. After the collected EEG signals are preprocessed (such as denoising, filtering and artifact removal), vision-related features (such as frequency domain features and time domain features) are extracted from them. These features are used as input to construct a vision prediction model using machine learning algorithms (such as support vector machines, random forests) or deep learning methods (such as convolutional neural networks, recurrent neural networks). By training and optimizing the model, an objective assessment of vision level can be achieved.
[0005] Therefore, the present invention diagnoses people with visual impairment based on non-invasive brain-computer interface technology, which not only avoids the bias of subjective feedback, but also can be applied to more complex visual task evaluation. In addition, this method can be further developed into a real-time online detection system, providing an efficient and intelligent solution for vision detection. Summary of the Invention
[0006] The purpose of the present invention is to provide an intelligent vision detection method and system based on non-invasive brain-computer interface technology to solve the problem that traditional vision examination charts in the prior art have some limitations.
[0007] To achieve the above objectives, the present invention provides an intelligent vision detection method based on non-invasive brain-computer interface technology, comprising the following steps:
[0008] S1. Stimulus presentation and signal acquisition: Stimulate the subject's visual system by flashing visual marks of different sizes at a fixed frequency;
[0009] S2. Data acquisition: Use EEG acquisition equipment to simultaneously acquire raw EEG signals and event labels;
[0010] S3, building a prediction model: pre-processing the data collected in step S2 in an offline state, and extracting features from the processed EEG data to build a prediction model;
[0011] S4, online prediction: In the online state, the data collected in step S2 is input through the transmission control protocol, the data is preprocessed and feature extracted, and the prediction model established in step S3 is called to perform online prediction, and the vision prediction result is output and fed back to the display screen.
[0012] Preferably, step S1 includes:
[0013] Vision measurement task: The user sits quietly in a chair, watches the blinking sight mark on the computer screen, and uses a Bluetooth keyboard to select the direction of the sight mark. If the user makes two incorrect choices, the user's vision will be directly displayed on the screen to record the user's true ability.
[0014] Observation task: The user sits quietly in a chair, wears the EEG device, and looks at the flashing visual signs on the computer screen, consistent with the visual acuity measurement task;
[0015] Step S1 consists of 14 stages. In each stage, different sizes of sight marks will appear, ranging from 4.0 to 5.3 from large to small. In each stage, the same sight mark will appear randomly in different directions, up, down, left, and right. There are a total of 5 trials. Each trial flashes for 2 seconds, followed by a 0.5-second blank interval.
[0016] Preferably, in step S2, the data acquisition uses an amplifier to amplify the original signal, and the supporting SCAN software is used to save the data; standard Ag / Agcl electrodes are used, the electrode placement refers to the international 10-20 system, and the number of channels is 64 leads; the sampling parameters are set to a sampling rate of 1000 Hz, a 5-50 Hz bandpass filter, and a 50 Hz notch filter is used to filter out power frequency interference. The acquisition process is based on the top of the head as a reference, the forehead is grounded, and the impedance between the scalp and the electrode is kept below 10 KΩ.
[0017] Preferably, step S3 includes the following steps:
[0018] S31. Use the Python-based MNE EEG processing library to preprocess the raw EEG signals, including data format conversion, bandpass filtering, artifact removal, and data block preprocessing operations;
[0019] S32. Extract relevant features from the preprocessed EEG data, including 11 features in total, which are divided into frequency domain features, time domain features, and time-frequency features;
[0020] S33. Establish a recognition prediction model.
[0021] Preferably, the frequency domain features in step S32 include SSVEP amplitude and SSVEP signal-to-noise ratio. The frequency domain feature extraction is based on fast Fourier transform (FFT) to calculate the 10 Hz SSVEP amplitude and signal-to-noise ratio from the segmented EEG data, specifically:
[0022] Get each trial block from segmented_epochs. Each block contains 5 epochs. For each epoch, select 10 occipital channels, convert the signal unit to microvolts, and remove the DC component by subtracting the mean.
[0023] Apply FFT to each channel signal in each epoch to calculate the spectrum. The sampling rate is 1000 Hz, 2 seconds of data contains 2000 sample points, and the frequency resolution is 0.5 Hz. Use np.fft.fft to calculate the complex spectrum, retaining the positive frequency component, and use np.abs to obtain the amplitude spectrum. Analyze the 10 Hz SSVEP and its harmonics.
[0024] For each epoch, the amplitude of the 10 Hz frequency point was obtained, and the 10 Hz amplitudes of 10 channels and 5 trials were averaged to obtain the SSVEP amplitude of each trial block;
[0025] The target frequency band was defined as 8-12 Hz. The maximum amplitude in this band was extracted as the 10 Hz SSVEP signal strength, and its frequency was verified to be close to 10 Hz. The background noise power was defined as the square mean of the amplitude within the range of ±1 Hz of the peak frequency, excluding the peak ±0.1 Hz. The signal-to-noise ratio was calculated in decibels using the formula:
[0026]
[0027] Where peak_power is the square of the maximum amplitude in the 8-12 Hz target frequency band, and background_power is the average of the squares of the noise frequency band amplitudes.
[0028] Preferably, the time domain features in step S32 include the amplitude, latency, area, and ERP power of the P1 and N1 components. The extraction of the P1 feature includes the amplitude, latency, and area. Specifically, the time window is set to 70-160ms, and a double screening strategy is used to determine the peak with the largest amplitude, candidate_A, and the peak with the latency closest to 100ms, candidate_B. The selection rule is: if the amplitude of candidate_A exceeds 4 / 3 times that of candidate_B, the former is selected; otherwise, the latter is selected.
[0029] The extraction of N1 features includes amplitude, latency, and area. Specifically, the N1 time window is 20ms to 200ms after the P1 peak. The minimum value of the signal within this range is identified as the N1 peak. The minimum value is the amplitude, the latency is the time corresponding to the trough, and the area is the signal integral within the time window.
[0030] The ERP power feature is extracted as follows: the 0-300ms segment is extracted from the average signal and the square mean of its amplitude is calculated. The formula is:
[0031]
[0032] Where N is the number of sample points; is the square of the amplitude signal.
[0033] Preferably, the time-frequency features in step S32 include α waves and β waves, and the feature extraction is specifically as follows:
[0034] Each label corresponds to a trial block, which contains 5 trials. The trials are divided into two time windows: 0.5 seconds before stimulation and 0.5 seconds after stimulation. The time window length is 0.5 seconds. A zero-phase-shift FIR filter is used to perform bandpass filtering on the α wave and β wave respectively in each time window signal. For each filtered time window, the power of the α wave and β wave is calculated, and the power spectral density is estimated using the Welch method. The formula is:
[0035]
[0036] Among them, L is the length of each signal segment, M is the total number of segments, x m (n) is the nth sampling point of the mth segment signal, n is the sampling point index in each segment signal, w(n) is the value of the window function at point n, f is the frequency variable, e -j2πfn / N is the complex exponential factor of the discrete Fourier transform; the window length is set to 256 sample points, and the frequency band power is obtained by integrating the power spectrum within the specified frequency range:
[0037]
[0038] Among them, fhigh is the highest frequency of the specified frequency band; f low The lowest frequency in the specified frequency band; the integration range is α wave and β wave, and the power unit is μV 2 / Hz, calculate the frequency band power of all channels and take the average value to obtain the α wave and β wave power of the time window;
[0039] For each trial block, the average power of α and β waves before and after stimulation was calculated. The pre-stimulus power pre was the average power of the 0.5-second time window before the five trials, and the post-stimulus power post was the average power of the 0.5-second time window after the five trials. The power ratio was defined as:
[0040]
[0041] If the power before stimulation is 0, the power ratio is marked as an invalid value.
[0042] Preferably, step S4 detects the user's vision in real time through a computer program and feeds back the information to the display screen. Specifically, the online data is first input, and preprocessing and feature extraction are performed in sequence. Then, the prediction model trained offline in step S3 is called to input the extracted features to predict the vision value, and the prediction results are output and fed back to the display screen.
[0043] The present invention also provides an intelligent vision detection system based on non-invasive brain-computer interface technology, comprising:
[0044] The stimulus presentation module generates a fixed-frequency flickering visual mark stimulus interface and controls the size, direction, and flickering parameters of the visual mark.
[0045] The data acquisition module synchronously collects EEG signals and event labels through EEG acquisition equipment;
[0046] Model building module, which preprocesses raw EEG data, extracts features and builds a vision prediction model offline;
[0047] The online control module inputs raw EEG data through the transmission control protocol; preprocesses and extracts features from the data; calls the prediction model for online prediction; and outputs the vision prediction results to the display screen.
[0048] Therefore, the present invention adopts the above-mentioned intelligent vision detection method and system based on non-invasive brain-computer interface technology, which has the following beneficial effects:
[0049] (1) EEG signal detection is an objective physiological measurement method that avoids the limitations of traditional vision test charts that rely on subjective feedback from subjects and reduces human errors (such as misunderstanding or intentional misreporting);
[0050] (2) EEG testing based on steady-state visual evoked potential (SSVEP) can dynamically reflect the functional status of the visual system. It can not only evaluate static visual acuity, but also capture dynamic characteristics such as the speed of visual processing, attention allocation, and visual fatigue, providing a more comprehensive assessment of visual function.
[0051] (3) EEG testing is suitable for special populations (such as children, the elderly, or people with cognitive impairment) who may have difficulty cooperating with traditional vision testing;
[0052] (4) EEG signal detection can be combined with machine learning or deep learning technology to achieve automated and intelligent vision assessment, providing an efficient tool for large-scale screening and real-time monitoring.
[0053] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 The vision detection brain-computer interface system framework of the embodiment of the present invention;
[0055] Figure 2 This is a flowchart of a vision detection paradigm according to an embodiment of the present invention;
[0056] Figure 3 The confusion matrices of the three classification models in the embodiments of the present invention are shown in Figure 2, where (a) is XGBoost, (b) is SVM, and (c) is RF.
[0057] Figure 4 Comparison of absolute error box plots of low vision prediction models according to embodiments of the present invention, where (a) is an integrated regression model and (b) is a support vector regression model;
[0058] Figure 5 Comparison of absolute error frequency histograms of low vision prediction models according to embodiments of the present invention, where (a) is an integrated regression model and (b) is a support vector regression model;
[0059] Figure 6 The scatter plots of the predicted values and true values of the low vision prediction model according to the embodiment of the present invention are compared, where (a) is an integrated regression model and (b) is a support vector regression model;
[0060] Figure 7 Comparison of absolute error box plots of high vision prediction models according to embodiments of the present invention, where (a) is an integrated regression model and (b) is a support vector regression model;
[0061] Figure 8 Comparison of absolute error frequency histograms of high vision prediction models according to embodiments of the present invention, where (a) is an integrated regression model and (b) is a support vector regression model;
[0062] Figure 9 The scatter plots of the predicted values and true values of the high vision prediction model according to the embodiment of the present invention are compared, where (a) is an integrated regression model and (b) is a support vector regression model;
[0063] Figure 10 This is a comparison chart of the mean absolute error of each eye in an embodiment of the present invention;
[0064] Figure 11 A trend line graph of the actual value and the predicted average value according to an embodiment of the present invention;
[0065] Figure 12 is a bar graph of the standard deviation of each eye according to an embodiment of the present invention;
[0066] Figure 13 is an absolute error distribution histogram of an embodiment of the present invention. DETAILED DESCRIPTION
[0067] The following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort shall fall within the scope of protection of the present invention.
[0068] An intelligent vision detection system based on non-invasive brain-computer interface technology, the overall system design is as follows Figure 1 As shown in the figure, it mainly consists of four parts: stimulus presentation module, data acquisition module, model building module, and online control module. The stimulus presentation module displays the specific experimental task using flashing visual signs. The subject only needs to respond mentally to the signs. The data acquisition module uses an EEG acquisition device (Neuroscan) to synchronously acquire raw EEG signals and event labels (event labels are generated by the stimulus presentation module and transmitted to the EEG acquisition device via a serial port). The model building module's main function is to preprocess the raw EEG signals (collected by the data acquisition module) offline; extract time domain (such as amplitude and latency) and frequency domain (such as power spectral density and frequency response) features from the preprocessed EEG data to build a prediction model; and input the prediction model into the online module for vision prediction. The online control module inputs raw EEG data via the Transmission Control Protocol (TCP); preprocesses the data; extracts features from the preprocessed EEG data; calls the prediction model (output by the model building module) for online prediction; and outputs the vision prediction results to the display screen.
[0069] The flow chart of intelligent vision detection paradigm based on non-invasive brain-computer interface technology is as follows Figure 2 As shown in the figure, the offline experiment process consists of two tasks: 1. Vision measurement task: The user sits quietly in a chair, without the need for an EEG device. They only need to observe a flashing optotype on the computer screen and use a Bluetooth keyboard to select the optotype's direction. If they make two incorrect choices, their visual acuity is displayed directly on the screen, recording their actual visual acuity. 2. Observation task: The user sits quietly in a chair, wearing the EEG device. As in the previous task, they only need to observe a flashing optotype on the computer screen. However, they do not need to use a Bluetooth keyboard to select the optotype's direction; they only need to fixate on the optotype. The offline experiment consists of 14 stages. Each stage presents optotypes of varying sizes, with the smallest representing 5.3 to 4.0. Within each stage, the same optotype appears randomly in different directions, up, down, left, and right. Five trials are presented, each trial flashing for 2 seconds, with a 0.5-second interval between each stage, and a 0.5-second interval between stages. The online experiment shortens the duration, with the same 14 stages, but each stage flashes for only 1 second, with a 3-second interval between stages. After the user's visual acuity is tested, feedback is provided on the computer screen.
[0070] An intelligent vision detection method based on non-invasive brain-computer interface technology includes the following steps:
[0071] S1. Stimulus presentation: The stimulus presentation module is designed with an E-shaped visual mark stimulation interface that flashes at a fixed frequency (set to 10Hz). The visual mark stimulation adopts a weak implicit stimulation form, and the size of the visual mark gradually decreases from 4.0 to 5.3, and is set to the standard visual range at a measurement distance of 3 meters, which meets the initial screening requirements. Each visual mark is stimulated 5 times in a random direction, each time for 2 seconds, followed by a 0.5-second blank interval. In order to evaluate the vision measurement accuracy of this stimulus interface, a comparison program was designed. Each visual mark maintains a weak implicit stimulation form and is played 5 times. The user selects the direction seen through the keyboard. If 2 out of 5 selections are wrong, it returns to the previous visual mark size to determine the vision value. During the experiment, the user only needs to sit quietly at a distance of three meters from the display screen and stare at the flashing visual mark (such as Figure 3 ).
[0072] S2, data acquisition: EEG data acquisition uses Neuroscan's Synamps2 amplifier to amplify the original signal, and the matching SCAN software is used for data saving. The standard Ag / Agcl electrode is used, and the electrode placement position refers to the international 10-20 system. The channel number is 64 leads. The sampling parameter is set to 1000 Hz, 5-50 Hz band pass filter, and 50 Hz notch filter is used to filter out power frequency interference. The reference is the top of the head, the forehead is grounded, and the impedance between the scalp and the electrode is kept below 10KΩ. The subjects are required to remain still during the experiment, and the surrounding environment is kept quiet to avoid the influence of subtle movements and other reasons unrelated to the task on the EEG signal, thereby ensuring the reliability of the collected data.
[0073] S3, model building:
[0074] S31, EEG data preprocessing: The system uses the Python-based MNE EEG processing library to preprocess the original EEG signal. Mainly includes data format conversion, band pass filtering, artifact removal and data block preprocessing operations, as follows:
[0075] S311, data format conversion: read the CNT original file through mne.io.read_raw_cnt, and convert it to NumPy array format in memory;
[0076] S312, band pass filtering: the system mainly explores the amplitude + SNR (signal-to-noise ratio) of SSVEP, the amplitude and latency of P1, N1, AUC, ERP power and Alpha / Beta wave power ratio. Therefore, a band pass filter with a filtering range of 5-40 Hz is used to filter the data, remove the interference of low and high frequency signals in the EEG signal, and retain the frequency band required for subsequent processing;
[0077] S313, artifact removal: Infomax algorithm is used to automatically identify electrooculogram / electromyogram artifacts, remove artifacts affecting the EEG signal, and ensure the reliability of the data;
[0078] S314, data block: first extract the event markers and their IDs in the original data, then for each valid event (events with labels 40-53), create multiple 2-second data segments based on the preset time offset (0 / 2.5 / 5.0 / 7.5 / 10.0 seconds) from the start of the stimulus. Each data segment is independently cut off and expanded in dimension before being stored, and finally a list containing event labels and corresponding data blocks is returned. This function specifically excludes boundary events and non-target events, and each block in the output result contains 5 consecutive time window data, which can be used to analyze SSVEP and other features.
[0079] S32. Feature extraction and analysis: Feature extraction is to extract relevant features from the preprocessed EEG data, including 11 features in total, which are divided into frequency domain features (SSVEP amplitude, SSVEP signal-to-noise ratio), time domain features (P1, N1 amplitude, latency, area, ERP power) and time-frequency features (α wave and β wave power ratio).
[0080] S321. Frequency Domain Feature Extraction: Frequency domain features, including SSVEP amplitude (ssvep_amp) and SSVEP signal-to-noise ratio (ssvep_snr), are used to quantify the strength and signal quality of visual cortical oscillations evoked by a 10 Hz flickering optotype. Frequency domain feature extraction is based on a fast Fourier transform (FFT) to calculate the 10 Hz SSVEP amplitude and signal-to-noise ratio from the segmented EEG data (1 × 10 × 2000 tensor, 10 channels, 2 seconds, 1000 Hz sampling rate).
[0081] Each trial block (corresponding to visual scale size 40-53) was obtained from segmented_epochs. Each block contained 5 epochs (1×10×2000). For each epoch, 10 occipital channels were selected, the signal units were converted to microvolts (μV), and the DC component was removed by subtracting the mean to eliminate baseline offset.
[0082] Apply FFT to each channel signal in each epoch to compute the spectrum. The sampling rate is 1000 Hz, 2 seconds of data contains 2000 samples, and the frequency resolution is 0.5 Hz (fs / N = 1000 / 2000). Use np.fft.fft to compute the complex spectrum, retaining the positive frequency component (0.5-500 Hz), and use np.abs to obtain the magnitude spectrum. Focus on analyzing the 10 Hz SSVEP and its harmonics (20 Hz and 30 Hz).
[0083] To extract ssvep_amp, for each epoch, the amplitude at the 10 Hz frequency point (index 20, i.e., 10 / 0.5) is obtained. The 10 Hz amplitudes for all 10 channels and 5 trials are averaged to obtain the SSVEP amplitude (in μV) for each trial block. Averaging is performed using np.mean to reduce inter-trial and inter-channel variability and ensure that the amplitude consistently reflects the strength of the optotype response.
[0084] To calculate ssvep_snr, define the 8-12 Hz frequency band as the target frequency. Extract the maximum amplitude (peak_amp) within this band as the 10 Hz SSVEP signal strength, and verify that its frequency is close to 10 Hz. Background noise power is defined as the squared mean of the amplitude within ±1 Hz of the peak frequency, excluding ±0.1 Hz of the peak. The signal-to-noise ratio is calculated in decibels (dB) using the following formula:
[0085]
[0086] Among them, peak_power is the square of the maximum amplitude of the target frequency band of 8-12Hz, back ground_power The mean of the squared amplitudes of the noise frequency band. For each epoch, the SNR is averaged across 10 channels and 5 trials to obtain the SSVEP SNR for that trial block, reflecting the strength of the signal relative to the background noise. Feature extraction results are verified using spectrograms.
[0087] S322. Time domain features include the amplitude, latency, area under the curve, and ERP power of the P1 and N1 components.
[0088] P1 features were extracted, including amplitude (p1_amp), latency (p1_lat), and area (p1_auc). To comprehensively cover possible P1 peak advances and delays, a time window of 70-160 ms was defined. A dual screening strategy was employed, detecting all positive peaks within the time window (signal > 0 and greater than adjacent points). The peak with the largest amplitude (candidate_A) and the peak with the latency closest to 100 ms (candidate_B) were selected. The final selection rule was: if the amplitude of candidate_A exceeded 4 / 3 of that of candidate_B, the former was selected (focusing on significance); otherwise, the latter was selected (focusing on typical latency). P1 features include amplitude (μV, peak value), latency (seconds, peak time), and area (μV·s, signal integration between 70 and 160 ms), reflecting the strength, speed, and total activation of the neural response, respectively.
[0089] N1 features extracted include amplitude (n1_amp), latency (n1_lat), and area (n1_auc). The N1 time window extends from 20ms to 200ms after the P1 peak. The minimum signal within this range is identified as the N1 peak (negative trough). The amplitude is the minimum value (μV), the latency is the time corresponding to the trough (seconds), and the area is the integral of the signal within the time window (μV·s), reflecting the overall neural activity of the N1. Calculations are performed only when there are more than two data points in the time window to ensure valid results.
[0090] ERP power (erp_power) is used to characterize the overall neural activity intensity within 300ms before visual stimulation. The 0-300ms segment is extracted from the average signal and its square mean amplitude is calculated using the formula:
[0091]
[0092] Where N is the number of sample points; is the square of the signal amplitude. This feature, measured in μV², reflects the energy distribution in the early stages of visual stimulation. It can quantify the overall response strength of the visual cortex to stimulation and is related to the salience and processing efficiency of visual perception.
[0093] S323. Time-frequency characteristics include the power ratio of alpha waves (8-12 Hz) and beta waves (13-30 Hz), focusing on alpha suppression and beta enhancement.
[0094] Each label corresponds to a trial block containing five trials, divided into two time windows: 0.5 seconds before and 0.5 seconds after stimulation. Each time window is 0.5 seconds long, and the signal in each time window is bandpass filtered using a zero-phase-shift FIR filter for alpha waves (filtering range 6-14 Hz) and beta waves (filtering range 12-31 Hz).
[0095] For each filtered time window, the power of the α and β waves is calculated. The power spectral density (PSD) is estimated using the Welch method, as follows:
[0096]
[0097] Among them, L is the length of each signal segment, M is the total number of segments, x m (n) is the nth sampling point of the mth segment signal, n is the sampling point index in each segment signal, w(n) is the value of the window function at point n, f is the frequency variable, e -j2πfn / N is the complex exponential factor of the discrete Fourier transform. The window length is set to 256 samples to balance frequency resolution and computational stability. The band power is obtained by integrating the power spectrum within the specified frequency range:
[0098]
[0099] Among them, f high is the highest frequency of the specified frequency band; f low The lowest frequency in the specified frequency band; the integration range is α wave (8-12Hz) and β wave (13-30Hz), and the power unit is μV 2 / Hz. Calculate the frequency band power of all channels and take the average value to obtain the α wave and β wave power of the time window.
[0100] For each trial block, the average power of alpha and beta waves before and after stimulation was calculated. Pre-stimulus power (pre) was the average power of the 0.5-second time window before the five trials, and post-stimulus power (post) was the average power of the 0.5-second time window after the five trials. The power ratio was defined as:
[0101]
[0102] If the pre-stimulus power is 0, the power ratio is marked as a not-a-number (NaN) value. The power ratio quantifies the degree of a-wave suppression (ratio < 1) and b-wave enhancement (ratio > 1) and reflects the changes in neural oscillations induced by visual stimulation.
[0103] S33, establishing an identification model: calling the offline trained prediction model to input the extracted features to predict the vision value, the system adopts a three-level prediction mechanism:
[0104] High and low vision classification stage: the original data contains 60 training samples and 60 test samples, corresponding to the data of 12 eyes respectively. The XGBoost model is used to evaluate the feature importance, and the features with greater contribution to the classification performance are selected for modeling. The performance comparison of three classification models in high and low vision classification task is shown in Table 1, and the confusion matrix comparison of three models is shown in Figure 3 . Finally, the random forest model is selected as the high and low vision discrimination model of this study, and its optimal hyperparameter configuration is:
[0105] n_estimators = 100, max_depth = 4, min_samples_split = 2
[0106] Table 1 Performance comparison of three classification models
[0107] Model Validation set F1 score Test set accuracy Test set F1 score XGBoost 0.716 0.583 0.667 Support Vector Machine 0.766 0.667 0.714 RF 0.897 0.833 0.833
[0108] Low vision refinement prediction: if it is judged as low vision, the integrated regression model (XGBoost and RandomForest) and the support vector regression model are compared in model selection, and the MAE of the integrated regression model is 0.070, while the MAE of the SVR model is 0.110, which means that the latter is better in prediction accuracy. In order to further analyze the performance difference, three groups of performance comparison graphs are drawn: Figure 4-Figure 6 . After comprehensive analysis, the SVR model is better than the integrated regression model in prediction accuracy and stability, therefore, the SVR model is selected as the final low vision prediction model, and is saved after retraining with the full data set. High vision prediction: if it is judged as high vision, the integrated regression model (XGBoost and RandomForest) and the support vector regression model are compared in model selection, and the MAE of the integrated regression model is 0.0857, while the MAE of the SVR model is 0.1357, which means that the former is better in prediction accuracy. In order to further analyze the performance difference, three groups of comparison graphs are drawn: Figure 7 (absolute error box plot), Figure 8 (absolute error frequency histogram) and Figure 9(Scatter plot of predicted values and true values). Comprehensive analysis shows that the integrated regression model is superior to the SVR model in both prediction accuracy and stability. Therefore, the integrated regression model is selected as the final high-vision model, and the optimal model parameters are:
[0109] RandomForestRegressor: max_depth=4, n_estimators=100, min_samples_split=2, random_state=42)
[0110] XGBRegressor (n_estimators = 100, learning_rate = 0.1, max_depth = 3, random_state = 42), and integrated prediction by weighted averaging (XGBoost: 0.6, RandomForest: 0.4), the model is retrained using all the data and saved.
[0111] The main function of the S4 online control module is to monitor the user's vision in real time through a computer program and provide feedback to the display screen. First, the online data is input (the EEG acquisition module establishes a stable connection with the acquisition host connected to the Neuroscan system via the TCP / IP protocol and continuously receives EEG data streams from it). Preprocessing and feature extraction are then performed. The offline-trained prediction model is then called to input the extracted features for vision prediction. The prediction results are then output and fed back to the display screen.
[0112] The online experiment used eight eyes, including six with high vision (Eyes 1-6) and two with low vision (Eyes 7-8). The first stage of classification prediction was performed using a 4.4-degree visual acuity scale. If the eye was classified as low vision, the low vision model was used directly for prediction. If the eye was classified as high vision, the high vision model was used for prediction after all stimuli were completed. Each eye was predicted five times (P1 to P5). The online experimental results were analyzed to evaluate the performance of the online vision prediction system.
[0113] The average MAE of the online experiment is 0.173, which shows that the system has a certain prediction accuracy but still has room for improvement. Figure 10 As shown, the MAE for high-vision eyes (Eyes 1-6) is high (0.217), especially for Eye 3, which was misclassified twice as a low-vision eye, resulting in a large prediction error. In contrast, the MAE for low-vision eyes (Eyes 7-8) is only 0.040, with the predicted values highly consistent with the true values. These results indicate that the system's predictions for low-vision eyes are more accurate, while errors for high-vision eyes are primarily due to misclassification. However, averaging multiple measurements can effectively reduce the MAE and improve accuracy.
[0114] In order to ensure the reliability of the predicted values of the online vision prediction system, a correlation assessment is required. The consistency between the true value and the predicted value is analyzed by the Pearson correlation coefficient test and the trend line graph. The Pearson correlation coefficient r = 0.952 (p = 0.004), indicating that there is a significant high linear correlation between the true value and the predicted average value. The trend line graph is shown in Figure 2. Figure 11 shown.
[0115] In order to ensure the stability of the system prediction value, a volatility assessment is required. The standard deviation distribution of each eye is as follows: Figure 12 As shown in the figure, the standard deviation of low-vision eyes is 0.054, and the predicted values fluctuate slightly around the true values of 4.1 and 4.2. Among high-vision eyes, Eye5 has the lowest standard deviation (0.054), and the predicted value is close to the true value of 5.0, with less volatility; while Eye1 (0.412), Eye4 (0.371), and Eye6 (0.371) have higher standard deviations, a wider range of predicted values, and more significant volatility. The absolute error distribution is shown in the figure. Figure 13 As shown, among the 40 predictions, 75% of the absolute errors were less than 0.2, mainly concentrated in the range of 0-0.2, and the fluctuation range was generally controllable.
[0116] Therefore, the present invention adopts the above-mentioned intelligent vision detection method and system based on non-invasive brain-computer interface technology, by designing a specific flashing E-shaped visual mark stimulation interface, collecting the electroencephalogram (EEG) generated by the subject under visual stimulation, extracting time domain and frequency domain eigenvalues, and combining advanced signal processing technology and machine learning algorithms to construct a high-precision vision prediction model, thereby achieving rapid and accurate screening of myopic patients. The method utilizes the objective physiological characteristics of electroencephalogram signals, avoids the limitation of traditional vision detection relying on subjective feedback, and has significant advantages such as non-invasiveness, high efficiency and dynamism. By analyzing the characteristics of electroencephalogram signals (such as frequency, amplitude, latency, etc.), the method can comprehensively evaluate the state of visual function, is suitable for special populations such as children and the elderly, and provides a new technical path for large-scale vision screening and personalized visual health management. In addition, the method can be further combined with portable electroencephalogram devices and online detection systems to promote the intelligence and popularization of vision detection technology, which has broad application prospects and social value.
[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solutions of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. An intelligent vision detection method based on non-invasive brain-computer interface technology, characterized in that: The following steps are involved: S1. Stimulus presentation and signal acquisition: Stimulate the subject's visual system by flashing visual marks of different sizes at a fixed frequency; S2. Data acquisition: Use EEG acquisition equipment to simultaneously acquire raw EEG signals and event labels; S3, building a prediction model: pre-processing the data collected in step S2 in an offline state, and extracting features from the processed EEG data to build a prediction model; S4, online prediction: In the online state, the data collected in step S2 is input through the transmission control protocol, the data is preprocessed and feature extracted, and the prediction model established in step S3 is called to perform online prediction, and the vision prediction result is output and fed back to the display screen.
2. The intelligent vision detection method based on non-invasive brain-computer interface technology according to claim 1 is characterized in that: Step S1 includes: Vision measurement task: The user sits quietly in a chair, watches the blinking sight mark on the computer screen, and uses a Bluetooth keyboard to select the direction of the sight mark. If the user makes two incorrect choices, the user's vision will be directly displayed on the screen to record the user's true ability. Observation task: The user sits quietly in a chair, wears the EEG device, and looks at the flashing visual signs on the computer screen, consistent with the visual acuity measurement task; Step S1 consists of 14 stages. In each stage, different sizes of sight marks will appear, ranging from 4.0 to 5.3 from large to small. In each stage, the same sight mark will appear randomly in different directions, up, down, left, and right. There are a total of 5 trials. Each trial flashes for 2 seconds, followed by a 0.5-second blank interval.
3. The intelligent vision detection method based on non-invasive brain-computer interface technology according to claim 1 is characterized in that: In step S2, the data acquisition uses an amplifier to amplify the original signal, and the accompanying SCAN software is used to save the data. Standard Ag / AgCl electrodes are used, and the electrode placement is based on the international 10-20 system. The number of channels is 64. The sampling parameters are set to a sampling rate of 1000 Hz, a 5-50 Hz bandpass filter, and a 50 Hz notch filter to filter out power frequency interference. The acquisition process is based on the top of the head as a reference, the forehead is grounded, and the impedance between the scalp and the electrodes is kept below 10 kΩ.
4. The intelligent vision detection method based on non-invasive brain-computer interface technology according to claim 1 is characterized in that: Step S3 includes the following steps: S31. Use the Python-based MNE EEG processing library to preprocess the raw EEG signals, including data format conversion, bandpass filtering, artifact removal, and data block preprocessing operations; S32. Extract relevant features from the preprocessed EEG data, including 11 features in total, which are divided into frequency domain features, time domain features, and time-frequency features; S33. Establish a recognition prediction model.
5. The intelligent vision detection method based on non-invasive brain-computer interface technology according to claim 4 is characterized in that: The frequency domain features in step S32 include SSVEP amplitude and SSVEP signal-to-noise ratio. The frequency domain feature extraction is based on fast Fourier transform (FFT) to calculate the 10 Hz SSVEP amplitude and signal-to-noise ratio from the segmented EEG data, specifically: Get each trial block from segmented_epochs. Each block contains 5 epochs. For each epoch, select 10 occipital channels, convert the signal unit to microvolts, and remove the DC component by subtracting the mean. Apply FFT to each channel signal in each epoch to calculate the spectrum. The sampling rate is 1000 Hz, 2 seconds of data contains 2000 sample points, and the frequency resolution is 0.5 Hz. Use np.fft.fft to calculate the complex spectrum, retaining the positive frequency component, and use np.abs to obtain the amplitude spectrum. Analyze the 10 Hz SSVEP and its harmonics. For each epoch, the amplitude of the 10 Hz frequency point was obtained, and the 10 Hz amplitudes of 10 channels and 5 trials were averaged to obtain the SSVEP amplitude of each trial block; The target frequency band was defined as 8-12 Hz. The maximum amplitude in this band was extracted as the 10 Hz SSVEP signal strength, and its frequency was verified to be close to 10 Hz. The background noise power was defined as the square mean of the amplitude within the range of ±1 Hz of the peak frequency, excluding the peak ±0.1 Hz. The signal-to-noise ratio was calculated in decibels using the formula: Where peak_power is the square of the maximum amplitude in the 8-12 Hz target frequency band, and background_power is the average of the squares of the noise frequency band amplitudes.
6. The intelligent vision detection method based on non-invasive brain-computer interface technology according to claim 4 is characterized in that: The time-domain features in step S32 include the amplitude, latency, area, and ERP power of the P1 and N1 components. The P1 feature extraction includes amplitude, latency, and area. Specifically, the time window is set to 70-160ms, and a double screening strategy is used to determine the peak with the largest amplitude, candidate_A, and the peak with the latency closest to 100ms, candidate_B. The selection rule is: if the amplitude of candidate_A exceeds 4 / 3 of that of candidate_B, the former is selected; otherwise, the latter is selected. The extraction of N1 features includes amplitude, latency, and area. Specifically, the N1 time window is 20ms to 200ms after the P1 peak. The minimum value of the signal within this range is identified as the N1 peak. The minimum value is the amplitude, the latency is the time corresponding to the trough, and the area is the signal integral within the time window. The ERP power feature is extracted as follows: the 0-300ms segment is extracted from the average signal and the square mean of its amplitude is calculated. The formula is: Where N is the number of sample points; is the square of the signal amplitude.
7. The intelligent vision detection method based on non-invasive brain-computer interface technology according to claim 4 is characterized in that: The time-frequency features in step S32 include α waves and β waves, and the feature extraction is specifically as follows: Each label corresponds to a trial block, which contains 5 trials. The trials are divided into two time windows: 0.5 seconds before stimulation and 0.5 seconds after stimulation. The time window length is 0.5 seconds. A zero-phase-shift FIR filter is used to perform bandpass filtering on the α wave and β wave respectively in each time window signal. For each filtered time window, the power of the α wave and β wave is calculated, and the power spectral density is estimated using the Welch method. The formula is: Among them, L is the length of each signal segment, M is the total number of segments, x m (n) is the nth sampling point of the mth segment signal, n is the sampling point index in each segment signal, w(n) is the value of the window function at point n, f is the frequency variable, e -j2πfn / N is the complex exponential factor of the discrete Fourier transform; the window length is set to 256 sample points, and the frequency band power is obtained by integrating the power spectrum within the specified frequency range: Among them, f high is the highest frequency of the specified frequency band; f low The lowest frequency in the specified frequency band; the integration range is α wave and β wave, and the power unit is μV 2 / Hz, calculate the frequency band power of all channels and take the average value to obtain the α wave and β wave power of the time window; For each trial block, the average power of α and β waves before and after stimulation was calculated. The pre-stimulus power pre was the average power of the 0.5-second time window before the five trials, and the post-stimulus power post was the average power of the 0.5-second time window after the five trials. The power ratio was defined as: If the power before stimulation is 0, the power ratio is marked as an invalid value.
8. The intelligent vision detection method based on non-invasive brain-computer interface technology according to claim 1 is characterized in that: Step S4 uses a computer program to detect the user's vision in real time and feeds it back to the display screen. Specifically, first input online data, perform preprocessing and feature extraction in sequence, then call the prediction model trained offline in step S3 to input the extracted features to predict the vision value, output the prediction results and feed them back to the display screen.
9. An intelligent vision detection system based on non-invasive brain-computer interface technology, applied to the intelligent vision detection method based on non-invasive brain-computer interface technology according to any one of claims 1 to 8, characterized in that: include: The stimulus presentation module generates a fixed-frequency flickering visual mark stimulus interface and controls the size, direction, and flickering parameters of the visual mark. The data acquisition module synchronously collects EEG signals and event labels through EEG acquisition equipment; Model building module, which preprocesses raw EEG data, extracts features and builds a vision prediction model offline; The online control module inputs raw EEG data through the transmission control protocol; preprocesses and extracts features from the data; calls the prediction model for online prediction; and outputs the vision prediction results to the display screen.