Sunteți pe pagina 1din 33

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Table of Contents
Rsum/Abstract .................................................................................................................... 2 INTRODUCTION ..................................................................................................................... 3 1. CONTEXT AND PROBLEM STATEMENT : ............................................................... 4 1.1 1.2 1.3 2. Context / socio-economic interest of the project .................................................. 4 Problem statement .................................................................................................... 4 State of art .................................................................................................................. 4

METHODOLOGY ............................................................................................................ 6 2.1 2.2 2.3 Problem Decomposition ........................................................................................... 6 Summary of the various steps of the methodology ............................................. 8 Modelling and algorithms of the different blocks ................................................ 16 Block 1 ;............................................................................................................. 17 Block 2 :............................................................................................................. 17 Block 3 :............................................................................................................. 18 Block 4 :............................................................................................................. 19 Block 5 :............................................................................................................. 20 Block 6 :............................................................................................................. 21 Block 7 :............................................................................................................. 21 Block 8 :............................................................................................................. 22

2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.4 3. 4. 5. 6.

Synoptic of the program ........................................................................................ 23

RESULTS ....................................................................................................................... 25 ANALYSIS AND DISCUSSIONS ................................................................................ 31 CONCLUSIONS ET PERSPECTIVES....................................................................... 32 REFERENCES............................................................................................................... 33

5 GTEL, 2012-2013

Page 1

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Rsum

Abstract

Ce projet vise faciliter la prise en charge des maladies respiratoires, en mettant la disposition des mdecins et autres spcialistes de la sant un moyen rapide danalyser des relevs de la courbe respiratoire dun sujet. Il sagit notamment de concevoir une application qui prend en entre la courbe de respiration (volume en fonction du temps) chantillonne dun sujet, accomplit une analyse, dtecte et classifie les maladies dont les empreintes se trouveraient dans ce signal. Ceci afin que le mdecin en charge puisse apporter rapidement les soins ncessaires au sujet, en cas de maladie.

The aim of this project is to improve on the diagnosis and treatment of diseases affecting the respiratory system, by providing doctors and other health personnel, with a rapid way of analyzing data of a subjects respiratory pattern. In fact, the objective is to design a program with a user interface, which uses as input, sampled data of a subjects respiratory pattern (volume-time curve) recorded under suitable conditions, analyzes the data in order to detect and classify any disease, whose signature may be present in the respiratory signal. This would enable a quick appropriate medical care to be given to the subject, in case of any illness.

5 GTEL, 2012-2013

Page 2

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES INTRODUCTION
Nowadays with the fast growing world population, efficient widespread methods of diagnosing diseases, with or without the presence of a medical doctor, are becoming very important. A wide variety of chronic diseases affect the human respiratory pattern. In this sense, it is essential to study the symptoms of these diseases and design methods for the analysis of this pattern so as to be able to detect and classify any disease influencing it. Our objective is to design a computer program capable of analyzing a subjects respiratory pattern and proposing a classification of the disease(s) the person may be suffering from. We shall first present the context and problem statement of this study and later the methodology applied in order to obtain the expected results.

5 GTEL, 2012-2013

Page 3

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
1.

CONTEXT AND PROBLEM STATEMENT :

1.1 Context / socio-economic interest of the project This project aims at providing a cheap and fast way of analyzing a subjects respiratory pattern, it requires little experience and qualification (a technician who knows how to manipulate some hardware spirometer and record some data files). The results provided by the program (which we shall design) can then be appreciated by a specialist and necessary medical attention given to the subject, based on the results. 1.2 Problem statement Once data files have been recorded for a given subject, they need to be treated for the necessary parameters to be extracted. We shall thus design a computer program to solve the latter problem. We shall assume in this study that the data have already been collected so we shall concentrate on the analysis of the above mentioned files. 1.3 State of art

There exist several manufacturers of computer-based systems comprising both the hardware necessary for data collection and the corresponding computer software for analysis.

Figure 1: A PC-based spirometer (Source: healthequip.com)

5 GTEL, 2012-2013

Page 4

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Figure 2 : A USB spirometer, GUI interface (by Advanced Medical Engineering)

5 GTEL, 2012-2013

Page 5

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
2.

METHODOLOGY

