Estimation of Gas Velocity in Optical Gas Imaging Based on Deep Optical Flow Network
Gu Xiaoyu,Gu Xiaojing,Ding Jie,Gu Xingsheng
DOI: https://doi.org/10.3788/aos240598
2024-01-01
Acta Optica Sinica
Abstract:Objective Optical gas imaging(OGI)technology represents a non-contact method for detecting gases based on the distinctive infrared absorption characteristics.Compared to traditional contact gas detection methods such as catalytic combustion,electrochemical sensors,and semiconductor gas sensors,OGI offers advantages including a broad monitoring range,rapid response,high safety,and operational flexibility and efficiency.Over the past decade,it has been widely used in gas leak detection.Despite its success in detecting gas leaks,OGI technology encounters challenges in achieving high-precision gas flow rate measurements.Recent studies have attempted to address this issue by integrating optical flow algorithms with OGI technology to measure gas flow rates.These approaches estimate the optical flow of the leaking gas image using conventional optical flow algorithms and then calculate the gas velocity based on the ratio of pixels to physical length.However,the accuracy of this method remains limited in complex dynamic scenarios.With advancements in neural networks,scholars have explored the use of optical flow neural networks for gas flow estimation.However,existing optical flow neural networks are primarily designed for rigid body optical flow,and thus require significant modifications to address the unique physical and motion characteristics of gases.This necessitates meticulous adjustments and optimizations at each stage,from dataset construction to network design,to accommodate the special scenario of gas optical flow estimation. Methods We introduce a method for constructing a dataset of gas leakage optical flow using physics-based simulation software.Initially,the raw methane motion data are generated using the fire dynamics simulator(FDS).Subsequently,the three-dimensional gas data are projected to obtain the column concentration and optical flow labels via a ray marching technique.Gas infrared imaging is simulated based on radiative transfer principles,with data augmentation and background superimposition applied to enhance dataset complexity and diversity.This approach not only ensures the authenticity of the data but also provides an accurate foundation for the training and validation of subsequent deep learning models.Furthermore,we enhance the loss function in response to the unique characteristics of gas motion.Considering the blurriness of gas edges and the minor internal motion variations,a gradient-based loss function is designed.The discrepancy between the estimated optical flow gradient and the true optical flow gradient is employed as the loss function.This adjustment aims to improve the network's sensitivity to flow variations between adjacent pixels,enhancing the detection of subtle movements within the gas regions.Simultaneously,since the optical flow gradient at the gas edges is prone to abrupt changes,the optical flow network's focus on gas contours is further improved.Lastly,we adopt a theoretical model for calculating gas flow rate,by computing the gas leak rate using the column concentration and velocity at various points on the gas plume cross-section.In solving for gas velocity,the optical flow algorithm is first used to estimate the optical flow of the gas image sequence.Then,the gas flow velocity is calculated based on the gas optical flow,time,and conversion coefficient. Results and Discussions We evaluate four classic optical flow networks-FlowNet2,PWC-Net,RAFT,and GMA-by fine-tuning and testing the gas optical flow dataset,and comparing their performance with traditional optical flow algorithms.All optical flow networks fine-tuned using the methods described in this paper show a significant decrease in average endpoint error(AEPE)and average angular error(AAE)on the gas optical flow dataset,with the fine-tuned FlowNet2 exhibiting the best performance.Traditional optical flow estimation algorithms tend to underestimate the gas motion regions,but the estimated gas optical flow's direction and magnitude are relatively accurate.Optical flow networks without fine-tuning on the gas optical flow dataset can only estimate the general direction of gas movement,but there is still a large discrepancy in the motion region of the gas,and in some scenarios,they fail to discern the gas motion region and direction.Optical flow networks fine-tuned using the methods proposed in this paper are more accurate in estimating both the direction and region of gas motion,with primary errors concentrated at the edges of the gas movement and within the subtle variation areas inside.We have also tested the estimation of gas optical flow in multiple real-world scenarios,and our method has proven to be relatively effective.The accuracy of gas velocity estimation on synthetic images,using the cross-section one-third above the gas source as a reference,shows that the fine-tuned FlowNet2 achieves an accuracy of 81.66%,representing 22 percentage points improvement over the original FlowNet2. Conclusions Our study presents a novel method for gas velocity detection method based on infrared gas optical flow estimation.To address the distinctions between gases and rigid bodies,the dataset and network design have been reconfigured and adjusted.Initially,a gas optical flow dataset is constructed using physical simulation,with the FDS tool employed to generate raw methane gas data.The column concentration and corresponding optical flow are obtained through projection by the ray marching method,followed by the simulation of the infrared imaging process of methane gas based on the radiative transfer model.The dataset's diversity is further enhanced through background superimposition and data augmentation techniques.Subsequently,a gradient loss function tailored to the characteristics of gas motion is devised,significantly reinforcing the optical flow network's sensitivity to the edges and minute internal movements of the gas.Finally,a sectional gas flow calculation model is utilized to quantitatively analyze the accuracy of the proposed method's gas velocity estimation.Experimental results on synthetic datasets and actual infrared images demonstrate that all optical flow networks fine-tuned with the gas optical flow dataset exhibit improved performance in the task of gas optical flow estimation.Additionally,the method proves effective in predicting gas optical flow in real-world scenarios,with 22 percentage points increase in accuracy for synthetic gas velocity measurements.Ablation studies indicate that background superimposition and data augmentation improve dataset quality,and the gradient loss function significantly enhances the network's ability to estimate gas contours and internal minute movements.