Double-normal-form real-time near-infrared neural feedback method and system
By using a device-independent interface and a time-based adaptive neural feedback system, combined with sliding window processing and least squares regression, plug-and-play and real-time interpretable neural feedback for multi-brand devices is achieved. This solves the problems of strong device coupling, real-time performance, and incomplete evidence chains in existing systems, and provides ecological interference assessment and an auditable evidence chain.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENYANG MEDICAL COLLEGE
- Filing Date
- 2026-01-23
- Publication Date
- 2026-04-10
AI Technical Summary
Existing neurofeedback systems suffer from problems such as strong device coupling, statistical and rendering coupling, temporal base fragility, incomplete evidence chains, and insufficient adaptability to training targets, making them particularly difficult to meet the requirements for multi-center applications and clinical quality control.
Employing device-independent interfaces, time-based self-adaptation, statistical-rendering layering, and auditable evidence chains, combined with sliding window processing and least squares regression, we achieve dual-paradigm feedback, including the brain-heart axis and the motor intention/cognitive paradigm. Real-time performance and interpretability are ensured through finite state machines and adaptive degradation rendering.
It enables plug-and-play, real-time interpretable neural feedback for multi-brand devices, solving problems such as high hardware migration costs, difficulty in balancing real-time performance and smoothness, single paradigm of traditional systems, and incomplete evidence chains. It also features ecological interference assessment and an auditable evidence chain.
Smart Images