2.1 Problem Decomposition

Figure 3: Architecture of the program

5 GTEL, 2012-2013

Page 6

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
NB:

The above classification of a subjects condition, under: Normal; Obstructive; Restrictive or Mixed, is the most detailed possible classification that studies permit us to perform.

The following information should be collected for each patient whose spirogram (breathing pattern data) is recorded since they are closely related to the respiratory pattern and necessary for further analysis of the results obtained: Age Gender: Male or Female Height Weight Smoker or not a smoker? If female subject, pregnant or not pregnant? In order to record the breathing pattern data of a subject, the examiner should ensure the following: Subject should be relaxed, sit upright and exercise no effort during the examination. The examination should be carried out with a device that records the volume of air in the subjects lungs with time, and stores the data in a digital format for analysis on a computer. The subject should insert the mouthpiece while undertaking tidal breathing (ordinary breathing) at FRC (Functional Residual Capacity), and then, in one continuous sequence, make a slow inspiration to total lung capacity (TLC), followed directly by a slow expiration to residual volume (RV), followed by a full inspiration with maximal effort to TLC and then by a full expiration with maximal effort back to RV.

Figure 4 : The various characteristics of the respiratory pattern during ordinary and forced breathing conditions

5 GTEL, 2012-2013

Page 7

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
2.2 Summary of the various steps of the methodology

Step 1 : Smoothening of the breathing pattern curve to eliminate noise


1) A multilevel 1-D wavelet analysis or Z-transform, of the input signal i(t) is performed. ( ) ( ( )) 2) A low-pass filter is applied to the resulting signal (the Daubechies filter db4); ( ) ( ) followed by an inverse Z-transform; () [ ( )] ( ) ( )

and then a down sampling of factor 2 (one sample out of 2 is discarded). ( ) ( ).

3) The above step 2 is repeated four times in order to obtain a final smooth signal.

Figure 5 : Example to illustrate the smoothening algorithm

Step 2 : Detection of the maximum turning points of the curve and the minimum turning point just after each maximum

Consider (

) the set of maximum turning points.

5 GTEL, 2012-2013

