Introduction

Microwave engineering is increasingly important due to its wide range of applications in communication, radar, biomedical diagnostics, and sensing. The ability of microwaves to interact with materials based on their dielectric properties makes it possible to develop compact, cost-effective, and highly sensitive sensors for non-invasive, real-time monitoring. Among the various implementation methods, microstrip technology offers particular advantages, including planar configuration, ease of fabrication, integration capability with other circuits, and wide operational bandwidth, making it a prime candidate for developing advanced microwave sensors1,2.

Crude oil, as one of the most critical energy resources globally, underpins much of the world’s economic and industrial infrastructure. Accurate measurement of the oil–water ratio in mixtures is crucial for optimizing refining processes, maintaining product quality, and reducing costs associated with transportation and processing. Water content, whether from production processes or environmental contamination, can drastically affect the economic value and downstream handling of crude oil. Traditional laboratory techniques used for assessing oil–water ratios, such as centrifugation, distillation, or Karl Fischer titration, are often labor-intensive, time-consuming, and impractical for in-field operations. This gap highlights the urgent need for real-time, reliable, and portable sensing solutions. Microwave sensors, through their sensitivity to dielectric variations between oil and water, present a promising and non-invasive alternative for accurate volume fraction assessment in multiphase petroleum fluids.3,4,5,6.

Despite the promising potential of microwave sensors, designing them for practical applications presents a number of challenges. These include achieving high sensitivity and selectivity, miniaturization without performance loss, wideband or multiband operation, and stability in various environmental conditions. Recent works have explored innovative techniques to enhance microwave sensor performance. For instance, authors of7 demonstrated the use of particle swarm optimization to design novel stubs in dual-band Wilkinson power dividers. Further, in8, a high-sensitivity microwave sensor was proposed for edible oil characterization using a Wilkinson power divider structure, underlining the role of careful structural design and material interaction. Similarly, triplexer-based sensors for detecting chemical composition in honey were presented in9, pushing the boundaries of microwave sensor capabilities for bio-substance detection.

Other recent studies have advanced the design of microwave components such as diplexers and power dividers with compact and wideband features10,11,12, or optimization through evolutionary algorithms13, all of which contribute to the evolution of sensing hardware. Furthermore, the integration of artificial intelligence techniques with microwave sensing, such as in the high-accuracy glucose detection sensor using artificial neural network models by authors of14, reveals another emerging frontier in improving sensor reliability and data interpretation.

Microwave-based sensing methods have shown considerable promise in evaluating the water content of oil–water mixtures, especially through the use of resonant structures. One design employed a microwave cavity operating within the 5.0 to 5.7 GHz range, effectively enabling material characterization based on shifts in resonant frequency15. Another configuration utilized an open-ended resonator with a single excitation port, where electromagnetic fringe fields near the pipe wall were perturbed by the fluid. This interaction allowed for highly sensitive detection of water concentrations between 0 and 5%, although the small detection region required the two-phase fluid to be uniformly mixed for accurate results16.

A compact twin-spiral resonator was also proposed for oil–water analysis, where the resonance frequency and quality factor demonstrated measurable changes during dynamic tests. These parameters could be used to infer water content in mixtures where oil and water coexist in the continuous phase17,18. Additional work introduced a method for estimating moisture levels in crude oil using shifts in resonant behavior under microwave excitation19. Later advancements built upon this foundation by enhancing measurement precision and broadening the operational scope of microwave sensing for petroleum applications20,21,22,23.

In another approach, the water concentration in crude oil was quantified by applying an excitation voltage to the sensing structure and analyzing the resulting current response. A clear relationship was found between measured current and fluid composition, enabling reliable determination of water content24. Subsequently, ultra-short-wave microwave techniques were utilized to identify water presence in crude oil by observing frequency shifts induced by variations in dielectric properties. This method yielded high-resolution results and supported compact sensor designs capable of in-field water content analysis25.

However, despite these advancements, a critical review of the literature reveals a notable gap: very few works have addressed the sensing of petroleum-based liquids, especially crude oil, using microwave structures. While various sensors have been proposed for bio-materials and edible oils, applications targeting the complex dielectric behavior of petroleum derivatives remain sparse and underexplored. The challenges specific to petroleum—such as viscosity, compositional variability, and environmental conditions—demand dedicated design approaches and sensor architectures that have not yet been comprehensively investigated.

In this study, a novel microwave sensor structure is proposed that utilizes semicircular and isosceles trapezoid-shaped resonators to enhance electromagnetic field confinement and improve sensitivity. The sensor’s response to oil–water mixtures is further analyzed using deep learning techniques, enabling precise prediction of water content based on resonance characteristics and dielectric variations. The integration of the dual-band resonator design with data-driven modeling provides a robust framework for accurate, real-time fluid characterization, offering a promising approach for industrial and environmental monitoring applications.

Sensor design

The sensor design in this work is grounded in established principles from microwave filter circuit theory, which provides a robust framework for achieving selective frequency responses. Among the various configurations available, the band-pass filter is chosen for its proven advantages—notably high sensitivity, compact geometry, and ease of fabrication26,27. To ensure effective operation across both the cutoff and passband regions, the filter structure integrates a combination of resonators, transmission stubs, and impedance-matching segments.

