Supplementary Figure 3: Prediction of stage and fish motion optimizes tracking performance. | Nature Methods

Supplementary Figure 3: Prediction of stage and fish motion optimizes tracking performance.

From: Pan-neuronal calcium imaging with cellular resolution in freely swimming zebrafish

Supplementary Figure 3

(a) We model the stage as a linear time invariant (LTI) system that transforms target stage velocity (control input, vinput) to actual stage velocity (voutput). (b) To build a predictive model of stage motion, stage velocities (black) were measured in response to white noise input (red). (c) The impulse response function (red) was solved by ordinary least squares regression, using the preceding 100 ms of control input (vinput) as regressors and the actual stage velocity (voutput) as the response variable. Integrating the impulse response function with respect to time yields the impulse response function for position (red). Every 4 ms, our MPC controller uses this LTI model to select the optimal control input (vinput) that minimizes the predicted future error between the stage position and brain position. (d) The direction of forward fish motion and current forward velocity is estimated from the past 6 time steps of the fish trajectory (-20 ms to 0 ms, red). Based on this history, the fish position is projected 7 time steps into the future (+4 ms to +28 ms, blue). (e) Stage position more closely tracks fish position (black) when fish motion prediction is enabled (blue) than when prediction is disabled (red). (f,g) Cumulative distribution of tracking error with fish motion prediction (blue), without motion prediction (red), or with the actual future fish position (gray). Tracking performance with actual future fish position represents the hypothetical performance of MPC control in the case of perfect motion prediction. (h) Stage position more closely tracks fish position (black) with an MPC controller (blue) relative to a PID controller (red). (i,j) Cumulative distribution of tracking error using MPC (blue) and PID (red) controllers, measured across all time points (i) or while the fish is moving (j). (k) Tracking performance visualized during the replay of a movement bout using MPC or PID control. Scale bar, 500 μm. For cumulative distribution of tracking error, n = 130,621 NIR images (all time) and n = 30,610 NIR images (in motion). All data were collected from an awake and freely swimming 6 dpf larval zebrafish.

Back to article page