Page 8

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
STEP 1: Detection of the maximum turning points ) Let m, s denote the

) consider a window of For a point ( points around it, denoted as ( mean and standard deviation respectively of the data points in ( ) round This () . shall be chosen by the user to refine the peak selection process.

point is a peak or maximum turning point if : ( ) | | [ for some suitably chosen value of ] since this interval gave satisfactory peaks during tests.

i.e.

[ (

] ) )| ( ),

(the set of peaks) STEP 2: Detection of the minimum turning point consecutive to each maximum turning point

Minimum turning points occur at troughs between two consecutive maximum turning points. So to detect the minimum sample between two consecutive maximum turning points, we apply the min function to each inter-peak interval. By so doing we obtain the set of minima .

Figure 6 : Illustration of peak and trough detection. The maxima are the red points while the minima are black:

Step 3 : Classification of the maximum values detected under ordinary and forced

5 GTEL, 2012-2013

Page 9

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Our objective here is classify the maxima into two subgroups of points ( ) ( ): those belonging to the ordinary breathing pattern and those belonging to the forced breathing pattern (greater values due to forceful breath). It will then be possible to evaluate characteristics pertaining to the ordinary breathing pattern (respiratory rate, tidal volume, functional residual capacity) and those pertaining to the forced breathing pattern (forced vital capacity, forced expiratory volume in 1 second, peak expiratory flow). PROCEDURE A maximum turning point is selected at random amongst the above determined set of maximum turning points ( ), say, This point is considered to be in the subgroup ( ) The difference between and each of the other values of the set ( ) is then calculated :

If the absolute value of the difference is less than 0.5 litre, | | then the points and belong to the same subgroup of points ( ) which could be ORDINARY or FORCED. NB: 0.5 L because the difference in volume between two points both belonging to either the ordinary or forced breathing pattern is normally negligible.

Otherwise (the absolute value of the difference is greater than 0.5 litre), the points and belong to different subgroups. i.e. belongs to ( ). ,

Now an arbitrary value, is chosen from the set ( ) and compared to an arbitrary value, ( ) chosen from the set :

If then the set ( ) is the set of points which belong to the ordinary breathing pattern and the set ( ) is that which contains the points of the forced breathing pattern. ), ( ) is the set for the forced breathing pattern and ( ) the set Otherwise ( for the ordinary breathing pattern.

Step 4 : Calculation of the respiratory rate, functional residual capacity and tidal volume

5 GTEL, 2012-2013

Page 10

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Let

be the set of maximum turning points of the ordinary breathing pattern.

Volume Sample n Time


Determination of the tidal volume (in Liters) : TV (Tidal Volume): The tidal volume is the volume of air that is inhaled or exhaled in a single breath/cycle.

Figure 7: Each dark double-arrowed line indicates the amplitude of the tidal volume Determination of the functional residual capacity(FRC) (in liters): The FRC is the average volume of the set of minima, of the ordinary breath pattern.

Figure 8: The dark horizontal line indicates the volume level of the functional residual capacity

Determination of the respiratory rate (in breaths per minute):

5 GTEL, 2012-2013

Page 11

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
This is done by determining the average time interval T (minutes) between two consecutive points of the set . ( ) ( ( ) ) ( ) ( )

Figure 9 : Each dark double-arrowed line arrows indicates the size of a period (time axis horizontal)

Step 5 : Plot of the Flow Volume curve

It shows various parameters that can be read directly by a specialist.

5 GTEL, 2012-2013

Page 12

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Figure 10: Significance of the Flow - Volume curve (Source: Farah Madhani-Lovely, MD) The slope at each point of a chosen forced breathing pattern cycle (between two successive minima) is determined using the two points on the curve that surround it (the point before and the point after). [ ] is given by: ) where The slope at the point ( ( )

Figure 11 : Each dark double- arrowed line indicates a set of values which can be used to construct a Flow-Volume curve

Step 6 : Calculation of the FVC (Forced Vital Capacity), FEV1 (Forced Expiratory Volume in 1 s) and PEF (Peak Expiratory Flow)

5 GTEL, 2012-2013

Page 13

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Figure 12 : Calculation of the FVC, FEV1 and PEF Determination of the Forced Vital Capacity (FVC) (in Liters): and

This is the difference between -

Determination of the Forced Expiratory Volume in 1 second (FEV1) (in Liters): This is the difference between and the volume 1 second later during expiration.
( )

Determination of the Peak Expiratory Flow (PEF) (in Liters per minute/ Liters per second): This is the maximal flow or speed achieved during the maximally forced expiration initiated at full inspiration. [ ( ( ) ) ]
[ ( )]

Step 7 : Calculation of nominal values of FVC, FEV1 and PEF

Nominal values of FVC, FEV1 and PEF are calculated as follows:

5 GTEL, 2012-2013

Page 14

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

where: H is the height of the subject in meters. A is the age of the subject in years. Norms provide the values of the coefcients

for each parameter.

The coefcients for FVC, FEV1 and PEF, published by the European Respiratory Society are presented in the table below. According to the norms, the age range is from 25 to 70 years and the height range is from 1.55 to 1.95 meters (for men) and from 1.45 to 1.80 meters (for women).

Coefficients FOR MEN FVC FEV1 PEF FOR WOMEN FVC FEV1 PEF
Table 1 : Standard coefficients for the calculation of the nominal values of FVC, FEV1 and PEF These parameters demonstrate a stronger dependence on the height (large absolute value of on the age (small absolute value of ). ) than

Step 8 : Comparison of nominal values with those obtained from the subjects breathing pattern and classification of a subjects condition

5 GTEL, 2012-2013

Page 15

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
The individual spirometry results vary depending on the conditions of the ventilation mechanism. In general, the results close to 100% of the nominal values are interpreted as normal. The results that differ 20% and more from the nominal value are considered abnormal. With ( the age and height of a ) are calculated. given subject, the above nominal values

The following classification of diseases (OBSTRUCTIVE, RESTRICTIVE or MIXED) is based on the comparison of the values obtained from measurements with the nominal values.

OBSTRUCTIVE 1) Chronic Obstructive Pulmonary Disease which includes emphysema and chronic bronchitis Diseases 2) Asthma 3) Bronchiectasis 4) Cystic Fibrosis 5) Lung Cancer 6) Obliterative Bronchiolitis 1) 2) 3)

