arXiv:2609.06074cs.CVSep 2026

Manuscript Offprint

arXiv:2609.06074

NSFlow: End-to-End Differentiable Neuro-Symbolic Optical Flow for Visual Odometry

Yicheng Lin, Yuxiu Xu, WenDong Chen, Cong Li, Bin Han

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yicheng Lin, Yuxiu Xu, WenDong Chen, Cong Li, and Bin Han, Senior Member, IEEE

Abstract—Sparse optical flow provides stable inter-frame correspondence, playing a key role in Visual Odometry (VO) and Visual-Inertial Odometry (VIO). Classical optimization-based methods, such as Lucas-Kanade (LK), perform well under small displacements but are sensitive to large motions and illumination changes. Modern regression-based learning methods, while more robust in complex scenes, are often computationally heavy and lack explicit geometric consistency, making them less suitable for efficient VO/VIO front-ends. To bridge this gap, we propose a hybrid neuro-symbolic framework that combines the strengths of both paradigms. Our method uses a Convolutional Neural Network (CNN) to extract robust feature representations, which is fed into a differentiable LK optimizer to estimate optical flow in an end-to-end trainable manner. Through implicit differentiation, gradients are propagated across the iterative solver, enabling joint optimization of feature extraction and flow estimation. The resulting system integrates seamlessly into existing VO/VIO pipelines and runs in real-time on embedded platforms. Experiments show that our method outperforms conventional optimization-based flow in challenging conditions such as dynamic lighting and low texture, while also achieving higher accuracy and lower latency than purely regression-based alternatives. When deployed in a VIO system, our method demonstrates significant performance improvement, achieving an average error reduction of 42% on challenging datasets while enhancing tracking stability. The code is publicly available.¹

Index Terms—Sparse optical flow, Neuro-Symbolic Learning, Implicit differentiation, Visual odometry, End-to-end learning, Robotic navigation

I. INTRODUCTION

VISUAL Odometry (VO) and Visual-Inertial Odometry (VIO) are techniques that estimate a device's or robot's own movement trajectory in environments where GPS is unavailable. This forms a core capability for autonomous navigation [1], [2]. The accuracy and stability of these systems depend heavily on inter-frame correspondence—the process of matching pixels or features between consecutive images to provide geometric constraints for motion estimation [3], [4]. However, in real-world conditions, factors such as, changing lighting, motion blur, and low-texture areas can severely degrade the quality of these matches. This leads to accumulated

drift in the estimated trajectory and, ultimately, a loss of localization stability [5], [6]. Therefore, achieving robust and reliable inter-frame correspondence under challenging visual conditions remains a key obstacle to the practical deployment of VO/VIO systems.

Image correspondence methods are generally categorized into direct and indirect approaches [5], [7]. Direct methods perform image registration by minimizing photometric errors at the pixel level. This approach typically relies on the assumptions of brightness constancy and the presence of sufficient texture. Indirect methods follow a two-step process: establishing feature correspondences or optical flow first, then leveraging them for geometric optimization. They are typically regarded as more adaptable to diverse and difficult environments as a result [2], [3]. Here, we focus on optical flow, which is based on the principle of video continuity to measure the subtle, sub-pixel displacements of keypoints across frames. This enables robust and continuous pose estimation. Hence, optical flow is a popular choice for correspondence in systems ranging from classics like VINS-Mono [4] and MSCKF [8] to modern learning-based models like DROID [9], [10]. Yet, despite its widespread use, its robustness can be severely compromised by illumination variations, large displacements, and the constraints of real-time computation.

Optical flow estimation methods can be broadly categorized into optimization-based and regression-based paradigms. Optimization-based methods (e.g., Lucas-Kanade) estimate motion by solving an energy function derived from photometric and spatial constraints [11], [12]. This formulation ensures efficiency and geometric consistency, but its reliance on explicit assumptions (e.g., brightness constancy) limits robustness under large motions or illumination changes. In contrast, regression-based methods use deep networks to

Figure

Fig. 1. A Framework for End-to-End Trained Neuro-Symbolic Optical Flow. In the forward pass, a convolutional network extracts image features for an iteratively optimized LK algorithm to solve optical flow; during backpropagation, gradients through this optimization are computed via the implicit function theorem to enable error propagation and joint training.

This work was supported National Nature Science Foundation of China (52375015) and in part by the Interdisciplinary Research Program of HUST (2024JCYJ037). (Yicheng Lin and Zhuohao Li contributed equally to this work.) (Corresponding author: Bin Han.)

Y. Lin, Y. Xu, C. Li, X. Jiao, and B. Han are with the State Key Laboratory of Intelligent Manufacturing Equipment and Technology, School of Mechanical Science and Engineering, Huazhong University of Science and Technology, Wuhan 430074, China (e-mail: yichenglin, yuxiuxu, wendongchen, congli, and binhan@hust.edu.cn).

¹Code: https://anonymous.4open.science/status/LET-NET2-Review.

directly predict flow from image pairs. Trained on large datasets, they capture complex motion patterns and show strong robustness to appearance variations [13]–[15]. However, as noted in [9], their outputs often lack explicit geometric consistency, making them less suitable for visual odometry without post-processing. Recent hybrid approaches integrate global optimization (e.g., bundle adjustment) into learning frameworks to enhance geometric consistency [9], [16], [17]. Yet, these iterative refinements incur high computational and memory costs, leaving a critical trade-off among robustness, accuracy, and efficiency—especially for real-time embedded VO/VIO systems.

To address this trade-off, we introduce a neuro-symbolic learning framework for end-to-end trainable sparse optical flow, as shown in Fig.1. As introduced in [18], neuro-symbolic learning refers to a category of methods that embed interpretable symbolic modules into data-driven models. Our design effectively merges the geometric clarity of optimization-based methods with the adaptive power of data-driven learning. In the forward pass, this synergy is realized by replacing the conventional photometric error with a feature-based objective. A lightweight CNN extracts robust feature maps, and the LK algorithm iteratively minimizes the difference between feature vectors at warped locations to solve for optical flow. To enable gradient flow in the backward pass, we rely on a key property from the forward optimization: once the solver converges to a solution, the gradient there is zero. We then use the implicit function theorem on this optimality condition. This allows us to directly compute how the flow changes with respect to the input CNN features. Consequently, the entire LK optimization becomes differentiable, permitting end-to-end training. Overall, the contributions of this paper include,

  1. A neuro-symbolic framework that unites a data-driven CNN feature extractor with an optimization-based differentiable LK solver, enabling end-to-end trainable sparse optical flow.

  2. A fully differentiable LK layer implemented via implicit differentiation, allowing stable gradient propagation through the iterative optimizer.

  3. Effective learning from synthetic data only, which achieves robust zero-shot generalization to real-world scenes.

  4. Real-time VIO integration that improves odometry accuracy, reduces tracking failures, and maintains stable performance under challenging visual conditions.

The rest of the paper is organized as follows. Section II reviews related work in deep learning enhanced visual odometry, learned optical flow for VO/VIO, and differentiable optimization methods. Section III details our proposed method, including the system overview, descriptor-based LK optical flow estimation, backpropagation through the LK solver, and the end-to-end training procedure. Experimental setup, optical flow analysis, comparison with state-of-the-art methods, and integration into a VIO system are presented in Section IV. Finally, Section V concludes the paper.

References (54)