Diagnosing Thyroid Disease by Neural Networks

The aim of the present study is to diagnose the types of thyroid disease, using neural networks. In this research, the tests (T3UR, FTI, FT4, FT3, T4, T3, TSH) were conducted on 244 subjects (30 subjects with healthy thyroid, 30 subjects suffering from hyperthyroidism, 34 subjects suffering from hypothyroidism, 30 subjects suffering from Subclinical hyperthyroidism and 30 subjects suffering from Subclinical hypothyroidism , 30 subjects suffering from hyperthyroidism treatment and 30 subjects suffering hyperthyroidism treatment, and 30 subjects with resistant thyroid) for investigating status of their thyroid by considering their age and diversity of normal range of hormone tests in various ages. Data analysis was conducted using MATLAB 2014 software to categorize the thyroid disease. For investigating authenticity of the data, by using 3-fold cross-validation, authenticity of categorization of thyroid disease was evaluated by neural networks (MLP, PNN, GRNN, FTDNN, CFNN). In this method, networks are taking 7 hormone tests and age as input, output is diagnosed with thyroid disease. Also for 40 subjects (5 subjects for each categories), new data were given to the GUI of MATLAB through the designed graphical user interface for testing the network, and all 40 data were correctly responded. Results of this research indicated that by hormone tests and using neural networks, various types of thyroid disease can be diagnosed and the neural network provides us with almost 100% correct answers.


INTRODUCTION
Thyroid is a small gland with the shape of a butterfly or H letter and is located at the front of windpipe and below larynx and it is consisted of two lobes attached to each other in the middle parts.The thyroid gland absorbs iodine existing in food and creates T3 and T4 hormones.This hormones flow in blood by two ways: as attached by TBG protein and in as free (free T3 and free T4).These hormones are stored in the mentioned gland and gradually in the required time they are released in blood.Hypothalamus is the regulator of thyroid hormones.It releases a hormone called thyrotropin (TRH) which goes to pituitary and pituitary releases TSH hormone in blood which stimulates thyroid gland so that it releases thyroid hormones (T3 and T4) in blood.For this reason, when level of thyroid hormone of body decreases, more TSH is released in blood and its level rises in blood and resumes to the normal level again 1 .
These hormones play an important role in diagnosing thyroid disease, since thyroid hormones are very essential for normal growth of brain and neural system, especially in the first three years of life and in case of their malfunction, mental retardation might occur.Children in higher ages in order to have appropriate growth, and adults in order to have a regular metabolism and regulating the mechanism of their body, need thyroid hormones.For this reason, in some countries, at the first moment of birth, thyroid regulation test is conducted on babies.Thyroid diseases are more common among women than Various modern diagnosis methods such as Elisa, Electrochemiluminescence, etc., have been proposed for conducting hormone tests (T3UR, FTI, FT4, FT3, T4, T3, TSH), and then diagnosing the type of thyroid disease and treating it.Conducting hormone tests is one of the most common diagnosis methods of thyroid disease that by using its great advantages including no negative effect on patient and low cost, the type of thyroid disease can be precisely diagnosed 1 .Nowadays, in order to diagnose diseases with high accuracy and reducing human errors existing in diagnoses of physicians, neural networks are used and they enjoy advantage of automatic diagnosis.
Neural network is a data processing system which its idea is taken from human brain and assigns process of the data to a large number of small processors that behave each other in a continuous and parallel network to solve a problem.In these networks, by applying programming knowledge, a data structure is designed that can act as neuron.
Then by creating a network between these neurons and applying it a training algorithm, the network is trained.In this memory or neural networks, neurons have two states including active (on or 1) and Fig. 3: Architecture of GRNN network Fig. 4: Architecture of FTDNN network inactive (off or 0) and each face (synapse or relation between groups) has a weight.Faces with positive weight cause stimulation or activation of the next inactive node and faces with negative weight make the next node inactive (if it was active before).The network structures used in this research include MLP, PNN, GRNN, FTDNN, and CFNN [2][3] .the network structures such as MPL, PNN, GRNN, and FTDNN ,respectively, is shown (Fig. 1 to 4 ) 4,5,6,7 .
Cascade Forward neural network (CFNN) is similar to "feedforward" neural network but it includes a weight attachment from input to each layer and from each layer to next layers.Although the two-layer feedforward network can learn each input-output relation, the feedforward network with more layers can learn more complicated relations in a higher speed.Cascade-Feedforward neural network model with the back propagation algorithm is like a forward neural network with a back propagation algorithm for updating the weights.However, the main property of this neural network is that neurons of each layer are in relation with all neurons of the previous layer 8 .Now, considering this fact that neural networks can greatly help us with diagnosing