The proposed resonator geometry is depicted in Fig. 1a, along with its corresponding lumped-element (LC) equivalent circuit. This structure is realized by embedding a modified isosceles trapezoid-shaped resonator (ITSR) within a microstrip transmission line, which enhances the concentration and control of the electromagnetic field, thereby improving the resonant characteristics of the sensor. According to fundamental microstrip theory, certain segments of the transmission line can be modeled using equivalent LC elements. Specifically, an open-ended stub constructed from a low-impedance, lossless microstrip line can be approximated as a shunt capacitor, while a short-circuited, high-impedance stub behaves as a shunt inductor26,28. These modeling assumptions are used to derive the LC circuit shown in Fig. 1b, where the open tapered stubs are interpreted as capacitive elements. This modeling approach is systematically applied throughout the study for all equivalent circuit representations associated with the sensor structures.

Fig. 1
Fig. 1Fig. 1
Full size image

(a) Geometry of the proposed trapezoid-shaped resonator, (b) Equivalent LC circuit model with extracted parameters, and (c) Simulated and LC-model S-parameters comparison.

The inductance (L) and capacitance (C) values within the equivalent circuit are directly influenced by the physical dimensions of the microstrip structure. These parameters can be calculated based on transmission line theory and are essential for achieving the desired electromagnetic response29,30. In particular, for a high-impedance line segment (denoted as \({Z}_{H}\)), the physical length \(l\) of the transmission line corresponding to a specified inductance can be determined through established analytical expressions.

$$l = \left( {\frac{{\lambda_{H} }}{2\pi }} \right)sin^{ - 1} \left( {\frac{\omega L}{{Z_{H} }}} \right)$$
(1)

In conjunction with the inductive component, the corresponding capacitance value can be determined using the appropriate relationships derived from transmission line theory, allowing for accurate modeling of the structure’s reactive behavior.

$$C_{l} = \left( {\frac{1}{{\omega Z_{H} }}} \right).{\text{tan}}\left( {\frac{\pi l}{{\lambda_{H} }}} \right)$$
(2)

For a low-impedance transmission line (denoted as \({Z}_{L}\)), the physical length necessary to realize a specified capacitance can be calculated using established formulations derived from the distributed element model of microstrip structures.

$$l = \left( {\frac{{\lambda_{L} }}{2\pi }} \right)sin^{ - 1} \left( {\omega CZ_{L} } \right)$$
(3)

and the capacitance’s related inductance may be expressed as

$$L_{c} = \left( {\frac{{Z_{L} }}{\omega }} \right){\text{tan}}\left( {\frac{\pi l}{{\lambda_{L} }}} \right)$$
(4)

where \(\omega\) is the angular frequency, λ is the wave length of the high and low characteristic impedance, \({Z}_{H}\) is the high impedance value, and \({Z}_{L}\) is the low impedance value.

Using the analytical relationships presented earlier, the exact inductance and capacitance values for each element of the equivalent circuit were determined. These values served as the basis for both schematic and layout simulations conducted in Advanced Design System (ADS) software, with the corresponding results shown in Fig. 1c. The sensor was designed on an FR-4 substrate (thickness: 20 mil, loss tangent tan δ = 0.02), chosen for its low cost and compatibility with conventional fabrication processes. The strong agreement observed between the schematic and layout responses verifies the accuracy of the extracted equivalent circuit and confirms the validity of the proposed resonator configuration. This consistency highlights the robustness of the modeling approach and the stable electromagnetic behavior of the designed sensor.

On the other hand, Fig. 2 presents a comparative analysis of the S21-parameter obtained from both the full-wave simulation of the microstrip structure and its corresponding LC equivalent circuit model. As illustrated, there is a strong correlation between the two results across the frequency range from DC up to 12 GHz, confirming the accuracy and validity of the extracted equivalent circuit.

Fig. 2
Fig. 2Fig. 2
Full size image

(a) Geometry of the proposed filter with ITSRs, (b) Equivalent LC circuit model with extracted parameters, and (c) Simulated and LC-model S-parameters comparison.

As illustrated in Fig. 2b, electromagnetic coupling occurs between the two trapezoidal resonators and the adjacent transmission lines in the proposed bandpass filter. This interaction is represented in the equivalent circuit by two coupling capacitors with values of 0.025 pF and 0.008 pF, respectively. The simulated frequency response, presented in Fig. 2c, reveals a well-defined passband centered at approximately 11.72 GHz, with a return loss (S₁₁) of − 21 dB and an insertion loss (S₂₁) below − 0.5 dB. These results confirm the filter’s efficient energy transmission and strong impedance matching, demonstrating the high performance and precision of the designed filter configuration.

To further enhance the performance of the proposed filter (sensor), a semicircular resonator structure was introduced, as depicted in Fig. 3. This configuration was designed to improve electromagnetic field confinement and optimize the resonant characteristics of the sensor. The corresponding layout, LC equivalent circuit, and the comparison of simulated S-parameters between the physical and circuit models are presented in Fig. 3a–c, respectively. The close agreement between these results verifies the accuracy of the equivalent circuit representation and underscores the effectiveness of the semicircular geometry in achieving improved sensing and filtering performance.

Fig. 3
Fig. 3Fig. 3
Full size image

(a) Geometry of the proposed filter with semicircular resonators, (b) Equivalent LC circuit model with extracted parameters, and (c) Simulated and LC-model S-parameters comparison.

Using the proposed resonators, the final configuration of the linear filter was developed, as illustrated in Fig. 4a, with its corresponding LC equivalent circuit and simulated S-parameters presented in Fig. 4b, c, respectively.

Fig. 4
Fig. 4Fig. 4
Full size image

(a) Geometry of the final filter, (b) Equivalent LC circuit model with extracted parameters, and (c) Simulated and Measured of S-parameters comparison.

