Radiation therapy advance quantity adaptive gating system based on transformer respiratory prediction

By using a Transformer-based respiratory prediction system, combined with multi-source data and delay calibration technology, precise delay compensation of radiotherapy equipment and accurate irradiation of tumor target areas were achieved. This solved the problems of insufficient dose at the target edge and excessive irradiation of normal tissues caused by the inherent delay fluctuations of radiotherapy equipment, thus improving the accuracy and safety of treatment.

CN122321365APending Publication Date: 2026-07-03HUNAN PROVINCIAL TUMOR HOSPITAL

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUNAN PROVINCIAL TUMOR HOSPITAL
Filing Date
2026-06-02
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

The inherent response delay fluctuations of existing radiotherapy equipment lead to errors in radiotherapy prediction compensation, resulting in insufficient tumor dose at the target margin or excessive irradiation of normal tissue.

Method used

A Transformer-based respiratory prediction system is adopted. The system acquires the patient's respiratory signals and accelerator operating parameters through a multi-source acquisition module, learns long-term respiratory patterns using a Transformer model, estimates beam response delays by combining a delay matching module, generates dynamic gating commands in advance by a trigger module, and calibrates the delay estimate online through a closed-loop correction module, thereby achieving precise alignment and state adjustment between the X-ray and tumor motion.

Benefits of technology

It achieves precise irradiation of the tumor target area and protection of normal tissues during radiotherapy, balancing treatment efficiency and safety, and solves the problem of dose loss at the target edge caused by delayed fluctuations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122321365A_ABST
    Figure CN122321365A_ABST
Patent Text Reader

Abstract

This invention discloses an adaptive gating system for radiotherapy advance based on Transformer respiratory prediction, specifically relating to the field of adaptive gating technology. By synchronously collecting multi-dimensional operating condition parameters and estimating beam response delay online, and combining Transformer's full-cycle modeling of long-term respiratory signals and future trajectory prediction, the predicted trajectory and dynamic delay are aligned ahead of time on the time axis to generate an adaptive advance trigger command. At the same time, an attention mechanism is used to identify respiratory state to adjust the gating window width and triggering conditions in real time, and a closed-loop feedback of beam response deviation is introduced to correct the delay estimation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of adaptive gating technology, and more specifically, to an adaptive gating system for radiotherapy advance based on Transformer respiratory prediction. Background Technology

[0002] Current radiotherapy respiratory gating largely relies on real-time threshold triggering, directly controlling the on / off state of radiation based on the current body surface location. However, radiotherapy equipment such as accelerators has an inherent response delay from receiving the trigger command to the actual beam emission or closure. This inherent response delay is not a fixed constant and fluctuates by 10–50 ms depending on changes in equipment preheating temperature, dose rate switching, or gantry rotation angle. When the system attempts to compensate in advance by predicting future tumor location, the predicted trajectory must be precisely spatiotemporally aligned with this unstable delay. If the delay calibration is off, the advance calculation will introduce a fixed bias, causing the radiation to turn on prematurely or close lag-wise. This results in a sharp dose reduction for tumors at the target edge due to insufficient irradiation, while adjacent normal tissue boundaries are over-irradiated. Moreover, this error accumulates with delay fluctuations, severely weakening the effectiveness of predictive compensation. Summary of the Invention

[0003] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide an adaptive gating system for radiotherapy advance based on Transformer respiratory prediction, in order to solve the problems mentioned in the background art.

[0004] To achieve the above objectives, the present invention provides the following technical solution:

[0005] The radiotherapy advance adaptive gating system based on Transformer respiratory prediction includes a multi-source acquisition module, a timing prediction module, a delay matching module, an advance triggering module, a state gating module, and a closed-loop correction module.

[0006] The multi-source acquisition module is used to acquire the patient's respiratory signal and simultaneously acquire the current operating parameters of the accelerator. The operating parameters include at least the gantry angle, dose rate setpoint, and radio frequency system warm-up time.

[0007] The time-series prediction module is used to process the respiratory signal using a pre-trained Transformer model, learn the long-term fluctuation pattern across multiple respiratory cycles, and output the predicted trajectory of tumor movement within a preset time period in the future.

[0008] The delay matching module is used to determine the estimated beam response delay of the accelerator in the current state based on the operating condition parameters and a pre-calibrated delay mapping relationship.

