Introduction

Tuberculosis is an infectious disease mostly caused by the microorganism called Mycobacterium tuberculosis [1]. These microorganisms are generally brought in together with the infected air. Blood and lymph are the common means for them to ‘transport’ from the initial spot in the lungs to all other parts of the body; the infection can also set in through the airways and/or in case of immediate exposure of other organs. When an infected person coughs, sneezes, talks or spits, the bacteria get into the air. Quite a small quantity of bacteria is enough to get infected. The risk of being infected depends on how long or how intense the exposure to the bacteria is. The risk is greatest in those who live or work with an infected person [24].

The typical symptoms of pulmonary tuberculosis are the chronic cough, weight loss, intermittent fever, loss of appetite, night sweats and coughing out blood. The disease develops in the human body in two stages. At the first stage, the infection sets in, having been ‘imported’ from an infected individual (this stage is commonly referred to as “tuberculosis infection”); consequently, at the second stage, the disease develops (“tuberculosis” itself) [2, 3].

Tuberculosis is one of the commonest major maladies worldwide, especially in Asia and Africa. It is a great problem for most developing countries. It has the largest mortality ratio for an illness caused by a single type of microorganism. In 2006, 9.2 million new cases of infection and 1.7 million deaths were reported to have occurred throughout the world. Of them 0.7 million cases and 0.2 deaths were HIV-positive people [2, 4]. In Turkey, according to the State’s Health Ministry’s 2006 report, approximately 23,875 patients died of tuberculosis [4].

The multilayer neural networks (MLNNs) have been successfully implemented in decision support systems for disease diagnosis systems [58]. The back-propagation (BP) algorithm [9] is widely used for training the network. However, it has to take too many steps to train the network, and the weights are calculated step by step. In genetic algorithm, several weight sets are calculated in parallel and thus, finding the optimal solution needs less complicated computations.

Fig. 1
figure 1

The implementation of multilayer neural network used for diagnosing tuberculosis

Fig. 2
figure 2

The flow-chart of the simple genetic algorithm

This paper aims to present a study on diagnosing tuberculosis with the help of multilayer neural network trained with genetic algorithm. For this purpose, an MLNN with two hidden layers and genetic algorithm has been used (Fig. 1). The results were also compared with the previous studies [1012]. The tuberculosis dataset was taken from a state hospital’s database, based on patient’s epicrisis reports.

Data source

In order to perform this study, first, the patients’ epicrisis reports have been taken from Diyarbakir Chest Disease Hospital. The dataset was prepared, based on these epicrisis reports, which contained 150 samples for two classes of patients: those with tuberculosis (Class 1: 50 patients), and those with other, non-tuberculosis diseases (Class 2: 100 patients).

All samples present 38 parametres. Organized into 2 groups, these parametres are:

  1. 1.

    The results of preliminary examination: complaints of cough, high temperature, aches in the chest, weakness, dyspnea, wheezes in the chest, sputum, sound on respiratory tract, pressure in chest, smoking

  2. 2.

    Laboratory tests: leukocyte (WBC), erythrocyte (RBC), trombosit (PLT), hematocrit (HCT), hemoglobin (HGB), albumin 2, alkaline phosphatase 2°L, alanine aminotransferase (ALT), amylase, aspartate aminotransferase (AST), bilirubin (total+ direct), CK/ creatine kinase total, CK-MB, iron (SERUM), gamma-glutamyl transferase (GGT), glucose, HDL cholesterol, calcium (CA), blood urea nitrogen (BUN), chlorine (CL), cholesterol, creatinin, lactic dehydrogenase (LDH), potassium (K), sodium (NA), total protein, triglyceride, uric acid.

Previous studies

