Skip to main content
Wiley Open Access Collection logoLink to Wiley Open Access Collection
. 2025 Aug 18;95(1):286–298. doi: 10.1002/mrm.70044

Modeling the MRI gradient system with a temporal convolutional network: Improved reconstruction by prediction of readout gradient errors

Jonathan B Martin 1,, Hannah E Alderson 1,2, John C Gore 1,2,3, Mark D Does 1,2,3, Kevin D Harkins 1,2
PMCID: PMC12620175  PMID: 40826892

Abstract

Purpose

Our objective is to develop a general, nonlinear gradient system model that can accurately predict gradient distortions using convolutional networks.

Methods

A set of training gradient waveforms were measured on a small animal imaging system and used to train a temporal convolutional network to predict the gradient waveforms produced by the imaging system.

Results

The trained network was able to accurately predict nonlinear distortions produced by the gradient system. Network prediction of gradient waveforms was incorporated into the image reconstruction pipeline and provided improvements in image quality and diffusion parameter mapping compared to both the nominal gradient waveform and the gradient impulse response function.

Conclusion

Temporal convolutional networks can more accurately model gradient system behavior than existing linear methods and may be used to retrospectively correct gradient errors.

Keywords: image reconstruction, diffusion MRI, machine learning, deep learning, temporal convolutional network, noncartesian trajectory, time series forecasting, gradient correction

1. INTRODUCTION

Magnetic resonance imaging (MRI) pulse sequences frequently incorporate time‐varying gradient waveforms that put great demands on associated gradient hardware. Examples include gradient waveforms for non‐Cartesian imaging, 1 , 2 selective excitation localization, 3 , 4 or diffusion encoding. 5 , 6 These applications require high fidelity of the gradient system, as distortions of the gradient waveform reduce image quality, for example, causing artifacts after reconstruction 7 or distortion of the excitation profile 8 .

Gradient distortions may be linear or nonlinear in nature. For example, system group delays 9 and system bandwidth limitations result in waveform distortions that are time‐invariant and linear in both spatial and time dimensions. Eddy current field distortions are temporally linear, but may be spatially nonlinear. 10 , 11 Other distortions are known to be more challenging to correct and may be the product of system characteristics which are not linear‐time invariant (LTI). Additionally, gradient amplifiers themselves are nonlinear devices. Gradient amplitude, slew rate, and acceleration constraints imposed by the hardware are nonlinear effects. Other nonlinear amplifier distortions can occur within the normal operating range, such as amplifier droop 12 or zero‐crossing distortions in two‐stage push‐pull amplifiers such as the H‐bridge, which are popular in gradient amplifier design. 13 , 14 Further, gradient hardware heating results in a time‐varying gradient system response 15 , 16 and vibrations due to mechanical resonances can produce nonlinear field distortions. 17

One strategy to improve the fidelity of the gradient system is to directly measure the gradient waveforms—either through pulse sequence methods 18 , 19 or with monitoring hardware 20 , 21 —and then use the measured gradient trajectories to improve image reconstruction and/or RF pulse design. While this approach is accurate, it can be time consuming, requiring calibration scans to be acquired when there is any modification to the gradient waveforms. Furthermore, gradient monitoring hardware incurs an additional system expense.

An alternative approach is to create a system model of the gradient hardware chain, which may then be used for retrospective correction, 22 , 23 or to prospectively design pre‐emphasized gradient waveforms that produce nominal temporal gradient waveforms after they are corrupted by the system. 24 Most modern MRI systems provide methods to prospectively compensate for group delay and eddy currents. 9 , 25 , 26 , 27 , 28

More recently, a LTI model such as the gradient impulse response function (GIRF) or the equivalent frequency domain gradient system transfer function (GSTF) has been proposed 21 , 29 , 30 to model the gradient system. However, these linear models are incapable of accurately correcting the behavior of a gradient system which is not linear time‐invariant (LTI). In some systems, nonlinear behavior may be particularly pronounced and severely impact image quality despite GIRF correction. 12 , 31 , 32 Attempts have been made to expand the GIRF model to account for nonlinear temperature effects, 16 but this model is still an adaptation of the original linear model and is incapable of properly characterizing nonlinear behavior.

In contrast, deep learning networks provide an opportunity to predict nonlinear artifacts of the gradient system. Recurrent neural networks such as the long short‐term memory (LSTM) architecture have previously been used 33 , 34 , 35 , 36 for sequence modeling. Convolutional neural network (CNN) architectures have been shown to have some advantages over recurrent networks in this area in terms of reduced memory and time costs, easier parallelization in training, and improved stability and generalization in many cases. 37 , 38 , 39 In particular, temporal convolutional networks (TCN) 40 have had success in modeling complex physical systems. 39 , 41 , 42 Despite the popularity of deep learning approaches for time‐series forecasting and prediction in nonlinear systems, there has been only preliminary work on deep learning‐based modeling of MRI gradient systems. 36 Hence, the application of deep learning to this problem and the demonstration of real‐world applicability of deep learning models has yet to be fully assessed.

To overcome the shortcomings of LTI methods for the modeling of gradient systems and to build upon previous work investigating nonlinear corrections for gradient errors, 36 we investigate a learned model of the full gradient system to predict readout gradient waveforms. The model is created using pulse‐sequence‐based measurements of a training library of gradient waveforms. We show that a learned model of the gradient system can accurately predict gradient waveform shapes not seen in the training process, demonstrating the feasibility of applying learned models to real‐world MRI systems. The utility of the model for improving the quality of the reconstructed image and the estimation of quantitative parameters is demonstrated on a preclinical 7 Tesla system.

2. METHODS

We examined the feasibility of using a neural network to predict gradient waveform errors and the effectiveness relative to established linear methods. First, a library of gradient waveforms was measured to characterize the gradient system response. These measurements were used to construct both a linear (GIRF) and neural network‐based (TCN) model of the gradient system. Both models were used to predict readout gradient errors, and the predicted gradient waveforms were used in the reconstruction of multi‐shot spin‐echo images and diffusion parameter maps.