[0009] The advance triggering module is used to align the predicted tumor motion trajectory with the estimated beam response delay on the time axis, calculate the dynamic advance triggering time that makes the ray establishment time coincide with the tumor arrival time, and generate preset commands for beam output and beam termination.

[0010] The state gating module is used to extract respiratory state discrimination features from the Transformer model, identify the current respiratory state, which includes a stable state and an abnormal state, and adjust the width of the gating window and the trigger enable condition in conjunction with the dynamic early trigger time.

[0011] The closed-loop correction module is used to monitor the timing deviation between the actual beam response time of the accelerator and the preset command, and uses the timing deviation as a feedback quantity to correct the delay mapping relationship online.

[0012] In a preferred embodiment, the multi-source acquisition module is specifically used to: acquire multi-channel body surface displacement signals by placing a multi-channel respiratory displacement sensor on the patient's chest and abdomen, filter and align with timestamps to remove abnormal data points, and perform weighted fusion and normalization processing on the multi-channel signals to obtain respiratory signals. At the same time, it reads the gantry angle, dose rate set value and radio frequency system warm-up time from the accelerator control bus, and synchronously forms a multi-dimensional data frame with the respiratory signal.

[0013] In a preferred embodiment, the abnormal data points are identified by using a sliding median filter window to determine sampling points whose amplitude deviates from the median within the window by more than a preset threshold as invalid interference data.

[0014] In a preferred embodiment, the time-series prediction module is specifically used to: extract normalized respiratory signal amplitudes from multiple consecutive sampling points in the multidimensional data frame to construct a respiratory time-series observation window, and input it into a pre-trained Transformer model; the Transformer model includes an encoder and a decoder, the encoder performs global context encoding on each time point within the observation window through a multi-head self-attention mechanism, the decoder generates respiratory signal prediction values ​​for a future preset time period based on the encoding features through autoregression, and then maps the respiratory signal prediction values ​​to a tumor three-dimensional spatial location prediction sequence through a pre-established body surface-tumor association model.

[0015] In a preferred embodiment, the length of the respiratory timing observation window covers at least three complete respiratory cycles.

[0016] In a preferred embodiment, the delay matching module is specifically used to: before treatment, measure the actual response delay of the accelerator from the issuance of the beam output command to the attainment of a steady-state preset ratio of the radiation intensity under combined operating conditions of different gantry angles, different dose rate settings, and different radio frequency preheating times, and establish a discrete delay calibration table; during treatment, obtain the estimated beam response delay value from the discrete delay calibration table through multidimensional interpolation based on the current operating condition parameters.

[0017] In a preferred embodiment, the early triggering module is specifically used to obtain the allowable displacement range of the target area in the main motion direction from the treatment planning system, determine the crossing time of the tumor entering and leaving the displacement range according to the tumor three-dimensional spatial position prediction sequence, calculate the precise time of the tumor entering and leaving the target area through linear interpolation, subtract the estimated beam response delay value from the precise time to obtain the dynamic early beam opening trigger time and the dynamic early beam closing trigger time, and generate preset commands for beam exit and beam closing.

[0018] In a preferred embodiment, the state gating module is configured to: extract the attention weight vector of the current time to the historical time from the encoder self-attention weight of the Transformer model; calculate the entropy value of the attention weight vector as the respiratory state discrimination feature; compare the entropy value with a preset stable entropy threshold range; if the entropy value is within the stable entropy threshold range, it is determined to be a stable state; otherwise, it is determined to be an abnormal state.

[0019] In a preferred embodiment, the state gating module is further configured to: forcibly disable the enable in an abnormal state to suspend beam triggering until the entropy values ​​of multiple consecutive sampling points recover to the range of the stable entropy threshold and the predicted trajectory stably enters the adaptive gating window, before releasing the trigger lock.

[0020] In a preferred embodiment, the closed-loop correction module is specifically used for: acquiring real-time dose rate signals through a penetrating ionization chamber located at the accelerator beam exit port; taking the moment when the dose rate signal first rises to 50% of the current steady-state dose rate as the actual beam establishment moment and the moment when it first falls to 50% of the steady-state dose rate as the actual beam shutdown moment; calculating the deviation between the actual beam establishment moment and the dynamic early beam opening trigger moment, and the deviation between the actual beam shutdown moment and the dynamic early beam shutdown trigger moment, respectively; taking the average of the two deviations as the delay correction error; updating the bias correction term using a first-order recursive smoothing method; and superimposing the updated bias correction term onto the estimated beam response delay value.