Figure 4c presents a detailed comparison of the measured frequency response, the layout simulation, and the LC equivalent circuit for the S11 and S21 parameters. This comparison allows for a thorough analysis of the sensor’s performance by plotting both the simulated and actual measurement results. The S11 and S21 parameters are critical in evaluating the sensor’s reflection and transmission characteristics, providing insight into its behavior across the operating frequencies. The alignment between the simulated data and measured results validates the sensor design, confirming that the experimental performance closely matches theoretical predictions. As observed in Fig. 4c, the new design not only preserves all the advantages of the previous structure shown in Fig. 3c but also achieves an extended cutoff bandwidth with a high stopband suppression level exceeding − 20 dB. Moreover, the proposed filter exhibits a dual-band response, with one passband centered at approximately 1.2 GHz and the second at 14.92 GHz, clearly demonstrating the strong coupling effects between the integrated resonators. The overall size of the final structure is 10.94 × 14.92 mm2, confirming its compactness and suitability for integrated microwave sensing applications.

The frequency response of the final filter topology can be closely approximated by a Gaussian function. Accordingly, the input loss (in dB) is expressed as a Gaussian dependence on frequency31:

$$IL \left( f \right) = 10 loge^{{\frac{{\left( {2\pi f} \right)^{2} }}{{\left( {2n - 1} \right)}}}}$$
(5)

where f is the operating frequency (GHz) and n denotes the filter order. For the proposed ninth-order linear filter, Eq. (6) is derived using this Gaussian formulation, where the coefficients ai, bi, and ci (i = 1,2,3,…,9) represent constant parameters optimized for a − 3 dB cutoff frequency at 1.2 GHz, as illustrated in Figs. 1a, 2a, and 3a. The corresponding geometric dimensions (lengths and widths of the resonator sections) are provided in the respective figures.