All MR experiments were performed on a 7T 16 cm bore Bruker Biospin Avance III HD small animal scanner (Bruker BioSpin GmbH & Co. KG, Ettlingen, Germany). A 38 mm transmit/receive quadrature volume coil was used for RF excitation and reception. The scanner is equipped with actively shielded gradients with a maximum gradient strength of 770 mT/m and rise times of 146 µs to full amplitude. Built‐in eddy current compensation was enabled for all experiments.

2.1. Training and validation gradient waveform collection

A library of 18 gradient waveforms was designed to characterize the response of the gradient system and provide training and validation data for the network. Data files with all training waveforms are stored at the following link: https://github.com/jonbmartin/tcn_gradient_prediction. The training and validation gradient waveforms contained realistic readout waveforms for imaging, such as spiral and trapezoidal waveforms, and additional waveforms designed to characterize the response of the system, such as chirps, multisines, and triangle waveforms. 21 11 waveforms were assigned to the training dataset and 7 were withheld for validation. The training set primarily consisted of system characterization (nonimaging) waveforms, while the validation set included primarily imaging waveforms. The readout waveforms used in the imaging experiments comprised a third distinct test dataset, nonoverlapping with the validation set.

All gradient waveforms were measured on all 3 gradient axes using a previously established pulse‐sequence based method. 19 Measurements were performed using a homogeneous 5 mL spherical phantom filled with a 5 mM CuSO4 solution. The variable pre‐phasing sequence had TE/TR = 10.8/500 ms and used 8 variable pre‐phasing steps across 9 slices with a thickness of 0.35 mm. 15 gradient waveform amplitudes uniformly distributed in the range [70, 700] mT/m were measured for waveforms in the training dataset, which resulted in a scan time of 8 minutes/waveform. Only 7 gradient waveform amplitudes in the same range were measured for validation waveforms, which resulted in a scan time of 3 m 44 s/waveform. Final training/validation split of the data based on the total number of measured time points of data in each dataset was 76% train, 24% validation. The total scan time to measure all amplitudes for 11 unique training waveforms and 7 unique validation waveforms on all 3 gradient axes was 5 h 42 m. Gradient waveforms from the training dataset were used to form a GIRF model 21 of the gradient system for all 3 axes. Unlike in the original GIRF method 21 gradient waveforms were measured using a pulse‐sequence based method 19 rather than with a dynamic field camera.

Examples of measured gradient validation waveforms are given in Figure 1, including a spiral readout waveform (A) with zero‐crossing nonlinearities that are amplitude dependent (C). Similarly, a chirp waveform is also shown (B), exhibiting amplitude dependent variations in the magnitude and group delay of the measured response waveform (D).

FIGURE 1.

FIGURE 1

Spiral and chirp gradient waveforms measured on the 7T Bruker system, with conspicuous nonlinearities. Waveform timecourses are normalized by their respective maximum nominal amplitudes. (A,B) show the nominal waveforms with zoomed‐in ROI highlighted. (C,D) show the nominal and measured waveforms at several different amplitudes. Clear nonlinearities are present. In (C) the two waveforms are not simply scaled copies of one another but have distinct zero crossing artifacts. In (D), the response varies with amplitude of the applied waveform. Delay and attenuation increase with decreasing amplitude.

2.2. Network architecture and training

The TCN architecture used for gradient waveform prediction is shown in Figure 2 and follows the architecture of a multistage TCN outlined in Ref. [ 37 ]. This TCN takes in a window of size [Nt,2], containing Nt samples of the normalized [‐1, 1] nominal gradient waveform and the system's scaling of the gradient waveform also normalized to [‐1, 1] at each time point (typically constant for a given gradient pulse). This formatting was chosen to prevent dynamic range issues due to large differences in waveform scaling within the dataset, either in input value or target value. 43 The fundamental building block of the TCN is the causal convolution layer— a 1D convolution layer of size T which uses a kernel of size k incorporating only previous time points in the calculation of output values in order to preserve the temporal order of data. To capture long‐time dependencies, a dilated convolution is used, which allows the receptive field of the convolution to grow exponentially without a corresponding increase in model size or computational cost. Two causal convolutions are concatenated within residual blocks, with weight normalization, a GELU activation layer, 44 and a dropout layer following each convolution. Residual blocks also incorporate a 1D convolution with a small k=1 kernel that bypasses the causal convolutions. The full TCN consists of Nres cascaded copies of these residual blocks. A final linear layer returns the normalized gradient sample prediction at time point t. The network was trained using a mean absolute error loss of the prediction values.

FIGURE 2.

FIGURE 2

The temporal convolutional network architecture 37 used in this work. The TCN consists of multiple concatenated residual blocks. Each residual block consists of two layers of causal convolution, each followed by weight normalization, GeLU activation, and a dropout layer. A 1D residual convolution bypasses the causal convolution layers. The causal convolution prevents violations in causality of the data by forcing convolution outputs to only have dependencies on prior timepoints.

To find optimal network hyperparameters within this architecture, a hyperparameter optimization was performed using the Optuna toolbox 45 with the measured train and test waveforms. The default Tree‐structured Parzen Estimator algorithm was used to find optimal hyperparameters. The final network hyperparameters were Nres = 5, k = 16, dropout probability= 0.2, and T = 48. We used an exponential dilation for the convolutional layers of d=2i for the ith residual block. Optimizer hyperparameters for an Adam optimizer were a learning rate of 8.4×104, a batch size of 32, a weight decay of 9×108, β1=0.9, β2=11×106. All other parameters used were PyTorch defaults. Using these hyperparameters, the network was trained for 150 epochs, with a unique model trained for each gradient axis.

