Abstract
Accurately determining fluid viscosity is crucial for various industrial and scientific applications. Traditional methods of viscosity measurement, though reliable, often require manual intervention and cannot easily adapt to real-time monitoring. With advancements in machine learning and computer vision, this work explores the feasibility of predicting fluid viscosity by analyzing fluid oscillations captured in video data. The pipeline employs a 3D convolutional autoencoder pretrained in a self-supervised manner to extract and learn features from semantic segmentation masks of oscillating fluids. Then, the latent representations of the input data, produced from the pretrained autoencoder, is processed with a distinct inference head to infer either the fluid category (classification) or the fluid viscosity (regression) in a time-resolved manner. When the latent representations generated by the pretrained autoencoder are used for classification, the system achieves a 97.1% accuracy across a total of 4,140 test datapoints. Similarly, for regression tasks, employing an additional fully-connected network as a regression head allows the pipeline to achieve a mean absolute error of 0.258 over 4,416 test datapoints. This study represents an innovative contribution to both fluid characterization and the evolving landscape of Artificial Intelligence, demonstrating the potential of deep learning in achieving near real-time viscosity estimation and addressing practical challenges in fluid dynamics through the analysis of video data capturing oscillating fluid dynamics.
Introduction
Viscosity—a fluid's resistance to flow—is a critical parameter in everything from food processing to engine design. However, measuring it traditionally requires viscometers or rheometers, which are often labor-intensive, require manual intervention, and are difficult to integrate into real-time, automated workflows. This paper tackles the challenge of non-invasive, real-time viscosity estimation using only visual data, effectively teaching a robot to "feel" the thickness of a liquid by observing its slosh patterns.
Methodology
The researchers employ a strategy called Interactive Perception. Instead of passively observing a still liquid, a 7-DoF Franka Emika Panda robot arm agitates the fluid container with a consistent linear shaking motion to generate discernible oscillation patterns.
The technical pipeline consists of three main stages:
- Segmentation: Raw RGB video is processed through a pretrained semantic segmentation model to create binary masks. This isolates the fluid from the background and the robot arm, ensuring the AI focuses only on the liquid's dynamics.
- 3D Convolutional Autoencoder (3D-CAE): The core of the system is a 3D-CAE trained in a self-supervised manner. Unlike standard 2D networks, the 3D convolutions allow the model to learn spatio-temporal features—essentially capturing how the shape of the fluid changes over time.
- Transfer Learning: Once the autoencoder learns to reconstruct these oscillation patterns, the "decoder" half is discarded. The "encoder" is then used as a feature extractor. These features (latent representations) are fed into two different "heads": a logistic regression head for classification and a fully-connected network for regression.
Key Results and Insights
The system was evaluated on two primary datasets: a classification set featuring five distinct fluids (water, coffee, oil, mango juice, and dish soap) and a regression set using glycerol-water solutions to provide precise viscosity ground truths.
- Classification: The model achieved 97.1% accuracy at the data level and 96.6% accuracy at the video level (correctly identifying 29 out of 30 test videos).
- Regression: For the viscosity estimation task, the "unfrozen" model (where the encoder was fine-tuned) achieved a Mean Absolute Error (MAE) of 0.258 cP.
- Latent Space "Physics": By using Principal Component Analysis (PCA) to visualize the model's internal representations, the authors found that the model naturally organizes videos into continuous trajectories. This suggests the AI is intuitively capturing the damping coefficients and decay rates of the oscillations without being explicitly programmed to do so.
- The Power of Pretraining: The study found that self-supervised pretraining was essential. A model trained from scratch had a Mean Absolute Error nearly 70 times higher than the pretrained version.
Conclusion
This work demonstrates the potential of deep learning in achieving near real-time viscosity estimation through the analysis of video data. While currently focused on Newtonian fluids, future work will address non-Newtonian fluids and expand the dataset to include different types of agitation, such as stirring or pouring, to make the system more robust for "in-the-wild" robotic applications.
Summary updated