There have been several studies on diagnosing tuberculosis [1012]. El-Solh, et al., used a general regression neural network (GRNN) and clinical and radiographic information as parameters to predict active pulmonary tuberculosis [10]. In that study, 21 distinct parameters, which fall into three groups: demographic variables, constitutional symptoms and radiographic findings, have been used. The authors utilized a ten-fold cross-validation procedure to train the network and provided estimation for diagnosing tuberculosis. The authors reported approximately 92.3% diagnosis accuracy [10]. Er, et al., used two different multilayer neural networks with one and two hidden layers and trained the network with Levenberg-Marquardt training algorithm [12]. The input patterns were formed by the 38 parameters, which have been implemented in this study as well. Three-fold cross-validation procedure was utilized to train the network. The authors reported approximately 93.93% diagnosis accuracy, using back-propagation algorithm with momentum (BPwM) [12]. Santos, et al., used symptoms and physical signs for constructing the neural network modeling [11].

They reported approximately 77% diagnosis accuracy using a MLNN with one hidden layer.

Diagnosing tuberculosis with the help of neural networks

In this study, a multilayer neural network structure with two hidden layers is used for diagnosing tuberculosis.

There are 50 neurons on each of the hidden layers and only one neuron at the output layer. All of the neurons use a non-linear sigmoid activation function. In this system, 38 inputs were understood as features and one output represents the value of the diagnosis (1—other, 2—tuberculosis). To train the MLNN, genetic algorithm was used. Detailed information can be found in the references [13].

If a neural network learns the training set of a task, it generalizes the problem and gives more or less accurate outputs for the dataset different from training set. But if a neural network starts to memorize the training set, it gives proper answers to the training set but the generalization performance falls down. The k-fold cross-validation method shows how accurate a generalization can be made by a neural network [17]. In this study, three-fold cross-validation method is used to estimate the performance of the neural network used.

As a performance measure, the formula below is used [6]:

$$\begin{array}{*{20}l}{{\begin{array}{*{20}c}{{classification}} & {{accuracy}} \\\end{array} = \frac{{{\sum\limits_{i = 1}^{{\left| N \right|}} {assess{\left( {n_{i} } \right)}} }}}{{{\left| N \right|}}}} \hfill} & {{n_{i} \in N} \hfill} \\{{assess{\left( n \right)} = \left\{ {\begin{array}{*{20}r}{\hfill 1} & {\hfill {\,if\,classify{\left( n \right)}}} \\{\hfill 0} & {\hfill {otherwise}} \\\end{array} } \right.} \hfill} & {{} \hfill} \\\end{array} $$

where N is the set of data to be classified (validation set), nc is the class of the item n, and classify (n) returns the classification of n calculated with neural network.

Training the network with genetic algorithm

Genetic Algorithm is a search technique to find approximate solutions to optimization problems. It is a global search technique and a particular class of evolutionary algorithms. From biological sciences, evolutionary processes have been borrowed and translated to efficient search and design strategies. Genetic Algorithms use these strategies to find an optimum solution for any multi-dimensional problem [14].

When the genetic algorithm is used for training an Artificial Neural Network (ANN), weights and biases are encoded into chromosomes. So a generation (a set of chromosomes) represents a set of ANN.

Each chromosome is decoded and the error function of ANN, which the chromosome represents, is calculated. In order to train the ANN, the error over all training sets has to be minimized [1518] (Fig. 2). With a chosen selection ratio, more successful chromosomes are selected to create new generation by cross-breeding with those, being used to create more successful chromosomes than their predecessors. After this operation, within a mutation ratio, chromosomes are mutated to obtain diversity with possible successful generations. The mutation helps to change the improper chromosomes but can as well damage the proper ones. That’s why the mutation ratio must be chosen carefully.

Results and conclusion

The classification accuracies obtained by other studies for tuberculosis are; by reference [10] was 92.30% and [12] was 93.93% with back-propagation. More efficiency was obtained by using Levenberg-Marquardt training algorithm [12], but because of the complexity of the algorithm, it is more difficult to encode it. For that reason, the results were compared with back-propagation algorithm. In this study, the result was 94.88% with the same structure as in the reference [12].

As seen in the Table 1, this study shows that the general algorithm as a training algorithm has better performance in diagnosing tuberculosis diagnosis using multilayer neural network with simple coding.

Table 1  

By way of conclusion, the following results should be mentioned:

  • In general, the classification success obtained by this study is better than those obtained by reference studies [1012];

  • Training the multilayer neural network with genetic algorithm takes too much time;

  • It is obtained that using MLNN with GA is a successful way to diagnose tuberculosis;