MATERIALS AND METHODS
In this research, the said hormone tests were conducted for 244 subjects including 30 subjects with healthy thyroid, 34 subjects suffering from hypothyroidism, 30 subjects suffering from Subclinical hyperthyroidism and 30 subjects suffering from Subclinical hypothyroidism , 30 subjects suffering from hyperthyroidism treatment and 30 subjects suffering hyper thyroidism treatment, and 30 subjects with resistant thyroid, by considering age of the patients.Therefore, it can be mentioned that clinical property of age and seven hormone tests were defined as input and eight categories including being healthy, hyperthyroidism, hypothyroidism, Subclinical hyperthyroidism, Subclinical hypothyroidism, hyper thyroidism treatment, hypothyroidism treatment, and resistant thyroid, were defined as output.Data analysis was conducted using MATLAB 2014 software to categorize the thyroid disease.For evaluating validity of the data, by using 3-fold of cross-validation, validity of thyroid disease categorization by neural networks such as MLP, PNN, GRNN, FTDNN, and CFNN, was evaluated.For this purpose, the data were divided into three categories including 81, 81, and 82, and between each of the categories 8 types of thyroid diseases were equally divided and each category was trained for ten times.The best result of 10 times as a accurate classification of each category will be considered.The end result of each network is the average of the best results obtained for each of the categories.Also for 40 subjects (5 subjects for each categories), new data were given to the GUI of MATLAB through the designed graphic interface for testing the network.
In this work, eight outputs were defined for all networks as binary from 10000000 which is first category (normal) to 00000001 which is the eighth category (resistant thyroid) to achieve more accurate results of networks and in this case, output of networks will be between [0,1].Also for determining category type of 8 inputs the Networks after training read the binary code as output category, or determine the decoding defined categories.

RESULTS
Results of the present research regarding MLP, PNN, GRNN, FTDNN, and CFNN are respectively indicated in the following.

MLP Network
For training and testing the network using 3-fold cross-validation, the data were classified into three categories including 81, 81, and 82, so that each category was trained for ten times and as a

PNN Network
For training and testing the network using 3-fold cross-validation, the data were classified into three categories including 81, 81, and 82, so that each category was trained for ten times and as a result of that, the best result obtained for each of the categories is respectively 100%, 100%, and 100% and their mean is 100%.Also for 40 subjects (5 subjects for each categories), new data were given to the GUI of MATLAB through the designed graphic interface for testing the network, and all 40 data were correctly responded.the regression diagram in the learning stage of PNN network related to the first, second, and third validation category, respectively, is shown (Diagram.4 to 6).

GRNN Network
For training and testing the network using 3-fold cross-validation, the data were classified into three categories including 81, 81, and 82, so that each category was trained for ten times and as a result of that, the best result obtained for each of the categories is respectively 100%, 100%, and 100% and their mean is 100%.Also for 40 subjects (5 subjects for each categories), new data were given to the GUI of MATLAB through the designed graphic interface for testing the network, and all 40 data were correctly responded.the regression diagram in the learning stage of GRNN network related to the first, second, and third validation category, respectively, is shown (Diagram.7 to 9).

FTDNN Network
For training and testing the network using 3-fold cross-validation, the data were classified into three categories including 81, 81, and 82, so that each category was trained for ten times and as a result of that, the best result obtained for each of the categories is respectively 100%, 98.78%, and 100% and their mean is 99.59%.Also for 40 subjects (5 subjects for each categories), new data were given

CFNN Network
For training and testing the network using 3-fold of cross-validation, the data were classified into three categories including 81, 81, and 82, so that each category was trained for ten times and as a result of that, the best result obtained for each of the categories is respectively 100%, 100%, and 100% and their mean is 100%.Also for 40 subjects (5 subjects for each categories), new data were given to the GUI of MATLAB through the designed graphic interface for testing the network, and all 40 data were correctly responded.the regression diagram in the learning stage of CFNN network related to the first, second, and third validation category, respectively, is shown (Diagram.13 to 15).

Designing in GUI (Graphical User Interface) of Matlab
The aim of designing graphical interface in GUI is to facilitating user work by using this interface rather than typing various commands for testing the network the graphical interface is used which is indicated in (fig.10).Using this graphical interface, the network can be trained using each of the networks used in this research and also the results obtained from testing the network can be demonstrated and eight inputs can be given to the network and the category related to these eight properties will be demonstrated.We gave 40 new data in addition to the 244 data used for testing the networks by this way to this graphical interface for each network and we observed that all the data were correctly categorized.