4) 5)

6) 7)

RESTRICTIVE Interstitial lung disease Sarcoidosis Obesity, including obesity hypoventilation syndrome Scoliosis Muscular dystrophy or Amyotrophic Lateral Sclerosis Parenchymal lung tumors Pulmonary edema

MIXED

Both an obstructive and a restrictive disease

FVC

FEV1

PEF
(See Figure 10 on page 13, for the Flow-Volume curve shape of each group of diseases)

2.3 Modelling and algorithms of the different blocks

5 GTEL, 2012-2013

Page 16

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
2.3.1 Block 1 ;

Real signals are noisy and need to be filtered. This block filters the input data in order to smoothen its curve and facilitate the subsequent detection of the maxima and minima it contains. After the input file is read, filtering is performed in MATLAB with the following command lines:

[C,L] = wavedec(rough,8,'db4'); smooth = appcoef(C,L,'db4',5); where: - rough is the vector containing the samples of the input (rough) signal and - smooth is the vector containing the samples of the smooth signal. NB: The filter used is a daubechies filter and the resulting smooth signal contains samples than the initial rough signal. times less

Figure 13: Example showing a rough and corresponding filtered signal 2.3.2 Block 2 :

5 GTEL, 2012-2013

Page 17

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
The calculation of the required parameters (FVC, FEV1, PEF, Tidal Volume, etc) is based on information concerning the peaks and troughs of the smooth signal. These maxima and minima therefore have to be detected. %% Peak detection MATLAB PROGRAM max_counter_i = 0; max_counter_f = 0; for ctr = k+1 : length(xx)-k local_mean(1,ctr) = mean( [smooth(ctr-k:ctr1),smooth(ctr+1:ctr+k)] ); local_std(1,ctr) = std( [smooth(ctr-k:ctr1),smooth(ctr+1:ctr+k)] ); if ((smooth(ctr) >= local_mean(1,ctr)) && (abs( smooth(ctr) - local_mean(1,ctr) ) >= 1.12* local_std(1,ctr))) % Selection criterion for maximum max_counter_i = max_counter_i + 1; Maxima_i(max_counter_i, 1:3) = [xx(ctr), smooth(ctr),ctr]; %% ctr is the index of this sample in the smooth vector end end %% On limine les max loigns de la moyenne for ctr = 1 : max_counter_i if ctr == ctr %abs( Maxima_i(ctr,2) - mean(Maxima_i(:,2)) ) <= 1.5*std((Maxima_i(:,2))) max_counter_f = max_counter_f + 1; Maxima_f(max_counter_f,1:3) = Maxima_i(ctr,1:3); Maxima_f_min(max_counter_f, 1:3) = Maxima_f(max_counter_f,1:3); end end %% Finding the minimum after each maximum for ctr1 = 1 : max_counter_f - 1 index_start = Maxima_f(ctr1,3); index_end = Maxima_f(ctr1+1, 3); [value, pos] = min(smooth(index_start:index_end)); %% On recherche le min entre deux max conscutifs Maxima_f_min(ctr1,4:5) = [value, xx(pos+index_start)]; % Col1 = Time values for each max, Col2 = Max values; Col3 = index of max, Col4 = value of next min; Col5 = time of next min end test = Maxima_f_min(1,2); ctr_small_max = 1; Maxima_f_small_max(1,1:5) = Maxima_f_min(1,1:5); for ctr2 = 2: max_counter_f if (abs(test - Maxima_f_min(ctr2,2)) < 0.5) ctr_small_max = ctr_small_max + 1; Maxima_f_small_max(ctr_small_max, 1:5) = Maxima_f_min(ctr2,1:5); end end

2.3.3

Block 3 :

5 GTEL, 2012-2013

