Fiber-Optic Hydrophone Based on Michelson’s Interferometer with Active Stabilization for Liquid Volume Measurement

Sensing technologies using optical fibers have been studied and applied since the 1970s in oil and gas, industrial, medical, aerospace, and civil areas. Detecting ultrasound acoustic waves through fiber-optic hydrophone (FOH) sensors can be one solution for continuous measurement of volumes inside production tanks used by these industries. This work presents an FOH system composed of two optical fiber coils made with commercial single mode fiber (SMF) working in the sensor head of a Michelson’s interferometer (MI) supported by an active stabilization mechanism that drives another optical coil wound around a piezoelectric actuator (PZT) in the reference arm to mitigate external mechanical and thermal noise from the environment. A 1000 mL glass graduated cylinder filled with water is used as a test tank, inside which the sensor head and an ultrasound source are placed. For detection, amplitudes and phases are measured, and machine learning algorithms predict their respective liquid volumes. The acoustic waves create patterns electronically detected with resolution of 1 mL and sensitivity of 340 mrad/mL and 70 mvolts/mL. The nonlinear behavior of both measurands requires classification, distance metrics, and regression algorithms to define an adequate model. The results show the system can determine liquid volumes with an accuracy of 99.4% using a k-nearest neighbors (k-NN) classification with one neighbor and Manhattan’s distance. Moreover, Gaussian process regression using rational quadratic metrics presented a root mean squared error (RMSE) of 0.211 mL.


Introduction
Optical fibers have been used worldwide over long distances for ultra-high bitrates in telecommunication systems [1] and for sensor applications [2], including sensing acoustic waves through light modulation [3]. The use of optical fibers as acoustic sensors was first demonstrated in 1977 [4]. Optical fiber sensors (OFSs) have been studied and applied in the industries of petroleum exploration, fuel storage and transportation, industrial manufacturing, military, chemical processing, medical, aerospace, food and civil engineering [5][6][7].
The oil and gas industry requires control techniques for their vessels, with the aim of increasing production rates, avoiding environmental contamination, mitigating human labor risks, and reducing the costs of plant setup investments (CAPEX), operations, and maintenance (OPEX) [8]. A problem in these industries is the need for continuous monitoring of liquid volumes inside separation vessels working under the presence of dynamic emulsion and foam layers, accumulation of unwanted solids, sand in the bottom and sludge on the walls, turbulence caused by fluid injections, corrosive substances, and explosive atmospheres [9,10].
Ultrasound-based sensors employ acoustic transmitters and receivers immersed in liquids to calculate the acoustic impedance between adjacent layers of fluids [11]. For The first MI arm is called the "sensor head" or "wet arm"; it has a length L and is exposed to measurands, such as sound, pressure, temperature, strain, and mechanical vibrations. The other arm is known as the "reference arm" or "dry arm"; it has a length L and should be isolated from environment disturbances [7].
A desired measurand induces changes on the sensor head that dynamically change its physical fiber length L , leading to a path difference ∆L among the two arms that induces phase differences Δϕ between their light beams, resulting in phase variations that are electronically expressed by a photodetector [7]. Linear polarization of a light beam in one MI arm can be expressed by [31]: Considering an MI fed with power P IN , the light wavelength in the medium λ, a wave number k = 2π/λ, and a lossless beam splitter with a division rate of 0.5, the relation between the output power P OUT and the interferometer's optical path differences ∆L = L S − L R can be expressed by [35]: The first MI arm is called the "sensor head" or "wet arm"; it has a length L S and is exposed to measurands, such as sound, pressure, temperature, strain, and mechanical vibrations. The other arm is known as the "reference arm" or "dry arm"; it has a length L R and should be isolated from environment disturbances [7].
A desired measurand induces changes on the sensor head that dynamically change its physical fiber length L S , leading to a path difference ∆L among the two arms that induces phase differences ∆φ between their light beams, resulting in phase variations that are electronically expressed by a photodetector [7].
Linear polarization of a light beam in one MI arm can be expressed by [31]: where → E is the electrical field of the optical electromagnetic wave, E 0 is its maximum amplitude, ω 0 is the optical wave frequency in radians per seconds, z is the longitudinal space point, and t is time.
Equation (2) shows amplitudes that might be present on the transverse → x or on the → y space coordinates, propagating through the longitudinal → z coordinate. Considering the fiber's physical length L, the light speed in vacuum c 0 , the vacuum wavelength λ 0 , the fiber refraction index n, the wave group velocity v = c 0 /n, which leads to 1/λ = n/λ 0 , the electrical field can be expressed by: and Equation (4) shows the fixed phase angle φ 0 (in radians) of the light beam. The term "nL" is defined as the "optical path length" [52].
and changes in L or n lead to phase variations, expressed by: where ∆φ are the incremental phase changes due to incremental length changes ∆L, which induce refraction index variations ∆n due to the optical fiber's photo-elastic effect. Further, frequency variations (jitter) from the laser source may also contribute to phase drifts, and Equation (5) can be expressed as a sum of derivatives of the terms involved in the phase drifts [52]: Current optical detection systems estimate the average power per unit area and unit time as a measure of intensity or irradiance I OUT , which is proportional to the squared amplitude of the electrical field [53]: Sensors 2022, 22, 4404 5 of 30 The summation of both arms' light waves ( → E T = → E R + → E s ) results in an irradiance perceived by the photodetector [31] that can be expressed by: where ∆φ = φ R − φ S is the phase difference of both light waves' summation.
In another view, this phase difference can also be represented by ∆φ = φ e − dφ m , in which φ e is the bias phase standing for the external disturbances with low frequency and slow drifts with time, affecting both interferometer arms (sensor and reference). The second term dφ m represents the pure physical measurand variations of interest, whose value represents the interferometer's sensor arm [40].
When the interferometer is forced to keep its bias phase φ e around (2n + 1) * π/2 radians points, it reaches a condition called quadrature state, in which it supplies a better response to the measurand dφ m . The nature of sinusoidal waves at the quadrature point limits the two-beam interferometers to work under the largest optical phase displacements of half a wavelength. Moreover, when the bias phase φ e is located around zero or on multiple integers of ±π radians, the resulting interferometric pattern jumps between zero and maximum peak values, representing the worst sensitivity points, as the derivatives of intensity to phase are zero at them [31,35,40,54].

Michelson's Interferometer for Acoustic Wave Detection
Taking into consideration the equations and terms already presented, an MI whose sensor arm is composed of a single-mode optical fiber coil immersed in liquid, within which propagates an acoustic field of pressure P a and angular frequency ω a , the interferometer's resulting light beam is expressed by [4]: → E = E 0 exp i(ω o t) + E 0 exp i(ω o t + K a sin(ω a t) + ∆φ), (9) where K a is the modulation index that defines the acoustic influence on the phase drifts, and ∆φ are the dynamic optical phase differences between both MI arms. For a uniform acoustic field, K a is expressed below, and L c is the physical length of the optical fiber coil interacting with the acoustic wave [4]: Bucaro et al. [4] also define S d as constant that defines the detector's sensitivity, which depends on the photodetector's gain G, quantum efficiency q, electron charge e = 1.602 × 10 −19 c, Planck's constant h = 6.626 × 10 −34 m 2 kg/s, and on other terms already presented, as expressed by: Finally, [4,57] have shown that small values of modulation index K a will result in the following irradiance equation as perceived by the MI hydrophone:

Active Stabilization for Homodyne Detection
The phase instabilities inherent to optical interferometers represent a challenge that requires countermeasures to mitigate [35]. In an ideal scenario, the MI works properly when its arms are equal in length (balanced condition) and the reference arm is isolated from external noise [18,[54][55][56]. Thus, MI measurement noise needs to be controlled by adjustment mechanisms [6][7][8], such as Pockels cells [58], rubber and springs for anti-vibration [28], optical tables, hermetic boxes, thermal baths [56], piezoelectric actuators [18,55], sensing information encoded in a carrier signal, phase generated carriers, and active homodyne demodulation [40]. Despite the solutions aiming to achieve MI stabilization, they are not always continuously stable over time, and, as reported by [28], sometimes noise isolation is "still an art rather than a science".

Materials and Methods
This system works based on physics principles in which acoustic wave behavior depends on liquid density, reflections from internal tank walls and other components, and on changes to the acoustic path characterized by changes in the volume of liquid [46].

Experimental Setup
The experiment setup in Figure 2 shows an FOH system for liquid volume measurement, based on the MI, with an electronic feedback (EF) circuit loop to compensate for external noise from the sensor's measurands. The system outputs a sinusoidal signal from which two values are extracted: amplitude and phase. The phase is the difference between the acoustic field delivered to the UT and the acoustic field detected by two optical coils S1 and S2 placed at the sensor head. For each differential volume of water added to or extracted from the tank, the length of the water (acoustic path) changes, and the internal water surface dislocates. Thus, a new profile of internal sound reflections and backscattering inside the tank creates an interferometric and stationary pattern, knowing that internal water interface works as a mirror to the acoustic waves. Then, the optical coils capture the ultrasound intensities present at their fixed positions, modulating light beams through their photo-elastic (acousto-optic) effects, creating an output signal from which the amplitudes and phases are extracted.
It is not trivial to mathematically equate the components of this setup to reach an expression that infers the water's liquid volume by using the system's output. This setup involves optical and acoustic phenomena taking place simultaneously by an unbalanced MI composed of two optical coils in the same sensor arm with noise stabilized by an EF circuit driving a piezoelectric actuator in the reference arm. The coils are not multiplexed.

Hardware Components
The setup worked for seven days in an air-conditioned room and water temperatures varying from 22 • C to 24 • C. The test tank was a 1000 mL glass graduated measuring cylinder with 10 mL grading divisions filled with water one milliliter at a time from 440 mL to 1000 mL (561 liquid volume points) with a syringe graduated at 1 mL. The measurements started at 440 mL due to setup arrangements and positioning of the UT inside and in the bottom of the tank. The irradiating face of the UT was positioned at 300 mL volume due to its mechanical size, and the distance of 140 mL between the UT's face and first coil S1 was due to the near field of Fresnel's zone.
A coherent laser light source TN Laser (Teraxion Narrow Linewidth Laser) was tuned at 1550 nm, and its wavelength drift was negligible as it implements internal hardware for electronic current and temperature stabilization. The TNL laser injected 12.5 dBm of light power in the system. The isolator IS (Thorlabs, Newton, NJ, USA) protected the laser source port against undesired returning power. After passing through circulator C1, polarization controller PC1 and the 3 dB beam splitter BS, the light power was equally injected in both MI arms, which ended in Faraday-rotator mirrors M1 and M2. The MI's reference arm was composed of an optical coil of 11 m [55] made with SMF fiber (Corning SMF-125/9, only with acrylate protection) wound around a piezoelectric actuator PZT (Thorlabs APF705) responsible for stabilization. The sensor arm's coils S1 and S2 were both identical and made of the same fiber type, with an outer diameter of 2.4 cm, and 25 fiber turns, resulting in 188.5 cm of total fiber length per coil. In total, considering all fibers used, component connections, installation arrangements and coils, each MI arm achieved a length of around 15 m. Single mode fibers were used because the behavior and analysis of multimode interferometers are difficult to control [56]. It is not trivial to mathematically equate the components of this setup to reach an expression that infers the water's liquid volume by using the system's output. This setup involves optical and acoustic phenomena taking place simultaneously by an unbalanced MI composed of two optical coils in the same sensor arm with noise stabilized by an EF circuit driving a piezoelectric actuator in the reference arm. The coils are not multiplexed.

Hardware Components
The setup worked for seven days in an air-conditioned room and water temperatures varying from 22 °C to 24 °C. The test tank was a 1000 mL glass graduated measuring cylinder with 10 mL grading divisions filled with water one milliliter at a time from 440 mL to 1000 mL (561 liquid volume points) with a syringe graduated at 1 mL. The measurements started at 440 mL due to setup arrangements and positioning of the UT inside and in the bottom of the tank. The irradiating face of the UT was positioned at 300 mL volume due to its mechanical size, and the distance of 140 mL between the UT's face and first coil S1 was due to the near field of Fresnel's zone.
A coherent laser light source TN Laser (Teraxion Narrow Linewidth Laser) was tuned at 1550 nm, and its wavelength drift was negligible as it implements internal hardware for electronic current and temperature stabilization. The TNL laser injected 12.5 dBm of light power in the system. The isolator IS (Thorlabs) protected the laser source port against undesired returning power. After passing through circulator C1, polarization controller PC1 and the 3 dB beam splitter BS, the light power was equally injected in both MI arms, which ended in Faraday-rotator mirrors M1 and M2. The MI's reference arm was composed of an optical coil of 11 m [55] made with SMF fiber (Corning SMF-125/9, only with acrylate protection) wound around a piezoelectric actuator PZT (Thorlabs All optical components, such as the isolator, circulators, beam splitter, Faraday mirrors and PZT with its optical coil, were installed inside boxes (non-hermetic) with the goal of mitigating external influences, such as temperature variations, random pressure fluctuations, sounds, air flows, or mechanical stress on fibers and connectors. The optical components and photodetectors were mounted over an optical bread board with a rubber foot to mitigate mechanical vibration and vibration on the table where the components were situated. These disturbances were controlled as they could decrease measurand accuracy [18,55,56].
The polarization controller PC1 was placed at the MI input to adjust the polarization and improve the contrast [56]. Following the same idea, PC2 was installed at the MI output, which delivers the sensor's measurand signal to the photodetector PD3. The two circulators C1 and C2 provided the required optical paths [55] to photodetectors PD1, PD2, and PD3 (Thorlabs PDA30B-EC). This optical arrangement guaranteed that the optical signals input to PD1 and PD2 were 180 • out of phase. While both photodetectors PD1 and PD2 were only working for the stabilization mechanism, PD3 was uniquely responsible for supplying the sensor system's output signal. The EF circuit was fed by PD1 and PD2, and its output drove the PZT, which stretched the optical coil of the MI's reference arm, keeping the interferometer locked in quadrature state and providing a final sensing signal with less interference through PD3.
On the electronic side, the Signal Generator SG (BK Precision 4053) was set to provide a 100 kHz continuous sinusoidal wave (CW) on both its output channels, CH1 and CH2, with the same phases but different peak-to-peak voltages of 10 Vpp and 1.8 Vpp, respectively. During the preliminary tests, a range of UT frequencies were evaluated from 50 kHz to 1 MHz, and an adequate response range of voltage and phase variations occurred at 100 kHz. The lower UT (Precision Acoustics Unfocussed 1 MHz, 23 mm diameter and 75 mm focal distance) frequency was used to create higher wavelength sounds in the water, supplying a better response to the volume variations of 1 mL.
The SG-CH1 signal was amplified by the Juntek DPA-2698 (BW 10 MHz and 3 dB gain) amplifier (A), which output a 20 Vpp sinusoidal CW signal of 5 W to the UT. The second port of signal generator SG-CH2 was connected to the CH1 input of the Oscilloscope OP (Tektronix Open Choice MDO 3012) to work as a reference for FOH system phase recovery. The UT was positioned in such a way that the ultrasound waves were irradiated upwards through the liquid, and their wavefronts were parallel to the plane of the optical coils S1 and S2. The FOH output was injected into the second oscilloscope port (OP-CH2).
Both OP ports (CH1 and CH2) were configured to supply AC coupling and BW of 20 MHz, making them more adequate for the involved frequencies and to cut DC power. The OP's Fourier-transform function allowed seeing one channel in both time and frequency domains simultaneously, and the signal amplitude of 1.8 Vpp from SG-CH2 was chosen to help with adjustment during setup. Last, the MATLAB application (MA) [59] read the signals from both oscilloscope ports and extracted two measurands: amplitude in volts and phase in degrees. This phase value was calculated by MA and stood for the difference between the original signal injected into the UT (interferometer input) and the resulting signal delivered by PD3 (main MI output). This output was then digitalized by the oscilloscope at a sample rate of 100 MS/s, the samples were read in vectors of 10 thousand points of double type variables, which were passed through a software band-pass filter and then to a Fourier transformation, from which the values of amplitude and phase were registered in a database.

Fresnel's Acoustic near Field
A Fresnel's near field was kept free between the UT surface and the first coil S1. The acoustic's near field was a Fresnel's space that should not have been obstructed by any object so that the acoustic field [12] emitted by the UT would not be destroyed or severely attenuated, which would have compromised the acoustic detection by the optical coils in the MI's sensor head. The calculation of this field considered the UT's diameter (D = 23 mm), the ultrasound frequency (f = 100 kHz), and the wave speed in water [60]. At lower temperatures, the larger the near field; the worst case of T = 22 • C was used to calculate the water's sound speed s wa [60] and the near field distance F nf [12] as follows: The near field for a cylindrical UT is expressed by: For the test tank of this experiment and λ wa = 14. 9 [mm], the distance F nf = 8. 9 [mm] is equivalent to the volume range F nf = 26.3 mL. Considering that the UT surface was placed at the volume of 300 mL, the near field for f = 100 kHz and T = 22 • C is found in the range from 300 mL to 326.3 mL and, therefore no objects, not even an optical coil sensor, should be put in this region.
As higher ultrasound frequencies were also used during the preliminary tests, the free water volume of 140 mL purposely left between the UT surface and the first S1 coil allowed the use of a maximum frequency of 520 kHz without obstructing the near field.

Electronic Feedback Loop Circuit
In this work, an active and self-compensate mechanism for the MI was adopted to control the environment disturbances and offer better stability to the measurand data perceived by the sensor head. It was based on the work developed by [18,55], who implemented the electronic feedback (EF) loop circuit shown in Figure 3.
8.9 mm is equivalent to the volume range F = 26.3 mL. Considering that the UT sur-face was placed at the volume of 300 mL, the near field for f = 100 kHz and T = 22 °C is found in the range from 300 mL to 326.3 mL and, therefore no objects, not even an optical coil sensor, should be put in this region.
As higher ultrasound frequencies were also used during the preliminary tests, the free water volume of 140 mL purposely left between the UT surface and the first S1 coil allowed the use of a maximum frequency of 520 kHz without obstructing the near field.

Electronic Feedback Loop Circuit
In this work, an active and self-compensate mechanism for the MI was adopted to control the environment disturbances and offer better stability to the measurand data perceived by the sensor head. It was based on the work developed by [55] and [18], who implemented the electronic feedback (EF) loop circuit shown in Figure 3. The EF was composed of four operational amplifier chips (U1 to U4), a dual comparator chip U5, a dual flip-flop chip U6 (CD4013BC), one four-electronic keys chip U7 (CD4016BCN), and other discrete components such as resistors (18 units), capacitors (2 units), and diodes (3 units). This EF circuit has two inputs, whose signals are received from the photodetectors PD1 and PD2, and one signal output, which drives the PZT. The output values of PD1 and PD2 were matched through dB gain adjustment knobs of the photodetector's hardware (Thorlabs PDA30B-EC).
Some minor changes were made to the original author's electronics and optical schemes published by [55] to simplify the setup, but without affecting any original The EF was composed of four operational amplifier chips (U1 to U4), a dual comparator chip U5, a dual flip-flop chip U6 (CD4013BC), one four-electronic keys chip U7 (CD4016BCN), and other discrete components such as resistors (18 units), capacitors (2 units), and diodes (3 units). This EF circuit has two inputs, whose signals are received from the photodetectors PD1 and PD2, and one signal output, which drives the PZT. The output values of PD1 and PD2 were matched through dB gain adjustment knobs of the photodetector's hardware (Thorlabs PDA30B-EC).
Some minor changes were made to the original author's electronics and optical schemes published by [55] to simplify the setup, but without affecting any original functionality of the circuit. Both input low pass filters were not electronically implemented, as they were provided by the oscilloscope input ports and by a software high-pass filter implemented in MATLAB. Furthermore, the DC power supplies were simplified to use the values of +10 and −10 volts, cutting the need for +5/−5 and +15/−15 VDC inputs. Finally, the four U7 electronic switches were connected in parallel to decrease their internal resistance and to allow proper PZT operation.
The active stabilization's EF loop acts as a homodyne demodulator that nullifies as much as possible the output of the differential amplifier U3, locking the MI operation around the vicinities of the quadrature point [40]. The interferometric signals output by PD1 and PD2 (electronic currents) were 180 • out of phase and input to the EF circuit for differential detection.
where I 0 relates to the system input power, K 0 is related to the interferometric fringe visibility, φ s is the static differential phase, and φ d is the disturbances' differential phase. After PD1 output is inverted by U1, and, together with PD2 output, both signals are differentially combined by the converter U2, the following signal is seen on the U2 output, where K 2 if the conversion gain of U2: After U2 OUT is integrated by U3, the new output signal is presented below, where K 3 is the conversion gain of U3: As the perfect quadrature point is defined by φ s + φ d = π/2, and the interferometer is forced to be kept around the quadrature state, then U3 OUT will tend to zero, knowing that, the differential phase will be: However, this absolute zero is not supported, and in the vicinity of the quadrature point, differential phase ∆φ drifts assume small values, allowing the approximation below, considering that sin(∆φ) ∼ = ∆φ for small values of the angle ∆φ: This simplification represents a practical assumption when a sine or cosine math function falls inside a cosine or sine formula, such as the term "exp i(ω o t + K a sin(ω a t) + φ 0 )" in Equation (9). This assumption is considered valid for ∆φ 1 and ∆φ ≤ 0.1 radians as described as acceptable by [52]. In fact, it avoids the need to consider many terms of Bessel's functions of the first kind, as the first two terms of their coefficient family, J 0 (∆φ) and J 1 (∆φ), represent 98% of the homodyne power spectrum energy [52].
Therefore, U3 OUT is quasi-linear at the quadrature state [18]. It is used as the correction signal that drives the PZT, making displacements and strain changes in the optical fiber coil wound around it, keeping the interferometer working close to the quadrature state.
The EF circuit also tracks the external noise through an equivalent voltage in capacitor C1. The circuits U5.1 and U5.2 compare C1 with the reference voltage defined by the potentiometer POT (R18), and, when they are equal, the EF switches the C1 voltage to zero by an up-pulse to flip-flop U6 that keeps the four U7 switches closed and discharging by the time τ = R19 × C2 = 0.47 ms. The reference value of +5 volts is selected with R18 (potentiometer) so that the limits of +5/−5 volts of accumulated phase drift errors are enough to protect the PZT and other electronic components, respecting their technical datasheets [18]. In general, the EF circuit can be regarded as a high-pass filter with a cutoff angular frequency f EF in hertz, as expressed by [55]: The voltage-phase coefficient K p rad/V for the PZT actuator and its optical fiber coil and the phase-voltage coefficient K d V/rad for photodetectors have been experimentally measured by driving the PZT with a low-frequency triangular wave [55], allowing calculation of f EF Hz, and are further presented in the results section.

Sensitivity, Resolution, Bandwidth and Other Technical Characteristics
The purposed setup is composed of different elements, both optical and electric, each with specific technical parameters for power, frequency, bandwidth, sensitivity, resolution, internal noise sources, and others [40]. The proposed FOH system's sensitivity, resolution, and bandwidth are dependent on the setup's arrangement and on its components' intrinsic characteristics, whose values are examined in the results section, following collected data series and their derivatives of phases and amplitudes.
Although it has not been the scope of this work to measure isolated parameters of the optical coils built for the MI's sensor head, other studies have already demonstrated a sensitivity of −116 dB re rad/µPa in the bandwidth of 10 Hz to 2 kHz, phase noise of −102 dB re rad/ √ Hz, and pressure noise of 14 dB re µPa/ √ Hz [15]. Another study shows a sensitivity of −170 dB re rad/µPa and noise floor of 50 dB re µPa/ √ Hz below 1 kHz [40]. These parameters vary with the type and length of fibers exposed to the acoustic waves, coil sizes and their layout, number of fiber layers, acoustic wave frequency and direction, mechanical and elasto-optic properties of fibers, and other parameters [51,[61][62][63].

Data Collection and Database Structure
The MA developed for this experiment was connected online to all setup equipment and took twenty measurements of amplitude and phase per each milliliter of liquid volume, for a total of 11,220 readings (20 × 561) that were stored in a database. Values of amplitudes (volts) were rounded to 2 digits, and phases (degrees) were rounded to zero digits to the right of the decimal point to allow the system to calculate the modes (most frequent values) of both measurands.
Each reading was registered as a tuple of data object (lines) having 64 attribute fields (columns) of information. Among these fields, the tuple had point values of amplitude and phase, along with modes, means, standard deviations, and outlier indicators. The last measure of a group was calculated after removing the interquartile outliers. In this work, these outliers were values greater than 1.5 times the interquartile size, above the upper quartile (75%) and below the lower quartile (25%), for a measurement group. The interquartile method was applicable for data both normally distributed or not. The database also registered a field to show outliers that were less than 10 or above 90 percentile ranges. These two strategies are referred to in this text as "interquartile" and "percentile" outliers, respectively.
As temperature changes acoustic properties of liquids, each object tuple also had a field that registered water temperature, which was provided by an electronic sensor installed inside the test tank and connected to the MA. This field was used by the machine learning algorithms with the action of merely adding it or not among the columns of attributes selected to compose a data model to be assessed.
Further, no phase or amplitude values from repetitive cycles of increasing and decreasing volumes were registered in the database, despite the fact that this repeatability was seen during the setup tests.

Phase and Amplitude Data Series Analyses
This work presents data series analyses of amplitudes and phases, including their derivatives in relation to liquid volumes. Standard deviations and small linear intervals of these series were evaluated. All graphs show results before and after the S2 coil was submerged. The data series include the mode values of each measurand. First, the phase and amplitude were individually analyzed, and further both were put together in a twodimensional Cartesian space. A specific phase analysis included three adjustment actions, after which an unwrapped phase characterization was obtained for the FOH system.
A limitation in the arctangent function executed by homodyne detectors, where sine and cosine signals are converted to phase, is that the phase can change a maximum of π radians between samples. So changes greater than π represent ambiguity as to whether the signal travelled a full clockwise or counterclockwise lap around the four quadrants [64]. Therefore, an absolute change higher than 180 • between two adjacent milliliters may be a discontinuity caused by a new wrap cycle in the domain of 360 • , influenced not only by the intrinsic nature of the system but also by noise that was still present in the measured data despite the stabilization mechanism. Under this condition, predictive algorithms were used to improve the π limitation [40] as performed by other publications about phase measurands from optical interferometers [30,64,65].

Three Actions of Phase Series Adjustments
Taking into consideration the aspects of phase detection reported in the earlier topic, three actions were applied on the phase data collected in this work.

Action (a)-Fixing Phase Discontinuities with 360 • Rotations
In action (a), all absolute variations above 180 • between two adjacent milliliters were rotated by 360 • . For example, if a liquid volume point is −270 • and the earlier point was +45 • , then a 315 • absolute variation is detected and, therefore, the −270 • point is changed to +90 • after a 360 • rotation. If this new value also caused new further absolute variations above 180 • , the respective liquid volumes were rotated as well.

Action (b)-Unwrapping the Phase Series
In action (b), the phase data series was unwrapped, in which the angles were rotated by ±180 • based on the following thresholds vector: (−180 • −90 • −60 • −30 • ). The minus signal of a threshold value works only on up-down variations, and the plus signal on downup variations. The algorithm ran on each phase difference between two adjacent milliliters, and if it was higher than the threshold value and was in the signal direction of the threshold signal, the point and the remaining series were rotated by 180 • . Up-down movements were rotated by +180 • and down-up by −180 • . In the end, these rotations performed an unwrap operation in the whole phase series, respecting the arctangent function properties as the earlier and the updated angles still kept the same tangent values. Different values of this vector were assessed, and it was found that positive thresholds (high down-up movements) did not affect the unwrapping process.

Action (c)-Excluding Phase Points with Deviations Above 60 •
In action (c), as a strategy for phase noise treatment, a phase point was excluded when the standard deviation in the measurements group of liquid volumes was greater than 60 • during data collection.

Fitting Model for Phase Characterization
After performing the three actions of phase adjustments, the best result was selected based on the greater R-squared (R 2 ) and minor root mean square error (RMSE) according to the fitting model assessed for the final series of the unwrapped phase. Among the models evaluated, there were polynomials, exponentials, Fourier series, Gaussians, power series, and sums of sines.
RMSE and RMSE% are calculated by Equations (22) and (23), respectively, where Y Ti and Y Pi are the true and predicted values, respectively, of the ith term in the phase series composed by N terms.

Machine Learning Algorithms
This work employed machine-learning algorithms under supervised learning to predict liquid volumes from amplitudes and phases of acoustic waves. Two distance-based techniques were tested, Rocchio and k-NN [66], with five distance metrics: Euclidean, Mahalanobis, cosine distance, cosine similarity, and Manhattan. Rocchio is a classifier based on the nearest centroid defined by the training data, and k-NN is based on the k-nearest neighbors to the training data.
In total, six scenarios were evaluated, and each scenario was defined by a specific choice of object tuples (lines) and attributes (columns) from the 11,220 × 64 matrix of collected data. A group of selected tuples defines a dataset, and the group of selected attributes defines a data model. In this case, a data model can include, for example, water temperature, so as to see the influence of this field in the results. Further, each scenario has its own criteria to separate the training from the testing datasets. As an example, a training dataset can be composed only of the twentieth object tuple of the liquid volume points (mode centroids), and the testing dataset by the remaining objects, or the training set can be composed of a random selection of 75% of all tuples, and the testing dataset includes the remaining 25%. In addition, other characteristics, such as distance metrics used and the "k" number of neighbors in k-NN were assessed.
When the training dataset is composed of one tuple standing for the centroid of a milliliter, both Rocchio and 1-NN reach the same accuracy. So, in these cases, the 3-NN is presented, while other cases used 1-NN as it delivered better accuracy. For all scenarios evaluated, both training and testing datasets were normalized to avoid distortions caused by the scales of the attributes. Each liquid volume point was defined as a class (label) with which a new aleatory sample of phase and amplitude was processed to obtain the respective liquid volume. The data were balanced, as the classes have the same number of samples, although they can vary a little with scenarios that excluded outliers.

Gaussian Process Regression
In addition to the use of classification algorithms, this work also assessed machinelearning regression versions based on the same fitting models used to characterize unwrapped phase data series. However, instead of testing only the mode values of amplitudes and phases, the regression models with machine-learning were applied to all database points with the same random selection of 75%/25% to define the training and the testing datasets, respectively. The best result in terms of R2 and RMSE was obtained from Gaussian process regression (GPR), whose values are presented in the result section of this paper. GPR assumes that the target variables are Gaussian distributions and makes use of covariance matrices derived from data attributes to predict a fitting model [66].

Sensitivity, Resolution, Bandwidth, and Other Technical Characteristics
Regarding acoustic bandwidth, the system was designed to operate at the fixed frequency of 100 kHz with the ultrasound transducer able to work at the maximum frequency of 1.5 MHz, and Figure 4 shows an experimental result of a 6 dB bandwidth at 700 kHz, ranging from around 30 kHz to 730 kHz, inside which specific frequencies of 80 kHz, 220 kHz, and 340 kHz presented high peak values in the response curve. This response was computed under a fixed liquid volume, as different volumes present different voltage amplitudes for a fixed frequency. The choice of the FOH system's fixed operation frequency took into consideration experimental bandwidth, the Fresnel's zone restrictions, and the longest possible acoustic wavelength in the water.

Sensitivity, Resolution, Bandwidth, and Other Technical Characteristics
Regarding acoustic bandwidth, the system was designed to operate at the fixed frequency of 100 kHz with the ultrasound transducer able to work at the maximum frequency of 1.5 MHz, and Figure 4 shows an experimental result of a 6 dB bandwidth at 700 kHz, ranging from around 30 kHz to 730 kHz, inside which specific frequencies of 80 kHz, 220 kHz, and 340 kHz presented high peak values in the response curve. This response was computed under a fixed liquid volume, as different volumes present different voltage amplitudes for a fixed frequency. The choice of the FOH system's fixed operation frequency took into consideration experimental bandwidth, the Fresnel's zone restrictions, and the longest possible acoustic wavelength in the water. The EF loop circuit cutoff bandwidth was calculated following [55], and Figure 5 shows the oscilloscope graphical results used to obtain the sensitivity K =  The EF loop circuit cutoff bandwidth was calculated following [55], and Figure 5 shows the oscilloscope graphical results used to obtain the sensitivity K p = 31.5π 4.24 = 23.34 rad/V and K d = 1.06 π/2 = 0.67 V/rad after driving the PZT with a 50 Hz and V pp = 4.24 V triangular wave. The only requirement to choose the triangular wave's frequency was to make it as small as possible in order to allow counting the number of cycles in the resulting sinus modulated wave. Therefore, the experimental high cutoff frequency of the EF circuit loop resulted in f EF = 23.34×0.67 2π×100×10 3 ×4.7×10 −6 = 5.33 Hz, which was enough to mitigate most environmental noise. A replacement of capacitor C1 from 4.7 µF to 1 µF raised this value to 25.07 Hz, which is close to the value experimentally found by [55].

Original Amplitude and Phase Data Series Collected
The original collected values of amplitudes and phases per each liquid volume point are plotted in Figure 6. As a homodyne detector (phasemeter), each amplitude in volts stands for the optical phase displacement between the signals from the MI's arms, related to a specific liquid volume, and each phase point is the electronic acoustic phase difference between the input and the output signals from the FOH system. Phasemeters recover the phases from the four-quadrant arctangent according to the ratio between two quadrature signals (a sine and a cosine). The relationship between the expected phase and the phase effectively measured should be linear, but there are often distortions caused by spurious effects in the optics or in the signal processing that result in the nonlinearities and periodic errors [35] seen in Figure 6. Specific characteristics can be noted from the originally collected data. Both

Original Amplitude and Phase Data Series Collected
The original collected values of amplitudes and phases per each liquid volume point are plotted in Figure 6. As a homodyne detector (phasemeter), each amplitude in volts stands for the optical phase displacement between the signals from the MI's arms, related to a specific liquid volume, and each phase point is the electronic acoustic phase difference between the input and the output signals from the FOH system. Phasemeters recover the phases from the four-quadrant arctangent according to the ratio between two quadrature signals (a sine and a cosine). The relationship between the expected phase and the phase effectively measured should be linear, but there are often distortions caused by spurious effects in the optics or in the signal processing that result in the nonlinearities and periodic errors [35] seen in Figure 6.
Specific characteristics can be noted from the originally collected data. Both amplitude and phase series are nonlinear with liquid volumes; they are not intrinsically correlated to each other; there are different peaks and valleys when only S1 is under water than when both S1 and S2 are submerged; below S2, the phase varies around the limits of −45 • to +45 • , covering a range of 90 • as limited by the quadrature; above S2, the phase measurand shows maximum and minimum values that touch the limits of −270 • and +90 • , covering a range of 360 • ; above S2, the amplitude window of peaks and valleys dislocates down; both series present limited linearity intervals with liquid volumes, as seen in Figure 7; the amplitude shows quadratic behavior at volumes of 820, 890, 920, 940, and 970 mL; the phase measures show discontinuity jumps near the volumes of 650, 690 to 710, 740, 860, 920, 940, and 990 mL; and the first measured phase at 440 mL presented a value smaller than −180 • . between the input and the output signals from the FOH system. Phasemeters recover the phases from the four-quadrant arctangent according to the ratio between two quadrature signals (a sine and a cosine). The relationship between the expected phase and the phase effectively measured should be linear, but there are often distortions caused by spurious effects in the optics or in the signal processing that result in the nonlinearities and periodic errors [35] seen in Figure 6. Specific characteristics can be noted from the originally collected data. Both amplitude and phase series are nonlinear with liquid volumes; they are not intrinsically correlated to each other; there are different peaks and valleys when only S1 is under water than when both S1 and S2 are submerged; below S2, the phase varies around the limits of −45° to +45°, covering a range of 90° as limited by the quadrature ; above S2, the phase measurand shows maximum and minimum values that touch the limits of −270° and +90°, covering a range of 360°; above S2, the amplitude window of peaks and valleys dislocates  These results confirm nonlinearities, differences in using one or two optical coils as sensing elements, attenuation of acoustic fields as the volume of water increases, and that phase differences between the optical signals in the MI arms are not related to the phase differences between the acoustic signal input and output from the system.

Phase Measurand Analysis
Three actions were applied to the collected phase data in order to: (a) fix the discontinuities; (b) unwrap the data series; and (c) mitigate the noise.
In action (a), after all rotations, the new phase profile is shown in Figure 7, from which it is noted the effect of dislocating the whole data series from the limits of −270°/+90° to a new range of −180°/+180°.
For comparison with the original data presented before, Figure 8 shows the original amplitudes and the new phase series corrected with the 360° rotations. These results confirm nonlinearities, differences in using one or two optical coils as sensing elements, attenuation of acoustic fields as the volume of water increases, and that phase differences between the optical signals in the MI arms are not related to the phase differences between the acoustic signal input and output from the system.

Phase Measurand Analysis
Three actions were applied to the collected phase data in order to: (a) fix the discontinuities; (b) unwrap the data series; and (c) mitigate the noise.
In action (a), after all rotations, the new phase profile is shown in Figure 7, from which it is noted the effect of dislocating the whole data series from the limits of −270 • /+90 • to a new range of −180 • /+180 • .
For comparison with the original data presented before, Figure 8 shows the original amplitudes and the new phase series corrected with the 360 • rotations. discontinuities; (b) unwrap the data series; and (c) mitigate the noise.
In action (a), after all rotations, the new phase profile is shown in Figure 7, from which it is noted the effect of dislocating the whole data series from the limits of −270°/+90° to a new range of −180°/+180°.
For comparison with the original data presented before, Figure 8 shows the original amplitudes and the new phase series corrected with the 360° rotations.  A derivative analysis of both amplitude and phase measurands is presented in Figure 9, with common phase sensitivities reaching 20 • degrees/mL (349 milliradian/mL) and amplitudes in 70 mV/mL. The dashed lines are one standard deviation over means for both measurands, separated by liquid volumes below and above the S2 coil. Comparing variations due to the influence of the S2 coil, the amplitude deviation decreased from 44 mV to 31 mV, while the phase increased from 24 • to 37 • . A derivative analysis of both amplitude and phase measurands is presented in Figure  9, with common phase sensitivities reaching 20° degrees/mL (349 milliradian/mL) and amplitudes in 70 mV/mL. The dashed lines are one standard deviation over means for both measurands, separated by liquid volumes below and above the S2 coil. Comparing variations due to the influence of the S2 coil, the amplitude deviation decreased from 44 mV to 31 mV, while the phase increased from 24° to 37°.
That is, the presence of S2 decreased the sensitivity of amplitude (homodyne detection related to the optical phase differences between the signals inside the MI arms) but increased the sensitivity of the acoustic phases (related to the electrical phase differences between the signal input to the UT and the measurand signal delivered by PD3). Based on that result, future analysis would take S2 out of the system and verify if coil S1 alone could detect different series of amplitudes and phases, including their derivatives.  Figure 10 shows plain linear intervals, with numbers at the ends of straight lines being the first and final liquid volume of each interval. This figure also shows that the majority of phase points have their mode values ("x") close to their mean values ("+"), which is a characteristic of normal distributions, although neither normal fitting test was performed over the data, as it was not a goal of this work. That is, the presence of S2 decreased the sensitivity of amplitude (homodyne detection related to the optical phase differences between the signals inside the MI arms) but increased the sensitivity of the acoustic phases (related to the electrical phase differences between the signal input to the UT and the measurand signal delivered by PD3). Based on that result, future analysis would take S2 out of the system and verify if coil S1 alone could detect different series of amplitudes and phases, including their derivatives. Figure 10 shows plain linear intervals, with numbers at the ends of straight lines being the first and final liquid volume of each interval. This figure also shows that the majority of phase points have their mode values ("x") close to their mean values ("+"), which is a characteristic of normal distributions, although neither normal fitting test was performed over the data, as it was not a goal of this work. Figure 9. Derivatives of amplitudes and corrected phases. Figure 10 shows plain linear intervals, with numbers at the ends of straight lines being the first and final liquid volume of each interval. This figure also shows that the majority of phase points have their mode values ("x") close to their mean values ("+"), which is a characteristic of normal distributions, although neither normal fitting test was performed over the data, as it was not a goal of this work.    Figure 11 shows the resulting series after each one of the three phase actions were executed. The bottom of Figure 11 also shows room and water temperatures, both measured during data collection days represented by small circles on the graph.

Sensors 2022, 22, x FOR PEER REVIEW
18 of 31 Figure 9 shows that after executing action (a), the phase derivative series are mostly confined in the limits of −20°/20° with one standard deviation of 37°. So, a maximum admissible standard deviation error of 60° for a point in action (c) is a conservative value, although other values have been evaluated. So, action (c) caused the elimination of 4% of collected data, and Figure 11 shows the resulting series after each one of the three phase actions were executed. The bottom of Figure 11 also shows room and water temperatures, both measured during data collection days represented by small circles on the graph. According to Figure 12, while the original phase derivatives reached a six-standard deviation of 290°, the final adjusted phase series ended with a six-sigma deviation of 82°. This result was achieved after the execution of three sequenced steps of phase adjustments, whose algorithms improved upon the π constraints of angle measurands [40]. In fact, those steps detected and cleaned phase jumpers between adjacent milliliters with absolute values higher than 180° and unwrapped the phase series after removing phase points with deviations equal to or higher than 60° from the original data.
Derivative analysis showed the improvements achieved by these proposed phase According to Figure 12, while the original phase derivatives reached a six-standard deviation of 290 • , the final adjusted phase series ended with a six-sigma deviation of 82 • . This result was achieved after the execution of three sequenced steps of phase adjustments, whose algorithms improved upon the π constraints of angle measurands [40]. In fact, those steps detected and cleaned phase jumpers between adjacent milliliters with absolute values higher than 180 • and unwrapped the phase series after removing phase points with deviations equal to or higher than 60 • from the original data. deviation of 290°, the final adjusted phase series ended with a six-sigma deviation of 82°. This result was achieved after the execution of three sequenced steps of phase adjustments, whose algorithms improved upon the π constraints of angle measurands [40]. In fact, those steps detected and cleaned phase jumpers between adjacent milliliters with absolute values higher than 180° and unwrapped the phase series after removing phase points with deviations equal to or higher than 60° from the original data.
Derivative analysis showed the improvements achieved by these proposed phase adjustment algorithms, which had the goal of finding a final phase characterization for the FOH system. Those actions were based on parameters that could be previously configured, allowing the MA to apply them as long as new data were collected online.  Derivative analysis showed the improvements achieved by these proposed phase adjustment algorithms, which had the goal of finding a final phase characterization for the FOH system. Those actions were based on parameters that could be previously configured, allowing the MA to apply them as long as new data were collected online.
Finally, Figure 13 shows the phase characterization after fitting the unwrapped phase with a sum-of-sines of nine terms, resulting in R2 of 0.9994 and RMSE% of 4.15%. The model was configured to run with least absolute residual method and nonlinear least squares. Finally, Figure 13 shows the phase characterization after fitting the unwrapped phase with a sum-of-sines of nine terms, resulting in R2 of 0.9994 and RMSE% of 4.15%. The model was configured to run with least absolute residual method and nonlinear least squares. The sum-of-sines fitting function is expressed by: where L is the predicted liquid volume in milliliters, and ∆∅ is the angle detected and The sum-of-sines fitting function is expressed by: where L ml is the predicted liquid volume in milliliters, and ∆∅ s is the angle detected and processed by the FOH system's application after the three phase treatments are applied. The coefficients a i , b i , and c i of the adjusted function are listed in Table 1.

Amplitude Measurand Analysis
The amplitude and its derivative series have already been presented in the earlier section to allow their comparison with the phase series. So, a next analysis is to show the presence of linear intervals, as shown in Figure 14. This figure also shows that most amplitude points have mode values quasi-equal to mean values, what is also a characteristic of normal distributions. The amplitude and its derivative series have already been presented in the earlier section to allow their comparison with the phase series. So, a next analysis is to show the presence of linear intervals, as shown in Figure 14. This figure also shows that most amplitude points have mode values quasi-equal to mean values, what is also a characteristic of normal distributions.      Figure 15 shows the derivatives of amplitude to liquid volumes, with limited ranges of linear behavior. The amplitude analysis shows that the collected data are nonlinear, and it is not obvious how to derive a math function to fit these data. In this sense, the next section presents an analysis using both phase and amplitude mode points.

Phase and Amplitude Analysis
This topic evaluates both amplitude and phase as coordinates of a 2D Cartesian space. Figure 16 uses the corrected phases previously presented in Figure 7, and Figure 17 uses the unwrapped phases presented in Figure 13. Both graphs have the phase measurand in the x-axis and the amplitude measurand in the y-axis, with point coordinates defined by their mode values. The integer numbers plotted over the sequenced points are the The amplitude analysis shows that the collected data are nonlinear, and it is not obvious how to derive a math function to fit these data. In this sense, the next section presents an analysis using both phase and amplitude mode points.

Phase and Amplitude Analysis
This topic evaluates both amplitude and phase as coordinates of a 2D Cartesian space. Figure 16 uses the corrected phases previously presented in Figure 7, and Figure 17 uses the unwrapped phases presented in Figure 13. Both graphs have the phase measurand in the x-axis and the amplitude measurand in the y-axis, with point coordinates defined by their mode values. The integer numbers plotted over the sequenced points are the respective liquid volumes in milliliters. Considering the substantial number of measured points, not all values were plotted to preserve an adequate graphical visualization by the reader. respective liquid volumes in milliliters. Considering the substantial number of measured points, not all values were plotted to preserve an adequate graphical visualization by the reader. Figure 16 shows points standing for a linear sequence of liquid volumes, but with the evolute as curves of amplitude and phase coordinates making clockwise turns as long as the liquid volume increases linearly, forming patterns like "snail paths" that are overlapped by other paths, showing nonlinear behavior of the FOH system. This pattern also shows spaces with a high concentration of liquid volume points and empty spaces in the vicinity. There is also a difference in space point occupation when S1 is submerged (liquid volumes below S2) compared to when both S1 and S2 are underwater. In fact, the unwrapped phases are seen only with measurements above S2.

Rocchio and k-NN with Different Distance Metrics
This topic presents six scenarios of data analysis. Scenarios one to four used the phase adjusted to the range of −180°/+180°. Scenario five used the unwrapped phase, and scenario six used the original phase without any adjustments. Figure 18 shows the results of first scenario that evaluated the mode values of phase and amplitude related to a liquid volume point. The mode values were used as the training dataset, and they were evaluated against themselves as testing data. In this scenario, an accuracy of 100% was expected, but the accuracy of 96.8% shows that 3.2% of the centroids overlap; that is, although they stand for different liquid volumes, they have the same coordinates of amplitude and phase. This result corroborates the behavior of Figure 16 in which the "snail paths" overlap each other more than one time. This also shows that Rocchio is not applicable if data are composed of centroids of mode values. Additionally, k-NN can be seen as useless with an accuracy of 31.2%. The small circles in the graphs supply a visual notion of the wrongly classified points.
This first Rocchio result shows a trade-off in which the need to round numbers to allow the use of mode values has the collateral effect of increasing the probability of centroids overlapping. So, the number of digits to the right of the decimal points is an input parameter to the system. The fewer digits, the higher probability of overlapping. Based on the results of this first scenario, new data models and new selections of training and testing data were defined to improve analysis. Figure 17. The 2D grade of amplitudes and unwrapped phases (after action "c" is applied). Figure 16 shows points standing for a linear sequence of liquid volumes, but with the evolute as curves of amplitude and phase coordinates making clockwise turns as long as the liquid volume increases linearly, forming patterns like "snail paths" that are overlapped by other paths, showing nonlinear behavior of the FOH system. This pattern also shows spaces with a high concentration of liquid volume points and empty spaces in the vicinity. There is also a difference in space point occupation when S1 is submerged (liquid volumes below S2) compared to when both S1 and S2 are underwater. In fact, the unwrapped phases are seen only with measurements above S2.

Rocchio and k-NN with Different Distance Metrics
This topic presents six scenarios of data analysis. Scenarios one to four used the phase adjusted to the range of −180 • /+180 • . Scenario five used the unwrapped phase, and scenario six used the original phase without any adjustments. Figure 18 shows the results of first scenario that evaluated the mode values of phase and amplitude related to a liquid volume point. The mode values were used as the training dataset, and they were evaluated against themselves as testing data. In this scenario, an accuracy of 100% was expected, but the accuracy of 96.8% shows that 3.2% of the centroids overlap; that is, although they stand for different liquid volumes, they have the same coordinates of amplitude and phase. This result corroborates the behavior of Figure 16 in which the "snail paths" overlap each other more than one time. This also shows that Rocchio is not applicable if data are composed of centroids of mode values. Additionally, k-NN can be seen as useless with an accuracy of 31.2%. The small circles in the graphs supply a visual notion of the wrongly classified points. A second scenario used the same data model as the first one, but with modes replaced by means, and Figure 19 shows an accuracy of 100% for Rocchio and 29.8% for 3-NN. If both modes and means are used in the data model as a third scenario, the Rocchio and 3-NN accuracies are 100% and 31.4%, respectively. A partial conclusion here is that both training and testing datasets, besides the data models, still need to be improved. Figure 20 shows a fourth scenario in which the training data are the centroids of modes and means of phase and amplitude, and the testing data are all the remaining points collected by the experimental setup excluding the centroids and the interquartile outliers.  This first Rocchio result shows a trade-off in which the need to round numbers to allow the use of mode values has the collateral effect of increasing the probability of centroids overlapping. So, the number of digits to the right of the decimal points is an input parameter to the system. The fewer digits, the higher probability of overlapping. Based on the results of this first scenario, new data models and new selections of training and testing data were defined to improve analysis.
A second scenario used the same data model as the first one, but with modes replaced by means, and Figure 19 shows an accuracy of 100% for Rocchio and 29.8% for 3-NN. A second scenario used the same data model as the first one, but with modes replaced by means, and Figure 19 shows an accuracy of 100% for Rocchio and 29.8% for 3-NN. If both modes and means are used in the data model as a third scenario, the Rocchio and 3-NN accuracies are 100% and 31.4%, respectively. A partial conclusion here is that both training and testing datasets, besides the data models, still need to be improved. Figure 20 shows a fourth scenario in which the training data are the centroids of modes and means of phase and amplitude, and the testing data are all the remaining points collected by the experimental setup excluding the centroids and the interquartile outliers.  If both modes and means are used in the data model as a third scenario, the Rocchio and 3-NN accuracies are 100% and 31.4%, respectively. A partial conclusion here is that both training and testing datasets, besides the data models, still need to be improved. Figure 20 shows a fourth scenario in which the training data are the centroids of modes and means of phase and amplitude, and the testing data are all the remaining points collected by the experimental setup excluding the centroids and the interquartile outliers.
The fourth scenario is more data intensive than the third, as it used more tuples as testing data, resulting in an accuracy of 57.8% for Rocchio and 25.0% for 3-NN. Additionally, 5-NN's accuracy is 15.8%. In this sense, it is possible to note that training datasets composed only of centroids are poor data models, as their low distances and overlapping points are not adequate for distance-based algorithms.
Therefore, a fifth scenario was defined, in which the data model was improved, and its attributes were composed of point values, means, and modes (intermediate and finals) for both amplitude and phase, complemented by the water temperature. The fifth scenario considered the unwrapped and characterized phase data presented in Figure 13.
If both modes and means are used in the data model as a third scenario, the Rocchio and 3-NN accuracies are 100% and 31.4%, respectively. A partial conclusion here is that both training and testing datasets, besides the data models, still need to be improved. Figure 20 shows a fourth scenario in which the training data are the centroids of modes and means of phase and amplitude, and the testing data are all the remaining points collected by the experimental setup excluding the centroids and the interquartile outliers.  The choice of object tuples (lines) was aleatory to define the training and the testing datasets with the respective proportion of 75%/25%. Initially, no outliers were excluded. The k-NN was defined to one nearest neighborhood (1-NN) as it presented better results than when using three or more neighbors for all distance metrics.
As a result, for Euclidean distance, 1-NN reached an accuracy of 91.6%, and other k-NNs with three or more neighbors presented lower accuracies (3-NN = 87.9%; 5-NN = 85.3%; 9-NN = 80.2%; 15-NN = 71.6%; and 20-NN = 64.0%), reinforcing that 1-NN is always better. Figure 21 shows the resulting accuracies for different distance metrics used with Rocchio and k-NN, in which 1-NN with Manhattan distance reached an accuracy of 97.0%. The cosine similarity metrics resulted in accuracy of 0% (zero) for both algorithms and for all scenarios evaluated so far. The fourth scenario is more data intensive than the third, as it used more tuples as testing data, resulting in an accuracy of 57.8% for Rocchio and 25.0% for 3-NN. Additionally, 5-NN's accuracy is 15.8%. In this sense, it is possible to note that training datasets composed only of centroids are poor data models, as their low distances and overlapping points are not adequate for distance-based algorithms.
Therefore, a fifth scenario was defined, in which the data model was improved, and its attributes were composed of point values, means, and modes (intermediate and finals) for both amplitude and phase, complemented by the water temperature. The fifth scenario considered the unwrapped and characterized phase data presented in Figure 13.
The choice of object tuples (lines) was aleatory to define the training and the testing datasets with the respective proportion of 75%/25%. Initially, no outliers were excluded. The k-NN was defined to one nearest neighborhood (1-NN) as it presented better results than when using three or more neighbors for all distance metrics.
As a result, for Euclidean distance, 1-NN reached an accuracy of 91.6%, and other k-NNs with three or more neighbors presented lower accuracies (3-NN = 87.9%; 5-NN = 85.3%; 9-NN = 80.2%; 15-NN = 71.6%; and 20-NN = 64.0%), reinforcing that 1-NN is always better. Figure 21 shows the resulting accuracies for different distance metrics used with Rocchio and k-NN, in which 1-NN with Manhattan distance reached an accuracy of 97.0%. The cosine similarity metrics resulted in accuracy of 0% (zero) for both algorithms and for all scenarios evaluated so far. These distance-based analyses could have stopped with the fifth scenario, as an accuracy above 95% was found. However, perceiving the result of Manhattan's distance metrics in the fifth scenario, a sixth and last scenario was proposed with the goal of testing new attribute models and data sources only using that metric. The data sources were differentiated according to the three phase adjustment actions previously presented. A phase series could be (i) original; (ii) adjusted to −180°/+180°; (iii) unwrapped; or (iv) unwrapped with exclusions of deviations above 60°.
Testing revealed the best accuracy found for the sixth scenario occurred when the data model attributes and data tuple selection were performed the same as for the fifth scenario, but with the original phases as collected from the experiment without any adjustments. Fine-tuning of the data model was also applied, in which different combinations of interquartiles and percentiles were evaluated using the fields of outlier Figure 21. Fifth scenario. This figure has ten graphs distributed in two columns and five lines. Graphs on the left column are Rocchio and on the right are 1-NN. Each line stands for a different distance metric. Each graph title has the name of the distance used, the resulting accuracy, and number of tested samples.
These distance-based analyses could have stopped with the fifth scenario, as an accuracy above 95% was found. However, perceiving the result of Manhattan's distance metrics in the fifth scenario, a sixth and last scenario was proposed with the goal of testing new attribute models and data sources only using that metric. The data sources were differentiated according to the three phase adjustment actions previously presented. A phase series could be (i) original; (ii) adjusted to −180 • /+180 • ; (iii) unwrapped; or (iv) unwrapped with exclusions of deviations above 60 • .
Testing revealed the best accuracy found for the sixth scenario occurred when the data model attributes and data tuple selection were performed the same as for the fifth scenario, but with the original phases as collected from the experiment without any adjustments. Finetuning of the data model was also applied, in which different combinations of interquartiles and percentiles were evaluated using the fields of outlier indicators originally registered by the FOH's MA application. As there are four variables, sixteen combinations of two outliers and two measurands were evaluated, and their results are presented in Table 2. When an outlier exclusion is applied, it is shown by an "x" in the table. Figure 22 shows the best graphic results derived from theses analyses. indicators originally registered by the FOH's MA application. As there are four variables, sixteen combinations of two outliers and two measurands were evaluated, and their results are presented in Table 2. When an outlier exclusion is applied, it is shown by an "x" in the table. Figure 22 shows the best graphic results derived from theses analyses.  Although Test 2 of Table 2 presented the greatest accuracy of 99.4% among the 16 tests, Figure 22 shows that Test 1 also has a high accuracy of 99.1% but a cleaner graph, in Although Test 2 of Table 2 presented the greatest accuracy of 99.4% among the 16 tests, Figure 22 shows that Test 1 also has a high accuracy of 99.1% but a cleaner graph, in which the distances between the correctly and the wrongly predicted liquid volumes are shorter. This result shows that the simultaneous application of both outlier exclusion strategies, interquartile and percentile on both amplitude and phase series, on Test 1 eliminated more noisy values than on Test 2. Therefore, although Test 1 (99.1%) has a slightly lower accuracy than Test 2 (99.4%), Test 1 is preferable as a model as it has classification errors with smaller deviations around the right liquid volumes.
The use of distance-based machine learning algorithms was prominent in this work, as the results achieved accuracies of 99.4% for 1-NN and 97.3% for Rocchio, with both using Manhattan distance metrics. Values of 3-NN = 99.1% and 5-NN = 98.5% were calculated, proving that one-neighborhood models have better accuracy. The accuracies for Euclidean distance in sixth scenario were 88.5% for Rocchio and 98.0% for 1-NN.
Manhattan metrics represent the distance between two points measured along axes at right angles of 90 • degrees, following a grid approach instead of the straight lines of Euclidean distance [67]. When comparing measured and reference signals, similarity methods based on Manhattan metrics can be used to minimize the distances between signals [68,69]. Besides the better accuracy, Manhattan metrics are more preferable than Euclidean in terms of resource consumption, as Euclidean requires square-root operations, and Manhattan needs only the absolute value of a subtraction [70].

Gaussian Process Regression
A Gaussian Process Regression (GPR) algorithm was configured with the method of rational quadratic type, and the resulting R 2 of 1.00 and the RMSE of 0.21164 are shown in Figure 23. An error of 0.2 over supervised data collected with the steps of 1.0 mL shows a great fit of the GPR over the nature of physics involved in this experiment. which the distances between the correctly and the wrongly predicted liquid volumes are shorter. This result shows that the simultaneous application of both outlier exclusion strategies, interquartile and percentile on both amplitude and phase series, on Test 1 eliminated more noisy values than on Test 2. Therefore, although Test 1 (99.1%) has a slightly lower accuracy than Test 2 (99.4%), Test 1 is preferable as a model as it has classification errors with smaller deviations around the right liquid volumes. The use of distance-based machine learning algorithms was prominent in this work, as the results achieved accuracies of 99.4% for 1-NN and 97.3% for Rocchio, with both using Manhattan distance metrics. Values of 3-NN = 99.1% and 5-NN = 98.5% were calculated, proving that one-neighborhood models have better accuracy. The accuracies for Euclidean distance in sixth scenario were 88.5% for Rocchio and 98.0% for 1-NN.
Manhattan metrics represent the distance between two points measured along axes at right angles of 90° degrees, following a grid approach instead of the straight lines of Euclidean distance [67]. When comparing measured and reference signals, similarity methods based on Manhattan metrics can be used to minimize the distances between signals [68,69]. Besides the better accuracy, Manhattan metrics are more preferable than Euclidean in terms of resource consumption, as Euclidean requires square-root operations, and Manhattan needs only the absolute value of a subtraction [70].

Gaussian Process Regression
A Gaussian Process Regression (GPR) algorithm was configured with the method of rational quadratic type, and the resulting R 2 of 1.00 and the RMSE of 0.21164 are shown in Figure 23. An error of 0.2 over supervised data collected with the steps of 1.0 mL shows a great fit of the GPR over the nature of physics involved in this experiment. Therefore, ending the results and discussion, different machine learning algorithms were evaluated, in which two were of classification and one was of regression type. A model fit to the unwrapped phase was also shown. The classification algorithms were assessed considering five different distance metrics.
After all analyses, the best results are presented in Table 3.  Therefore, ending the results and discussion, different machine learning algorithms were evaluated, in which two were of classification and one was of regression type. A model fit to the unwrapped phase was also shown. The classification algorithms were assessed considering five different distance metrics.
After all analyses, the best results are presented in Table 3.

Conclusions and Future Work
In this work, a fiber-optic hydrophone (FOH) based on Michelson's interferometer (MI) is actively stabilized by an electronic feedback (EF) loop circuit to mitigate mechanical and thermal noise coming from the external environment. The FOH system is employed as a hardware and software application to perform liquid volume measurements of a 1000 mL glass graduated cylinder filled with water with volumes ranging from 440 mL to 1000 mL. This range limitation is due to the setup and positioning of the ultrasound source inside the cylinder. The sensing elements are composed of two optical fiber coils placed at the sensor head and a third optical fiber coil placed at the MI's reference arm. The coils are made of readily available and common SMF fiber. The reference coil is wound around a piezoelectric actuator to stabilize the system at the quadrature point of π/2, and the two sensor coils are submerged in water to detect acoustic wave patterns formed by a particular liquid volume, supplying distinct values of amplitudes (volts) and phases (degrees) as output measurands. Finally, due to the nonlinear behavior of theses measurands, machine-learning algorithms are employed under supervised learning to predict the liquid volumes.
The accuracy of 99.4% achieved by this work is a prominent result in liquid volume predictions for a system that employs acoustic detection through optical fiber sensors. Further, an RMSE of 0.21164 mL shows the feasibility of the FOH system. For the test tank used, the value of 0.21 mL is equivalent to 0.0714 mm of error in the height of the water column. An added contribution of this work is the characterization of the unwrapped phase measurand, in which a sum-of-sines fitting function reached an R 2 of 0.9994 and an RMSE% of 4.15%.
Another contribution of this work is a practical demonstration of the homodyne demodulation approach working with an active stabilization mechanism over a Michelson's interferometer, as [40] mentions that it is a challenge to stabilize such systems for sensing applications, and it is useful for laboratory analysis. The advantages and drawbacks of quadrature stabilization methods are related to the resolution of the interferometer, which is the smallest physical quantity that a sensor can measure, defined by the noise of the measurand. Multiple reflections in optical arms improve the resolution of a homodyne interferometer but can induce phase jumps and loss of laser coherence. Therefore, a compromise must be found between increasing resolution and losing coherence [35].
As a limitation, this first version of the FOH system was used to measured only one type of liquid (water), although the two optical coils in MI's sensor head were intentionally constructed to find different fluids around them (e.g., water and oil), which will be done in future tests. Another limitation is the medium time of three seconds to collect and process one data sample. As a milliliter requires twenty samples, the FOH system takes a minute to predict liquid volume.
As suggestions, the system can be improved to detect different fluids and multifluid interfaces. This stabilized FOH can also be used with a few adaptations to perform ultrasound piezoelectric transducer calibration [18,58]. Third, the FBG structure purposed by [23,71] could include an optical coil inside the polymer diaphragms as an additional sensing mechanism to detect vibration patterns of liquids inside a production vessel. Finally, a long short-term memory (LSTM) neural network could be considered as a prediction model, as its recursive behavior would be capable of detecting a sequence of points in the "snail paths" shown in the 2D plane of modal amplitude and phase patterns.