[0021] The technical effects and advantages of this invention are as follows:

[0022] 1. This invention addresses the problem of inaccurate prediction compensation and uncontrolled dose at the target edge caused by the inherent delay of radiotherapy equipment fluctuating with operating conditions. By synchronously collecting multi-dimensional operating condition parameters and estimating beam response delay online, and combining Transformer's full-cycle modeling and future trajectory prediction of long-term respiratory signals, the predicted trajectory and dynamic delay are aligned ahead of time on the time axis to generate adaptive early triggering commands. At the same time, attention mechanism is used to identify respiratory state to adjust the gating window width and triggering conditions in real time, and a closed-loop feedback of beam response deviation is introduced to correct the delay estimation. This achieves accurate delay compensation throughout the treatment course, precise irradiation of the tumor target area, and protection of normal tissue, taking into account both treatment efficiency and irradiation safety. Attached Figure Description

[0023] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings;

[0024] Figure 1 This is a module connection diagram of the system according to an embodiment of the present invention. Detailed Implementation

[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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 are within the scope of protection of the present invention.

[0026] Example: The present invention provides, as follows Figure 1 The radiotherapy advance adaptive gating system based on Transformer respiratory prediction shown includes a multi-source acquisition module, a timing prediction module, a delay matching module, an advance triggering module, a state gating module, and a closed-loop correction module.

[0027] The multi-source acquisition module is used to acquire the patient's respiratory signal and simultaneously acquire the current operating parameters of the accelerator. The operating parameters include at least the gantry angle, dose rate setpoint, and radio frequency system warm-up time.

[0028] The time-series prediction module is used to process the respiratory signal using a pre-trained Transformer model, learn the long-term fluctuation pattern across multiple respiratory cycles, and output the predicted trajectory of tumor movement within a preset time period in the future.

[0029] The delay matching module is used to determine the estimated value of the beam response delay of the accelerator under the current state based on the operating condition parameters and a pre-calibrated delay mapping relationship. The delay mapping relationship can be adaptively corrected as the operating conditions change.

[0030] The advance triggering module is used to align the predicted tumor motion trajectory with the estimated beam response delay on the time axis, calculate the dynamic advance triggering time that makes the ray establishment time coincide with the tumor arrival time, and generate preset commands for beam output and beam termination accordingly.

[0031] The state gating module is used to extract respiratory state discrimination features from the Transformer model, identify the current respiratory state, which includes a stable state and an abnormal state, and adjust the width of the gating window and the trigger enable condition in conjunction with the dynamic early trigger time.

[0032] The closed-loop correction module is used to monitor the timing deviation between the actual beam response time of the accelerator and the preset command, and uses the timing deviation as a feedback quantity to correct the delay mapping relationship online, so as to continuously calibrate the delay estimation and advance triggering amount of subsequent cycles in a closed-loop manner.

[0033] In this embodiment of the invention, the patient's respiratory signal is acquired, and the current operating parameters of the accelerator are simultaneously collected. These operating parameters include at least the gantry angle, dose rate setpoint, and radio frequency system warm-up time. Specifically:

[0034] Capacitive respiratory displacement sensors were placed at the level of the patient's sternal angle and 2 cm above the umbilicus, respectively, at a sampling frequency of [missing information]. Simultaneously acquire the simulated surface displacement signal of the first channel. Second channel body surface displacement simulation signal ; will the and Converted into a digital sequence by a 24-bit analog-to-digital converter, and then passed through a cutoff frequency. A second-order Butterworth low-pass filter was used to remove high-frequency muscle tremors and power frequency interference, resulting in the first channel respiratory signal. Second channel respiratory signal ;

[0035] The angle value output from the rack rotary encoder is read in real time from the accelerometer control bus. The resolution is And obtain the dose rate setpoint of the current irradiation pulse. Simultaneously, the cumulative warm-up time calculated by the RF drive module from the moment the electron gun filament current reaches the steady-state nominal value is read. ;

[0036] Based on the accelerator master clock, the following... , , , and Hardware timestamp alignment is performed, with alignment accuracy better than After alignment, for the first and second channels, a sliding median filter window is used to identify data points with abnormal amplitude jumps caused by instantaneous sensor detachment or bus packet loss. If the amplitude of a sampling point deviates from the median within the window by more than a preset median threshold, the sampling point is determined to be invalid interference data, which is then removed and filled in with linear interpolation. The weighted average of the respiratory signals of the first and second channels after removing invalid interference data is calculated to obtain the fused respiratory signal. ,in The fusion weights are determined based on the signal-to-noise ratio of the two channels during the quiet breathing calibration phase; the fused breathing signal is then processed. Normalization, with the normalization baseline being the baseline value collected at the end of expiratory breath-holding. With maximum inspiratory end amplitude The normalization formula is as follows: ;

[0037] Finally, a multidimensional data frame sequence of synchronous sampling is generated. ,in For the first The normalized respiratory signal amplitude corresponding to each sampling sequence number.

[0038] In this embodiment of the invention, a pre-trained Transformer model is used to process the respiratory signal, learn the long-term fluctuation pattern across multiple respiratory cycles, and output a predicted trajectory of tumor movement within a preset future time period, specifically:

[0039] Extract the normalized respiratory signal amplitude from L consecutive sampling points from the multidimensional data frame sequence. Construct a respiratory time series observation window of length L. ,in , To determine the length of the observation time window, take... seconds to cover at least One complete respiratory cycle The sampling frequency;

[0040] The respiratory timing observation window The input is a pre-trained Transformer encoder, which is composed of... The system consists of stacked multi-head self-attention modules and a feedforward network. Each layer transforms the input sequence as follows: First, H parallel scaled dot product self-attention heads are used to calculate the correlation weights between each time step in the input sequence. The output of the h-th attention head is... ,in , , These are the query matrix, key matrix, and value matrix, respectively. , , Let h be the learnable projection parameter matrix corresponding to the h-th head. The scaling factor is the dimension of the key vector.

[0041] The outputs of the H attention heads are concatenated and then linearly projected to obtain the final encoded feature sequence of the Transformer encoder. , where each encoded vector It integrates the weighted contextual information of all moments within the respiratory timing observation window to capture the amplitude drift trend, rhythm fluctuation pattern and baseline migration pattern across multiple respiratory cycles;

[0042] The encoded feature sequence The input is fed into a Transformer decoder, which uses a cross-attention mechanism to autoregressively generate predicted respiratory signal values ​​for the next P time steps, conditioned on the encoded features at the current moment. The number of prediction steps , The preset time period for the future can be 0.5 to 2.0 seconds;

[0043] Based on the predicted respiratory signal values ​​within the predetermined future time period, the predicted respiratory signal values ​​are mapped to a predicted sequence of three-dimensional spatial location of the tumor using a pre-established body surface-tumor association model. The surface-tumor correlation model is a mapping relationship between the respiratory phase and the displacement of the tumor centroid reconstructed by 4D-CT during the treatment planning stage. ,in For associative mapping functions;

[0044] It should be noted that, Linear scaling can be used. ,in The three-dimensional reference coordinates for the tumor centroid in the baseline end-expiratory position are provided. This corresponds to the normalized respiratory signal baseline at the end of expiration. This is a displacement-breathing scaling factor vector in three spatial dimensions. The displacement of the tumor centroid and the corresponding surface signal amplitude in the reconstructed images of each respiratory phase of 4D-CT were determined by linear regression fitting.

[0045] In this embodiment of the invention, based on the operating condition parameters, the estimated beam response delay of the accelerator in the current state is determined through a pre-calibrated delay mapping relationship. This delay mapping relationship can be adaptively corrected as the operating conditions change. Specifically:

[0046] Before the treatment system is officially put into clinical use, the delay mapping relationship is calibrated in accelerator quality control mode: at different gantry angles. (by For step length in to Take within range (sampling angle), different dose rate settings) (Covering M dose levels from the lowest available dose rate to the highest clinical dose rate) and different radiofrequency warm-up times (Sampling points are taken every 30 seconds after the filament is powered on, for a total of N time points) Under the combined operating conditions, the actual response delay from the issuance of the beam emission command to the moment when the radiation intensity reaches 90% of the steady-state value is measured at the isocenter point using a high-speed photodetector. Therefore, a discrete delay calibration table in the three-dimensional working condition parameter space is constructed. ,in , , ;

[0047] During the treatment process, the rack angle at the current moment is extracted from the multidimensional data frame sequence. Dose rate setpoint and RF warm-up time Using these three as query indexes in the discrete delay calibration table The beam response delay estimate in the current state is obtained through multidimensional linear interpolation. The expression for the multidimensional linear interpolation is: ,in, For linear interpolation weights in the rack angle dimension, when Falling into the range hour, , The weights of the indexes from other angles are zero; and Similarly, calculations were performed on the dose rate dimension and the preheating time dimension.

[0048] In this embodiment of the invention, the predicted tumor motion trajectory and the estimated beam response delay are aligned in advance on the time axis. A dynamic advance triggering time is calculated to ensure that the beam establishment time coincides with the tumor arrival time. Based on this, preset commands for beam output and beam termination are generated. Specifically:

[0049] Retrieve the allowable displacement range in the main direction of tumor movement for the current treatment phase from the treatment plan system. ,in The lower boundary of the target area is located in the direction of the main tumor movement. This refers to the upper boundary of the target area;

[0050] Based on the tumor three-dimensional spatial location prediction sequence With sampling interval Using a time step, the crossing status of the predicted tumor location with respect to the displacement interval is determined point by point: if the tumor is outside the displacement interval at the current moment, the first condition that satisfies this condition is searched from front to back in the prediction sequence. Enter index The precise moment when the tumor enters the target area is calculated using linear interpolation between the predicted point and the previous point: ,in, For the current moment, and These represent the tumor locations at two adjacent predicted points before and after crossing the target points;

[0051] If the tumor is currently within the displacement interval, then search the predicted sequence from front to back for the first tumor that satisfies this condition. leave index Similarly, calculate the precise moment when the tumor leaves the target area: ;

[0052] Obtain the estimated beam response delay value output from the previous step. Subtracting the estimated delay value from the precise time when the tumor enters the target area yields the dynamic advance beam-opening trigger time: ;

[0053] Similarly, by subtracting the estimated delay value from the precise time when the tumor leaves the target area, the dynamic early termination trigger time is obtained: ;

[0054] The dynamic early beam-opening trigger time and the dynamic early beam-closing trigger time are respectively converted to values ​​relative to the current time. The waiting time interval is calculated and written into the hardware timer module to generate a preset instruction sequence for setting the beam enable signal high and low; if the calculated... Then immediately issue a beam-opening preset command, if If so, a beam-off preset command is immediately issued to ensure that the beam switching time after delay compensation is precisely synchronized with the actual time when the tumor crosses the target area boundary.

[0055] In this embodiment of the invention, respiratory state discrimination features are extracted from the Transformer model to identify the current respiratory state, which includes a stable state and an abnormal state. Combined with the dynamic early triggering time, the width of the gating window and the triggering enable condition are adjusted, specifically:

[0056] Extract the normalized attention weight vector for each sampling time step from the self-attention weight matrix of the last layer of the Transformer encoder. And calculate the entropy value of the attention weight vector as a respiratory state discrimination feature: ,in The normalized attention weight for the current time to the i-th historical time is given by L, where L is the length of the breathing time series observation window. The more dispersed the attention distribution, the higher the entropy value, indicating that the model is integrating multi-period information to maintain stable prediction. The lower the entropy value, the more drastic the waveform change, indicating that the attention distribution is sharply concentrated in a few times.

[0057] The attention entropy value Compared with the preset lower bound of stationary entropy peace stationary entropy upper limit Compare and identify the current breathing state: If If the condition is met, then the current state is determined to be stable; if the condition is met... , If at least one of the following conditions is met, the current state is determined to be abnormal, and the abnormal state includes respiratory disturbance, coughing, or signal mutation caused by body position swaying;

[0058] Based on the respiratory status identification results, set the door control window width adjustment factor. When in a stable state, take To relax the width control of doors and windows, This is the gating window widening factor for stable conditions, with a value greater than 1. It is used to proportionally widen the upper and lower boundaries of the allowable displacement range of the target area when breathing is stable, thereby improving treatment efficiency. When in an abnormal state, it is set to... To narrow the width of the door-controlled window, The gating window contraction coefficient for abnormal states, with a value less than 1, is used to proportionally narrow the allowable displacement range of the target area during respiratory abnormalities, sacrificing treatment efficiency for irradiation accuracy, and avoiding accidental irradiation of surrounding normal tissues when the uncertainty of tumor trajectory prediction increases; the gating window width adjustment factor acts on the allowable displacement range of the target area to obtain the adaptive gating window boundary: , ,in As a reference position for the center of the target area, The base gate width is preset based on the target area movement range given in the treatment plan;

[0059] Based on the respiratory state identification results, combined with the dynamic advance triggering time and The trigger enable condition is set as follows: When in a stable state, the enable signal is enabled, allowing the normal execution of the beam opening and closing preset commands generated according to the dynamically advanced trigger time; when in an abnormal state, the trigger enable signal is forcibly disabled, immediately stopping any ongoing beam emission and pausing the issuance of all subsequent preset commands until continuous... The attention entropy value of each sampling point all dropped back to Only when the Transformer model's prediction sequence for the next P time steps within the interval is stably within the boundary of the adaptive gating window will the trigger enable lock be released and normal preset instruction execution resume.

[0060] In this embodiment of the invention, the timing deviation between the actual beam response time of the accelerator and the preset command is monitored, and the timing deviation is used as a feedback quantity to correct the delay mapping relationship online. This continuously calibrates the delay estimation and advance triggering amount for subsequent cycles in a closed-loop manner. Specifically:

[0061] A high-speed penetrating ionization chamber is placed at the accelerator beam exit point, at the aforementioned sampling frequency. Synchronous acquisition of real-time dose rate signals After the preset command triggers the beam opening, the real-time dose rate signal is continuously monitored. The changes will First rise to the current dose rate setting Corresponding steady-state dose rate 50% of the time is recorded as the actual beam establishment time. When the preset command is issued and the shutdown trigger is activated, it will... First drop to 50% of the time is recorded as the actual beam cut-off time. ,in , This is the calibration conversion factor for the ionization chamber to the accelerator output dose rate;

[0062] Extract the dynamic advance beam-opening trigger time corresponding to this beam-out cycle from the command record. With dynamic early termination trigger time Calculate the estimated values ​​of the actual beam setup delay and beam shutdown delay relative to the beam response delay. Timing deviation: , ,in The estimated beam response delay value determined based on the operating parameters under the current multidimensional linear interpolation is [value missing]. Establish the total delay for the actual measured beam. This represents the actual measured total beam shut-off delay;

[0063] The average of the beam-opening timing deviation and the beam-closing timing deviation is taken as the delay correction error for this cycle: ;

[0064] Set a first-order recursive bias correction term. Its initial value And it is updated exponentially smoothed after each beamout-off cycle: ,in The forgetting factor has a value range of 1. To smooth out short-term random fluctuations while tracking the slow drift of delay characteristics;

[0065] Update the bias correction term The delay estimate is superimposed on the beam response delay estimate obtained by the multidimensional linear interpolation to obtain the online corrected delay estimate. : ,in The original delay estimate is obtained by querying the discrete delay calibration table based on the current operating parameters and interpolating it; the online corrected delay estimate is then used to... Alternative This serves as the input for calculating the dynamic advance trigger time of the next cycle, thereby achieving closed-loop continuous calibration of the delay mapping relationship throughout the entire treatment process.

[0066] This invention simultaneously acquires respiratory signals and multi-dimensional operating parameters such as accelerator gantry angle, dose rate setpoint, and radio frequency warm-up time. Based on a pre-calibrated three-dimensional delay calibration table, it performs multi-dimensional linear interpolation to estimate the current beam response delay. This allows the delay estimate to adaptively adjust to changes in equipment operating conditions, eliminating the fixed bias introduced by traditional fixed delay constants in scenarios such as temperature drift and dose rate switching. It utilizes a Transformer model to perform global self-attention encoding on long-term respiratory signals covering multiple complete respiratory cycles, capturing baseline drift trends and rhythmic fluctuations that traditional short-term models cannot learn, enabling continuous prediction of tumor motion trajectories for the next 0.5 to 2 seconds. By aligning the predicted tumor motion trajectory with the online-updated beam response delay estimate on the time axis, it calculates the precise crossing times of tumor entry and exit from the target area boundary and subtracts the current delay, generating dynamically advanced beam opening and closing trigger times. This ensures that the stable establishment time of radiation intensity coincides precisely with the tumor's movement. The timing of beam arrival coincides with the timing of beam deactivation, which is synchronized with the timing of tumor departure. This fundamentally solves the problem of sharp dose reduction at the target area edge and overexposure of normal tissue caused by inaccurate delay compensation. Entropy values ​​are extracted from the Transformer's self-attention weights as a respiratory status discrimination feature to identify stable and abnormal respiratory states. Based on this, the gating window width and trigger enable conditions are dynamically adjusted. When breathing is stable, the irradiation window is automatically widened to improve treatment efficiency. When breathing is disordered, coughing occurs, or the body moves, the irradiation window is automatically narrowed or the trigger is forcibly locked to avoid mis-irradiation during signal chaos, thus balancing treatment efficiency and irradiation safety. The actual beam establishment and deactivation times of each beam output are monitored online through a high-speed penetrating ionization chamber. The timing deviation between the actual beam establishment and deactivation times is calculated and the preset command is calculated. The deviation is fed back to the delay estimate for online bias correction using a first-order recursive smoothing method. This forms a closed-loop continuous calibration of the delay mapping relationship, ensuring that the delay estimate always tracks the slow drift of the equipment status throughout the entire treatment course, thus guaranteeing the stability of the prediction compensation accuracy in long-term treatment.

[0067] This invention addresses the problem of inaccurate prediction compensation and uncontrolled dose at the target area edge caused by the inherent delay of radiotherapy equipment fluctuating with operating conditions. By synchronously collecting multi-dimensional operating condition parameters and estimating beam response delay online, and combining Transformer's full-cycle modeling and future trajectory prediction of long-term respiratory signals, the predicted trajectory and dynamic delay are aligned ahead of time on the time axis to generate adaptive early triggering commands. At the same time, attention mechanism is used to identify respiratory status to adjust the gating window width and triggering conditions in real time, and a closed-loop feedback of beam response deviation is introduced to correct the delay estimation. This achieves accurate delay compensation throughout the treatment course, precise irradiation of the tumor target area, and protection of normal tissue, balancing treatment efficiency and irradiation safety.

[0068] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0069] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0070] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0071] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0072] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An adaptive gating system for radiotherapy advance based on Transformer respiratory prediction, characterized in that: It includes a multi-source acquisition module, a time-series prediction module, a delay matching module, an early triggering module, a state gating module, and a closed-loop correction module; The multi-source acquisition module is used to acquire the patient's respiratory signal and simultaneously acquire the current operating parameters of the accelerator. The operating parameters include at least the gantry angle, dose rate setpoint, and radio frequency system warm-up time. The time-series prediction module is used to process the respiratory signal using a pre-trained Transformer model, learn the long-term fluctuation pattern across multiple respiratory cycles, and output the predicted trajectory of tumor movement within a preset time period in the future. The delay matching module is used to determine the estimated beam response delay of the accelerator in the current state based on the operating condition parameters and a pre-calibrated delay mapping relationship. The advance triggering module is used to align the predicted tumor motion trajectory with the estimated beam response delay on the time axis, calculate the dynamic advance triggering time that makes the ray establishment time coincide with the tumor arrival time, and generate preset commands for beam output and beam termination. The state gating module is used to extract respiratory state discrimination features from the Transformer model, identify the current respiratory state, which includes a stable state and an abnormal state, and adjust the width of the gating window and the trigger enable condition in conjunction with the dynamic early trigger time. The closed-loop correction module is used to monitor the timing deviation between the actual beam response time of the accelerator and the preset command, and uses the timing deviation as a feedback quantity to correct the delay mapping relationship online.