Page 18

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES We shall process input signals which contain a waveform for ordinary breath and a waveform for forced breath. It is essential to classify the peaks and troughs as belonging to either the ordinary or forced breath phases.
%% A portion of the MATLAB code for the classification of the peaks and troughs ctr_small_max_1 = 2; Maxima_f_small_max_1(1:2,1:5) = Maxima_f_small_max(1:2, 1:5); ctr_small_max_2 = 0; ctr_small_max_3 =0; ctr_small_max_4 = 0; for ctr3 = 3: length(Maxima_f_small_max) if ((Maxima_f_small_max(ctr3,1) - Maxima_f_small_max(ctr31,1)) < 2 * (Maxima_f_small_max(2,1) - Maxima_f_small_max(1,1)) ) ctr_small_max_1 = ctr_small_max_1 + 1; Maxima_f_small_max_1(ctr_small_max_1, 1:5) = Maxima_f_small_max(ctr3,1:5); else ctr_small_max_2 = ctr_small_max_2 + 1; Maxima_f_small_max_2(ctr_small_max_2,1:5) = Maxima_f_small_max(ctr3,1:5); ctr_small_max_2 = ctr_small_max_2 + 1; Maxima_f_small_max_2(ctr_small_max_2,1:5) = Maxima_f_small_max(ctr3+1,1:5); break; end end

2.3.4

Block 4 :

%% Calculation of breath rate average1 = (length(Maxima_f_small_max_1(:,1)) 1)/(Maxima_f_small_max_1(end,1) - Maxima_f_small_max_1(1,1)); average_resp_rate1 = 60 * average1; average2 = (length(Maxima_f_small_max_2(:,1)) 1)/(Maxima_f_small_max_2(end,1) - Maxima_f_small_max_2(1,1)); average_resp_rate2 = 60 * average2; average3 = (length(Maxima_f_small_max_3(:,1)) 1)/(Maxima_f_small_max_3(end,1) - Maxima_f_small_max_3(1,1)); average_resp_rate3 = 60 * average3; average_resp_rate = (average_resp_rate1 + average_resp_rate2 + average_resp_rate3 )/3; set(handles.resp_rate, 'String', num2str(average_resp_rate));

5 GTEL, 2012-2013

Page 19

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
%% Calculation of tidal volume tidal1 = mean(Maxima_f_small_max_1(:, 2)) mean(Maxima_f_small_max_1(1:end-1, 4)); tidal2 = mean(Maxima_f_small_max_2(:, 2)) mean(Maxima_f_small_max_2(1:end-1, 4)); tidal3 = mean(Maxima_f_small_max_3(:, 2)) mean(Maxima_f_small_max_3(1:end-1, 4)); tidal_volume = (tidal1 + tidal2 + tidal3)/3; set(handles.tidal_volume, 'String', num2str(tidal_volume)); %% Calculation of Functional Residual Capacity frc = (mean(Maxima_f_small_max_1(1:end-1, 4)) + mean(Maxima_f_small_max_2(1:end-1, 4)) + mean(Maxima_f_small_max_3(1:end-1, 4)))/3; set(handles.frc, 'String', num2str(frc));

2.3.5

Block 5 :

A specialist, at a glance, can identify the various calculated parameters (FVC, FEV1, PEF).
%% Plot of the Flow - Volume curve %% Partie Expiration index_maxi = Maxima_f_min_big_max_1(2, 3); index_mini2 = find (xx == Maxima_f_min_big_max_1(2, 5)); %% Tableau de Volume - en 1re colonne et Flow rate en 2me colonne compteurpts2 = 0; for indexpt = index_maxi:index_mini2 compteurpts2 = compteurpts2 + 1; Vol_Flow_Tab_exp(compteurpts2, 1:2)= [smooth(indexpt) , abs((smooth(indexpt + 1) - smooth(indexpt - 1))/( 2*xx(2)-2*xx(1)))]; end %% Partie Inspiration index_mini1 = find (xx == Maxima_f_small_max_1(ctr_small_max_1, 5)); %% Tableau de Volume - en 1re colonne et Flow rate en 2me colonne compteurpts1 = 0; for indexpt = index_mini1:index_maxi compteurpts1 = compteurpts1 + 1; Vol_Flow_Tab_ins(compteurpts1, 1:2)= [smooth(indexpt) , abs((smooth(indexpt + 1) - smooth(indexpt - 1))/( 2*xx(2)-2*xx(1)))]; end

5 GTEL, 2012-2013

Page 20

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
2.3.6 Block 6 :

These parameters are essential for detecting and classifying a subject under (NORMAL, OBSTRUCTIVE DISEASE, RESTRICTIVE DISEASE OR MIXED).