A long short‐term memory (LSTM) recurrent network 33 , 34 , 35 , 36 was also examined to assess the viability of alternative network architectures that are used for time‐series forecasting tasks. The Optuna toolbox was again used to perform a hyperparameter optimization, which produced the following optimal network: 2 layers with hidden layer size 96, learning rate of 8.5×104, a batch size of 32, a weight decay of 2×108, β1=0.8, and β2=0.99. All other parameters used were PyTorch defaults. Using these hyperparameters, this network was also trained for 150 epochs. As discussed in later sections, comparable but slightly inferior performance was observed with the LSTM network as compared with the TCN, so it was not used in further studies.

Training and validation were performed on a Nvidia RTX A5000 GPU (Nvidia Corporation, Santa Clara, CA, USA) with 24 GiB memory. Training each gradient axis model took approximately 2 hours. Test waveform prediction (multishot spiral and rosette) was performed on a local System76 (System76, Inc., Denver, CO, USA) Adder CPU workstation with 5.4 GHz Intel i9‐13900HX and 64 GB RAM. Prediction time for all 80 spiral in‐out gradient waveforms (40 shots with 2 waveforms per shot) was 18.27 s or 0.23 s/waveform. Prediction time for the rosette readouts (also 80 waveforms) was 22.02 s or 0.28 s/waveform. We have made network code and a library of training, validation, and test gradient waveforms available at https://github.com/jonbmartin/tcn_gradient_prediction. A table summarizing the waveforms used can be found in the GitHub repository or in the online supplemental materials as Table S1.

2.3. Imaging experiments

Images were acquired of a phantom and an ex‐vivo ferret brain. The phantom consisted of a plastic toy brick embedded in a mixture of CuSO4×2H2O salt solution (1 g/L) and agar gel (10 g/L) (Bruker standard phantom: T10681). After euthanasia in compliance with a protocol approved by the Vanderbilt University Insitutional Animal Care and Use Committee, the ferret brain was first perfused with 1L of chilled phosphate buffered saline (PBS, 1X) with 47.6 mg of heparin and then with 1L 2% PFA, 2.5% glutaraldehyde in 1X PBS with 47.6 mg of heparin and 0.25 mM of gadolinium (ProHance). Tissues were post fixed and then stored long term in 1X PBS, 1 mM gadolinium, and 0.01% sodium azide prior to imaging.

Two different multi‐shot noncartesian readout trajectories were used for imaging. The first was a 40‐shot spiral‐in‐out trajectory (with a readout duration of 5.27 ms), and the second was a 40‐shot 5‐petal rosette trajectory (with a readout duration of 6.71 ms). 46 These trajectories were chosen for this study because it was anticipated that they would be highly sensitive to gradient distortions. This is due to both trajectories requiring a pass through the center of k‐space late in the trajectory, which allows for gradient errors to accumulate resulting in inaccurate measurement of high‐signal regions of k‐space. These readout trajectories were incorporated into a multi‐shot spin echo pulse sequence (TR/TE=1000/10 ms, FOV=30×30 mm, and 0.3×0.3×0.5 mm resolution). In the ferret brain, a multi‐shot spin‐echo DTI sequence (TR/TE=1000/20 ms, FOV=30×30 mm, 6 diffusion encoding directions, and b = 1000 s/mmInline graphic) was also acquired. Imaging was repeated without diffusion encoding gradients. In all cases, 15 axial slices were acquired.

2.4. Image reconstruction and diffusion analysis

Reconstruction was repeated using nominal, GIRF‐predicted, TCN‐predicted, and measured trajectories. Raw signal was density compensated 47 and gridded based upon the estimated k‐space trajectories. B0 maps were derived from the multi‐shot rosette spin echo pulse sequence data 48 and incorporated into reconstruction using a time‐segmented off‐resonance correction. 49

