<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "https://jats.nlm.nih.gov/nlm-dtd/publishing/3.0/journalpublishing3.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article" dtd-version="3.0" xml:lang="en">
<front>
<journal-meta>
<journal-id journal-id-type="publisher">ISPRS-Archives</journal-id>
<journal-title-group>
<journal-title>The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences</journal-title>
<abbrev-journal-title abbrev-type="publisher">ISPRS-Archives</abbrev-journal-title>
<abbrev-journal-title abbrev-type="nlm-ta">Int. Arch. Photogramm. Remote Sens. Spatial Inf. Sci.</abbrev-journal-title>
</journal-title-group>
<issn pub-type="epub">2194-9034</issn>
<publisher><publisher-name>Copernicus Publications</publisher-name>
<publisher-loc>Göttingen, Germany</publisher-loc>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.5194/isprs-archives-XLVIII-4-W22-2025-37-2026</article-id>
<title-group>
<article-title>Condition-Based LSTM for Residual Calculation of Optical Flow</article-title>
</title-group>
<contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Mahdavi</surname>
<given-names>Mohammad Mahdi</given-names>
<ext-link>https://orcid.org/0009-0006-7671-5805</ext-link>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
</contrib>
<contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Sakhaee</surname>
<given-names>Mohammad Mahdi</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
</contrib>
<contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Alasty</surname>
<given-names>Aria</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
</contrib>
</contrib-group><aff id="aff1">
<label>1</label>
<addr-line>Advance Research Lab for Control and Agricultural Robotics (Sharif AgroLab), School of Mechanical Engineering, Sharif University of Technology, Tehran, Iran</addr-line>
</aff>
<pub-date pub-type="epub">
<day>30</day>
<month>05</month>
<year>2026</year>
</pub-date>
<volume>XLVIII-4/W22-2025</volume>
<fpage>37</fpage>
<lpage>44</lpage>
<permissions>
<copyright-statement>Copyright: &#x000a9; 2026 Mohammad Mahdi Mahdavi et al.</copyright-statement>
<copyright-year>2026</copyright-year>
<license license-type="open-access">
<license-p>This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this licence, visit <ext-link ext-link-type="uri"  xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link></license-p>
</license>
</permissions>
<self-uri xlink:href="https://isprs-archives.copernicus.org/articles/XLVIII-4-W22-2025/37/2026/isprs-archives-XLVIII-4-W22-2025-37-2026.html">This article is available from https://isprs-archives.copernicus.org/articles/XLVIII-4-W22-2025/37/2026/isprs-archives-XLVIII-4-W22-2025-37-2026.html</self-uri>
<self-uri xlink:href="https://isprs-archives.copernicus.org/articles/XLVIII-4-W22-2025/37/2026/isprs-archives-XLVIII-4-W22-2025-37-2026.pdf">The full text article is available as a PDF file from https://isprs-archives.copernicus.org/articles/XLVIII-4-W22-2025/37/2026/isprs-archives-XLVIII-4-W22-2025-37-2026.pdf</self-uri>
<abstract>
<p>Accurate state estimation for autonomous unmanned aerial vehicles (UAVs) is essential in GPS-denied environments, such as in indoor tasks. In these situations, Inertial Navigation Systems (INS) perform well in the short term with good accuracy, but they suffer from accumulated error (drift) caused by sensors&amp;rsquo; noise and bias. Optical flow (OF) is often utilized to correct this drift by estimating lateral velocity from the motion of images; however, OF is degraded by gyroscope errors when the UAV performs aggressive turns or high-acceleration maneuvers. This paper proposes a lightweight, condition-based Long Short-Term Memory (LSTM) neural network to correct these errors. The LSTM model will identify and correct systematic OF velocity errors when the UAV is performing aggressive maneuvers and it is triggered by applying a hysteresis gate that monitors the magnitude of gyroscope readings. This way, the LSTM is only active in scenarios where OF measurements are less reliable. This approach preserves the efficiency of classical methods and prevents any degradation of system performance during stable flight. Several test scenarios were conducted in the Gazebo simulation environment to evaluate the performance of the algorithm. Overall, the INS/OF/LSTM framework reduces trajectory root mean square error (RMSE) by 63.77 % and velocity RMSE by 28.94 % compared to a typical INS/OF pipeline on average across all test scenarios. This paper demonstrates that condition-based LSTM networks increase the accuracy and reliability of classical optical flow-based velocity estimation used in UAV applications.</p>
</abstract>
<counts><page-count count="8"/></counts>
</article-meta>
</front>
<body/>
<back>
</back>
</article>