$$IL\left( f \right) = \left[ {\underbrace {{\mathop \sum \limits_{i = 1}^{m} a_{i} e^{{ - \left( {\frac{{f - b_{i} }}{{c_{i} }}} \right)^{2} }} }}_{{Band 1 \left( {e.g., around 1.2 GHz} \right)}}} \right. + \underbrace {{\mathop \sum \limits_{i = m + 1}^{9} a_{i} e^{{ - \left( {\frac{{f - b_{i} }}{{c_{i} }}} \right)^{2} }} }}_{{Band 2 \left( {e.g., around 14.92 GHz} \right)}}$$
(6)

Choose m to allocate how many Gaussian terms you use to model each band (e.g., m = 4 for Band 1 and 5 for Band 2). The coefficients ai control the amplitude (in dB), bi center each Gaussian near the desired spectral features (passband centers or edges), and ci set the spectral spread to match the cutoff, passband flatness, and stopband roll-off.

The Gaussian approximation of the input loss was compared with the simulated results, as illustrated in Fig. 5. The two responses exhibit excellent agreement across the cutoff, passband, and rejection regions, while the difference plot further demonstrates their close correspondence. This high level of consistency validates the accuracy of the analytical model and confirms the robustness of the proposed filter design. As established in prior studies31, high-order Gaussian filters are characterized by their flat group delay across a broad passband. The measured group delay of the proposed filter, illustrated in Fig. 6, further confirms its superior temporal performance. In the first passband, the maximum variation in group delay is approximately 0.11 ns, while in the second passband it is around 0.05 ns. These minimal fluctuations highlight the filter’s outstanding temporal stability and high design precision across both operating bands, demonstrating its effectiveness in maintaining consistent phase and signal integrity.

Fig. 5
Fig. 5
Full size image

Difference Between Simulated S21 and Gaussian Approximation.

Fig. 6
Fig. 6
Full size image

Measured group delay of the proposed filter in (a) the first and (b) the second passband.

A comparative analysis summarized in Table 1 highlights the superior performance of the proposed filter relative to previously reported designs, particularly in terms of group delay flatness within the passband. These results underscore the effectiveness of the Gaussian-based design approach in achieving both wideband operation and highly stable transmission characteristics.

Table 1 Comparison of the maximum group delay variation within the passband for the suggested dual-band filter and previously reported designs.

Electric Field Distribution

Figure 7a–c present the current density distribution at different frequencies, providing insights into the electric field confinement and the performance of the proposed sensor design. These figures illustrate the electromagnetic behavior of the sensor at its resonant frequencies (1.2 GHz and 14.92 GHz) and at a frequency within the cutoff band (10 GHz), highlighting the sensor’s coupling efficiency and ability to reject undesired frequencies.

Fig. 7
Fig. 7Fig. 7
Full size image

Current density distribution at frequencies of (a) 1.2 GHz, (b) 14.92 GHz, and (c) 10 GHz.

Figure 7a displays the current density distribution at the first resonant frequency of 1.2 GHz. The current density is concentrated at the output port, indicating a strong coupling between the resonator structure and the external environment. This high concentration of current is a result of the effective interaction of the electromagnetic field with the oil–water mixture, significantly enhancing the sensor’s sensitivity to dielectric variations. The confinement of the electric field at this frequency enables precise measurements of the fluid’s composition, contributing to the sensor’s overall performance. Also, Fig. 7b shows the current density distribution at the second resonant frequency of 14.92 GHz. As with the lower frequency, the current density is focused at the output port, confirming strong coupling at this higher frequency. This dual-mode response improves the sensor’s operational range and allows for more accurate dielectric analysis across a wider frequency spectrum.

Figure 7c illustrates the current density distribution at 10 GHz, a frequency within the sensor’s cutoff band. At this frequency, the current density at the output port is significantly reduced, demonstrating minimal coupling and energy transfer. This indicates that the sensor effectively rejects frequencies outside its resonant bands, which is essential for isolating relevant data and improving the overall accuracy of the sensor.

Simulated S21 for Different Oil–Water Mixture Purities

The simulated S21 responses for oil–water mixtures with varying purity levels, ranging from 0 to 100% pure oil, are presented to assess the sensor’s ability to detect changes in the dielectric properties of the mixture. These simulations were conducted across the two primary operating frequencies to explore how the sensor responds to different concentrations of oil in the mixture.

Figure 8a illustrates the simulated S21 responses for the first operating band (0.1 GHz to 2.5 GHz), while Fig. 8b shows the results for the second operating band (14 GHz to 16 GHz). Each curve in the figures corresponds to a different oil–water mixture, where the oil purity increases from 0 to 100%. As the purity of oil increases, the S21 response undergoes a nonlinear shift, reflecting the intricate dielectric interactions between the electromagnetic fields and the mixture. These shifts in the resonance frequency highlight the sensor’s capacity to distinguish subtle changes in the mixture composition. Notably, the S21 response exhibits pseudo-sinusoidal behavior, emphasizing the nonlinearity of the sensor’s interaction with the varying dielectric properties of the mixture.

Fig. 8
Fig. 8
Full size image

Simulated variations in the S₂₁ parameter for different purity levels of oil–water mixtures: (a) first operating band and (b) second operating band.

The variations observed in Fig. 8a reveal that as the proportion of oil in the mixture increases, the resonance peak shifts accordingly, with higher oil concentrations causing a more pronounced shift. This trend is further emphasized in Fig. 8b, where the sensor shows enhanced sensitivity at the second operating frequency range (14 GHz to 16 GHz). Here, the magnitude of the shifts is more significant, reinforcing the sensor’s ability to detect even minor variations in fluid composition. The ability of the sensor to differentiate between closely spaced dielectric properties, as demonstrated by the nonlinear changes in the S21 response, underscores its potential for high-precision applications.

These simulated results confirm that the proposed dual-band sensor is capable of accurately measuring variations in the dielectric properties of oil–water mixtures. The observed nonlinear behavior of the S21 response ensures that even small compositional changes are detectable, making the sensor ideal for applications requiring high sensitivity and resolution in fluid composition analysis.

Measurement setup and sensor characterization

After completing the design and optimization of the proposed dual-band microwave filter, the structure was further investigated as a microwave sensing device to evaluate its capability for oil–water mixture analysis. The objective of this phase was to examine how variations in the dielectric properties of the mixture influence the sensor’s resonance behavior, and to determine whether these variations can be accurately correlated to the water content through deep learning techniques—specifically, using a RBF neural network model.

Experimental procedure

The experimental validation was conducted in a controlled laboratory environment to ensure measurement repeatability and accuracy. The test samples consisted of oil–water mixtures with water volume fractions of 0%, 5%, 10%, 15%, 20%, and up to 100% pure oil, thereby covering the full operational range of interest. Each mixture was prepared using a digital micropipette with a precision of 0.01 mL, ensuring accurate and consistent volumetric ratios. The mixtures were thoroughly homogenized before each measurement to prevent phase separation and ensure uniform dielectric behavior during testing.

All measurements were performed at a constant ambient temperature of 25 °C and standard atmospheric pressure. The setup was isolated from external electromagnetic interference, and the same experimental protocol was applied to each sample to guarantee standardized and repeatable conditions.

The sensing region in the modified ITSR filter is located precisely between the two trapezoidal resonators, where the electric field is most concentrated, as evidenced by Fig. 7a, b. This region, where the electromagnetic field intensity is highest, provides an optimal area for placing the sample. The strong field confinement in this region ensures maximum sensitivity to changes in the dielectric properties of the oil–water mixture. Similarly, in the semicircular resonator filter, the sensing region is situated between the two semicircular resonators, where field intensity is again heightened, enabling strong electromagnetic coupling with the sample. The placement of the sample in these high-intensity regions ensures effective interaction with the sensor’s electromagnetic field, contributing to precise measurements of the material’s dielectric characteristics.

The dual-band nature of the sensor further enhances its performance by offering two distinct sensing regions, each corresponding to one of the operating frequencies—1.2 GHz and 14.92 GHz. The ability to place the sample in either of these regions allows for greater versatility and improved measurement accuracy across a wider frequency spectrum. Both resonant frequencies exhibit significant field intensity, making them suitable for detecting subtle variations in the dielectric properties of the oil–water mixture. By positioning the sample where the electric field is strongest, either between the trapezoidal resonators or the semicircles, the sensor achieves optimal sensitivity, enabling high-precision measurements of frequency shifts and resonant behavior, essential for real-time fluid composition analysis.

Measurement setup

The measurement configuration is illustrated in Fig. 9. The proposed sensor was connected to a vector network analyzer (VNA) through high-quality coaxial connectors to minimize signal losses and reflections. The sensor was positioned on a low-loss acrylic support to maintain mechanical stability and alignment throughout the measurement process. During testing, the prepared oil–water mixture samples were deposited at the designated sensing region of the microstrip structure using the digital micropipette, ensuring consistent sample placement and volume for every trial.

Fig. 9
Fig. 9
Full size image

Measurement setup.

For the experimental measurements, no container was used, as it would have significantly affected the sensor’s performance. The presence of a container would introduce additional material properties that could distort the frequency response, altering the dielectric properties of the sample and influencing the electromagnetic performance of the sensor’s far field. Containers can introduce unwanted resonances or interference, which would compromise the accuracy of the measurements. To ensure reliable and precise data, the measurements were taken directly on the oil–water mixture samples without any enclosing container, allowing for an undisturbed and accurate evaluation of the sensor’s response to variations in the sample’s dielectric properties.

The S21 parameter was measured over the frequency ranges corresponding to the sensor’s two primary resonant frequencies: 1.2 GHz and 14.92 GHz. To minimize experimental errors, each sample was measured four times, and the average response was used for data analysis. The observed shifts in resonance frequency and changes in the transmission magnitude were directly correlated with variations in the dielectric constant of the oil–water mixtures. These parameters were subsequently used as input features for the Radial Basis Function (RBF) neural network model, facilitating precise predictions of the water content within the mixtures.

Figure 10a, b show the measured S21 responses for various oil–water mixtures, with water content ranging from 0 to 100%. Each curve represents a specific oil–water composition, with clear resonance characteristics that reveal the sensor’s sensitivity to dielectric changes. As the oil content increases, significant shifts in both resonance frequency and transmission magnitude are observed in both frequency bands. These shifts indicate a decrease in the effective permittivity of the sensing region as the water content diminishes. However, the relationship between oil purity and resonance frequency shift is not linear. Rather, it exhibits complex, nonlinear behavior, which can be attributed to the intricate dielectric interactions between oil and water molecules. Factors such as molecular polarization, relaxation effects, and mixture heterogeneity contribute to these nonlinearities, making it impossible to rely solely on traditional linear regression or curve fitting techniques for accurate water concentration prediction.

Fig. 10
Fig. 10
Full size image

Measured variations in the S₂₁ parameter for different purity levels of oil–water mixtures: (a) first operating band and (b) second operating band.

This nonlinear relationship is clearly observed across both frequency bands. In Fig. 10a (1.2 GHz) and 8(b) (14.92 GHz), the frequency shifts are not uniform, suggesting that the dielectric response varies in a complex manner depending on the oil–water composition. As such, simple linear models are inadequate for capturing the underlying variations in the S21 data. To address this complexity, an RBF neural network was employed. The RBF network was chosen for its ability to model the nonlinear mappings between the input features—such as resonance frequency, magnitude, and bandwidth—and the target variable, which is the water content in the oil–water mixture. The network’s Gaussian activation functions are well-suited for approximating the intricate, nonlinear relationships present in dielectric-based microwave sensing, enabling the model to handle overlapping and complex sensor responses effectively.

By leveraging the RBF neural network, the sensor’s output characteristics were analyzed more accurately. The network not only learns from the complex data patterns but also generalizes well across the entire range of oil–water compositions. This capability of the neural network significantly enhances the sensor’s performance, providing reliable and accurate water content predictions, even in the presence of highly nonlinear dielectric interactions. Therefore, the integration of machine learning techniques, specifically the RBF network, is a key strength of this work, enabling the sensor to achieve high sensitivity and precision in real-time fluid composition monitoring.

It should be noted, the choice of 1.2 GHz and 14.92 GHz as the resonant frequencies for the proposed sensor was based on their ability to provide complementary sensitivity across a wide range of oil–water mixtures. The lower frequency, 1.2 GHz, is sensitive to broader dielectric changes, while the higher frequency, 14.92 GHz, offers enhanced sensitivity for detecting finer variations in the dielectric properties of the mixtures.

Neural network training and validation results

To accurately interpret the nonlinear relationship between the measured microwave responses and the dielectric characteristics of the oil–water mixtures, a RBF neural network was implemented. The RBF model, a subclass of artificial neural networks, is particularly effective for nonlinear function approximation due to its use of localized activation functions. In contrast to multilayer perceptrons that employ global sigmoidal or ReLU activations, the RBF network constructs its mapping through Gaussian basis functions, each centered around a specific region of the input space. This architecture enables the model to capture complex and continuous variations in sensor outputs with high accuracy and minimal computational cost36,37,38.

The general structure of the RBF network is illustrated in Fig. 11. It consists of three layers:

  • Input layer—receives the normalized sensor parameters;

  • Hidden layer—composed of several neurons, each employing a Gaussian kernel function to transform the input data into a higher-dimensional feature space;

  • Output layer—performs a weighted linear combination of the hidden neuron outputs to produce the final prediction of the liquid’s purity level.

Fig. 11
Fig. 11
Full size image

Structure of the implemented RBF model.

The parameters β₁ to β₆ in Fig. 11 represent the output-layer weights associated with each hidden neuron. Each weight determines how much influence its corresponding hidden neuron contributes to the final network output.

Here, the most important microwave parameters from the experiments were used as inputs to the RBF model. These included the resonant frequencies of the first and second bands (f₁ and f₂), the magnitudes of S₁₁ and S₂₁ at resonance, the quality factors (Q₁₁, Q₂₂), and the phase shift (φ₁₁) extracted from the S-parameter data. Each of these features reflects how the sensor reacts to changes in the oil–water mixture. The network output was the percentage of oil purity, ranging from 0 to 100%. The model was trained in a supervised manner and repeated four times with different starting points to make sure the results were stable. During training, the spread and position of the Gaussian functions in the hidden layer were adjusted automatically to reduce the MSE and MRE between the predicted and actual values.

The neural network model was developed and trained using MATLAB’s Neural Network Toolbox, which provided a flexible environment for implementing the RBF architecture. The training process began with the initialization of neuron centers and spread parameters, followed by the adaptive adjustment of the output weights (β₁–β₆) to minimize the prediction error. The network parameters were iteratively refined using an error minimization algorithm until optimal convergence was achieved. Through this process, the model effectively learned the nonlinear mapping between the measured microwave parameters and the oil purity levels, ensuring accurate and stable predictive performance.

The performance of the proposed RBF neural network was evaluated using two common statistical error indices: MSE and MRE. Both metrics quantify the difference between the predicted and measured oil purity values, but each emphasizes a different aspect of model accuracy.

MSE measures the average squared deviation between the predicted outputs (\({y}_{i}^{pre}\)) and the actual experimental values (\({y}_{i}^{tru}\)) and is defined as39,40:

$$MSE = \frac{1}{N}\mathop \sum \limits_{i = 1}^{N} \left( {y_{i}^{pre} - y_{i}^{tru} } \right)^{2}$$
(7)

where N is the total number of test samples. A lower MSE indicates that the model’s predictions are closely clustered around the true values, with large errors being penalized more heavily because of the squared term.

On the other hand, MRE evaluates the average proportional difference between predicted and true values, giving a direct sense of the percentage deviation. It is expressed as:

$$MRE = \frac{1}{N}\mathop \sum \limits_{i = 1}^{N} \left| {\frac{{y_{i}^{pre} - y_{i}^{tru} }}{{y_{i}^{tru} }}} \right| \times 100$$
(8)

Unlike MSE, which focuses on magnitude, MRE provides an intuitive percentage-based error measure and is less sensitive to outliers when the data are scaled.

The experimental dataset used for training and evaluation of the RBF neural network covered the full range of oil–water purities, from 0 to 100%, in incremental steps of 5%. The data were divided into 70% for training, 15% for validation, and 15% for testing to ensure balanced model development and unbiased evaluation. During training, the network demonstrated rapid convergence, and the final RBF model achieved a coefficient of determination (R2) greater than 0.99, confirming the strong agreement between predicted and measured values. This high level of accuracy indicates that the RBF model effectively captures the nonlinear characteristics of the sensor response and provides reliable predictions across the entire range of compositions.

In this implementation, the model’s performance was further quantified using MSE and MRE metrics. The average true purity across all test samples was approximately 50%, while the root mean square error (RMSE) obtained from the model was 1.8%. Based on these results, the calculated error indices were:

$$MSE = \left( {1.8} \right)^{2} = 3.24 \%^{2}$$
(9)
$$MRE = \frac{1.8}{{50}} \times 100 = 3.6 \%$$
(10)

The MSE value of 3.24 (%2) and the MRE of 3.6% clearly demonstrate the model’s ability to predict oil purity with high precision and minimal deviation from the experimental data. These low error values confirm the robustness of the proposed RBF neural network–based approach, highlighting its suitability for quantitative analysis and real-time monitoring of oil–water mixtures. The integration of the microwave sensing mechanism with the RBF neural framework thus provides a reliable, intelligent platform capable of delivering consistent and accurate purity estimations under standard laboratory conditions and with potential scalability for industrial applications.

Sensor performance results

The design, fabrication, and comprehensive experimental evaluation of a compact dual-band microstrip sensor are presented for the precise characterization of fluid purity, with particular emphasis on oil–water mixtures. The sensor structure was implemented on an FR-4 dielectric substrate with overall dimensions of 10.94 × 14.92 mm2, chosen for its favorable balance of dielectric stability, mechanical rigidity, and cost-effectiveness. The device exhibits two distinct resonant modes, centered at 1.2 GHz and 14.92 GHz, corresponding to the fundamental and higher-order operating bands, respectively. The presence of these dual passbands enhances the measurement resolution and extends the dynamic sensing range, enabling accurate discrimination of fluids with closely spaced dielectric constants.

The experimental procedure involved preparing a series of oil–water mixtures with purity levels ranging from 0 to 100%, in incremental steps of 5%. Each concentration was tested four times, resulting in a total of 84 independent measurements. All measurements were conducted under controlled laboratory conditions to ensure repeatability and minimize uncertainty. The resonance frequency and transmission coefficient (S₂₁) were recorded for each sample, forming the dataset used to train and validate the RBF neural network. The model utilized four input features—derived from the measured resonant frequencies, magnitudes, phase shift, and quality factors—to accurately predict the corresponding water volume percentage in each mixture.

On the other hand, in most liquid mixtures, the permittivity is not constant but varies with frequency, a phenomenon known as dispersion. To model this frequency-dependent behavior, the Debye formula is often employed, as it accounts for both the dielectric dispersion and absorption of the material. The Debye model is expressed as41,42:

$$\varepsilon \left( \omega \right) = \varepsilon_{\infty } + \frac{{\varepsilon_{s} - \varepsilon_{\infty } }}{1 + j\omega \tau }$$
(11)

where:

  • \(\varepsilon \left(\omega \right)\) is the complex permittivity as a function of angular frequency ω\omegaω,

  • \({\varepsilon }_{s}\) is the static permittivity (at zero frequency),

  • \({\varepsilon }_{\infty }\) is the permittivity at infinite frequency (the high-frequency limit),

  • \(\tau\) is the relaxation time, and

  • j is the imaginary unit.

Once the permittivity for each individual component of the mixture (such as oil and water) is determined using this model at their respective resonance frequencies, the Maxwell–Garnett or Lichtenecker’s formulas can be applied to calculate the permittivity of the mixture. These formulas relate the relative permittivity of the mixture to the volumetric fractions of the individual components and their respective permittivities43,44. Specifically, the Maxwell–Garnett model is suitable for systems where the mixture consists of a continuous medium containing dispersed particles, while Lichtenecker’s formula can be applied to mixtures where the components are more uniformly blended. These formulas are widely used in microwave sensor designs as they allow for accurate predictions of the mixture’s dielectric properties based on the individual properties of the components.

Sensitivity analysis

One of the key performance parameters for a resonant sensor is its sensitivity, which quantifies the sensor’s ability to detect small changes in the dielectric properties of the test fluid. For the proposed dual-band microstrip sensor, sensitivity is defined as the change in resonant frequency (Δf) per unit change in relative permittivity (Δεᵣ) of the fluid under test, and is expressed as:

$$S = \frac{{{\Delta }f}}{{{\Delta }\varepsilon_{r} }}$$
(12)

Table 2 presents the sensitivity calculations for each oil–water mixture sample, measured at two resonant frequencies: 1.2 GHz and 14.92 GHz. The sensitivity values reflect how the resonance frequency shifts of the sensor correlate with changes in the dielectric constant of the oil–water mixtures, which vary from 0% (pure oil) to 100% (pure water). The sensitivity for each sample is calculated as the change in resonance frequency (Δf) per unit change in relative permittivity (Δεᵣ) of the sample. For each mixture, Sensitivity (1.2 GHz) and Sensitivity (14.92 GHz) are reported separately for the first and second operating bands. These values indicate the sensor’s responsiveness to dielectric changes at the two resonant frequencies. As expected, the sensitivity at 14.92 GHz is higher than at 1.2 GHz, which can be attributed to the stronger interaction of the electromagnetic field with the fluid sample at the higher frequency. The shorter wavelength and enhanced field confinement at 14.92 GHz result in a more pronounced resonance shift for small changes in the relative permittivity, leading to higher sensitivity.

Table 2 Sensitivity calculation for each sample.

The normalized sensitivity values for both resonant frequencies are calculated by dividing the measured sensitivity at each sample concentration by the maximum sensitivity observed at 100% pure oil (i.e., Smax). This normalization allows for a direct comparison of the sensor’s sensitivity across different oil–water mixtures, irrespective of the absolute sensitivity values. Normalized sensitivity values are useful for understanding the relative effectiveness of the sensor in detecting small variations in the dielectric properties of the samples, especially when comparing across different fluid compositions.

For example, at 100% pure oil, the normalized sensitivity is set to 1.00 for both frequencies, as it represents the maximum sensitivity for each frequency band. As the water content increases, the sensitivity decreases, and the normalized values decrease accordingly. This demonstrates how the sensor’s response is influenced by the relative permittivity of the oil–water mixtures, which decreases with higher water content.

The proposed sensor exhibited maximum sensitivities of 87.5 MHz/εᵣ at 1.2 GHz and 114.2 MHz/εᵣ at 14.92 GHz, demonstrating that the dual-band configuration significantly enhances detection accuracy and improves the sensor’s ability to differentiate between fluids with subtle variations in dielectric properties.

The output of the trained RBF neural network was evaluated by comparing the predicted water content to the actual measured values, as shown in Fig. 12. The neural network was trained using the S21 responses—including resonance frequency shifts, magnitude changes, and other relevant microwave features—as input features, with the target variable being the water concentration in the oil–water mixture. The sensor’s outputs, derived from the S21 responses, correlate with water content in a nonlinear manner due to the complex dielectric interactions between oil and water molecules, which cannot be captured by simpler linear models.

Fig. 12
Fig. 12
Full size image

Residual analysis of the RBF neural network predictions with corresponding residual distribution for training and test datasets.

To assess the model’s performance, a residual analysis was conducted, where the residuals (defined as the difference between predicted and actual values) were plotted against the predicted water content. As illustrated in Fig. 12, the residuals are concentrated around the zero-error line, demonstrating that the model’s predictions are highly consistent with the experimental data across the entire range of water concentrations (0% to 100%). The minimal dispersion of the residuals, especially at higher purity levels, suggests that any small deviations are primarily due to factors such as measurement uncertainty, environmental variations, or subtle nonlinear interactions within the oil–water mixtures.

Furthermore, the residual distribution histogram on the right of Fig. 12 shows that most residuals are symmetrically distributed around zero, indicating that the neural network’s predictions are unbiased and exhibit high generalization capabilities. This is particularly important for ensuring that the model performs reliably when applied to both the training dataset (comprising approximately 70% of the total data) and the testing dataset (comprising approximately 30%). The results demonstrate that the RBF model has successfully learned the nonlinear relationship between the sensor’s output and water content, providing robust and reliable predictions across a broad range of fluid compositions.

The RBF neural network’s ability to model the nonlinear dielectric interactions between oil and water, as reflected in the S21 responses, highlights the sensor’s superior performance in detecting small variations in water content. This capability is crucial for real-time, high-accuracy monitoring of oil–water mixtures, making the sensor an invaluable tool in industrial and environmental applications.

It should be noted, a traditional calibration curve is not employed for predicting water concentration. Instead, the sensor’s output is processed through a RBF neural network, which directly analyzes the sensor data to predict the water concentration. Unlike conventional methods that rely on approximate models or calibration curves, the neural network captures the complex, nonlinear relationship between the sensor’s response and the dielectric properties of the oil–water mixtures. This approach eliminates the limitations and potential errors associated with calibration curves, which are often sensitive to variations in sample composition and experimental conditions.

The use of the neural network ensures greater accuracy and reliability by learning directly from the sensor data, allowing for precise predictions even as the mixture composition changes. In contrast to traditional methods that require separate calibration for each sample type, the RBF neural network is capable of generalizing across a wide range of fluid compositions. This capability provides consistent and minimal error predictions, offering a more robust and adaptable solution for real-time fluid composition analysis. The innovation of using the neural network model represents a significant advancement over calibration-based models, enhancing the overall performance and precision of the sensor.

Comparison with previous works

The quality factor (Q-factor) is a crucial metric for evaluating the sharpness and sensitivity of a sensor’s resonance. It is defined as the ratio of the working frequency (f0) to the bandwidth (Δf) at the -3 dB points of the resonance curve45:

$$Q = \frac{{f_{0} }}{{{\Delta }f}}$$
(13)

where f0 is the resonant frequency and Δf is the bandwidth. The Q-factor determines the sensor’s ability to distinguish closely spaced frequencies, with a higher Q indicating sharper resonance and enhanced sensitivity. This enables the sensor to detect subtle variations in the dielectric properties of the target material. The Q-factor for the proposed sensor was calculated to be 6.32 and 64.86 at the first and second operating frequencies, respectively. These values demonstrate the sensor’s ability to maintain high sensitivity and precise resonance across both frequency bands, enhancing its capability to detect small changes in the dielectric properties of the oil–water mixtures.

The detection limit (DL) is another key performance metric, representing the lowest concentration of a target analyte (such as sucrose or sorbitol) that can be reliably distinguished from background noise. The DL is closely related to the signal-to-noise ratio (SNR), with a higher SNR indicating better discrimination between the analyte signal and inherent noise. The DL can be quantified using the following expression 46,47:

$$DL = \frac{{3.3 \times \sigma_{noise} }}{{\text{S}}}$$
(14)

where \({\sigma }_{noise}\) represents the standard deviation of the background noise (i.e., the variability of the sensor’s signal in the absence of the sample), and S is the sensor’s sensitivity to changes in the analyte’s dielectric properties. This formula quantifies the minimum detectable concentration by the sensor with a 99% confidence level, ensuring that even small variations in the analyte’s concentration can be detected with high precision. A lower DL indicates that the sensor is capable of detecting very small amounts of the target analyte, which is particularly critical for applications that require accurate monitoring, such as the determination of oil–water mixture purity. For the proposed sensor, the DL values at the two operating frequencies were determined to be 0.0004 and 0.0002 dB·εr/MHz, respectively, highlighting the sensor’s exceptional sensitivity and its ability to accurately detect minute changes in the composition of oil–water mixtures.

To further evaluate the effectiveness of the proposed dual-band microstrip sensor, its performance was compared with several recently reported sensors designed for dielectric characterization and fluid purity analysis. The comparison criteria include operating frequency, setup, sensitivity, and overall physical dimensions. The summarized results are presented in Table 3.

Table 3 Comparison between the proposed sensor and other references.

As evident from the table, the proposed design achieves a substantially higher sensitivity of 87.5 MHz/εᵣ and 114.2 MHz/εᵣ, outperforming previously reported sensors across various frequency bands. Furthermore, its compact footprint of 10.94 × 14.92 mm2 demonstrates a significant improvement in miniaturization compared with most existing structures. The inclusion of a dual-band resonant configuration combined with RBF-based data processing enables enhanced electromagnetic coupling and improved dielectric response prediction, making the sensor highly suitable for precise, real-time analysis of oil–water mixtures.

While the proposed dual-band microwave sensor demonstrates outstanding sensitivity and precision for real-time fluid composition analysis, several challenges must be addressed to enhance its practical applicability. Scalability remains a key factor, particularly when transitioning from controlled laboratory settings to large-scale industrial environments. Although the sensor shows promise in detecting a wide range of oil–water mixtures, its performance in more complex and heterogeneous fluid mixtures, particularly in varying industrial settings, requires further optimization. Future work should focus on refining the sensor to handle broader composition ranges and maintaining accuracy under diverse real-world conditions, such as extreme fluid viscosities or highly variable dielectric properties. Furthermore, the sensor’s robustness in challenging environments—such as those with fluctuating temperatures, pressures, and electromagnetic interference—needs to be enhanced. Incorporating advanced shielding techniques, robust material selection, and environmental calibration strategies would ensure more reliable operation in industrial applications.

Another crucial aspect to consider is power consumption, especially for long-term monitoring in remote or portable sensing scenarios. While the current design is compact and effective in laboratory settings, optimizing energy efficiency will be paramount for continuous field deployment. Investigating low-power operation or energy harvesting techniques could significantly extend the sensor’s operational lifespan without sacrificing performance. Additionally, expanding the sensor’s frequency range or implementing multi-band operation could increase its versatility, enabling broader applications across various industries. Addressing these challenges—scalability, robustness, and power efficiency—will elevate the sensor’s real-world performance, paving the way for its adoption in large-scale, industrial, and environmental monitoring systems.

Conclusion

In this paper, a compact dual-band microstrip sensor was developed and experimentally verified for accurate analysis of oil–water mixtures. Fabricated on an FR-4 substrate with dimensions of 10.94 × 14.92 mm2, the sensor operates at 1.2 GHz and 14.92 GHz, providing dual-mode functionality for extended dielectric characterization. The dual-band configuration enhances measurement sensitivity and resolution, enabling effective distinction of mixtures with closely spaced permittivity values. The permittivity of the fluid varies with frequency, and this frequency dependence plays a crucial role in the sensor’s performance. Also, experimental investigations were performed on mixtures with oil purities ranging from 0 to 100%, under controlled laboratory conditions. The measured frequency shifts and S-parameter responses were processed using a RBF neural network, trained to predict water concentration from key electromagnetic features. The trained model achieved an R2 > 0.99, with an MSE of 3.24 (%2) and MRE of 3.6%, confirming excellent predictive accuracy and generalization. The proposed sensor exhibited sensitivities of 87.5 MHz/εᵣ at 1.2 GHz and 114.2 MHz/εᵣ at 14.92 GHz, which surpasses most comparable designs reported in the literature.. Its compact geometry, high sensitivity, and reliable data-driven analysis framework make it a strong candidate for real-time fluid composition monitoring. In summary, the integration of dual-band microstrip sensing with machine learning establishes a robust and intelligent measurement platform, offering high precision, compact size, and adaptability for future industrial and environmental sensing applications.