DTI parameters were estimated with weighted linear least squares fitting 50 using the REMMI‐Matlab toolbox (https://remmi‐toolbox.github.io/). 51 The mean diffusivity (MD), fractional anisotropy (FA), radial diffusivity (RD), and axial diffusivity (AD) were estimated for images acquired with each trajectory.

3. RESULTS

Figure 3 shows the NRMSE between the predicted waveforms and the measured waveforms for individual pulses in the validation set. Models created for all 3 gradient axes are shown. GIRF estimates of gradient waveform distortions reduced time‐domain waveform error on all three axes, while using either TCN or LSTM models further reduced time‐domain waveform error. Mean NRMSE for the nominal waveforms was Gz = 4.19×103, Gy = 2.53×103, and Gx = 2.92×103. Mean NRMSE for the GIRF‐predicted waveforms was Gz = 7.21×104, Gy = 1.20×103, and Gx = 1.01×103. Mean NRMSE for the LSTM‐predicted waveforms was Gz = 1.82×104, Gy = 1.45×104, and Gx = 1.66×104. Mean NRMSE for the TCN‐predicted waveforms was Gz = 1.55×104, Gy = 1.04×104, and Gx = 1.08×104. Overall, the TCN gradient system model produced the lowest error for waveforms on all three axes.

FIGURE 3.

FIGURE 3

Violin plot of NRMSE for individual validation set waveforms, for the nominal waveform and for each model (GIRF, LSTM, and TCN) on each axis (z, y, x). The GIRF reduces waveform error by approximately one order of magnitude, with either LSTM or TCN modeling reducing error by approximately one additional order of magnitude.

Figure 4 highlights time‐domain errors between the measured and predicted waveform in the same chirp waveform as Figure 1. The GIRF reduced waveform error, but struggled to accurately characterize the nonlinearities in the system response—including both the zero‐crossing distortions shown in the bottom left panels of Figure 4 and the changing system response with input waveform frequency, which manifested primarily as a reduction in measured waveform amplitude relative to input waveform at higher frequencies, shown in the bottom right panels of Figure 4. The TCN model is better able to account for both of these phenomena. RMSEs of the nominal, GIRF‐predicted, and TCN‐predicted trajectories were 34.43, 6.08, and 0.63 mT/m, respectively.

FIGURE 4.

FIGURE 4

Gradient waveforms for each prediction method, on validation‐set chirp waveform. Top: Full nominal, GIRF‐predicted, TCN‐predicted, and measured gradient waveforms, and errors (Δ). Boxes indicate ROIs below. Bottom left: Zoomed in 0.25 ms time segment of waveform and errors, exhibiting zero‐crossing nonlinearity. Bottom right: zoomed in 0.25 ms time segment of waveform and errors, exhibiting errors that the GIRF does not accurately predict.

Figure 5 shows the k‐space trajectory estimates and errors for a representative single shot of the spiral and rosette readout waveforms used in the imaging experiments. The GIRF and TCN models both predicted a trajectory that was more accurate to the measured values than the nominal trajectory, but the TCN had a greater error reduction than the GIRF. Mean RMSE values in normalized k‐space units across all 40 spiral shots were (2.23±0.12)×102, (1.38±0.64)×102, and (0.82±0.12)×102 for the nominal, GIRF‐predicted, and TCN‐predicted trajectories. Mean RMSE values across all 40 rosette shots were (1.96±0.13)×102, (1.10±0.08)×102, and (0.45±0.21)×102 for the nominal, GIRF‐predicted, and TCN‐predicted trajectories.

FIGURE 5.

FIGURE 5

Measured k‐space trajectories and trajectory errors for one of the 40 shots of the rosette and spiral trajectory readouts, normalized to the maximum k‐space coordinate. (A,B) show full trajectories, (C,D) zoomed in regions on each trajectory, (E,F) 2D k‐space errors for nominal, GIRF‐predicted, and TCN‐predicted trajectories.

Figure 6 shows magnitude and error images from the phantom acquisitions, reconstructed with all trajectory estimation methods for the rosette and spiral trajectories. Image errors are pixel‐wise differences normalized by maximum image intensity. Images reconstructed with the nominal trajectory in both cases exhibited severe artifacts, with dramatic signal intensity dropoff in the periphery of the phantom and hyperintensity in the center. Severe background aliasing was present in both cases. The GIRF‐based reconstruction improved both of these errors, but the TCN based reconstruction resulted in far less signal loss in the phantom.

FIGURE 6.

FIGURE 6

Phantom images acquired with spiral and rosette readout waveform, reconstructed from nominal, GIRF predicted, TCN predicted, and measured readout waveforms, with the percent signal difference from the measured value shown for each image. Difference images are scaled to ±60% of the maximum intensity in the measured image. RMSE of images normalized by maximum overall signal is reported.

The anatomical images of the ferret brain acquired with the spiral trajectory are shown in Figure 7, and the anatomical images of the ferret brain acquired with the rosette trajectory are shown in Figure 8, with three representative slices from each trajectory. As in the phantom images, severe distortions were present in the images reconstructed using the nominal trajectory. The spiral images exhibited severe blurring, while the rosette images primarily had signal intensity artifacts with signal build‐up in the center of the image and a ring of signal loss in the periphery. Reconstruction with GIRF‐estimated trajectories only partially resolved these effects. Blurring distortions were still evident in the spiral trajectory case, and signal hyperintensities and hypointensities were still present in the rosette trajectory case. Reconstruction with the TCN‐predicted trajectories produced images that are much closer to those reconstructed using the measured trajectories, although some artifacts were still present which were not seen in the measured‐trajectory images.

FIGURE 7.

FIGURE 7

(L) Ex‐vivo ferret brain magnitude images acquired with a spiral acquisition, for 3 evenly spaced slices. Reconstructions based on the nominal trajectory, GIRF‐predicted trajectory, TCN‐predicted trajectory, and measured trajectory are shown. (R) Difference images with respect to the measured‐trajectory image. Difference images are scaled to ±75% of the maximum intensity in the measured image. RMSE of images normalized by maximum overall signal are reported.

FIGURE 8.

FIGURE 8

(L) Ex‐vivo ferret brain magnitude images aquired with a rosette acquisition, for 3 evenly spaced slices. Reconstructions based on the nominal trajectory, GIRF‐predicted trajectory, TCN‐predicted trajectory, and measured trajectory are shown. (R) Difference images with respect to the measured‐trajectory image. Difference images are scaled to ±75% of the maximum intensity in the measured image. RMSE of images normalized by maximum overall signal are reported.

Diffusion parameter maps in the ferret brain are shown in Figure 9A,B for spiral and rosette acquisitions, respectively. The severe distortions present in the images reconstructed with the nominal trajectories created biased and noisy diffusion parameters in the periphery of the brain in both cases. GIRF‐ and TCN‐based reconstructions both remediated the most severe errors in parameter estimation. However, diffusion analysis with the GIRF‐predicted trajectory images still had a number of significant discrepancies with the parameter maps reconstructed using the measured images. The most notable distortion in the GIRF‐reconstructed spiral image was the loss of several white matter tract structures in the FA and RD maps. In the rosette images, the failure of the GIRF to fully resolve signal loss around the periphery of the brain resulted in overestimates of FA and AD and underestimates of RD and MD in those regions. In both cases, reconstruction with TCN‐predicted trajectories produced parameter maps that corresponded more closely to those created using the measured trajectories.

FIGURE 9.

FIGURE 9

A) Spiral acquired diffusion parameter maps for slice #1 in Figure 7. (B) Rosette acquired diffusion parameter maps for slice #1 in Figure 8. MD, FA, RD, and AD are shown for images reconstructed using the nominal, GIRF‐predicted, TCN‐predicted, and measured trajectories.