2. The adaptive gating system for radiotherapy advance based on Transformer respiratory prediction according to claim 1, characterized in that: The multi-source acquisition module is specifically used to: acquire multi-channel body surface displacement signals by placing a multi-channel respiratory displacement sensor on the patient's chest and abdomen, filter and align with timestamps to remove abnormal data points, and perform weighted fusion and normalization processing on the multi-channel signals to obtain respiratory signals. At the same time, it reads the gantry angle, dose rate set value and radio frequency system warm-up time from the accelerator control bus and synchronously forms a multi-dimensional data frame with the respiratory signal.

3. The adaptive gating system for radiotherapy advance based on Transformer respiratory prediction according to claim 2, characterized in that: The method for identifying abnormal data points is to use a sliding median filter window to determine sampling points whose amplitude deviates from the median within the window by more than a preset threshold as invalid interference data.

4. The adaptive gating system for radiotherapy advance based on Transformer respiratory prediction according to claim 2, characterized in that: The time-series prediction module is specifically used to: extract normalized respiratory signal amplitudes from multiple consecutive sampling points in the multidimensional data frame to construct a respiratory time-series observation window, and input it into a pre-trained Transformer model; the Transformer model includes an encoder and a decoder, the encoder performs global context encoding on each time point within the observation window through a multi-head self-attention mechanism, the decoder generates respiratory signal prediction values ​​for a future preset time period based on the encoding features through autoregression, and then maps the respiratory signal prediction values ​​to a tumor three-dimensional spatial location prediction sequence through a pre-established body surface-tumor association model.