Figure CN121817879A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of neurofeedback training and brain-computer interface technology, and more particularly to a dual-paradigm real-time near-infrared neurofeedback method and system. Background Technology
[0002] Near-infrared spectroscopy (NIRS) technology has significant advantages in the field of neurological function monitoring due to its portability, resistance to electromagnetic interference, and bedside deployment capabilities. By detecting local blood oxygenation dynamics parameters (such as changes in oxyhemoglobin and deoxyhemoglobin concentrations), this technology can obtain neurological activity indicators with clear physiological orientations, providing a reliable basis for the unified organization of training objectives and system judgment logic. The online judgment process needs to output statistics and effect sizes at fixed time intervals to ensure the interpretability, operational standardization, and consistency of the results.
[0003] Current neurofeedback systems have the following limitations: (1) Strong coupling of equipment: The hardware and algorithm modules are highly bound, making it difficult to achieve interface standardization in multi-center applications; (2) Coupling of statistics and rendering: Data processing and visualization rendering are not designed in layers, and real-time performance is limited by redundant calculations; (3) Time base vulnerability: The system timing synchronization depends on external triggers and is prone to clock inaccuracy due to signal delay; (4) Incomplete chain of evidence: Single-session training data lacks audit trail functionality, making it difficult to meet clinical quality control requirements.
[0004] In addition, existing solutions mostly adopt a single paradigm (such as motor intention or cognitive tasks) and lack quantitative assessment methods for sympathetic nerve inhibition and anti-interference ability, which limits the adaptive coverage of different training objectives. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides a dual-paradigm real-time near-infrared neurofeedback method and system. Within a fixed real-time budget, this invention provides a device-independent, time-based adaptive, statistical-rendering layered, and auditable evidence chain online neurofeedback pipeline, simultaneously covering both brain-heart axis and motor intention / cognition training paradigms.
[0006] The technical means employed in this invention are as follows: A dual-paradigm real-time near-infrared neural feedback method includes: S1. Acquire multi-channel near-infrared brain signal data, timestamps and event markers through a device-independent interface, and perform shape self-adaptation, time alignment and marker repair on the data to form an input frame consistent with the acquisition rhythm of the device. S2. Write the repaired input frame into a bounded buffer and extract sliding window data within a fixed time period. Perform low-pass filtering, detrending and in-window standardization on the target brain region channel average sequence to generate a stable response sequence for statistical modeling. S3. Generate a task square wave based on the preset modular task structure, convolve the task square wave with the hemodynamic response function to construct a prediction sequence, and use least squares regression to estimate the statistics and effect size within a sliding window; the statistics are used for online determination, and the effect size is used for spatial visualization. S4. Within the fixed callback period, implement dual-paradigm closed-loop feedback based on the statistics, including: Brain-heart axis paradigm: At the beginning of each task phase, a sinusoidal amplitude modulated pure tone is triggered and a band-limited white noise segment is inserted. The statistics are displayed in real time in the form of energy bars, and the effect size of the dorsolateral prefrontal region is colored on the three-dimensional cortical shell. Motion Intention / Cognitive Paradigm: A finite state machine is driven by statistical thresholds and continuous achievement rules, which sequentially enter the preparation phase, maintenance evaluation phase, rollback phase and completion advancement phase. Animation advancement and judgment logic are decoupled. Success judgment is only executed in the task phase when the statistics are valid, and a success event is only recorded once. S5. Align the statistics at the end of each sliding window with the timestamp, write them to the statistics log, and merge the success events, parameter snapshots and performance statistics into a single session file to form an auditable chain of evidence. S6. When the statistical link time is close to the callback cycle budget, adaptively reduce the 3D rendering frequency or pause the 3D display to prioritize the real-time completion of regression solution and judgment logic.
[0007] Furthermore, in step S1, the device-independent interface is implemented through the function handle factory pattern, supporting access via SDK, TCP / IP, or file playback, and the main process does not perform filtering or resampling processing on the original data.
[0008] Furthermore, in step S2, when the amount of data in the bounded buffer reaches the upper limit, only the tail data is retained. When the number of samples in the window is insufficient to meet the zero-phase filter endpoint protection, the filtering is skipped and automatically restored after sufficient samples are available.
[0009] Furthermore, in step S3, the modular task structure is composed of alternating rest segments and task segments. The start time of the task segment is triggered by the rising edge of the event marker, and the length of the task square wave and the prediction sequence are strictly aligned with the number of session sampling points.
[0010] Furthermore, in step S4, the sinusoidal amplitude modulated pure tone and the band-limited white noise segment are superimposed and played within the task segment. The superimposed signal is peak-limited, and the playback is triggered by the rising edge of the task start event marker.
[0011] Furthermore, in step S4, the finite state machine is successfully triggered by continuous target counting during the maintenance evaluation phase. After successful triggering, it enters the completion and advancement phase and automatically returns to the starting position of the preparation phase at the end of the completion and advancement phase without repeating the count.
[0012] Furthermore, in step S4, the animation advancement adopts a virtual three-dimensional robotic arm image sequence, the frame advancement is driven by a fixed time step, the advancement determination is triggered by a statistical threshold, the two are decoupled in time base, the animation is frozen outside the task stage and the determination logic is paused.
[0013] Furthermore, in step S5, the single session file adopts a binary format that supports incremental appending, triggers a soft retry mechanism when writing fails, and does not interrupt the main loop or feedback process; the success event is a sparse timestamp sequence, which corresponds one-to-one with the statistical log.
[0014] Furthermore, in step S6, the budget determination is based on the ratio of the average time consumption of the statistical link to the callback cycle. When the timeout risk increases, the 3D refresh frequency is reduced first. If the real-time requirement is still not met, the 3D display is paused until the load drops. The statistical link time consumption does not include the animation rendering time.
[0015] The present invention also provides a dual-paradigm real-time near-infrared neurofeedback system based on the above-mentioned dual-paradigm real-time near-infrared neurofeedback method, comprising: The device interface module is used to acquire multi-channel near-infrared brain signal data, timestamps and event markers through a device-independent interface, and to perform shape self-adaptation, time alignment and marker repair on the data to form an input frame consistent with the acquisition rhythm of the device. The caching and preprocessing module is used to write the repaired input frame into a bounded buffer and extract sliding window data within a fixed time period. It performs low-pass filtering, detrending, and in-window normalization on the target brain region channel average sequence to generate a stable response sequence for statistical modeling. The design generates and regresses a task square wave based on a preset modular task structure. The task square wave is then convolved with the hemodynamic response function to construct a prediction sequence. Least square regression is used within a sliding window to estimate the statistics and effect size. The statistics are used for online determination, and the effect size is used for spatial visualization. The dual-paradigm feedback module is used to implement dual-paradigm closed-loop feedback based on the statistics within the fixed callback period, including: Brain-Heart Axis Paradigm Submodule: At the beginning of each task phase, a sinusoidal amplitude modulated pure tone is triggered and a band-limited white noise segment is inserted. The statistics are displayed in real time in the form of an energy bar. At the same time, the effect size of the dorsolateral prefrontal region is colored on the three-dimensional cortical shell. The motion intention / cognitive paradigm submodule: driven by statistical thresholds and continuous achievement rules, the finite state machine enters the preparation phase, maintenance evaluation phase, rollback phase and completion advancement phase in sequence. The animation advancement and judgment logic are decoupled. Success judgment is only executed in the task phase and when the statistics are valid. Success events are only recorded once. The persistent logging module is used to align the statistics at the end of each sliding window with the timestamp, write them to the statistics log, and merge success events, parameter snapshots and performance statistics into a single session file to form an auditable chain of evidence. The real-time budget control module is used to adaptively reduce the 3D rendering frequency or pause the 3D display when the statistical link time is close to the callback cycle budget, so as to prioritize the real-time completion of regression solution and judgment logic.
[0016] Compared with the prior art, the present invention has the following advantages: 1. This invention achieves the technical effect of plug-and-play functionality and automatic data format alignment for multi-brand functional near-infrared spectroscopy devices by combining device-independent interfaces with time-base self-healing technology, thus solving the problem of high migration costs caused by strong hardware coupling.
[0017] 2. The sliding window least squares regression and hemodynamic response function convolution prediction technique of this invention achieves the technical effect of outputting interpretable statistics and effect sizes within a fixed time interval, solving the problem of lack of physiological basis for online determination of slow time-scaled signals.
[0018] 3. This invention uses a layered approach of statistical link and rendering link and decouples visual progression and judgment progression to achieve the technical effect of prioritizing regression solution and maintaining screen continuity when budget is tight, thus resolving the contradiction between real-time performance and smoothness.
[0019] 4. This invention achieves the technical effect of alternating brain-heart axis acoustic feedback and motion intention state machine animation training on the same pipeline by using a dual-paradigm shared unified kernel, thus solving the problems of single paradigm and insufficient scene coverage in traditional systems.
[0020] 5. This invention achieves the technical effect of no memory leaks and no filtering artifacts during long-term continuous operation by using bounded caching, endpoint protection, and adaptive degradation rendering, thus solving the hidden danger of poor stability of long bedside sessions.
[0021] 6. This invention achieves the technical effect of generating an auditable and offline replayable evidence chain immediately after training by using a single-session incremental disk writing technique combined with parameter snapshots, thus solving the problem of the lack of standardized audit documents in multi-center studies.
[0022] 7. This invention achieves the technical effect of quantifying the subject's anti-interference ability in a rhythmic context by superimposing steady-state acoustic cues with random insertion of band-limited white noise, thus solving the problem of the lack of ecological interference assessment indicators in traditional neural feedback.
[0023] 8. This invention uses a four-stage finite state machine approach combined with continuous target counting to achieve the technical effect of finely adjusting the difficulty of training objectives and preventing repeated counting of successful events, thus solving the problems of uncontrollable difficulty in motion intention training and imprecise accounting semantics.
[0024] 9. This invention achieves the technical effect of maintaining smooth cortical shading refresh on low-end graphics hardware by constructing a three-dimensional region of interest once and updating only the surface color, thus solving the problem of slowing down the judgment cycle due to mesh reconstruction in three-dimensional feedback.
[0025] 10. This invention uses a budget-aware adaptive degradation technique to automatically reduce or pause 3D rendering when the statistical link time approaches the cycle limit, while maintaining the energy bar and normal operation of the judgment, thus solving the problem of frame drops caused by large performance differences of clinical equipment. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a flowchart of the method of the present invention.
[0028] Figure 2 This is a schematic diagram of the unified real-time processing pipeline and dual-paradigm framework provided in the embodiments of the present invention.
[0029] Figure 3 A list of system toolboxes to be used in embodiments of the present invention.
[0030] Figure 4 The parameters for the brain-heart axis paradigm provided in the embodiments of the present invention are set.
[0031] Figure 5 The parameter settings for the motion intention / cognitive paradigm provided in the embodiments of the present invention.
[0032] Figure 6 This is a flowchart of data acquisition and preprocessing provided for an embodiment of the present invention.
[0033] Figure 7 This is a diagram illustrating the modular task and prediction sequence construction provided in an embodiment of the present invention.
[0034] Figure 8 Acoustic materials and components for the brain-heart axis paradigm provided in embodiments of the present invention.
[0035] Figure 9 The audio stimulus sequence depends on the root directory provided in the embodiments of the present invention.
[0036] Figure 10 This is a schematic diagram of acoustic cues and interference in the brain-heart axis paradigm provided in an embodiment of the present invention.
[0037] Figure 11 The interactive panel of the brain-heart axis paradigm provided in the embodiments of the present invention.
[0038] Figure 12 This is a schematic diagram of three-dimensional coloring and shell extraction of the dorsolateral prefrontal cortex provided in an embodiment of the present invention.
[0039] Figure 13 An interactive panel for a motion conception / cognitive paradigm provided in an embodiment of the present invention.
[0040] Figure 14 A schematic diagram of a virtual 3D robotic arm feedback scene (skeleton, target object, trajectory and stage annotations) provided for an embodiment of the present invention.
[0041] Figure 15 A schematic diagram of progress amount-path parameter mapping and stage boundary (A / B / R / C and rollback boundary) provided for embodiments of the present invention.
[0042] Figure 16 Retrospective analysis and auditing (parameter snapshots and session timing statistics) provided for embodiments of the present invention. Detailed Implementation
[0043] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0044] It should be noted that the terms "comprising" and "having" and any variations thereof in the specification, claims and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products or devices.
[0045] like Figure 1 As shown, this invention provides a dual-paradigm real-time near-infrared neural feedback method, comprising: including: S1. Acquire multi-channel near-infrared brain signal data, timestamps and event markers through a device-independent interface, and perform shape self-adaptation, time alignment and marker repair on the data to form an input frame consistent with the acquisition rhythm of the device. S2. Write the repaired input frame into a bounded buffer and extract sliding window data within a fixed time period. Perform low-pass filtering, detrending and in-window standardization on the target brain region channel average sequence to generate a stable response sequence for statistical modeling. S3. Generate a task square wave based on the preset modular task structure, convolve the task square wave with the hemodynamic response function to construct a prediction sequence, and use least squares regression to estimate the statistics and effect size within a sliding window; the statistics are used for online determination, and the effect size is used for spatial visualization. S4. Within the fixed callback period, implement dual-paradigm closed-loop feedback based on the statistics, including: Brain-heart axis paradigm: At the beginning of each task phase, a sinusoidal amplitude modulated pure tone is triggered and a band-limited white noise segment is inserted. The statistics are displayed in real time in the form of energy bars, and the effect size of the dorsolateral prefrontal region is colored on the three-dimensional cortical shell. Motion Intention / Cognitive Paradigm: A finite state machine is driven by statistical thresholds and continuous achievement rules, which sequentially enter the preparation phase, maintenance evaluation phase, rollback phase and completion advancement phase. Animation advancement and judgment logic are decoupled. Success judgment is only executed in the task phase when the statistics are valid, and a success event is only recorded once. S5. Align the statistics at the end of each sliding window with the timestamp, write them to the statistics log, and merge the success events, parameter snapshots and performance statistics into a single session file to form an auditable chain of evidence. S6. When the statistical link time is close to the callback cycle budget, adaptively reduce the 3D rendering frequency or pause the 3D display to prioritize the real-time completion of regression solution and judgment logic.
[0046] In a specific implementation, as a preferred embodiment of the present invention, in step S1, the device-independent interface is implemented through the function handle factory pattern, which supports access via SDK, TCP / IP or file playback, and the main process does not perform filtering or resampling processing on the original data.
[0047] In a preferred embodiment of the present invention, in step S2, when the data volume of the bounded buffer reaches its upper limit, only the tail data is retained; when the number of samples in the window is insufficient to meet the zero-phase filtering endpoint protection, the filtering is skipped and automatically restored after sufficient samples are available. In this embodiment, the upper limit of the data volume of the bounded buffer is three times the window length.
[0048] In a specific implementation, as a preferred embodiment of the present invention, in step S3, the modular task structure is composed of alternating rest segments and task segments. The start time of the task segment is triggered by the rising edge of the event marker, and the length of the task square wave and the prediction sequence are strictly aligned with the number of session sampling points.
[0049] In a preferred embodiment of the present invention, in step S4, the sinusoidal amplitude modulated pure tone and the band-limited white noise segment are superimposed and played within the task segment. The superimposed signal is peak-limited, and playback is triggered by the rising edge of the task start event marker. In this embodiment, the modulation frequency of the sinusoidal amplitude modulated pure tone is in the range of 0.5–2 Hz (Hertz), preferably 1 Hz; the modulation depth is in the range of 0.6–1.0, preferably 0.8; the carrier frequency is in the range of 240–300 Hz, preferably 261.63 Hz; cosine square fade-in / fade-out is applied at the beginning and end of the pure tone segment, and the fade-in / fade-out duration is in the range of 30–100 ms (milliseconds), preferably 50 ms. The bandpass of the white noise segment is in the range of 2–6 kHz (kilohertz), implemented using Butterworth 2–6 order with zero phase; the duration of a single segment is in the range of 5–15 s, preferably 10 s; the segment start point is located at the whole second in the middle of the task segment, avoiding the beginning and end of the task segment by 2 s. The starting point of the white noise segment is randomly selected without replacement from a set of preset candidate integer time points to achieve block-level randomization and uniform time coverage, suppressing time prediction and sequence effects. In the pure tone and white noise superposition area, the target signal-to-noise ratio (pure tone:noise) is set within the range of +1 to +6 dB (decibels), preferably +3 dB, according to the digital domain root mean square of the pure tone segment; cosine square fade-in / fade-out of ≥100 ms is applied to both sides of the white noise segment; after superposition, the entire signal is subjected to a 0.99 peak limit. The sampling rate of the acoustic stimulus audio material is not less than 44.1 kHz, preferably 48 kHz, the number of channels is mono, the quantization accuracy is not less than 16 bits (bytes), preferably 24 bits; the peak-to-average power ratio of the pure tone segment is controlled within the range of 1.5 to 3.0. The acoustic stimulation component is set with quality control criteria, including: envelope consistency (the smoothed envelope fluctuates stably at about 1 Hz), spectral structure (the main carrier peak and its symmetrical sidebands appear in the power spectral density), amplitude and ratio (peak value ≤ 0.99, and the measured signal-to-noise ratio of the superposition area matches the set value), and the relevant indicators and segment information are recorded in the material mixing log.
[0050] In a preferred embodiment of the present invention, in step S4, the finite state machine successfully triggers the continuous target counting during the maintenance evaluation phase. After successful triggering, it enters the completion advancement phase and automatically returns to the starting position of the preparation phase at the end of the completion advancement phase, without repeating the counting. In this embodiment, the completion advancement phase includes a target contact event. When the end effector reaches the target posture, a prompt is triggered, including a red flag, highlighting, or a brief pause. The prompt is automatically cleared after the completion advancement phase ends.
[0051] In a preferred embodiment of this invention, the animation progression employs a virtual 3D robotic arm image sequence. Frame progression is driven by a fixed time step, while decision progression is triggered by a statistical threshold. The two are decoupled in time, and the animation is frozen and the decision logic is paused outside the task phase. In this embodiment, the progress of the virtual 3D robotic arm is a monotonically bounded progress quantity, obtained through amplitude-limited accumulation based on the decision statistics during the maintenance evaluation phase. When the progress quantity reaches a preset threshold corresponding to a consecutive number of steps, a successful trigger is established, and the progression phase is completed. The virtual 3D robotic arm uses forward kinematics driven by a joint chain. The progress quantity is mapped to the path parameters of the end effector along a predefined trajectory in 3D space, thereby converting the statistical decision result into a continuous change in the end effector's pose. The predefined trajectory is a configurable curve or a set of segmented straight lines, the trajectory length, key nodes, and target pose of which are configurable. A backtrack boundary is set to limit the maximum backtracking amplitude during the backtracking phase. The virtual 3D robotic arm supports left and right mirror display and viewpoint switching. Mirroring or viewpoint changes do not alter the decision logic or successful recording. Meanwhile, to ensure real-time performance, the virtual 3D robotic arm rendering employs a layered detail and mesh simplification strategy. When the statistical link approaches its time budget, the refresh rate is reduced or 3D refresh is paused, updating only the energy bar and judgment result display. Outside of the task phase, the virtual 3D robotic arm remains frozen in its last displayed pose or standby pose. The display layer can be played independently at fixed time steps without advancing the judgment layer state.
[0052] In a preferred embodiment of this invention, in step S5, the single session file adopts a binary format that supports incremental appending. A soft retry mechanism is triggered when writing fails, without interrupting the main loop or feedback process. The success event is a sparse timestamp sequence, corresponding one-to-one with the statistical log. In this embodiment, the single session file adopts the MATLAB v7.3 format.
[0053] In a preferred embodiment of the present invention, in step S6, the budget determination is based on the ratio of the average time consumed by the statistical link to the callback cycle, to ensure that the determined link is completed within the budget. In this embodiment, the display layer uses a rate-limited refresh to reduce the load on the display end. The statistical link time does not include the drawing time for animation / 3D rendering. After the load decreases, the rate-limiting mechanism automatically restores the normal refresh.
[0054] The present invention also provides a dual-paradigm real-time near-infrared neurofeedback system based on the above-mentioned dual-paradigm real-time near-infrared neurofeedback method, comprising: The device interface module is used to acquire multi-channel near-infrared brain signal data, timestamps and event markers through a device-independent interface, and to perform shape self-adaptation, time alignment and marker repair on the data to form an input frame consistent with the acquisition rhythm of the device. The caching and preprocessing module is used to write the repaired input frame into a bounded buffer and extract sliding window data within a fixed time period. It performs low-pass filtering, detrending, and in-window normalization on the target brain region channel average sequence to generate a stable response sequence for statistical modeling. The design generates and regresses a task square wave based on a preset modular task structure. The task square wave is then convolved with the hemodynamic response function to construct a prediction sequence. Least square regression is used within a sliding window to estimate the statistics and effect size. The statistics are used for online determination, and the effect size is used for spatial visualization. The dual-paradigm feedback module is used to implement dual-paradigm closed-loop feedback based on the statistics within the fixed callback period, including: Brain-Heart Axis Paradigm Submodule: At the beginning of each task phase, a sinusoidal amplitude modulated pure tone is triggered and a band-limited white noise segment is inserted. The statistics are displayed in real time in the form of an energy bar. At the same time, the effect size of the dorsolateral prefrontal region is colored on the three-dimensional cortical shell. The motion intention / cognitive paradigm submodule: driven by statistical thresholds and continuous achievement rules, the finite state machine enters the preparation phase, maintenance evaluation phase, rollback phase and completion advancement phase in sequence. The animation advancement and judgment logic are decoupled. Success judgment is only executed in the task phase and when the statistics are valid. Success events are only recorded once. The persistent logging module is used to align the statistics at the end of each sliding window with the timestamp, write them to the statistics log, and merge success events, parameter snapshots and performance statistics into a single session file to form an auditable chain of evidence. The real-time budget control module is used to adaptively reduce the 3D rendering frequency or pause the 3D display when the statistical link time is close to the callback cycle budget, so as to prioritize the real-time completion of regression solution and judgment logic.
[0055] The embodiments of the present invention are described simply because they correspond to those in the embodiments above. For any similarities, please refer to the descriptions in the embodiments above, which will not be elaborated here.
[0056] Example 1 (Running Configuration and Parameters) The system supports configuring sampling rate, sliding window length, timed callback step size, judgment threshold and consecutive achievement steps, target brain region lateralization and expansion distance, energy bar threshold line and display range, batch and timed write thresholds, etc.; 3D rendering adopts a one-time construction, repeated shading strategy, reducing or pausing refresh when budget is tight, prioritizing regression solving and energy bar refresh; see [link to documentation] Figure 2-5 .
[0057] Example 2 (Data Acquisition and Preprocessing Pipeline) Multi-channel near-infrared signals, labels, and time vectors are acquired through a unified device interface; written to a circular buffer; a sliding window is constructed; smoothing, detrending, and standardization are performed within the window; the previous effective baseline is maintained when resting samples are insufficient; zero-phase filtering is skipped when boundary samples are insufficient; see [link to relevant documentation]. Figure 6 .
[0058] Example 3 (Predicting Sequences and Regression) The task square wave is generated according to the modular task design and convolved with the hemodynamic response function to obtain the prediction sequence; least squares regression is used to obtain the statistics and effect sizes for online judgment; see [link to relevant documentation]. Figure 7 .
[0059] Example 4 (Brain-Heart Axis Paradigm and Acoustic Stimulation Component) At the start of the task, a sinusoidal amplitude modulated pure tone is played. Band-limited white noise can be inserted during the middle of the task for anti-interference assessment. Online judgment relies solely on near-infrared statistics. Dorsolateral prefrontal cortex shading provides spatial localization. In this embodiment, the acoustic stimulation component of the brain-heart axis paradigm includes a sinusoidal amplitude modulated pure tone for providing steady-state rhythmic cues and a band-limited white noise segment for anti-interference assessment. The pure tone is automatically triggered at the start of the task phase, while the white noise segment is inserted only during the task phase. The start point of the white noise segment is randomly selected from several preset candidate integer second sets without replacement to achieve block-level randomization and uniform temporal coverage, suppressing temporal expectation and sequence effects. The sampling rate of the acoustic stimulation audio material is not less than 44.1 kHz and preferably 48 kHz, the number of channels is mono, and the quantization accuracy is not less than 16 bits (bytes) and preferably 24 bits. The peak-to-average power ratio of the pure tone segment is controlled within the range of 1.5 to 3.0. The acoustic stimulation component sets quality control criteria, including: envelope consistency (the smoothed envelope exhibits stable fluctuations at approximately 1 Hz), spectral structure (the presence of a carrier peak and its symmetrical sidebands in the power spectral density), amplitude and ratio (peak value ≤ 0.99, and the measured signal-to-noise ratio in the superposition area matches the set value). Relevant indicators and segment information are recorded in the material mixing log. The playback level of the acoustic stimulation is executed according to the comfort sound level and can be corrected for consistency through A-weighting and acoustic calibration; this correction does not change the online judgment link. The system sets up an acoustic stimulation submodule for triggering pure tone playback at the task start point, randomly scheduling white noise segments without replacement in the middle of the task phase, completing amplitude matching and fade-in / fade-out processing according to the SNR, and reducing 3D refresh or pausing 3D display when budget is tight to ensure the judgment link. The acoustic stimulation submodule includes a quality control unit for calculating envelope consistency and spectral sideband indicators, and writing peak value, root mean square, signal-to-noise ratio, and segment timing into the session log or independent QC log for review and consistency verification. See also Figure 8-12 .
[0060] Example 5 (Motion Intention / Cognitive Paradigm and Finite State Machine) The finite state machine includes preparation (A), maintenance evaluation (B), rollback (R, return), and completion advancement (C, advance after success); the vision layer advances in fixed steps, and the decision layer advances only during the task phase and when the statistics are valid; after completion advancement, it returns to the starting point of A and does not count success twice; the display frame domains of A / B / C are configurable, and the rollback range of R is limited to the upper bound of the segment from the starting point of A to B; see also Figure 13 , Figure 14 , Figure 15 .
[0061] Example 6 (Virtual 3D robotic arm feedback) The system employs forward kinematics-driven joint chains, mapping the progress values obtained from decision statistics through amplitude limiting and smoothing to path parameters of the end effector along a predefined trajectory (easily fading mapping can be used). Segment B involves progressive advancement, segment R involves restricted retraction, and upon reaching the target, segment C advances to the end effector and pauses briefly before returning to the starting position at A. Mirroring and viewpoint switching are supported. When budget is tight, hierarchical detail / mesh simplification and refresh frequency limiting or pausing are employed. See also... Figure 14 , Figure 15 .
[0062] Example 7 (Persistence, Retrospection, and Auditing) Only the statistics and time vectors corresponding to the end of the window are recorded, along with success logs and events, and parameter snapshots and session time-series statistics are saved. A batch and timed incremental write strategy is employed, with soft retries in case of write errors without interrupting the main loop. A single training session outputs one session file for review and consistency verification. See also... Figure 16 .
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A dual-paradigm real-time near-infrared neural feedback method, characterized in that, include: S1. Acquire multi-channel near-infrared brain signal data, timestamps and event markers through a device-independent interface, and perform shape self-adaptation, time alignment and marker repair on the data to form an input frame consistent with the acquisition rhythm of the device. S2. Write the repaired input frame into a bounded buffer and extract sliding window data within a fixed time period. Perform low-pass filtering, detrending and in-window standardization on the target brain region channel average sequence to generate a stable response sequence for statistical modeling. S3. Generate a task square wave based on the preset modular task structure, convolve the task square wave with the hemodynamic response function to construct a prediction sequence, and use least squares regression to estimate the statistics and effect size within the sliding window. Among them, the statistical measure is used for online determination, and the effect size is used for spatial visualization; S4. Within the fixed callback period, implement dual-paradigm closed-loop feedback based on the statistics, including: Brain-heart axis paradigm: At the beginning of each task phase, a sinusoidal amplitude modulated pure tone is triggered and a band-limited white noise segment is inserted. The statistics are displayed in real time in the form of energy bars, and the effect size of the dorsolateral prefrontal region is colored on the three-dimensional cortical shell. Motion Intention / Cognitive Paradigm: A finite state machine is driven by statistical thresholds and continuous achievement rules, which sequentially enter the preparation phase, maintenance evaluation phase, rollback phase and completion advancement phase. Animation advancement and judgment logic are decoupled. Success judgment is only executed in the task phase when the statistics are valid, and a success event is only recorded once. S5. Align the statistics at the end of each sliding window with the timestamp, write them to the statistics log, and merge the success events, parameter snapshots and performance statistics into a single session file to form an auditable chain of evidence. S6. When the statistical link time is close to the callback cycle budget, adaptively reduce the 3D rendering frequency or pause the 3D display to prioritize the real-time completion of regression solution and judgment logic.
2. The dual-paradigm real-time near-infrared neural feedback method according to claim 1, characterized in that, In step S1, the device-independent interface is implemented through the function handle factory pattern, which supports access via SDK, TCP / IP or file playback, and the main process does not perform filtering or resampling processing on the original data.
3. The dual-paradigm real-time near-infrared neural feedback method according to claim 1, characterized in that, In step S2, when the amount of data in the bounded buffer reaches the upper limit, only the tail data is retained. When the number of samples in the window is insufficient to meet the zero-phase filter endpoint protection, the filtering is skipped and automatically restored after sufficient samples are available.
4. The dual-paradigm real-time near-infrared neural feedback method according to claim 1, characterized in that, In step S3, the modular task structure is composed of alternating rest segments and task segments. The start time of the task segment is triggered by the rising edge of the event marker, and the length of the task square wave and the prediction sequence are strictly aligned with the number of session sampling points.
5. The dual-paradigm real-time near-infrared neural feedback method according to claim 1, characterized in that, In step S4, the sinusoidal amplitude modulated pure tone and the band-limited white noise segment are superimposed and played within the task segment. The superimposed signal is peak-limited and the playback is triggered by the rising edge of the task start event marker.
6. The dual-paradigm real-time near-infrared neural feedback method according to claim 1, characterized in that, In step S4, the finite state machine is successfully triggered by continuous target counting during the maintenance evaluation phase. After successful triggering, it enters the completion and advancement phase and automatically returns to the starting position of the preparation phase at the end of the completion and advancement phase without repeating the count.
7. The dual-paradigm real-time near-infrared neural feedback method according to claim 1, characterized in that, In step S4, the animation advancement uses a virtual three-dimensional robotic arm image sequence. Frame advancement is driven by a fixed time step, and the advancement determination is triggered by a statistical threshold. The two are decoupled in time, and the animation is frozen and the determination logic is paused outside the task phase.
8. The dual-paradigm real-time near-infrared neural feedback method according to claim 1, characterized in that, In step S5, the single session file adopts a binary format that supports incremental appending. When writing fails, a soft retry mechanism is triggered without interrupting the main loop or feedback process. The success event is a sparse timestamp sequence that corresponds one-to-one with the statistical log.
9. The dual-paradigm real-time near-infrared neural feedback method according to claim 1, characterized in that, In step S6, the budget determination is based on the ratio of the average time consumption of the statistical link to the callback cycle. When the risk of timeout increases, the 3D refresh frequency is reduced first. If the real-time requirement still cannot be met, the 3D display is paused until the load drops. The statistical link time consumption does not include the animation rendering time.
10. A dual-paradigm real-time near-infrared neurofeedback system implemented based on the dual-paradigm real-time near-infrared neurofeedback method according to any one of claims 1-9, characterized in that, include: The device interface module is used to acquire multi-channel near-infrared brain signal data, timestamps and event markers through a device-independent interface, and to perform shape self-adaptation, time alignment and marker repair on the data to form an input frame consistent with the acquisition rhythm of the device. The caching and preprocessing module is used to write the repaired input frame into a bounded buffer and extract sliding window data within a fixed time period. It performs low-pass filtering, detrending, and in-window normalization on the target brain region channel average sequence to generate a stable response sequence for statistical modeling. The design generates and regresses a task square wave based on a preset modular task structure. The task square wave is then convolved with the hemodynamic response function to construct a prediction sequence. Least square regression is used within a sliding window to estimate the statistics and effect size. The statistics are used for online determination, and the effect size is used for spatial visualization. The dual-paradigm feedback module is used to implement dual-paradigm closed-loop feedback based on the statistics within the fixed callback period, including: Brain-Heart Axis Paradigm Submodule: At the beginning of each task phase, a sinusoidal amplitude modulated pure tone is triggered and a band-limited white noise segment is inserted. The statistics are displayed in real time in the form of an energy bar. At the same time, the effect size of the dorsolateral prefrontal region is colored on the three-dimensional cortical shell. The motion intention / cognitive paradigm submodule: driven by statistical thresholds and continuous achievement rules, the finite state machine enters the preparation phase, maintenance evaluation phase, rollback phase and completion advancement phase in sequence. The animation advancement and judgment logic are decoupled. Success judgment is only executed in the task phase and when the statistics are valid. Success events are only recorded once. The persistent logging module is used to align the statistics at the end of each sliding window with the timestamp, write them to the statistics log, and merge success events, parameter snapshots and performance statistics into a single session file to form an auditable chain of evidence. The real-time budget control module is used to adaptively reduce the 3D rendering frequency or pause the 3D display when the statistical link time is close to the callback cycle budget, so as to prioritize the real-time completion of regression solution and judgment logic.