Figure 10 shows the correlation between diffusion parameters reconstructed using the measured trajectory (taken to be a “ground truth” image) and those reconstructed using the predicted trajectories, for the entire ex vivo ferret brain acquisition. In all cases, the correlation with parameters estimated from measured trajectory values is strongest when the TCN is used to predict the gradient trajectories.

FIGURE 10.

FIGURE 10

Diffusion parameter correlation between the measured trajectory (“ground truth”) values and values derived from reconstruction with various trajectory prediction methods. Individual plots are a kernel density estimation of pixel‐wise parameter values thresholded at 0.05, with correlation coefficient reported.

4. DISCUSSION

These results demonstrate the ability of temporal convolutional networks to accurately predict nonlinear imperfections in the gradient system of a small animal MRI system. We show that incorporating these gradient waveform estimates into the reconstruction process provides downstream improvements in image quality and quantitative parameter estimates.

We contribute further evidence to the body of work demonstrating that nonlinearities in MRI gradient systems can deviate from linear time‐invariant system responses. We document several temporal nonlinearities including zero‐crossing distortions and variable responses to waveform scaling. Such temporal nonlinearities are typically relatively small in clinical systems operating well within their gradient systems' design parameters. 22 However, nonlinearities may be more substantial in preclinical systems with high performance gradients, 32 , 52 or systems with relatively low‐performance gradient hardware. 12 , 53 Furthermore, even in clinical systems, trajectory errors may be substantial and nonlinear if challenging or nonstandard gradient waveforms are used. 54 , 55 , 56 Thus, a general model of the gradient system which makes no assumptions about linearity or time invariance is highly desirable.

The GIRF and GSTF provide excellent correction of gradient distortion when temporal nonlinearities are not significant, for example in more conventional Cartesian trajectories which rely on trapezoidal gradient waveforms. Linear distortion correction methods may be sufficient in these settings. The TCN method we introduce broadens the range of correctable gradient distortions, and likely has most additional utility in more challenging imaging readouts or in systems with more limited gradient hardware. We observe that the TCN model performs well in predicting Cartesian trajectory gradient waveforms, including the trapezoidal waveforms in our validation set and the trapezoidal waveforms prepended to the spiral in‐out test set waveforms. For Cartesian trajectories, either GIRF or TCN correction may be appropriate.

A lengthy scan session of several hours was used to collect training data for this study, and future work should be aimed at optimizing the library of gradient waveforms and scan time for initial training of such a model. This could include the design of waveforms optimized to provide the necessary characterization of the system in minimal scan time. Some waveforms are likely more important to include than others. For example, a slew rate‐constrained chirp (included in our training dataset), is highly desirable in that it covers a broad range of frequencies efficiently. Such a waveform may be more efficient in the improvements it provides to the model's generalization ability than, for example, a waveform with more limited spectral content such as a multisine (also included in our training data).

The model's ability to predict the gradient system's response to previously unseen gradient waveforms has the potential to eliminate the need for application‐specific scan‐time calibration sequences. Further, once a model is initially trained, a subset of waveforms can likely be used to update the model periodically. Previous work has shown that the responses of the gradient system remain relatively stable over time. 22

The TCN architecture was selected due to its excellence in capturing long‐term temporal relationships in time series data, 40 and its relative ease of training compared to recurrent neural networks. 37 , 38 Further optimization of the network architecture and comparison to other architectures appropriate for sequence modeling is possible.

Several limitations to this study should be noted. First, we created an independent model for each gradient axis. As such, the model does not incorporate the possibility of correcting for cross‐term responses. The training data acquisition process could be expanded to include measurements made while multiple gradient chains are active, although this would further lengthen the training data acquisition stage. Furthermore, since the TCN model is based on measurements made on a static phantom, it is not able to predict any gradient response changes that may be subject‐specific or dynamic across a scan. For applications in which these are significant considerations, concurrent monitoring such as that provided by a field camera may be preferred. 57

It is also known that gradient hardware heating, common in long scans, may result in temperature‐dependent changes in the gradient system response. 15 , 16 In order to model non‐LTI changes in the gradient response over a scanning session, such as those resulting from hardware temperature changes, modifications to the TCN network would be required. For example, an input feature related to the gradient duty cycle or measured gradient hardware temperature could be included. The training data for these experiments werer acquired in one long, uninterupted session, so it is likely that our trained model actually reflects the performance of the gradient system at high temperatures as most data was likely acquired after the scanner hardware reached a high‐temperature. The imaging experiments were performed in a separate imaging session from an initial “cold” hardware state, so our TCN model likely includes error due to unaccounted for temperature variations. Future investigations could attempt to include hardware temperature as a feature to more accurately model time‐varying hardware performance.

In the imaging experiments, gradient waveform prediction was applied only to the readout waveforms. Gradient waveforms used for non‐cartesian readouts are particularly demanding due to their relatively long duration and time‐varying envelopes, which make them a natural subject of this initial study. However, it is possible that very large gradient system imperfections could also impact other gradient waveforms, such as diffusion‐encoding gradients, phase‐encoding lobes, or slice‐select gradients. Since these were all undemanding trapezoidal waveforms in this study, distortions were assumed to be minimal relative to those manifesting in the more challenging non‐Cartesian readouts. However, temporal gradient distortions can also affect diffusion encoding, 58 and excitation localization, 55 particularly when more demanding gradient waveforms are used. Further studies could advance the work done here on improving diffusion parameter mapping by applying a prediction model to the diffusion encoding waveforms themselves. Incorporating the effects of diffusion gradients on the imaging readout would likely require a separate model trained on waveform measurements made following diffusion gradients, to characterize long‐time constant eddy current effects. More complex diffusion gradient waveforms than the PGSE gradients used in this work, such as oscillating gradient spin echo (OGSE) encoding gradients, could themselves be subject to severe distortions due to nonideal gradient hardware. Deviation from nominal OGSE diffusion waveforms could affect the diffusion parameters being measured. Future studies could investigate estimation of diffusion parameters using nonideal OGSE waveforms, but that exceeds the scope of this initial work.