5. The adaptive gating system for radiotherapy advance based on Transformer respiratory prediction according to claim 4, characterized in that: The length of the respiratory timing observation window covers at least three complete respiratory cycles.

6. The adaptive gating system for radiotherapy advance based on Transformer respiratory prediction according to claim 1, characterized in that: The delay matching module is specifically used to: before treatment, measure the actual response delay of the accelerator from the issuance of the beam output command to the arrival of the steady-state preset ratio of the radiation intensity under combined conditions of different gantry angles, different dose rate settings and different radio frequency preheating times, and establish a discrete delay calibration table; during treatment, obtain the estimated beam response delay value from the discrete delay calibration table through multidimensional interpolation based on the current operating parameters.

7. The adaptive gating system for radiotherapy advance based on Transformer respiratory prediction according to claim 1, characterized in that: The advance triggering module is specifically used to obtain the allowable displacement range of the target area in the main motion direction from the treatment planning system, and determine the crossing time of the tumor entering and leaving the displacement range according to the tumor three-dimensional spatial position prediction sequence. The precise time of the tumor entering and leaving the target area is calculated by linear interpolation. The precise time is subtracted from the estimated beam response delay value to obtain the dynamic advance beam opening trigger time and the dynamic advance beam closing trigger time, and the preset commands for beam exit and beam closing are generated.

