# Extrapolation of Calibration Curve of Hot-wire Spirometer Using a Novel Neural Network Based Approach

*Department of Mechanical Engineering, Iranian Research Organization for Science and Technology, Tehran, Iran*

^{1}

*Department of Electrical and Electronic Engineering, Iranian Research Organization for Science and Technology, Tehran, Iran*

**Address for correspondence:**Dr. Vahid Reza Nafisi, Department of Electrical and Electronic Engineering, Iranian Research Organization for Science and Technology (IROST), P.O. Box 15815 - 3538, Tehran, Iran. E-mail: gro.tsori@isifan_rv

## Abstract

Hot-wire spirometer is a kind of constant temperature anemometer (CTA). The working principle of CTA, used for the measurement of fluid velocity and flow turbulence, is based on convective heat transfer from a hot-wire sensor to a fluid being measured. The calibration curve of a CTA is nonlinear and cannot be easily extrapolated beyond its calibration range. Therefore, a method for extrapolation of CTA calibration curve will be of great practical application. In this paper, a novel approach based on the conventional neural network and self-organizing map (SOM) method has been proposed to extrapolate CTA calibration curve for measurement of velocity in the range 0.7-30 m/seconds. Results show that, using this approach for the extrapolation of the CTA calibration curve beyond its upper limit, the standard deviation is about –0.5%, which is acceptable in most cases. Moreover, this approach for the extrapolation of the CTA calibration curve below its lower limit produces standard deviation of about 4.5%, which is acceptable in spirometry applications. Finally, the standard deviation on the whole measurement range (0.7-30 m/s) is about 1.5%.

**Keywords:**

*Calibration curve*,

*hot-wire spirometer*,

*neural network curve fitting*,

*self-organizing map*

## INTRODUCTION

Spirometry is pivotal in screening, diagnosing and monitoring pulmonary diseases and is increasingly advocated for use in primary care practice. Inspired and expired lung volumes measured by spirometry are useful for detecting, characterizing and quantifying the severity of lung diseases.[1] A variety of techniques have been developed for the measurement of absolute lung volume based on the flow measurement. One such technique can measure flow rate with known orifice geometry and then do the time integral to get the total volume. One of the available operating principles for flow measurement is thermal anemometry.[2] It measures the total heat loss of a heating element and correlates the output signal to the flow rate of the fluid.[3]

A flow rate sensor with large dynamic range is very essential in medical applications to measure, for example, the breathing rate of a child in normal conditions or the breathing rate of an adult person in exercise conditions, all with the same sensor.[4]

Hot-wire is a delicate and highly sensitive device that provides flow velocity data. Its small size gives it good spatial resolution and high frequency response.[3] In addition, hot-wire anemometry exhibits stable performance characteristics across the clinical range of temperature and humidity, has a small dead-space and is unaffected by mean airway pressure.[5] Thermal flow transducers satisfy common clinical/research demands with respect to dynamic range[6] and response time.[7] Therefore, hot-wire spirometer is an important device for the measurement of respiration flow and lung volumes in the wide range of velocities.

Calibration of a hot-wire sensor is necessary for making accurate and reliable flow measurements. In the calibration process, reference velocities, *U _{r}*, are measured at various locations across the flow cross section, and the corresponding reference output voltages,

*E*, are obtained for all the measured data points. Subsequently, the resultant data pairs (

_{r}*E*) are plotted to obtain the calibration curve for the specific hot-wire sensor.

_{r}, U_{r}Different methods may be used for the calibration of hot-wire sensors. One such method is to use a pitot-tube for the measurement of reference velocity under laminar flow conditions. Measurement of pressure drop across a calibration nozzle is another method for the measurement of reference velocity. However, these methods present certain difficulties. For example, at low flow velocities (<2 m/s), due to low dynamic pressures at low velocities, the pitot-tube is difficult to use and final results are associated with large errors. Therefore, different approaches such as moving the hot-wire probe in the fluid, or vortex shedding due to the presence of cylindrical wire in the air flow, may be used to obtain the calibration curve at low velocities.[8–10] Yet another alternative approach is to apply the law of conservation of mass, in which the pitot-tube is placed in the test section, and the hot-wire probe is located in a settling chamber. Although these methods can be used, in practice they may be difficult and time consuming to perform.

Calibration of sensors for high velocity conditions involves certain difficulties, too. Firstly, due to large energy requirements it is difficult to produce the required high velocities. Secondly, measurement of high velocities can be difficult to perform because low velocity pressure transducers cannot be used in such applications.