While we observe substantial improvements in diffusion parameter maps when applying the TCN, the model was not applied to predict errors from diffusion gradient‐induced eddy currents, which could affect the estimated diffusion parameters. Further, the measured readout trajectories used as ground truth also do not consider the impact of diffusion gradients before readout. Future work could evaluate the impact of diffusion eddy currents on readout trajectories. It is possible that incorporating the effects of diffusion eddy currents on readout trajectories could require an expansion of the training data or even a modification of the model used.

We emphasize that as described, the proposed method accounts only for temporal nonlinearities in the gradient waveforms. Accounting for spatially nonlinear and cross terms would involve both changes to the gradient waveform measurement sequence and modifications of the TCN model, which we consider outside the scope of the current report. Some prior studies have investigated machine learning techniques to spatial gradient nonlinearity correction, 59 , 60 and hybrid approaches that account for both distortion types could be investigated.

There are general limitations to a retrospective prediction approach to gradient errors as opposed to prospective methods meant to preemptively prevent errors in the gradient waveforms. For example, errors in the excitation profile produced by trajectory errors cannot usually be corrected retrospectively. Our model of the gradient system response is highly accurate, so the model could be used within iterative predistortion approaches for offline design of preemphasized waveforms. 55 , 61 Machine learning‐based approaches are also being examined to determine MRI waveform pre‐emphasis for situations in which this retrospective approach is not appropriate. 62 , 63

5. CONCLUSION

In conclusion, a framework for using deep learning has been presented to remove the impact of readout gradient waveform distortions from image reconstruction and quantiative diffusion parameter estimation. This method may enable the use of more advanced and challenging gradient waveforms in MRI that would otherwise be prohibited by system imperfections.

CONFLICT OF INTEREST STATEMENT

The authors declare no potential conflict of interests.

FUNDING INFORMATION

This work was supported by National Institute of Health grants T32 EB001628‐21 and R01 EB031954.

Supporting information

Supporing Information

MRM-95-286-s001.png (148.8KB, png)

ACKNOWLEDGMENTS

The authors gratefully acknowledge Daniel Colvin for support with the Bruker imaging systems. This study was funded by the following grants from the National Institute of Health: R01 EB031954 and T32 EB003817.

Martin J. B., Alderson H. E., Gore J. C., Does M. D., and Harkins K. D., “Modeling the MRI gradient system with a temporal convolutional network: Improved reconstruction by prediction of readout gradient errors,” Magnetic Resonance in Medicine 95, no. 1 (2026): 286–298, 10.1002/mrm.70044.

DATA AVAILABILITY STATEMENT

The data that support the findings of this study are available from the corresponding author upon reasonable request. Code and data that support the findings of this study are available on Github at: https://github.com/jonbmartin/tcn_gradient_prediction.