DISCUSSION AND CONCLUSION
Thyroid tests are considered as the methods with the lowest side-effects for diagnosing thyroid disease which are widely being used in the process of clinical diagnosis.However, since the normal range for each age group is different, using neural networks can greatly help the physicians with easier diagnosis of thyroid status.Rouhani and Mansouri conducted a research by using neural networks including RBF, PNN, GRNN, LVQ, and SVM, by considering five categories for thyroid disease such as being healthy, hyperthyroidism, hypothyroidism, hyperthyroidism under clinical conditions, and hypothyroidism under clinical conditions, and by using hormone tests such as TSH, T4, T3, TBG, FT4, FT3, T3U, by considering clinical conditions of hair loss, weight gain, dry skin, moist and warm skin, tachycardia, and heart beat for designing networks that can have the best performance for categorizing thyroid disease.The obtained results indicated that these networks can diagnose with a high accuracy, for example for diagnosing hyperthyroid disease, the GRNN network reported 99.5% positive response 10 .

In this research, results of thyroid hormone tests which included seven tests such
In a research conducted by Shukla et al. for 187 subjects, neural networks such as BPA, RBF, and LVQ were used by considering three categories, to design networks for classifying thyroid diseases.They concluded that these networks are able to diagnose thyroid disease with a high accuracy so that this extent in LVQ network reaches 98% 11 .
Also in a research conducted by Temurtas, neural networks such as MLNN, PNN, LVQ were used and three categories were considered to design a network that can have the best performance for classifying thyroid disease.They concluded that these networks are able to diagnose thyroid disease with high accuracy, so that this extent in PNN network reaches 94.81% 12 .
Makas and Yumusak conducted a research on 215 subjects by conducting hormone tests such as T3, T4, TSH, T3U, and maximum change of TSH after injecting thyrotropin on three categories such as being healthy, hyperthyroidism, and hypothyroidism by using MLNN, PNN, LVQ, GRNN, FTDNN, CFNN, and ENN, and optimization algorithms such as SCG, PSO, ABC, MBO, and finally resulted that these networks are able to diagnose thyroid disease with a high accuracy 13 .
In a study conducted in 2015 by V. Prasad et al using architectural design combines artificial intelligence techniques ¡ rough data sets theory and machine learning algorithms have been succeed to diagnose thyroid disease using this architecture 14 .
In a study conducted in 2012 by Li-Na Li et al using Extreme Learning Machine algorithm diagnosed thyroid disease in 215 people, including 150 healthy subjects, 35 patients with hyperthyroidism and 30 suffering from hypothyroidism with 98.1% accuracy 15 .
After numerous investigations of the obtained results in the past and the results obtained in this research, it can be resulted that all of the past research are consistent with the present research and using fundamental properties such as age of patients as input of networks and also the possibility of diagnosing three new categories of thyroid disease including hyperthyroidism under treatment, hypothyroidism under treatment, and resistant thyroid is applicable and by help of neural networks in diagnosing thyroid diseases, existing challenges in accurate diagnosis due to human error would be minimized.Also it should be noted that in order to widely use these networks in the diagnosis system, following points are recommended: • By using neural networks we can design a system that by receiving various properties, can automatically diagnose various diseases.

•
By using neural networks we can identify the effect of various diseases on each other.

•
We can identify effect of various diseases on thyroid disease, by designing neural networks

Diagram 5 :
Regression diagram in learning stage of PNN network, related to the second validation category Diagram 6: Regression diagram in learning stage of PNN network, related to the third validation category result of that, the best result obtained for each of the categories is respectively 100%, 100%, and 98.78% and their mean is 99.59%.Also for 40 subjects (5 subjects for each categories), new data were given to the GUI of MATLAB through the designed graphic interface for testing the network, and all 40 data were correctly responded.the regression diagram in the learning stage of MLP network related to the first, second, and third validation category, respectively, is shown (Diagram.1 to 3).

Diagram 8 :Diagram 9 :
Regression diagram in learning stage of GRNN network, related to the second validation category Regression diagram in learning stage of GRNN network, related to the third validation category to the GUI of MATLAB through the designed graphic interface for testing the network, and all 40 data were correctly responded.the regression diagram in the learning stage of FTDNN network related to the first, second, and third validation category, respectively, is shown (Diagram.10 to 12).