Paper deep dive
PRIMS: Physics-guided Representation for Fluid Identification in Multimodal Sensing
Hai-Long Nguyen, Trung Thanh Nguyen, Lars Holm, Dennis Alveringh, Duc Viet Le
Intelligence
Status: not_run | Model: - | Prompt: - | Confidence: 0%
Entities (0)
Relation Signals (0)
No relation signals yet.
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Accurate on-device fluid identification is essential for microfluidic applications, yet maintaining reliability under varying flow, pressure, and temperature remains a key challenge. Existing learning-based methods often treat sensor signals as domain-agnostic features, neglecting the underlying physical relationships that govern fluid behavior, thereby limiting generalization and interpretability. To address this, we propose PRIMS, a physics-aware multimodal Transformer that integrates physical knowledge into representation learning and attention mechanisms through three dedicated modules: (1) Physics-based Token Vectorization transforms raw Coriolis and pressure sensor signals into physically meaningful token embeddings; (2) Physical Component Synthesizer models viscosity-related dependencies among flow, pressure, and density; and (3) Physics-guided Fusion captures cross-physical correlations through attention-based integration. By embedding these physics-based relationships directly into the model architecture, PRIMS bridges analytical fluid mechanics and deep learning, enabling interpretable, data-efficient, and resilient fluid classification. Evaluations on a five-fluid benchmark under dynamic flow, pressure, and temperature conditions show that PRIMS achieves 98.92% average F1-score with only 0.46 million parameters, a 14 times reduction compared to state-of-the-art Transformer-based methods. PRIMS also consistently outperforms prior SOTA models under out-of-distribution shifts to unseen temperature ranges and unseen flow-rate ranges, indicating strong robustness to operating conditions not observed during training. These findings suggest that designing architectures that explicitly mirror governing physical relationships can make them learn transferable, environment-independent representations, improving real-world reliability for microfluidic sensing.
Tags
Links
- Source: https://arxiv.org/abs/2607.22422v1
- Canonical: https://arxiv.org/abs/2607.22422v1
Trouble viewing inline? Open PDF directly →
Full Text
46,384 characters extracted from source content.
Expand or collapse full text
PRIMS: Physics-guided Representation for Fluid Identification in Multimodal Sensing Hai-Long Nguyen 1 (), Trung Thanh Nguyen 2 , Lars Holm 1 , Dennis Alveringh 1 , and Duc V. Le 1 1 University of Twente, Netherlands hailong.nguyen,l.holm,d.alveringh,v.d.le@utwente.nl 2 Nagoya University, Japan nguyent@cs.is.i.nagoya-u.ac.jp Abstract. Accurate on-device fluid identification is essential for microflu- idic applications, yet maintaining reliability under varying flow, pressure, and temperature remains a key challenge. Existing learning-based meth- ods often treat sensor signals as domain-agnostic features, neglecting the underlying physical relationships that govern fluid behavior, thereby limiting generalization and interpretability. To address this, we propose PRIMS, a physics-aware multimodal Transformer that integrates phys- ical knowledge into representation learning and attention mechanisms through three dedicated modules: (1) Physics-based Token Vectorization transforms raw Coriolis and pressure sensor signals into physically mean- ingful token embeddings; (2) Physical Component Synthesizer models viscosity-related dependencies among flow, pressure, and density; and (3) Physics-guided Fusion captures cross-physical correlations through attention-based integration. By embedding these physics-based relation- ships directly into the model architecture, PRIMS bridges analytical fluid mechanics and deep learning, enabling interpretable, data-efficient, and resilient fluid classification. Evaluations on a five-fluid benchmark under dynamic flow, pressure, and temperature conditions show that PRIMS achieves 98.92% average F1-score with only 0.46 million param- eters, a 14×reduction compared to state-of-the-art Transformer-based methods. PRIMS also consistently outperforms prior SOTA models un- der out-of-distribution shifts to unseen temperature ranges and unseen flow-rate ranges, indicating strong robustness to operating conditions not observed during training. These findings suggest that designing ar- chitectures that explicitly mirror governing physical relationships can make them learn transferable, environment-independent representations, improving real-world reliability for microfluidic sensing. Keywords: Physics-informed Machine Learning· Fluid Identification· Multimodal Sensor Fusion· Multivariate Time Series 1 Introduction Microfluidic sensing technologies have become central to a wide range of in- dustrial, biomedical, and environmental applications [6]. Over the last decades, arXiv:2607.22422v1 [physics.flu-dyn] 24 Jul 2026 2H.-L. Nguyen et al. advances in sensor miniaturization and integration have enabled the simultaneous measurement of multiple flow parameters on a single chip [24, 18]. Among these, Coriolis mass-flow sensors co-integrated with differential pressure sensors provide a rich, multimodal description of fluid behavior [21]. The Coriolis sensor directly measures mass flow and density through tube oscillations, while the pressure sensors capture viscosity-dependent pressure drops, together enabling physical characterization of the fluid. Despite these advances, conventional analytical models for fluid characteri- zation rely on idealized assumptions that often fail under nonlinear or variable operating regimes, such as temperature fluctuations, turbulence, or low-flow conditions. To overcome these limitations, learning-based methods have been introduced to extract features directly from time-series sensor signals [1, 31]. Con- volutional and recurrent architectures [1] have demonstrated the ability to classify fluids and infer rheological parameters, offering data-driven adaptability beyond static analytical formulas. However, these models typically treat sensor readings as domain-agnostic features, neglecting the underlying physical dependencies among flow rate, pressure, and density that govern the system’s behavior. As a result, their predictions often degrade when operating conditions deviate from those seen during training, limiting generalization and robustness. Recent developments in physics-informed learning [20, 5, 19] highlight the potential of integrating physical constraints within neural architectures to en- hance interpretability and stability. For flow systems, physical laws such as the Hagen–Poiseuille equation [8] establish deterministic relations among measurable quantities like pressure drop, viscosity, and channel geometry. However, existing physics-informed approaches have not been adapted to multimodal microfluidic sensing, where multiple coupled physical quantities must be jointly modeled. Meanwhile, learning-based methods such as iTransformer [12], with approxi- mately 6.50 million trainable parameters, have demonstrated strong capability in modeling temporal dependencies across multimodal sensor streams. Yet their large model size and domain-agnostic design limit practicality for embedded or edge devices, where computational resources and power budgets are constrained. These observations highlight the need for compact, physics-aware architectures that integrate domain knowledge directly into the learning process. To address these limitations, we propose PRIMS, a physics-aware multi- modal Transformer designed for fluid classification in microfluidic systems. PRIMS integrates physical principles directly into the learning process through three modules. (1) Physics-based Token Vectorization encodes raw Coriolis and pressure signals into compact and physically meaningful representations, motivated by the observation that spectral and differential features directly relate to mass flow, density, and pressure drop. (2) Physical Component Synthesizer models intrinsic relationships among mass flow, density, and pressure through cross- attention, reflecting the viscosity coupling described by the Hagen–Poiseuille law. (3) Physics-guided Fusion integrates these multimodal representations through self-attention, enabling the model to capture cross-physical dependencies while maintaining interpretability. By embedding physical structure into the Trans- PRIMS: Physics-guided Representation for Fluid Identification3 former architecture, PRIMS bridges the gap between analytical modeling and data-driven learning, achieving interpretable and resilient fluid classification under varying flow, temperature, and pressure conditions. The main contributions are as follows: – We propose PRIMS, a physics-aware multimodal Transformer that embeds physical relationships among flow, pressure, and density directly into its tok- enization and attention layers, enabling efficient and interpretable deployment on edge devices. –We design three physics-aware modules, namely Physics-based Token Vector- ization, Physical Component Synthesizer, and Physics-guided Fusion, that jointly transform raw sensor signals into physics-consistent representations, synthesize viscosity-related features, and fuse multimodal information to capture cross-physical relationships. – We provide a comprehensive experimental evaluation across five fluids under varying flow and thermal conditions, including out-of-distribution shifts, demonstrating that PRIMS consistently achieves the best F1-score across all experimental settings while using 14×fewer parameters than state-of-the-art Transformer-based methods. 2 Related Work Learning-based Fluid Identification. Low-flow sensing in microfluidic systems is commonly realized through thermal, differential-pressure, ultrasonic, and Coriolis principles [22, 7]. Recent research has increasingly integrated machine learning with microfluidic sensing to interpret complex, multivariate signals and infer fluid properties directly from sensor data. Alveringh et al. [1] propose a micro-Coriolis–pressure fusion framework using a deep learning model to classify multiple fluids from combined flow and pressure signals, demonstrating the promise of learning-based fluid identification. Related efforts have applied machine learning to infer rheological properties such as viscosity from microchannel deflection data [13], and to detect complex biological mixtures through integrated microfluidic-sensor platforms [28]. Despite these advances, current learning-based methods often treat sensor outputs as independent features and exhibit sensitivity to domain shifts in viscosity, density, and flow regime, with limited incorporation of physical fluid relations. Physics-guided Learning for Flow Systems. Integrating physical constraints into learning, through Physics-Informed Neural Networks (PINNs) or differen- tiable Partial Differential Equation (PDE) solvers, has been shown to improve extrapolation under domain shifts [20]. In microfluidic systems, analytic relations such as the Hagen–Poiseuille equation link pressure drop, viscosity, and geom- etry in laminar regimes [8]. In mechanical and chemical sensing, cross-modal attention mechanisms have achieved state-of-the-art performance by learning interaction priors between physical variables [29, 9], and physics-aware fusion networks have been explored to align heterogeneous sensor modalities within 4H.-L. Nguyen et al. Table 1: Physical properties of five fluids used in this study, based on Bronkhorst ® FLUIDA ® [3]. Values correspond to a single gauge-pressure condition. FluidAbbr. Phase Density Kinematic Visc. Dynamic Visc. (kg m −3 )(m 2 s −1 )(mPa s) NitrogenN 2 Gas7.052.440.018 WaterH 2 OLiq.9991.161.15 Isopropanol IPALiq.8003.402.72 EthanolEtOH Liq.8121.531.27 AcetoneAceLiq.8050.420.34 Note: Abbr. = Abbreviation; Liq. = Liquid; Visc. = Viscosity. shared latent spaces. However, these physics-guided methods have largely focused on mechanical or chemical domains and have not been adapted to multimodal microfluidic sensing, where coupled quantities such as flow, pressure, and density must be jointly modeled. Efficient and Transformer-based Sensing Models. Transformers [25] have rapidly become a foundation for multivariate time-series and sensor fusion tasks [15], benefiting from their flexible attention structure. Models such as Informer [30] and Autoformer [27] introduced efficient sparse attention for long- horizon forecasting, while more recent work like iMoT [14] adapts attention mechanisms for physical sensing by modeling temporal alignment and uncertainty across motion modalities. In parallel, compact Transformer variants such as Effi- cientFormer [10] and EdgeViT [17] demonstrate that attention-based architectures can achieve real-time inference on resource-constrained hardware. These advances show that Transformers can jointly capture complex temporal dependencies and remain computationally practical, yet most existing designs focus on motion or vision tasks rather than coupled physical processes in fluids. 3 Preliminaries: Fluid Classification Theory In this section, we present the fundamental physical properties that underlie fluid behavior in microfluidic systems. Traditional fluid identification relies on direct measurements of density, dynamic viscosity, and kinematic viscosity, which are strongly linked to molecular composition and temperature [4]. Sensor calibration using reference fluids allows the construction of lookup tables or multidimensional property spaces for classification. As shown in Table 1, many liquids exhibit similar densities or viscosities, which further limits discriminative power. These limitations motivate the physics-aware learning approach introduced in Section 4. Phase. In fluid mechanics, the term phase refers to the physical state of matter, which can exist as a solid, liquid, or gas. Each phase exhibits distinct thermody- namic and transport properties that govern flow behavior. Since solids do not undergo continuous deformation, microfluidic sensing typically focuses on liquids and gases, which can exhibit measurable flow characteristics. PRIMS: Physics-guided Representation for Fluid Identification5 Density. Denoted byρ=m/V, is defined as the mass of a fluid (m) per unit volume (V) [4]. It governs buoyancy, pressure distribution, and the overall dynamics of fluid motion. Variations in density, particularly in compressible or thermally driven flows, can strongly influence flow behavior and the measurable response of microfluidic sensors. Dynamic Viscosity. Denoted byη=τ du dy , quantifies a fluid’s internal resistance to shear deformation [4], whereτis the shear stress and du dy is the velocity gradient perpendicular to the flow direction. For Newtonian fluids,ηremains constant under varying shear rates, while non-Newtonian fluids exhibit shear-dependent viscosity that requires more complex rheological modeling. Kinematic Viscosity. Denoted byν=η/ρ, represents the ratio of dynamic viscosity (η) to density (ρ) [4]. This property describes the balance between viscous and inertial forces and determines flow regimes characterized by the Reynolds number, which governs the transition between laminar and turbulent behavior. Together, dynamic and kinematic viscosity define the energy dissipation and resistance to deformation in fluid motion. 4 Methodology Motivation. Among existing fluid sensing technologies, micro-fabricated Coriolis mass-flow sensors integrated with resistive pressure sensors introduced in [2] represent the state-of-the-art, offering direct and high-precision measurements of mass flow and density, and enabling viscosity estimation when combined with pressure sensors (Figure 1). These sensors provide stability and compact integration, making them well suited for embedded microfluidic applications. However, physics-based analytical approaches relying solely on these sensors struggle with nonlinear flow regimes, environmental variation, and overlapping fluid properties. PRIMS addresses these challenges by embedding fluid-domain knowledge directly into a multimodal Transformer architecture. Problem Formulation. The objective of this study is to classify fluid types from time-series signals acquired by an integrated Coriolis mass-flow and pressure sensing system (Figure 1). The Coriolis sensor produces two sinusoidal signals, C 1 (t) andC 2 (t), whose phase difference∆φis proportional to the mass flow rate, while the resonance frequency depends on the fluid densityρ[1]. Two resistive pressure sensors located upstream and downstream provide voltage signalsP u (t) andP d (t), from which the pressure drop is obtained as∆P=P u − P d . By combining the Coriolis and pressure modalities, the system enables simultaneous estimation of fluid properties, including densityρ, dynamic viscosityη, and kinematic viscosityν, which serve as discriminative features for fluid classification. Each measurement windowX i from the Coriolis and pressure modalities spans a fixed temporal durationT(milliseconds), sampled at a frequencyF s (samples per second), resulting in D = F s 1000 Ttime steps. The recorded data are represented as multivariate time series from two modalities as: X c = [C 1 ,C 2 ], X p = [P u ,P d ],(1) 6H.-L. Nguyen et al. Upstream pressure (푃 ! ) Coriolis electrode I (C 1 ) Coriolis electrode I (C 2 ) Downstream pressure (푃 " ) Pressure drop (훥푃)Mass flow (푚̇) Density (휌) Kinematic viscosity (휈) Dynamic viscosity (휼) Hagen-Poiseuille Law 푄= 휋% 푟 ! %Δ푃 8%(휈휌)%퐿 훥푃= 8%(휈휌)%퐿%푚̇ 휋%푟 ! %휌 휂=휈휌 Δ푃=푃 ! −푃 " Fig. 1: Principle of fluid classification using an integrated Coriolis mass flow sensor with upstream and downstream pressure sensors. The sensors directly measure pressure (P u ,P d ), mass flow ( ̇m), and density (ρ), from which kinematic and dynamic viscosity (V,η) are derived via the Hagen–Poiseuille law, whereLand r denote the length and inner radius of the flow channel. where X c ,X p ∈R 2×D . Each training example is thus expressed asX i = [X i c ; X i p ]∈R 4×D . Given a dataset ofNlabeled samples(X i ,Y i ) N i=1 , where Y i ∈0,1 K is a one-hot vector denoting one ofKfluid categories, the goal is to learn a classification function as: G :R 4×D →0, 1 K ,(2) that predicts the fluid type Y from the multimodal inputX. In probabilistic terms,Gaims to approximate the conditional distributionp(Y|X), enabling identification of fluids under varying flow conditions and sensor noise. Figure 2 illustrates the overview of the proposed PRIMS method. 4.1 Physics-based Token Vectorization In the first stage of PRIMS, we convert raw Coriolis and pressure signals into compact and physically meaningful representations. Given two sensing modalities, the Coriolis mass flow X c = [C 1 ;C 2 ] and the pressure X p = [P u ;P d ], the signals are processed using physics-based transformations that align with fluid dynamic principles. This aims to reduce the model’s reliance on purely data-driven feature extraction and to embed physical interpretability into the learned representations. Coriolis Physics Model. The Coriolis mass flow sensor contains a vibrating microchannel that converts fluid motion into measurable electrical signals [23]. Two electrodes positioned symmetrically along the channel detect oscillatory signalsC 1 (t) andC 2 (t). According to [1], the phase shift∆φand resonance frequency f 0 are proportional to the mass flow rate ̇m and fluid density ρ: ∆φ∝ ̇m, f 0 ∝ 1 2π s k eff m c + V f ρ ,(3) PRIMS: Physics-guided Representation for Fluid Identification7 [2 x D] [2 x D] Coriolis physic model CoriolisSignal Pressure signal Vector concatenation C 푬 푷 , [2 x T] Physics-based Token Vectorization (PTV) Physics Component Synthesizer (PCS) Physics Guided Fusion (PGF) 푬 푪 , [2 x T] [2 x T]풉 퓥ퟐ [2 x T] 풉 휼 [8 x T] Classification Head (N2, H2O, IPA, EtOH, Ace) [2 x D] [2 x D] 퐶 ! [8 x T] Global Average Pooling FC layers Dropout FC layers Fusion Signal Pressure physic model STFT and Notch Filter 퐶 " 푃 # 푃 $ MLP ' MLP ( 퐴 ! ,Δ "! 휇 # ,Δ # Kinematic Viscosity Module Positional Encoding 퐸 ) , 퐸 * , ℎ 풱! Magnitude and Phase Computation Mean and Differential Pressure Computation ℎ 풱" MHA1 for Cross-Attention (Q:퐸 & , , K/V:퐸 ( , ) MHA2 for Cross-Attention (Q:퐸 ) , , K/V: 퐸 * , ) Dynamic Viscosity Module MHA for Cross-Attention (Q:ℎ 풱 , K/V:퐸 ) , ) ℎ 풱 ℎ , 1D Conv Fusion [8 x T] Self-attention 푸 푲 푽 Add & Norm Add & Norm Fusion Signal Concatenated Signal FFN ASS Module (Adaptive Spatial Sync) Padding 1x3 Conv [8 x T] Reshape [4 x 2T] GAP 1x1 Conv Sigmoid Reshape 1x1 Conv GeLU 푪 ퟏ ,푪 ퟐ 푷 풖 ,푷 풅 [2 x T]풉 퓥ퟏ Fig. 2: Overview of the proposed PRIMS. The model consists of three components: (1) Physics-based Token Vectorization (PTV) that transforms raw Coriolis and pressure signals into compact physics-informed representations; (2) Physical Com- ponent Synthesizer (PCS) that models relationships among physical quantities through cross-attention-based viscosity modules; and (3) Physics-guided Fusion (PGF) that integrates multimodal features via self-attention and adaptive spatial synchronization. The fused representation is passed to a classification head for fluid-type prediction. Here T denotes the embedding dimension d embed . wherek eff is the effective stiffness of the vibrating tube,m c is the tube mass, and V f is the internal fluid volume. To extract these physical cues, the Short-Time Fourier Transform (STFT) is applied toC 1 andC 2 to obtain their spectraF 1 k andF 2 k for 0≤ k < F. The corresponding magnitude and phase spectra are computed as: A k =|F 1 k | +|F 2 k |, ∆φ k = H notch (k) [∠F 2 k −∠F 1 k ],(4) whereH notch (k) is a notch filter [16] used to suppress noise. The resulting Coriolis embedding isZ c = [A;∆φ]∈R 2×F , which encodes frequency and phase information correlated with mass flow and density. Pressure Physics Model. The pressure modality X p = [P u ;P d ] provides static and dynamic information from upstream and downstream sensors. We compute the mean and differential pressure features as: μ P = (P u + P d )/2, ∆P = P u − P d ,(5) yielding the representationZ p = [μ P ;∆P]∈R 2×D . These features describe steady-state and transient pressure variations that are essential for flow and viscosity estimation. Embedding and Positional Encoding. The physics-derived features (Z c ,Z p ) are projected through modality-specific Multi-layer Perceptrons into an embed- ding space of dimension d embed as: E c = ReLU(Z c W c ), E p = ReLU(Z p W p ),(6) 8H.-L. Nguyen et al. whereW c andW p are learnable weights. To encode temporal dependencies, sinusoidal positional embeddings are added as: E ′ c = E c + PE, E ′ p = E p + PE,(7) withPE (pos,2i) =sin pos 10000 2i/d embed andPE (pos,2i+1) =cos pos 10000 2i/d embed . The outputsE ′ c ,E ′ p ∈R 2×d embed are then used as input tokens for subsequent physics-based reasoning. 4.2 Physical Component Synthesizer We design this module to model the interdependencies among flow, pressure, and density, and to extract viscosity-related representations that are both physically consistent and data-driven. According to the Hagen–Poiseuille law [4], the pressure drop∆Pacross a microchannel is proportional to the flow rate ̇m, modulated by viscosity and geometric parameters: ∆P = 8ηL ρπr 4 eff ̇m = 8νL πr 4 eff ̇m,(8) whereηandνdenote the dynamic and kinematic viscosities, respectively,Lis the channel length,ρis the fluid density, andr eff is the effective radius. This relationship forms the foundation for learning viscosity representations within the model. We capture the dependencies among these quantities through an attention-based module that estimates kinematic and dynamic viscosity in a physics-based approach. Kinematic Viscosity Module. We model kinematic viscosity by jointly encod- ing Coriolis and pressure representations through bidirectional cross-attention. Given embeddingsE ′ c andE ′ p , two Multi-Head Attention (MHA) blocks establish cross-modal alignment: h V 1 = MHA(E ′ p , E ′ c , E ′ c ), h V 2 = MHA(E ′ c , E ′ p , E ′ p ), (9) whereMHA(X Q ,X K ,X V ) follows the standard formulation of [25]. This bidirec- tional design allows pressure features to attend to flow and density cues while Coriolis features attend to pressure dynamics, encouraging the learned kinematic viscosity representations to respect the physical coupling between modalities. We use two separate attention blocks rather than a single cross-attention because the Hagen–Poiseuille relation expresses kinematic viscosity as the ratioν ∝ ∆P/ ̇m, where the pressure drop∆Pand the mass flow ̇mcontribute equally. A single cross-attention would make one modality the query and reduce the other to context, breaking this balance, whereas two blocks let each modality query the other in turn, giving both an equal role in the kinematic viscosity representation. The two cross-attention outputs are then fused via a point-wise 1×1 convolution that reduces the channel dimension: h V = Conv 1×1 [h V 1 ; h V 2 ] ∈R 2×d embed ,(10) PRIMS: Physics-guided Representation for Fluid Identification9 where [h V 1 ;h V 2 ]∈R 4×d embed denotes the channel-wise concatenation of the two cross-attention outputs and the 1×1 convolution applies a learnable linear projectionW conv ∈R 2×4 independently at each embedding position, reducing four channels back to two. Dynamic Viscosity Module. Since dynamic viscosity relates to kinematic viscosity scaled by density, we derive its representation by attending the fused kinematic viscosity embedding to density-related features via cross-attention: h η = MHA(h V , E ′ c , E ′ c ),(11) whereE ′ c carries density-related information from the Coriolis modality. By con- ditioning onE ′ c as keys and values, the module learns to modulate the kinematic viscosity representation with density cues, producing a dynamic viscosity feature that reflects the underlying physical coupling between the two quantities. 4.3 Physics-guided Fusion To unify all physics-informed representations for fluid classification, we introduce the Physics-Guided Fusion (PGF) module based on multi-head self-attention. This mechanism jointly processes embeddings of flow, pressure, density, and viscosity, enabling token-level interactions that capture cross-physical dependencies in a shared latent space: S all = [E ′ c ; E ′ p ; h V 1 ; h V 2 ; h η ]∈R 10×d embed ,(12) S MHA = MHA(S all , S all , S all ).(13) We retain the two directional outputsh V 1 andh V 2 here, rather than their fused formh V , so that self-attention can weigh each coupling direction independently per fluid. The fusedh V is instead optimized for the dynamic viscosity synthesis step, which could introduce unexpected biases. The attended representations are then refined through a residual connection with the Adaptive Spatial Sync (ASS) module [14], which recalibrates channel-wise features through spatially adaptive gating, followed by layer normalization: S ′ = LayerNorm S all + ASS(S MHA ) .(14) A position-wise feed-forward network (FFN) with GeLU activation is subsequently applied to enrich the per-token representations: FFN(S ′ ) = W 2 GeLU(W 1 S ′ + b 1 ) + b 2 ,(15) whereW 1 ∈R d embed ×d f ,W 2 ∈R d f ×d embed , andb 1 ,b 2 are learnable biases. A second residual connection with ASS and layer normalization yields the final fused output: S out = LayerNorm S ′ + ASS(FFN(S ′ )) .(16) The output representationS out ∈R 10×d embed , serves as a universal, physics- integrated summary of the entire signal ensemble. 10H.-L. Nguyen et al. 4.4 Classification Head The fused representation from the PGF module is mapped to the target fluid cat- egory through a lightweight classification head. We aggregate across all modality- channel tokens via global average pooling: ̄s = 1 M M X i=1 S out [i] ∈R d embed ,(17) whereMcorresponds to the total number of tokens. The pooled vector is then passed through two fully connected layers with dropout regularization. The network is trained by minimizing the cross-entropy loss: L CE =− C X j=1 y j log ˆy j ,(18) whereyandˆydenote the ground-truth and predicted probabilities, respectively. 5 Evaluation 5.1 Experimental Conditions Measuring Conditions. We obtain the data under controlled variations in environmental and flow conditions. Temperature is varied from 288 K to 308 K in 5 K increments, pressure from 4barto 6barin 0.5barsteps, and mass flow from 0 g h −1 to 5 g h −1 with increments between 0.3 g h −1 and 1 g h −1 . We con- duct experiments with five representative fluids: Nitrogen (N 2 ), Water (H 2 O), Isopropanol (IPA), Ethanol (EtOH), and Acetone (Ace). A total of 5,540 mea- surement streams are acquired, each containing four synchronized sensor signals (two Coriolis electrodes and two pressure channels) sampled at 10kHzfor one second. Each stream is divided into 50 non-overlapping segments of 20ms, yield- ing 277,000 samples in total. The key physical properties of the five fluids are summarized in Table 1. Comparison Methods and Evaluation Metric. We compare PRIMS with representative baselines for fluid classification, including physics-based analytical modeling and data-driven architectures such as ConvNet and BiLSTM introduced in [1]. For attention-based models, we conduct experiments with state-of-the-art time-series models, including TimeXer [26], iTransformer [12], and TQNet [11]. The task is formulated as a multi-class classification problem. Performance is evaluated using the macro-averaged F1-score over stratified 10-fold cross- validation, where each fold preserves the class distribution of the full dataset. To prevent data leakage, the stratified 10-fold cross-validation is performed at the acquisition condition level. All segments recorded under the same temperature, pressure, and flow-rate combination are assigned to the same fold. Model and Hyperparameters. We set the attention dimension to 88, corre- sponding to the selected frequency cutoff bins, and use 8 attention heads. The PRIMS: Physics-guided Representation for Fluid Identification11 Table 2: Comparison of F1 scores (%) for each fluid type and average of PRIMS and all baseline methods. All methods are evaluated across all mass flow rates at a 10 kS/s sampling rate, with results averaged over 10-fold cross-validation. For TimeXer, iTransformer, TQNet, and PRIMS, per-class and macro-averaged F1 (%), reported as mean ±std over 5 random seeds. Results for Analytical, ConvNet, and BiLSTM are taken from [1]. Best mean per column is highlighted in bold. MethodParams N 2 H 2 OIPAEtOHAce Average Analytical [1]—25.00100.079.1164.0088.0871.16 ConvNet [1]0.007 M 15.0046.0040.0044.0068.0042.60 BiLSTM [1]0.085 M 100.074.0077.0085.0086.0084.40 TimeXer [26]8.53 M 100.00 ±0.00 100.00 ±0.00 38.97 ±3.71 99.41 ±0.16 67.91 ±2.71 81.26 ±0.29 iTransformer [12] 6.42 M 99.99 ±0.01 100.00 ±0.01 92.11 ±1.37 99.94 ±0.06 94.84 ±0.77 97.37 ±0.44 TQNet [11]0.79 M 100.00 ±0.00 100.00 ±0.00 49.51 ±3.19 99.86 ±0.10 69.33 ±0.99 83.74 ±0.66 PRIMS (Ours) 0.46 M 99.91 ±0.06 99.97 ±0.02 97.04 ±0.09 99.86 ±0.10 97.81 ±0.06 98.92 ±0.03 classification head consists of two fully connected layers with a hidden dimension of 64. We optimize the model using stochastic gradient descent with a learning rate of 10 −3 , a batch size of 8, and train for 50 epochs. All baseline models are implemented following their original configurations. 5.2 Results Comparison with Baselines. As shown in Table 2, PRIMS achieves the highest overall performance across all baselines, with an average F1 of 98.92%. The purely physics-based analytical method yields an average of 71.16%, highlighting the difficulty of modeling nonlinear sensor interactions using handcrafted equations alone. By embedding physical relationships within the attention mechanism, PRIMS effectively distinguishes fluids with similar properties, such as IPA, EtOH, and Ace, where purely data-driven ConvNet and BiLSTM methods [1] exhibit substantial performance degradation. Moreover, PRIMS significantly outperforms TimeXer [26] and TQNet [11] in average score, surpassing them by 17.66% and 15.18%, respectively. Compared to iTransformer [12], which achieves 97.37% with 6.42 million trainable parameters, PRIMS attains superior performance with only 0.46 million parameters, a 14×reduction in model size. In addition, PRIMS is the most stable across random seeds: its average F1 varies by only±0.03%, roughly an order of magnitude smaller than TimeXer (±0.29%), iTransformer (±0.44%), and TQNet (±0.66%). These results confirm that integrating physics-based priors into multimodal attention substantially enhances both accuracy and robustness in fluid classification. Ablation Study. Table 3 presents the contribution of each proposed component. Removing any module consistently degrades performance, confirming the comple- mentary role of all three design stages. Excluding the Physical Component Synthe- sizer (PCS) leads to a reduction of 1.54% in average F1-score (Row 1→Row 2). 12H.-L. Nguyen et al. Table 3: Ablation study of PRIMS under different module configurations. PTV = Physics-based Token Vectorization; PCS = Physical Component Synthesizer; PGF = Physics-Guided Fusion. All experiments are conducted at a sampling rate of 10 kS/s across all flow rates. Best results are highlighted in bold. Row PTV PCS PGF Model Size N 2 H 2 O IPA EtOH Ace Average 1✓0.46 M 100.0 100.0 97.20 99.82 97.80 98.96 2✓0.35 M 99.92 99.97 93.70 98.90 94.59 97.42 3✓0.16 M 100.0 100.0 92.22 99.04 90.45 96.34 4✓0.05 M 59.79 66.65 92.21 39.22 54.29 58.16 5✓2.17 M 100.0 100.0 93.46 100.0 95.56 97.80 Although this drop is small, PCS provides physically grounded viscosity represen- tations that improve interpretability and contribute to the robustness observed in the out-of-distribution experiments. The absence of the Physics-Guided Fusion (PGF) module causes a larger drop of 2.62% (Row 1→Row 3), highlighting its essential role in integrating cross-physical relationships. When both PCS and PGF are removed, the average F1-score drops sharply to 58.16% (Row 1→Row 4), demonstrating that the physics-informed synthesis and fusion stages are critical for achieving strong classification performance beyond what tokenization alone can provide. Finally, removing the Physics-based Token Vectorization (PTV) while keeping both PCS and PGF (Row 1→Row 5) lowers the average F1-score by only 1.16%, yet enlarges the model from 0.46 M to 2.17 M parameters (about 4.7×). This shows that PTV can compresses the raw signal into a compact, physically meaningful token representation. Out-of-Distribution Generalization. Table 4 evaluates all models under out- of-distribution conditions, where an entire temperature regime is held out during training. PRIMS achieves the highest average F1-score across all five temperature splits, ranging from 80.08% at 288 K to 99.82% at 303 K. The advantage is most pronounced on fluids with similar rheological profiles: at 298 K, PRIMS achieves 93.63% on IPA while iTransformer [12] and TQNet [11] reach only 66.26% and 26.16%, respectively. This suggests that the physics-aware representations capture temperature-invariant features rather than memorizing regime-specific patterns. 5.3 Latent Space Analysis Figure 3 visualizes the learned latent spaces of the three viscosity branches via PCA. The dynamic viscosity space (left column) produces the clearest separation: all five fluid classes form distinct clusters in both folds, confirming that this branch learns highly discriminative features aligned with the underlying rheolog- ical differences among fluids. Kinematic viscosity 1 (middle column) reveals a complementary pattern: N 2 and H 2 O are well isolated, while IPA, EtOH, and Acetone exhibit partial overlap, consistent with their similar kinematic viscos- ity values in Table 1. Kinematic viscosity 2 (right column) shows considerable PRIMS: Physics-guided Representation for Fluid Identification13 Table 4: Out-of-distribution generalization under isolated temperature testing. Each block holds out a single temperature as the test set; all remaining tempera- tures are used for training. Best results are highlighted in bold. Temp ModelN 2 H 2 O IPA EtOH Ace Average 288 K TimeXer [26]100.0 100.0 3.02 91.58 67.5572.43 iTransformer [12] 100.0 100.0 65.60 74.45 41.1576.24 TQNet [11]100.0 100.0 27.91 77.31 47.5470.55 PRIMS (Ours)96.82 99.74 69.43 77.05 57.36 80.08 293 K TimeXer [26]100.0 100.0 21.14 98.69 69.0577.78 iTransformer [12] 100.0 100.0 49.71 99.83 11.0172.11 TQNet [11]100.0 100.0 48.00 97.96 54.5780.11 PRIMS (Ours) 100.0 99.94 73.50 96.45 69.47 87.87 298 K TimeXer [26]100.0 100.0 15.12 99.14 68.2376.50 iTransformer [12] 100.0 100.0 66.26 84.32 44.0678.93 TQNet [11]100.0 100.0 26.16 99.78 64.5378.09 PRIMS (Ours)99.95 99.98 93.63 98.17 92.81 96.91 303 K TimeXer [26]100.0 100.0 31.67 99.13 65.2879.22 iTransformer [12] 100.0 100.0 81.07 99.86 81.6992.52 TQNet [11]100.0 100.0 43.02 100.0 62.0981.02 PRIMS (Ours)99.64 100.0 99.64 99.82 100.0 99.82 308 K TimeXer [26]99.75 99.20 53.01 97.18 36.5677.14 iTransformer [12] 68.13 95.88 65.92 90.97 84.29 81.04 TQNet [11]100.0 99.94 53.35 99.23 62.3582.97 PRIMS (Ours)99.32 98.35 69.95 97.77 72.90 87.66 overlap among fluid classes, suggesting that this branch captures shared flow characteristics rather than class-specific features. Crucially, the cluster geometry remains consistent across Fold 1 and Fold 2, where different data partitions are used for training. This consistency demonstrates that the learned representations reflect stable physical structure rather than artifacts of a particular data split, corroborating the robust out-of-distribution generalization observed in Table 4. 5.4 Computational Efficiency To fairly compare computational cost across different frameworks, we export all models to the Open Neural Network Exchange (ONNX) format and profile them using ONNX Runtime on a single CPU core. It provides a framework- independent representation that ensures consistent measurement of model size, operator count, inference latency, and throughput across all methods. Table 5 compares the computational profiles of Transformer-based methods. PRIMS is the most compact, requiring only 1.68 MB and 463,507 parameters, which represents an 14×reduction in size compared to iTransformer [12] and a 25× reduction compared to TimeXer [26]. While TQNet [11] achieves the lowest 14H.-L. Nguyen et al. Dynamic viscosityKinematic viscosity 1Kinematic viscosity 2 Fold 1 Fold 2 Fig. 3: PCA visualization of the PRIMS latent spaces across two cross-validation folds. Each point represents a sample colored by fluid type (0: N 2 , 1: H 2 O, 2: IPA, 3: EtOH, 4: Ace). The dynamic viscosity space (left column) shows clear cluster separation, kinematic viscosity 1 (middle) shows partial separability, and kinematic viscosity 2 (right) reveals considerable overlap. The consistent geometry across both folds indicates stable, physically grounded representations. latency of 0.11 ms and highest throughput of 9,525 S/s, its classification accuracy of 83.29% average F1 falls substantially behind PRIMS at 98.96%. PRIMS achieves a competitive latency of 0.18 ms with 5,698 S/s throughput, offering the most favorable accuracy-efficiency trade-off among all compared methods. These results confirm that embedding physics-based inductive biases not only improves classification performance but also reduces model complexity, as the architecture can rely on physically meaningful representations. 6 Conclusion In this study, we proposed PRIMS, a physics-aware multimodal Transformer for fluid classification in microfluidic systems. PRIMS integrates physics-driven tokenization, cross-attention-based viscosity synthesis, and attention-based fusion to align data-driven learning with underlying fluid dynamics. Evaluations on a five-fluid benchmark demonstrate that PRIMS achieves 98.96% average F1-score with only 0.46 million parameters, a 14×reduction compared to state-of-the- art Transformer-based methods while maintaining strong generalization. These results confirm that embedding physical priors directly into the model architecture improves both accuracy and efficiency, enabling practical deployment on resource- constrained devices. Limitations and Future Work. PRIMS currently embeds physical knowledge through architectural design alone, without explicit auxiliary losses to enforce PRIMS: Physics-guided Representation for Fluid Identification15 Table 5: Computational profiling of PRIMS and baseline models using Open Neural Network Exchange (ONNX) Runtime on a single CPU core. Columns report model size (MB), parameter count, operation count (Ops), inference latency (ms), and throughput in samples per second (S/s). Best results are highlighted in bold. ModelSize (MB) Params Ops Latency (ms) Throughput (S/s) TimeXer [26]41.97 8,525,370 5113.54283 iTransformer [12]24.52 6,418,437 2030.502,017 TQNet [11]3.03 790,149 1210.119,525 PRIMS (Ours)1.68 463,507 1350.185,698 relationships. Incorporating physics-based constraint losses, such as those derived from the Hagen–Poiseuille law, could further regularize the latent space toward physically consistent representations. Additionally, the Hagen–Poiseuille relation assumes laminar, Newtonian, and incompressible flow; while this approximation is justified under low-flow, moderate-pressure operating regime, it may introduce modelling error for gases at higher flow rates where compressibility becomes significant. Future work will integrate explicit physical constraint losses, extend the framework to compressible and non-Newtonian flows, and validate on broader fluid vocabularies and real-world conditions. Acknowledgements This publication is part of the project MOSAIC: enhancement of MicrOfluidic Sensing with deep symbolic Artificial IntelligenCe with file number 19985 of the research programme Open Technology Programme which is (partly) financed by the Dutch Research Council (NWO). References 1.Alveringh, D., Le, D., Groenesteijn, J., Schmitz, J., Lötters, J.: Fluid classification with integrated flow and pressure sensors using machine learning. Sensors and Actuators A: Physical 363, 114762 (2023) 2.Alveringh, D., Schut, T.V.P., Wiegerink, R.J., Sparreboom, W., Lötters, J.C.: Resistive pressure sensors integrated with a coriolis mass flow sensor. In: 2017 19th International Conference on Solid-State Sensors, Actuators and Microsystems. p. 1167–1170 (2017) 3.Bronkhorst High-Tech B.V.: mini cori-flow ml120v21 datasheet (2016), accessed: 2025-10-04 4. Cengel, Y., Turner, R., Smith, R.: Fundamentals of Thermal-Fluid Sciences. Applied Mechanics Reviews 54(6), B110–B112 (Nov 2001) 5.Chen, H., Liu, Y., Sun, H.: Pinp: Physics-informed neural predictor with latent estimation of fluid flows. In: International Conference on Learning Representations (2025) 16H.-L. Nguyen et al. 6.Ejeian, F., Azadi, S., Razmjou, A., Orooji, Y., Kottapalli, A., Warkiani, M.E., Asadnia, M.: Design and applications of mems flow sensors: A review. Sensors and Actuators A: Physical 295, 483–502 (2019) 7.Haneveld, J., Lammerink, T., de Boer, M., Sanders, R., Mehendale, S., Lötters, J., Dijkstra, M., Wiegerink, R.: Modeling, design, fabrication and characterization of a micro coriolis mass flow sensor. Journal of Micromechanics and Microengineering 20(12), 125001 (2010) 8.Kirby, B.J.: Micro-and nanoscale fluid mechanics: transport in microfluidic devices. Cambridge university press (2010) 9.Koupai, A.K., Bocus, M.J., Santos-Rodriguez, R., Piechocki, R.J., McConville, R.: Self-supervised multimodal fusion transformer for passive activity recognition. IET Wireless Sensor Systems 12(5-6), 149–160 (2022) 10.Li, Y., Yuan, G., Wen, Y., Hu, J., Evangelidis, G., Tulyakov, S., Wang, Y., Ren, J.: Efficientformer: Vision transformers at mobilenet speed. Advances in Neural Information Processing Systems 35, 12934–12949 (2022) 11.Lin, S., Chen, H., Wu, H., Qiu, C., Lin, W.: Temporal query network for efficient multivariate time series forecasting. In: Forty-second International Conference on Machine Learning (2025) 12. Liu, Y., Hu, T., Zhang, H., Wu, H., Wang, S., Ma, L., Long, M.: itransformer: Inverted transformers are effective for time series forecasting. In: Kim, B., Yue, Y., Chaudhuri, S., Fragkiadaki, K., Khan, M., Sun, Y. (eds.) International Conference on Representation Learning. vol. 2024, p. 11116–11140 (2024) 13.Mustafa, A., Haider, D., Barua, A., Tanyeri, M., Erten, A., Yalcin, O.: Machine learning based microfluidic sensing device for viscosity measurements. Sensors & Diagnostics 2(6), 1509–1520 (2023) 14.Nguyen, S.M., Le, D.V., Havinga, P.: imot: Inertial motion transformer for inertial navigation. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 39, p. 6209–6217 (2025) 15.Nguyen, T.T., Kawanishi, Y., John, V., Komamizu, T., Ide, I.: Multisensor-home: A wide-area multi-modal multi-view dataset for action recognition and transformer- based sensor fusion. In: Proceedings of the 19th IEEE International Conference on Automatic Face and Gesture Recognition. p. 1–10 (2025) 16. Oppenheim, A.V., Schafer, R.W.: Discrete-Time Signal Processing. Pearson, Upper Saddle River, NJ, 3 edn. (2010) 17.Pan, J., Bulat, A., Tan, F., Zhu, X., Dudziak, L., Li, H., Tzimiropoulos, G., Martinez, B.: Edgevits: Competing light-weight cnns on mobile devices with vision transformers. In: European conference on computer vision. p. 294–311. Springer (2022) 18.Park, J., Kim, Y.W., Jeon, H.J.: Machine learning-driven innovations in microflu- idics. Biosensors 14(12), 613 (2024) 19.Pham, T.K., Vu, H.M., Chu, A.D., Nguyen, D.T., Nguyen, T.T., Truong, T.N., Son, M.H., Nguyen, T.T., Le Nguyen, P.: PADM: A physics-aware diffusion model for attenuation correction. In: Proceedings of the 2026 IEEE/CVF Winter Conference on Applications of Computer Vision. p. 2606–2615 (2026) 20.Raissi, M., Perdikaris, P., Karniadakis, G.E.: Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics 378, 686–707 (2019) 21.Schut, T.V.P., Alveringh, D., Sparreboom, W., Groenesteijn, J., Wiegerink, R.J., Lötters, J.C.: Fully integrated mass flow, pressure, density and viscosity sensor PRIMS: Physics-guided Representation for Fluid Identification17 for both liquids and gases. In: 2018 IEEE Micro Electro Mechanical Systems. p. 218–221 (2018) 22. Smith, R., Sparks, D.R., Riley, D., Najafi, N.: A mems-based coriolis mass flow sensor for industrial applications. IEEE Transactions on Industrial Electronics 56(4), 1066–1071 (2009) 23.Sparreboom, W., Van de Geest, J., Katerberg, M., Postma, F., Haneveld, J., Groenesteijn, J., Lammerink, T., Wiegerink, R., Lötters, J.: Compact mass flow meter based on a micro coriolis flow sensor. Micromachines 4(1), 22–33 (2013) 24. Van Kuijk, J., Lammerink, T., De Bree, H.E., Elwenspoek, M., Fluitman, J.: Multi- parameter detection in fluid flows. Sensors and actuators A: Physical 47(1-3), 369–372 (1995) 25. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, Ł., Polosukhin, I.: Attention is all you need. Advances in neural information processing systems 30 (2017) 26.Wang, Y., Wu, H., Dong, J., Qin, G., Zhang, H., Liu, Y., Qiu, Y., Wang, J., Long, M.: Timexer: Empowering transformers for time series forecasting with exogenous variables. Advances in Neural Information Processing Systems 37, 469–498 (2024) 27.Wu, H., Xu, J., Wang, J., Long, M.: Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting. Advances in neural information processing systems 34, 22419–22430 (2021) 28.Yang, S., Wang, Y., Jiang, Y., Qiang, T.: An integrated microfluidic microwave array sensor with machine learning for enrichment and detection of mixed biological solution. Biosensors 15(1), 45 (2025) 29.Yang, Y., Lu, J.: A fusion transformer for multivariable time series forecasting: The mooney viscosity prediction case. Entropy 24(4), 528 (2022) 30.Zhou, H., Zhang, S., Peng, J., Zhang, S., Li, J., Xiong, H., Zhang, W.: Informer: Be- yond efficient transformer for long sequence time-series forecasting. In: Proceedings of the AAAI conference on artificial intelligence. vol. 35, p. 11106–11115 (2021) 31.Zubavicius, R., Alveringh, D., Poel, M., Groenesteijn, J., Sanders, R.G., Wiegerink, R.J., Lötters, J.C.: Fluid viscosity and density determination with machine learning- enhanced coriolis mass flow sensors. In: 2024 IEEE 37th International Conference on Micro Electro Mechanical Systems. p. 82–85 (2024)