REFERENCES

  • 1. Willmering MM, Niedbalski PJ, Wang H, et al. Improved pulmonary 129 Xe ventilation imaging via 3D‐spiral UTE MRI. Magn Reson Med. 2020;84:312‐320. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2. Shen X, Özen Ali C, Sunjar A, et al. Ultra‐short T2 components imaging of the whole brain using 3D dual‐echo UTE MRI with rosette K‐space pattern. Magn Reson Med. 2023;89:508‐521. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3. Tong Y, Jezzard P, Okell TW, Clarke WT. Improving PCASL at ultra‐high field using a VERSE‐guided parallel transmission strategy. Magn Reson Med. 2020;84:777‐786. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4. Luo T, Noll DC, Fessler JA, Nielsen JF. Joint Design of RF and gradient waveforms via auto‐differentiation for 3D tailored excitation in MRI. IEEE Trans Med Imaging. 2021;40:3305‐3314. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5. Xu J. Probing neural tissues at small scales: Recent progress of oscillating gradient spin echo (OGSE) neuroimaging in humans. J Neurosci Methods. 2021;349:109024. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6. Chakwizira A, Westin CF, Brabec J, et al. Diffusion MRI with pulsed and free gradient waveforms: Effects of restricted diffusion and exchange. NMR Biomed. 2023;36:e4827. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7. Mani M, Magnotta V, Jacob M. A general algorithm for compensation of trajectory errors: Application to radial imaging. Magn Reson Med. 2018;80:1605‐1613. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8. Takahashi A, Peters T. Compensation of multi‐dimensional selective excitation pulses using measured k‐space trajectories. Magn Reson Med. 1995;34:446‐456. [DOI] [PubMed] [Google Scholar]
  • 9. Bhavsar PS, Zwart NR, Pipe JG. Fast, variable system delay correction for spiral MRI. Magn Reson Med. 2014;71:773‐782. [DOI] [PubMed] [Google Scholar]
  • 10. Jezzard P, Barnett AS, Pierpaoli C. Characterization of and correction for eddy current artifacts in echo planar diffusion imaging. Magn Reson Med. 1998;39:801‐812. [DOI] [PubMed] [Google Scholar]
  • 11. Li X, Ling X, Chen W, Liu F, Crozier S, Xie D. Finite element analysis of gradient Z‐coil induced eddy currents in a permanent MRI magnet. J Magn Reson. 2011;208:148‐155. [DOI] [PubMed] [Google Scholar]
  • 12. Reza B, Ergin A. Nonlinear droop compensation for current waveforms in MRI gradient systems. Magn Reson Med. 2022;88:973‐985. [DOI] [PubMed] [Google Scholar]
  • 13. Sabate J, Garces L, Szczesny P, Li Q, Wirth WF. High‐bandwidth high‐power gradient driver for magnetic resonance imaging with digital control. Conference Proceedings ‐ IEEE Applied Power Electronics Conference and Exposition ‐ APEC. Vol 2. IEEE; 2005:1087‐1091. [Google Scholar]
  • 14. Zeng K, Mao S, Rietveld G, et al. High‐Precision Control Method for High‐Power MRI Gradient Power Amplifiers. IEEE Trans Power Electron. 2022;37:9035‐9046. [Google Scholar]
  • 15. Stich M, Pfaff C, Wech T, et al. The temperature dependence of gradient system response characteristics. Magn Reson Med. 2020;83:1519‐1527. [DOI] [PubMed] [Google Scholar]
  • 16. Nussbaum J, Dietrich BE, Wilm BJ, Pruessmann KP. Thermal variation in gradient response: Measurement and modeling. Magn Reson Med. 2022;87:2224‐2238. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17. Zhang Z, Shen W, Havens TJ. Vibrational Magnetic Field Distortion Compensation System in MRI Superconducting Magnets. IEEE Trans Appl Supercond. 2014;24:1‐4. [Google Scholar]
  • 18. Onodera T, Matsui S, Sekihara K, Kohno H. A method of measuring field‐gradient modulation shapes. Application to high‐speed NMR spectroscopic imaging. J Phys E Sci Instr. 1987;20:416‐419. [Google Scholar]
  • 19. Harkins KD, Does MD. Efficient gradient waveform measurements with variable‐prephasing. J Magn Reson. 2021;327:106945. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20. Barmet C, De Zanche N, Pruessmann KP. Spatiotemporal magnetic field monitoring for MR. Magn Reson Med. 2008;60:187‐197. [DOI] [PubMed] [Google Scholar]
  • 21. Vannesjo SJ, Haeberlin M, Kasper L, et al. Gradient system characterization by impulse response measurements with a dynamic field camera. Magn Reson Med. 2013;69:583‐593. [DOI] [PubMed] [Google Scholar]
  • 22. Vannesjo SJ, Graedel NN, Kasper L, et al. Image reconstruction using a gradient impulse response model for trajectory prediction. Magn Reson Med. 2016;76:45‐58. [DOI] [PubMed] [Google Scholar]
  • 23. Lee NG, Ramasawmy R, Lim Y, Campbell‐Washburn AE, Nayak KS. MaxGIRF: Image reconstruction incorporating concomitant field and gradient impulse response function effects. Magn Reson Med. 2022;88:691‐710. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24. Ahn CB, Cho ZH. Analysis of the eddy‐current induced artifacts and the temporal compensation in nuclear magnetic resonance imaging. IEEE Trans Med Imaging. 1991;10:47‐52. [DOI] [PubMed] [Google Scholar]
  • 25. Peters DC, Derbyshire JA, McVeigh ER. Centering the projection reconstruction trajectory: Reducing gradient delay errors. Magn Reson Med. 2003;50:1‐6. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26. Robison RK, Devaraj A, Pipe JG. Fast, simple gradient delay estimation for spiral MRI. Magn Reson Med. 2010;63:1683‐1690. [DOI] [PubMed] [Google Scholar]
  • 27. Jensen DJ, Brey WW, Delayre JL, Narayana PA. Reduction of pulsed gradient settling time in the superconducting magnet of a magnetic resonance instrument. Med Phys. 1987;14:859‐862. [DOI] [PubMed] [Google Scholar]
  • 28. Morich MA, Lampman DA, Dannels WR, Goldie FTD. Exact temporal eddy current compensation in magnetic resonance imaging systems. IEEE Trans Med Imaging. 1988;7:247‐254. [DOI] [PubMed] [Google Scholar]
  • 29. Addy Nii O, Wu Holden H, Nishimura Dwight G. A simple method for MR gradient system characterization and K‐space trajectory estimation. Magn Reson Med. 2012;68:120. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30. Campbell‐Washburn AE, Xue H, Lederman RJ, Faranesh AZ, Hansen MS. Real‐time distortion correction of spiral and echo planar images using the gradient system impulse response function. Magn Reson Med. 2015;75:2278‐2285. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31. Rahmer J, Schmale I, Mazurkewitz P, Lips O, Börnert P. Non‐Cartesian k‐space trajectory calculation based on concurrent reading of the gradient amplifiers' output currents. Magn Reson Med. 2021;85:3060‐3070. [DOI] [PubMed] [Google Scholar]
  • 32. Scholten H, Wech T, Köhler S, et al. On the correction of spiral trajectories on a preclinical MRI scanner with a high‐performance gradient insert. NMR Biomed. 2024;37:e5249. [DOI] [PubMed] [Google Scholar]
  • 33. Hochreiter S, Schmidhuber J. Long Short‐Term Memory. Neural Comput. 1997;9:1735‐1780. [DOI] [PubMed] [Google Scholar]
  • 34. Alazab M, Khan S, Krishnan SSR, Pham QV, Reddy MPK, Gadekallu TR. A Multidirectional LSTM Model for Predicting the Stability of a Smart Grid. IEEE Access. 2020;8:85454‐85463. [Google Scholar]
  • 35. Chen Y, Lin M, Yu R, Wang T. Research on Simulation and State Prediction of Nuclear Power System Based on LSTM Neural Network. Science and Technology of Nuclear Installations. 2021;2021:8839867. [Google Scholar]
  • 36. Liu Q, Nguyen H, Zhu X, et al. Gradient waveform prediction using deep neural network. Proc Int Soc Magn Reson Med. 2022;31:639. [Google Scholar]
  • 37. Bai, Shaojie , Kolter, J. Zico , Koltun, Vladlen . An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. 2018.
  • 38. Razvan P, Tomas M, Yoshua B. On the difficulty of training recurrent neural networks. Proceedings of the 30th International Conference on Machine Learning. Vol. 28. PMLR; 2013:1310‐1318. [Google Scholar]
  • 39. Li Y, Longfei X, Handi W, Deyu L, Xu L. A comparative study of LSTM and temporal convolutional network models for semisubmersible platform wave runup prediction. J Offshore Mech Arct Eng. 2025;147:1‐39. [Google Scholar]
  • 40. Colin L, Flynn Michael D, René V, Austin R, Hager Gregory D. Temporal convolutional networks for action segmentation and detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR). CVPR;2017:156‐165. [Google Scholar]
  • 41. Jining Y, Lin M, Wang L, Rajiv R, Zomaya Albert Y. Temporal Convolutional Networks for the Advance Prediction of ENSO. Scientific Reports 2020 10:1. 2020;10:1‐15. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42. Lin Y, Koprinska I, Rana M. Temporal convolutional attention neural networks for time series forecasting. In: Proceedings of the International Joint Conference on Neural Networks. IEEE; 2021:1‐8. [Google Scholar]
  • 43. LeCun YA, Bottou L, Orr GB, Müller KR. Efficient BackProp. Neural networks: Tricks of the trade. Vol 7700. Springer Berlin Heidelberg; 2012:9‐48. [Google Scholar]
  • 44. Hendrycks D, Gimpel K. Gaussian Error Linear Units (GELUs). 2016.
  • 45. Akiba T, Sano S, Yanase T, Ohta T, Koyama M. Optuna: A next‐generation hyperparameter optimization framework. Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. ACM; 2019:2623‐2631. [Google Scholar]
  • 46. Noll DC. Multishot rosette trajectories for spectrally selective MR imaging. IEEE Trans Med Imaging. 1997;16:372‐377. [DOI] [PubMed] [Google Scholar]
  • 47. Pipe JG, Menon P. Sampling density compensation in MRI: Rationale and an iterative numerical solution. Magn Reson Med. 1999;41:179‐186. [DOI] [PubMed] [Google Scholar]
  • 48. Liu Y, Hamilton J, Eck B, Griswold M, Seiberlich N. Myocardial T1 and T2 quantification and water‐fat separation using cardiac MR fingerprinting with rosette trajectories at 3T and 1.5T. Magn Reson Med. 2021;85:103‐119. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 49. Noll DC, Meyer CH, Pauly JM, Nishimura DG, Macovski A. A homogeneity correction method for magnetic resonance imaging with time‐vaiying gradients. IEEE Trans Med Imaging. 1991;10:629‐637. [DOI] [PubMed] [Google Scholar]
  • 50. Kingsley PB. Introduction to diffusion tensor imaging mathematics: Part III. Tensor calculation, noise, simulations, and optimization. Concepts Magn Reson Part A. 2006;28A:155‐179. [Google Scholar]
  • 51. GitHub—remmi‐toolbox/remmi‐matlab: Matlab toolbox to reconstruct and process MRI data. Accessed April 16, 2024. https://github.com/remmi‐toolbox/remmi‐matlab
  • 52. Latta P, Jiřík R, Vitouš J, et al. Two‐parametric prescan calibration of gradient‐induced sampling errors for rosette MRI. Magn Reson Med. 2024;93:1285‐1297. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 53. O'Reilly T, Gans D, Leenheer L, Webb A. A low‐cost battery‐powered tri‐axial current‐controlled gradient power supply for sustainable and portable MRI, 3824. 2021.
  • 54. Brodsky EK, Samsonov AA, Block WF. Characterizing and correcting gradient errors in non‐Cartesian imaging: Are gradient errors linear time‐invariant (LTI)? Magn Reson Med. 2009;62:1466‐1476. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 55. Harkins KD, Does MD, Grissom WA. Iterative method for predistortion of MRI gradient waveforms. IEEE Trans Med Imaging. 2014;33:1641‐1647. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 56. Pipe JG, Borup DD. Generating spiral gradient waveforms with a compact frequency spectrum. Magn Reson Med. 2022;87:791‐799. [DOI] [PubMed] [Google Scholar]
  • 57. Dietrich BE, Brunner DO, Wilm BJ, et al. A field camera for MR sequence monitoring and system analysis. Magn Reson Med. 2016;75:1831‐1840. [DOI] [PubMed] [Google Scholar]
  • 58. Szczepankiewicz F, Westin CF, Nilsson M. Maxwell‐compensated design of asymmetric gradient waveforms for tensor‐valued diffusion encoding. Magn Reson Med. 2019;82:1424‐1437. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 59. Shan S, Gao Y, Liu PZY, et al. Distortion‐corrected image reconstruction with deep learning on an MRI‐Linac. Magn Reson Med. 2023;90:963‐977. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 60. Zhangxuan H, Yishi W, Zhe Z, et al. Distortion correction of single‐shot EPI enabled by deep‐learning. NeuroImage. 2020;221:117170. [DOI] [PubMed] [Google Scholar]
  • 61. Fillmer A, Vannesjo SJ, Pavan M, Scheidegger M, Pruessmann KP, Henning A. Fast iterative pre‐emphasis calibration method enabling third‐order dynamic shim updated fMRI. Magn Reson Med. 2016;75:1119‐1131. [DOI] [PubMed] [Google Scholar]
  • 62. Madison A M., Vaughn C E., Martin J B., Srinivas S Abitha, Grissom W A. RF pulse predistortion for low‐field MRI based on spin physics using a neural network amplifier‐to‐Bloch equation model. Proc Int Soc Magn Reson Med. 2024;31:4563. [Google Scholar]
  • 63. Martin, JB , Banik, R , Does, MD , Harkins, KD . Gradient preemphasis predicted by reinforcement learning. Proceedings of the 33rd Annual Meeting of the ISMRM, Singapore. ACMISMRM; 2024:3925. [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supporing Information

MRM-95-286-s001.png (148.8KB, png)

Data Availability Statement

The data that support the findings of this study are available from the corresponding author upon reasonable request. Code and data that support the findings of this study are available on Github at: https://github.com/jonbmartin/tcn_gradient_prediction.


Articles from Magnetic Resonance in Medicine are provided here courtesy of Wiley

RESOURCES