8. The adaptive gating system for radiotherapy advance based on Transformer respiratory prediction according to claim 1, characterized in that: The state gating module is configured to: extract the attention weight vector of the current time to the historical time from the encoder self-attention weight of the Transformer model, and calculate the entropy value of the attention weight vector as the breathing state discrimination feature; The entropy value is compared with a preset stable entropy threshold range. If the entropy value is within the stable entropy threshold range, it is determined to be a stable state; otherwise, it is determined to be an abnormal state.

9. The adaptive gating system for radiotherapy advance based on Transformer respiratory prediction according to claim 8, characterized in that: The state gating module is further configured to: forcibly disable the enable in an abnormal state to suspend beam triggering until the entropy values ​​of multiple consecutive sampling points recover to the range of the stable entropy threshold and the predicted trajectory stably enters the adaptive gating window, at which point the trigger lock is released.

10. The adaptive gating system for radiotherapy advance based on Transformer respiratory prediction according to claim 1, characterized in that: The closed-loop correction module is specifically used to: collect real-time dose rate signals through a penetrating ionization chamber set at the accelerator beam outlet, and take the moment when the dose rate signal first rises to 50% of the current steady-state dose rate as the actual beam establishment moment, and the moment when it first falls to 50% of the steady-state dose rate as the actual beam shutdown moment. The deviations between the actual beam establishment time and the dynamic early beam opening trigger time, and the deviations between the actual beam closing time and the dynamic early beam closing trigger time are calculated respectively. The average of the two deviations is taken as the delay correction error. The bias correction term is updated using a first-order recursive smoothing method, and the updated bias correction term is superimposed on the estimated beam response delay value.