Maxima_f_min_big_max_1(1, 1:5) = Maxima_f_min (ctr_small_max_1, 1:5); % Min before Maxima_f_min_big_max_1(2, 1:5) = Maxima_f_min (ctr_small_max_1 +1 , 1:5); % Max itself

Maxima_f_min_big_max_2(1, 1:5) = + ctr_small_max_2+1, 1:5); % Min before Maxima_f_min_big_max_2(2, 1:5) = + ctr_small_max_2+2 , 1:5); % Max itself

Maxima_f_min (ctr_small_max_1 Maxima_f_min (ctr_small_max_1

fvc = ( Maxima_f_min_big_max_1(2, 2) Maxima_f_min_big_max_1(2, 4)+ Maxima_f_min_big_max_2(2, 2) Maxima_f_min_big_max_2(2, 4) )/2; fev1_1 max(xx(find(abs(xx xx(1))))))); fev1_2 max(xx(find(abs(xx xx(1))))))); = Maxima_f_min_big_max_1(2, 2) - smooth(find (xx == - (Maxima_f_min_big_max_1(2, 1)+1)) <= (xx(2)= Maxima_f_min_big_max_2(2, 2) - smooth(find (xx == - (Maxima_f_min_big_max_2(2, 1)+1)) <= (xx(2)-

fev1 = (fev1_1 + fev1_2)/2; %% Calcul du PEF pef1 = max(smooth(Maxima_f_min_big_max_1(2, 3) + 1:find (xx Maxima_f_min_big_max_1(2, 5)) + 1) - smooth(Maxima_f_min_big_max_1(2, 3) 1:find (xx == Maxima_f_min_big_max_1(2, 5)) -1))/(2 *(xx(2)-xx(1))); pef2 = max(smooth(Maxima_f_min_big_max_2(2, 3) + 1:find (xx Maxima_f_min_big_max_2(2, 5)) + 1) - smooth(Maxima_f_min_big_max_2(2, 3) 1:find (xx == Maxima_f_min_big_max_2(2, 5)) -1))/(2 *(xx(2)-xx(1))); pef = (pef1 + pef2)/2;

== == -

2.3.7

Block 7 :

5 GTEL, 2012-2013

Page 21

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES These parameters are evaluated (depend on the sex, height and age of the subject) so as to be compared to those evaluated above.
%% FOR MEN if get(handles.sex, 'Value') == fvcnom = 5.76 * (height/100) fev1nom = 4.3 * (height/100) pefnom = 6.14 * (height/100) else %% FOR WOMEN fvcnom = 4.43 * (height/100) fev1nom = 3.95 * (height/100) pefnom = 5.5 * (height/100) end 1 - 0.026 * age - 4.34; - 0.029 * age - 2.49; - 0.043 * age + 0.15; - 0.026 * age - 3.28; - 0.025 * age - 2.6; - 0.03 * age - 1.11;

2.3.8

Block 8 :

Upon classification (by comparison), corresponding messages shall be displayed on the interface.
if (fvc >0.8*fvcnom && fev1 > 0.8*fev1nom && pef > 0.7*pefnom) NORMAL SUBJECT set(handles.classif_noresults, 'Visible', 'off'); set(handles.classif_normal, 'Visible', 'on'); set(handles.classif_obstruct, 'Visible', 'off'); set(handles.classif_restrict, 'Visible', 'off'); set(handles.classif_mixed, 'Visible', 'off'); elseif (fvc <= 0.8*fvcnom && pef <= 0.7*pefnom) %% OBSTRUCTIVE DISEASE set(handles.classif_noresults, 'Visible', 'off'); set(handles.classif_normal, 'Visible', 'off'); set(handles.classif_obstruct, 'Visible', 'on'); set(handles.classif_restrict, 'Visible', 'off'); set(handles.classif_mixed, 'Visible', 'off'); elseif (fvc <= 0.8*fvcnom && fev1 <= 0.8*fev1nom) %% RESTRICTIVE DISEASE set(handles.classif_noresults, 'Visible', 'off'); set(handles.classif_normal, 'Visible', 'off'); set(handles.classif_obstruct, 'Visible', 'off'); set(handles.classif_restrict, 'Visible', 'on'); set(handles.classif_mixed, 'Visible', 'off'); elseif (fvc <= 0.8*fvcnom && fev1 <= 0.8*fev1nom && pef <= %%

5 GTEL, 2012-2013

Page 22

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
0.7*pefnom) %% MIXED set(handles.classif_noresults, 'Visible', 'off'); set(handles.classif_normal, 'Visible', 'off'); set(handles.classif_obstruct, 'Visible', 'off'); set(handles.classif_restrict, 'Visible', 'off'); set(handles.classif_mixed, 'Visible', 'on'); else %% NONE set(handles.classif_noresults, 'Visible', 'off'); set(handles.classif_normal, 'Visible', 'on'); set(handles.classif_obstruct, 'Visible', 'off'); set(handles.classif_restrict, 'Visible', 'off'); set(handles.classif_mixed, 'Visible', 'off'); end

2.4 Synoptic of the program

Figure 14 : Synoptic of the program

5 GTEL, 2012-2013

Page 23

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

5 GTEL, 2012-2013

Page 24

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
3. RESULTS

The program once launched shows the interface below.

Figure 15 : Presentation of the program interface

To proceed we need to select an input file in one of three possible manners: Either by clicking on the File item of the Menu, by clicking on the Text Box beneath Respiratory data faile (*.mat) or by clicking the Browse button.

Figure 16 : Loading a file in 3 different manners Then select an input file in the dialog box.

5 GTEL, 2012-2013

Page 25

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Figure 17 : Selecting a file in the dialog box After the input file is selected, its content is displayed on the interface. Both the raw input signal and the corresponding filtered signal are displayed on the interface.

Figure 18 : Display of the raw input signal and filtered signal The type of data present in the file has to be selected and the age, sex and height of the subject defined. The size of the local statistics window used in peak detection has a default value which can be modified, so as find an optimum value for the selected input signal (i.e. a value which enables an acceptable peak detection as illustrated on the interface)

5 GTEL, 2012-2013

Page 26

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Figure 19: Type of input data,age, sex ,height and local statistics window size

For instance, for

we have an acceptable peak and trough detection.

Figure 20 : Example of peak and trough detection for k = 3 (ordinary and forced breath)

For

the peaks and troughs detected are not satisfactory.

5 GTEL, 2012-2013

Page 27

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Figure 21 : Example of peak detection for k = 10 - Not satisfactory, since several peaks detected at a single point For this other signal (in the ordinary breath mode), gives the best results.

Figure 22 : Example of peak and trough detection for k = 5 (ordinary breath only) In the ordinary breath mode, three parameters (TV, FRC and Respiratory rate) are evaluated, once the button:

is clicked.

Figure 23 : Calculation of respiratory rate, tidal volume and functional residual capacity (in ordinary breath mode) In the ordinary and forced breath mode, with an appropriate signal of course, in addition to the above three parameters, the Flow-Volume curve, nominal and derived values of FVC, FEV1 and PEF are evaluated as well as a classification of the subjects condition is given. In the example below, the subject is normal.

5 GTEL, 2012-2013

Page 28

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Figure 24 : Output for the analysis of a signal in the "ordinary and forced breath mode" A PDF report can be generated at this point.

5 GTEL, 2012-2013

Page 29

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES

Figure 25 : Generating a PDF report By clicking the View Report menu item, we can view this report.

Figure 26 : Viewing the report

Figure 27 : The "About" menu item

5 GTEL, 2012-2013

Page 30

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
4. ANALYSIS AND DISCUSSIONS

The work done in this project is an important part of the design of computer-based spirometers (comprising hardware and corresponding computer software for the analysis of data collected). The algorithms applied in the data processing are used worldwide and are known to be efficient. Nowadays manufacturers of computer-based spirometry systems sell their hardware accompanied by the corresponding software for data analysis, which cannot be used for just any type of hardware. They also provide the necessary connectors between the hardware and computer (usually USB communication). This work is thus that fragment of the system, which is data processing on a computer, and requires conveniently formatted data for analysis. The data file should be accompanied by a header file containing information like the gain, the units of the samples, the sampling frequency, the duration of the record, etc In this project, the input data was provided by a *.mat file (containing the values of the samples) accompanied by a header *.info file (containing information necessary for the interpretation of the samples). The following is an example of a header file:

Source: MATSON 5GTEL Start: [00:00:10.000] val has 1 row (signal) and 16001 columns (samples/signal) Duration: 1:04 Sampling frequency: 250 Hz Sampling interval: 0.004 sec Row Signal Gain Base Units 1 RESP 1 0 Liters To convert from raw units to the physical units shown above, subtract 'base' and divide by 'gain'.

Useful output data can be rendered by our program, provided that the input data is correctly recorded and the header file correctly filled.

5 GTEL, 2012-2013

Page 31

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
5. CONCLUSIONS ET PERSPECTIVES Our objective in this project was to provide a cheap and fast way of analyzing a subjects respiratory pattern, through a method requiring little experience and qualification. Our user interface had to take as input a subjects respiratory data file, age, height and sex. The results provided by our program can be appreciated by a specialist and necessary medical attention given to the subject, based on the results. First and foremost, the input data was filtered, then the maxima and minima detected. The method used for detecting peaks and troughs on the respiratory curve uses a local statistics window for each sample, of size, , where can be entered by the user and modified until the peaks and troughs displayed on the curve appear to be satisfactory. Upon classification of the obtained maxima and minima, useful parameters can then be evaluated, in order to perform the classification of a subjects condition under normal, obstructive disease, restrictive disease or both restrictive and obstructive disease. With our designed interface, it is possible to analyze data for ordinary breath only or both ordinary and forced breath. The program could not be sufficiently tested due to the lack of real respiratory data files obtained from persons with different respiratory diseases or conditions. Due to the absence of respiratory data files, a test signal was generated in MATLAB and recorded in a *.mat file, in order to test our program.

%% MATLAB CODE FOR THE GENERATION OF A TEST SIGNAL x = [0:13, 20, 25:45, 52, 57:64]; y = [3, 2.5, 3, 3.5, 3, 2.5, 3, 3.5, 3, 2.5, 3, 3.5, 3, 2, 6, 2, 3, 3.5, 3, 2.5, 3, 3.5, 3, 2.5, 3, 3.5, 3, 2.5, 3, 3.5, 3, 2.5, 3, 3.5, 3, 2, 6, 2, 3, 3.5, 3, 2.5, 3, 3.5, 3]; xx = 0:1/250:64; val = spline(x,y,xx); plot(x,y,'o',xx,val) save('testsignal.mat', 'val', '-mat') Further studies may enable us to refine our parameters, by testing our program with real data collected from real subjects. In fact, programs designed for the analysis of the breathing pattern are most often hardware-specific and the conditions under which the data should be collected are clearly specified otherwise the data are said to be non-acceptable.

5 GTEL, 2012-2013

Page 32

ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
6. REFERENCES

[1] Farah Madhani-Lovely, MD Pulmonologist/Intensivist, WhydoSpirometry.ppt, Oct. 24 2007; [2] Renzetti AD Jr. Standardization of spirometry. Am Rev Respir Dis 1979; 119: 831838; [3] American Thoracic Society. Standardization of spirometry: 1987 update. Am Rev Respir Dis 1987; 136: [4] Ferrer M, Alonso J, Morera J, et al. Chronic obstructive pulmonary disease and health related quality of life. Ann Int Med 1997; 127: 10721079. [5] Friedman M, Serby C, Menjoge S, Wilson J, Hilleman D, Witek T. Pharmacoeconomic evaluation of a combination of ipratropium plus albuterol compared with ipratropium alone and albuterol alone in COPD. Chest 1999; 115: 635641. [6] P. Quanjer, J. Tammeling, J. Cotes, Long volumes and forced ventilatory flows: report of working party, standardization of lung function tests, Eur. Respir. Journal, vol. 6, 1993, pp. 540. [7] P. Quanjer, M. Lebowitz, I. Gregg, Peak expiratory flow: conclusions and recommendations of a Working Party of the European Respiratory Society. Official ERS Statement, Eur. Respir. J., vol. 10, 1997, pp. 2-8.

th

5 GTEL, 2012-2013

Page 33

S-ar putea să vă placă și