The calibration curve is drawn using the velocity data points (*E _{r}, U_{r}*) obtained within the calibration range. Methods such as spline, power law (King's law), and polynomial curve fitting are used for fitting of data points.[11,12] However, it is difficult to extend the data points, with acceptable error margin, beyond the calibration range of a particular CTA. Therefore, to avoid unwanted errors, the calibration curve of the CTA should only be used for the measurement of velocities within the range for which the original calibration curve has been obtained. Therefore, to use the same hot-wire anemometer for measuring velocities outside the range of the CTA calibration curve, an approach permitting the extrapolation of the original calibration curve will be very useful.

Neural network method has been previously used for fitting of nonlinear calibration curves.[13] Therefore, this method may also be used for fitting of hot-wire calibration curve, which is of nonlinear nature. On the other hand, an estimator based on neural network will have the capability to retain and change its internal weights. Therefore, when a neural network estimator is designed based on calibration data, it will be possible to insert new data into this network and retrain the estimator to obtain a new and improved estimator, which can estimate new data in addition to the old data. Using this procedure, a hot-wire spirometer can be recalibrated in clinic (It is recommended that a spirometer should be readjusted daily[4]). This characteristic of the neural network estimator is not shared by other estimators of calibration curve. In view of these advantages, the authors have designed a neural network estimator for the extrapolation of calibration curve of hot-wire spirometer.

In this paper, a novel approach based on the conventional neural network method has been proposed to extrapolate the calibration curve of a CTA, obtained for the velocity range (3-15 m/s). Standard deviation values for velocity ranges higher and lower than the range of calibration curve have been obtained using the proposed approach. These values have been compared with the corresponding values obtained from the conventional neural network method and the other fitting methods mentioned above.

## MATERIALS AND METHODS

Experiments were carried out at Iranian Research Organization for Science and Technology (IROST), using a closed loop wind tunnel with a 60 cm × 60 cm test section [Figure 1]. The hot-wire spirometer uses a one-dimensional probe, consisting of two hot-wire sensors for its operation (flow magnitude and direction measurement). The vortex shedding method has been used for the calibration of each hot-wire sensor.

Experimental data is transferred to a PC via a 12 bit A/D data acquisition card. In order to increase the resolution of the CTA output, the top bridge voltage has been conditioned using a negative offset of 1.7 V and a gain of 16. Placing the hot-wire sensor at a suitable location, the output voltage and Karman vortex frequency have been measured.[10] In this method, a cylindrical wire of 1 mm diameter is placed in the flow path, and the vortex shedding behind the wire is measured. Flow velocity is then calculated using the relation given by:[14]

Here *F* = ƒ*d*^{2}/*v*, Re = *Ud/v*, where ƒ is the vortex shedding frequency (Hz), *d* is the cylindrical wire diameter (m), *U* is flow velocity (m/s), and *v* is kinematic viscosity (m^{2}/s).

As shown in Figure 2, calibration curve of the hot-wire sensor at different velocities has been obtained by averaging the output voltage, measuring the vortex shedding frequency, and applying Eq. (1). Data ranging from 0.7 to 30 m/s has been used for this purpose. On the basis of Eq. (1), data obtained for 170 < Re < 300 has been discarded due to the large uncertainty in this range of Reynolds numbers.[15]

(Data obtained using the experimental setup shown in Figure 1.)

### Neural Network Method

Examination of experimental data from section 2 showed that the kind and behavior of the governing functions of the system at low and high velocities would be different. Therefore, design of a single estimation function for extrapolation of the CTA calibration curve in the entire velocity range, 0.7-30 m/s, might lead to increased estimation errors. Hence, our approach has been to divide the experimental data, in the range 3-15 m/s, into two groups of 3-10 m/s and 10-15 m/s and design a different estimator for each group, based on the relevant neural networks. Subsequently, after training the groups at the training phase, results obtained from the two networks are combined.

#### The network architecture

Neural network method can be used as function approximator. The radial basis neural networks are among the most suitable neural networks for this purpose.[16] Radial basis networks consist of two layers: A hidden radial basis layer and an output linear layer [Figure 3a].

The ||*dist*|| box in Figure 3a accepts the input vector *P* and input weight matrix *W _{1}* and produces vector

*n*, whose elements are the distances between the input vector and row vectors of

_{1}*W*[17]:

_{1}*a*_{1} = *F* (||*W*_{1} – *p*|| * *b*_{1}) (2)

where *b _{1}* is the bias vector.

Every neuron in the radial basis layer will output a value, based on the distance of the input vector from each neuron's weight vector. Thus, radial basis neurons with weight vectors quite different from the input vector *P* will have near zero outputs. These small outputs have only negligible effect on the linear output neurons. For the linear layer we have:

y = *W*_{2}* *a*_{1} – *b*_{2} (3)

The transfer function (Radial Basis Function [RBF]) for a radial basis neuron is [Figure 3b]:

*F*(*n*) = *e ^{–n2}* (4)

where *n* is the input parameter vector. The radial basis function has a maximum value of 1 when its input is 0. As the distance between the weight vector *W*_{1} and input *P* decreases, the output increases. Thus, a radial basis neuron acts as a detector that produces 1, whenever the input *P* is identical to its weight vector *W*_{1, i}.[17]

The bias *b _{1}* allows the sensitivity of the radial basis neuron to be adjusted. Small values of parameter

*b*result in larger widths of the transfer function in Eq. (4), which means a bigger data ranges can be estimated. We have selected:

_{1}where *U* is the fluid velocity.

Similar to other neural networks, the radial basis neural network consists of training and test phases. During the training phase, known and existing input-output data points are used to construct a neural network, i.e., to obtain weight matrices *W _{1}, W_{2}*,… Aim of this phase, in addition to obtaining acceptable results at training phase, is to have a network with generalization ability to produce good approximation for obtaining acceptable non-existing data points, inside and outside the training data points.

#### The Estimation Algorithm for Low Velocity Region

Distribution of the main data in the training region is not necessarily optimal and it can affect the convergence of the network to its global minima. Therefore, initially, the number of input-output pairs in the velocity range 3 to 10 m/s was increased. For this purpose, polynomial calibration curve in the velocity range 3 to 15 m/s was used, and new data points were obtained from interpolation.

where Ũ is estimation of velocity vector, Ĕ is expanded (up sampled) *E* vector and *C's* are coefficients of the polynomial curve. However, if all the new data is used for training of the neural network, the network will be over trained on this data, impacting the extrapolation capability of the network (the over fitting problem). Therefore, it is important to pick the best input-output data pairs. These optimum data points are used to implement and train the RBF network for the estimation of data in the low velocity region. This is done using the principle of self-organizing neural networks (Self-Organizing Map [SOM]). The architecture of SOM is presented in Figure 4. An SOM learns to classify the input vectors according to the manner they are grouped in the input space.[17]

The ||*ndist*|| box in Figure 4 accepts the input vector *P* and input weight matrix *W _{C}* and produces vector

*n*having

_{1}*S*elements. The elements are the negatives of the distances between the input vector and weight vectors

^{1}*W*, formed from the rows of the input weight matrix. The maximum net input

_{C, i}*n*that the competitive layer can have is 0. This occurs when the input vector

_{1}*P*equals that of neuron's weight vector.[17]

The competitive transfer function accepts a net input vector and returns neuron outputs of 0 for all neurons except the winner (the neuron whose weight vector is closest to the input vector). The winner's output is 1. The weights of the winning neuron are adjusted with the Kohonen learning rule. Supposing that the *i*th neuron wins, the elements of the *i*th row of the input weight matrix are adjusted as given below:[17]

where *q* is an index representing the training stage, and *W _{C, i}* is the winning neuron vector.

Thus, the neuron whose weight vector is closest to the input vector is updated to be even closer. As more and more inputs are presented (*q* → ∞), each neuron in the layer closest to a group of input vectors soon adjusts its weight vector towards those input vectors. Finally, *Wc* will present the optimum data pairs for RBF network training and *S ^{1}* the number of the optimum data pairs.[17] Using trial and error, the number of optimum neurons for the SOM network has been selected. Figure 5 presents the approach described above.

## RESULTS AND DISCUSSION

In order to study the errors further, the following equation has been used for the determination of standard deviation:

Where *U _{c}* and

*U*are the calculated and measured velocities, respectively.

_{m}As mentioned earlier, a single estimation scheme for extrapolation of calibration curve of the experimental data (3-15 m/s) on either side, namely low velocity range (0.7-3 m/s) and high velocity range (15-30 m/s), cannot fulfill the required accuracy in the low velocity range, where a small error in estimation can produce large errors in extrapolated data [Table 1]. Therefore, to circumvent this problem, a dual-network estimation scheme has been designed, in which the entire range of experimental data (3-15 m/sec) has been divided into two regions: The first region defined as {*U*|3≤*U* < 10}, and the second region defined as{*U*|10≤*U* ≤ 15}. Subsequently, data points in the two regions were used to train the relevant RBF networks. Although, this procedure presents good estimation for the extrapolation of data in 15-30 m/sec velocity range, the estimated results are still not satisfactory for the low velocity range (3-10 m/s), as shown in the first row of Table 2.

Consideration of results presented in Tables Tables11 and and22 shows that, in the case of the dual-network estimation scheme, training of the first RBF network using the entire data in the region {*U*|3≤*U* ≤ 10} improves the estimation error for the low velocity range as compared to the single network used for the entire velocity range (0.7-30 m/s) [Table 1]. However, this improvement is still far from satisfactory. The problem seems to be due to the overestimation in the region {*U*|3≤*U* ≤ 10}. Therefore, it is important to pick the best input-output data pairs. These optimum data points are used to implement and train the RBF network for the estimation of data in the low velocity range. As mentioned earlier, this is done using the principle of self-organizing neural networks (SOM). The estimated results are satisfactory for the low velocity range (3-10 m/s), as shown in the second row of Table 2.

Table 3 presents the results pertaining to the estimation accuracy in the low velocity range, for different number of neurons in the SOM network. As shown, the decision for the selection of three optimum neurons has been justified. Figure 6 shows a sample result of present neural network algorithm. As shown, the SOM network is selected data pairs (‘+’ points) that may be different from real data (‘o’ points).

In order to evaluate the validity of the neural network algorithm, initially, the experimental data [Figure 2] is fitted using power law, polynomial and neural methods. For the case of power law method, the following relation known as power law[12] has been used:

*E*^{2} = *A* + *BU ^{n}* (9)

where *E* is the instantaneous voltage of CTA output, and *A, B* and *n* are constants.

The above relation is based on the top bridge voltage, which is obtained from the relation, *E _{b}* = (

*E/gain*)+

*offset*, where

*E*is the top bridge voltage.

_{b}It should be determined whether the calibration curve can be fitted at velocities lower or higher than the calibration range. For this purpose, four fitting methods, namely polynomial, power law, the conventional neural network, and the present approach, based on the neural network method, have been used for fitting of data points [Figure 2] in the velocity range 3-15 m/s, in addition to zero point. Subsequently, results for the entire velocity range 0.7-30 m/s have been evaluated. Figure 7 shows the percentage error for the entire velocity range, for different fitting methods. Here, *U _{c}* is the calculated velocity, obtained from the curve fitting, and

*U*is the reference velocity. Calibration has been obtained for the low and moderate velocity ranges [Figure 2]. The maximum to minimum velocity ratio,

_{r}*U*

_{max}/

*U*

_{min}, should be in 10 to 20 range.[12] However, in this study, this ratio is about 40.The percentage error in the fitting range 3-15 m/s is negligible for the four fitting methods. However, outside the range 0.7-3 m/s, this error is considerable for all fitting methods, except for the present approach. As shown, the maximum error occurs when using the polynomial method outside 0.7-5 m/s and 15-30 m/s velocity ranges. Moreover, power law and conventional neural methods show considerable errors, especially at velocities lower than 3 m/s. Even at velocities higher than 15 m/s, the errors are still considerable.

*U*

_{c}–

*U*)/

_{r}*U*) *100) % for velocity range 0.7-30 m/s (‘Neural’ means a single RBF network)

_{r}The absolute errors are shown in Figure 8. The absolute error in the fitting range 3-15 m/s is negligible for the four fitting methods. However, in the velocity range 0.7-3 m/s this error is considerable for all fitting methods, except the present approach. Moreover, in comparison with the power law and polynomial methods, the neural fitting methods present lower absolute errors. In the velocity range 15-30 m/s, the resulting errors from the application of the power law and polynomial fitting methods is very large, while errors in the conventional neural network method and present approach are acceptable. Table 4 presents the standard deviations based on Eq. (8), for each fitting method, in three sets of tests conducted in the entire velocity range (0.7-30 m/s). Data in calibration range is fitted. As mentioned earlier, the data is extrapolated in 15-30 m/s and 0.7-3 m/s velocity ranges. As shown, results obtained for calibration range 3-15 m/s, using all methods, indicates errors less than 0.5%. For extrapolation in the lower velocity range of 0.7-3 m/s, the standard deviation obtained with polynomial is larger than 100%. The standard deviation for power law method is about 28%. These standard deviation values are unacceptable. Therefore, these methods cannot be used for extrapolation in the lower velocity range. However, the standard deviation associated with the present approach has been reduced to about 4.5%. Within the extrapolated velocity range, higher than 15-30 m/s, the standard deviation values for polynomial and power law methods are about 10% and 5%, respectively. The standard deviation obtained with the present approach is less than 0.7%. For the entire 0.7-30 m/s range, the standard deviation associated with the present approach is about 2%, which is acceptable for spirometry applications.[4]

## CONCLUSIONS

Calibration curve of hot-wire is nonlinear and cannot be easily extrapolated. Therefore, it will be advantageous to find a reliable method for extrapolation of the calibration curve at velocities lower or higher than the calibration range.

Curve fitting methods such as polynomial, power law and neural network methods have been used. The entire calibration range considered in this study is large, *U*_{max}/*U*_{min} resulting in a large ratio. Extrapolation of data in the lower velocity range (0.7-3 m/s) using the power law, polynomial and the conventional neural fitting methods are not acceptable. Therefore, a novel approach based on the neural network method has been used for extrapolation purpose. The error using this approach for 0.7-3 m/s velocity range has been reduced to about 4.5%, which is acceptable for spirometry applications.

Results of extrapolation of data in the higher range of calibration range show that power law and polynomial methods are associated with larger errors (more than about 3%), which is not acceptable. However, the present approach has an error of less than about 1%, which is acceptable.

The above discussions suggest that in order to extrapolate the calibration curve outside the calibration range, the present approach can be used with advantage. In practice, the procedure will consist of obtaining the extrapolated calibration curve using the present approach, fitting the extrapolated data using the polynomial fitting method, and determining the corresponding polynomial coefficients. Subsequently, the general polynomial equation is used to determine the instantaneous velocity values *U* from the corresponding CTA output voltage values *E*. Look up tables can also be used, where the corresponding *U* and *E* values are presented for easy use.

In addition, as stated in the Introduction Section, due to the trainability of neural network estimator, it is possible to re-train and update the neural network with new data (collected during the spirometer use) without the need for re-estimation of the entire calibration curve. However, in the case of other estimating methods, it is not possible to make use of this important characteristic, and therefore, it becomes necessary to measure and use all data over the complete range of velocity for the re-estimation of the calibration curve.

## Footnotes

**Source of Support:** Nil

**Conflict of Interest:** None declared

## REFERENCES

**Medknow Publications**

## Formats:

- Article |
- PubReader |
- ePub (beta) |
- Printer Friendly |
- Citation

- Bi-directional flow sensor with a wide dynamic range for medical applications.[Med Eng Phys. 2004]
*Al-Salaymeh A, Jovanović J, Durst F.**Med Eng Phys. 2004 Oct; 26(8):623-37.* - Measurement of gas flow velocity: anemometer with a vibrating hot wire.[Rev Sci Instrum. 2010]
*Kiełbasa J.**Rev Sci Instrum. 2010 Jan; 81(1):015101.* - A strategy to eliminate all nonlinear effects in constant-voltage hot-wire anemometry.[Rev Sci Instrum. 2009]
*Berson A, Blanc-Benon P, Comte-Bellot G.**Rev Sci Instrum. 2009 Apr; 80(4):045102.* - Constant-bandwidth constant-temperature hot-wire anemometer.[Rev Sci Instrum. 2007]
*Ligeza P.**Rev Sci Instrum. 2007 Jul; 78(7):075104.* - An instrument to measure the heat convection coefficient on the endocardial surface.[Physiol Meas. 2003]
*dos Santos I, Shah J, Ferreira da Rocha A, Webster JG, Valvano JW.**Physiol Meas. 2003 May; 24(2):321-35.*

- PubMedPubMedPubMed citations for these articles

- Extrapolation of Calibration Curve of Hot-wire Spirometer Using a Novel Neural N...Extrapolation of Calibration Curve of Hot-wire Spirometer Using a Novel Neural Network Based ApproachJournal of Medical Signals and Sensors. Oct-Dec 2012; 2(4)185

Your browsing activity is empty.

Activity recording is turned off.

See more...