# Intelligent Disease Prediagnosis Only Based on Symptoms

Authors: Fangfang Luo; Xu Luo
Journal: Journal of Healthcare Engineering
 (2021)

---

## Abstract

People often concern the relationships between symptoms and diseases when seeking medical advices. In this paper, medical data are divided into three copies, records related to main disease categories, records related to subclass disease types, and records of specific diseases firstly; then two disease recognition methods only based on symptoms for the main disease category identification, subclass disease type identification, and specific disease identification are given. In the methods, a neural network and a support vector machine (SVM) algorithms are adopted, respectively. In the method validation part, accuracy of the two diagnosis methods is tested and compared. Results show that automatic disease prediction only based on symptoms is possible for intelligent medical triage and common disease diagnosis.


---

## Body

## 1. Introduction

At present, there is shortage of per capita medical resources, and high-quality medical resources are concentrated in large cities and large hospitals. In China, many patients have strong health awareness, even if their symptoms are not serious; they also flock to large hospitals to seek quality medical services. Constraints and conflicts between medical resource supply and demand are a long-standing phenomenon.In medical consultations, what people intuitively care about are the relationships between symptoms and diseases. Nowadays, many people provide symptoms online to obtain prediagnosis results, and their objective is to screen critical illnesses and seek an advice for further accurate medical treatment.An intelligent information system, which can automatically perform prediagnosis based on the symptoms provided by patients, can alleviate the problem of medical resource shortage. In this paper, such diagnosis methods are proposed. Through these methods, preliminary diagnoses can be provided for specialized diseases, and it can help medical workers in areas having underdeveloped medical resources implement medical triage and provide consultation services for people who will seek precise treatment in big hospitals. Additionally, a common disease diagnosis service can be realized for people who can seek medical treatment by themselves.


## 2. Related Works

Computer aided diagnosis research has begun since the last century. Most intelligent disease diagnosis researches focus on a certain type disease or only a specific disease. The contents mostly are intelligent diagnosis using machine learning algorithms based on pathology data, influencing factors, examination data, physiological performance, or images when disease types are known previously [1–7]. Some exploratory works have discussed the disease diagnosis only based on the symptoms provided by patients. A simple method is to compare the symptoms provided by a patient to record symptoms in each data item, and the disease in the most similar entry is an output result. In [8], the user gives out feathers related to the diseases such as gender, age, affected part, and related symptoms firstly. Jackcard similarities are calculated based on symptom matrixes, and the similarities are arranged in descending order. Diseases in the first 3 items are selected as alternative recommended answers. In [9], the similarities, which are evaluated by differences between a symptom vector provided by the user and characteristic symptom sets of different diseases, are calculated. The similarities are also arranged in descending order, and the diseases in the first 3 selected items are alternative recommended answers. Disease diagnosis only based on symptoms and without disease type limitation is a general practice (GP) problem. If the above methods are used to solve this kind of diagnosis problem, the efficiency is extremely low, and repetition calculations are involved in each diagnosis case. In related works [10, 11], automatic disease diagnoses based on machine learning algorithms are proposed; in these works, symptoms are extracted firstly, and then, the diagnosis is implemented using deep learning algorithms. There are many diseases, while all proposed methods are limited to discussions on few diseases in the above papers.Without detailed medical examination data and pathology support, accuracy of diagnosis methods based on symptoms cannot be guaranteed, while, in current online applications, reports, and documents, diagnosis only based on symptoms can be a disease screening method and used to help fast disease type recognition and disease triage in hospital. The key problem is the adaptability of this kind of diagnosis methods. At present, there is no discussion about which disease type levels or which diseases this kind of diagnosis methods is suitable for. To fill this gap, in this paper, this issue is considered.Disease prediagnosis based on symptoms, which are contained in consultation words, is indeed a text classification problem. In these works, the first step would mostly be lexical feather extraction, and then classification based on different feather properties is implemented [12–14]. Considering the particularity in clinic and immature Chinese word segmentations, in this paper, we only discuss the core prediagnosis problem, and the symptoms, which are also disease feathers, have been extracted according to clinical experience previously. A hierarchical frame is provided in this paper. Firstly, the diseases are divided into major categories and then are divided into several subtypes. Furthermore, specific diseases are filled into subclass disease types. In this paper, two automatic diagnosis methods using a neural network technology and a support vector machine (SVM) technology, respectively, are given to solve this general practice (GP) problem. In the methods, the first is the major disease category identification, and then it is based on the results to identify disease subtypes. Further process is the training for specific disease identification. To observe the effectiveness, the two diagnosis methods are tested and compared.


## 3. Problem Statement and Theories in This Paper

### 3.1. The Diagnosis Problem in This Paper

The intelligent diagnosis problem to be solved in this paper includes two aspects. The first one is seeking diagnosis experience according to the relationships between symptoms and diseases. Here, supervised machine learning methods are adopted. The second one is disease prediction based on the symptoms provided by visitors. The first one is the main problem.In our research, symptoms have been extracted in data preprocessing. Consider that samples with respect to the same disease type are in a hyperplane and linearly separable, and a different symptom may make two similar samples refer to different disease types; the support vector machine (SVM) algorithm is an appropriate method. As the neural network is a generic method in multiclassification problems, this method is also adopted in this paper and compared with SVM [15].


### 3.2. The Neural Network in This Paper

To describe this method, symbolic notations are given firstly:N: there are N symptoms in each data itemΓ: the number of nodes in the output layer of a neural networkY: the number of nodes in the hidden layer of a neural network is Y, and Y=10+N+Thn=hn1,hn2,hn3,…,hnY: the input vector of the hidden layer is hn, and the input of the pth hidden layer unit is hnpho=ho1,ho2,ho3,…,hoY: the output vector of the hidden layer is ho, and the output of the pth hidden layer unit is hoPyn=yn1,yn2,yn3,…,ynΓ: the input vector of the output layer is yn, and the input of the qth output layer unit is ynqyo=yo1,yo2,yo3,…,yoΓ: the output vector of the output layer is yo, and the output of the qth output layer unit is yoqwnp: the connection weight between the nth input layer unit and the pth hidden layer unitϖpq: the connection weight between the pth hidden layer unit and the qth output layer unitbp: the threshold value of the pth hidden layerbq: the threshold value of the qth output layerxk=x1k,x2k,…,xNk: the kth symptom record, which contains N components, is xk, and each component represents a different symptomdk=d1k,d2k,…,dΓk: the expected output when xk is input to the neural network is dk, and if this record is about the r th disease or disease type, the component drk=1, other components djk=0j≠r,j∈1,2,3,…,Γok=xk,dk=x1k,x2k,…,xNk,d1k,d2k,…,dΓk: represents the kth training sampleIn the neural network, each nerve cell is actually an activation function. For thepth hidden layer unit, if sample ok is used, the input is(1)hnpk=∑n=1Nwnpxnk−bp.A sigmoid function is used as the activation function, and the output is(2)hkpk=fhnpk=11+exp−hnpk,where exp() is an exponential function. An output cell of the hidden layer is an input cell of the output layer, and for the qth output layer unit, if sample ok is used, the input is(3)ynqk=∑p=1Yϖpqhopk−θq,and a softmax output is(4)ykqk=f2ynqk=expynqk∑q=1Γexpynqk.Furthermore, in the neural network, a cross-entropy loss function is adopted:(5)ek=f3yoqk=−∑q=1Γdqklnykqk.In the neural network, some important differential equations are also involved. The first is the partial differential of error functionek with respect to ϖpq, and it is(6)∂ek∂ϖpq=∂ek∂ynqk⋅∂ynqk∂ϖpq.Considering formula (3) and that the processing procedure is focused on the connection weight between the pth specific hidden layer unit and the qth specific output layer unit, the following formula can be obtained:(7)∂ynqk∂ϖpq=∂∑p=1Yϖpqhkpk−θq∂ϖpq=hopk.Further, based on formulas (4) and (5), there is(8)∂ek∂ynqk=∂ek∂yοqk⋅∂yοqk∂ynqk=−dqk+ykqk∑q=1Γdqk.Here, this result is marked asδqk.Ifδqk is obtained, it can be used to renew the weight between a hidden layer unit and an output layer unit, and the update rule is(9)ϖpq=ϖpq+η∂ek∂ϖpq=ϖpq+ηδqkhkpk.The connection weight between thepth hidden layer unit and the qth output layer unit in the next training process is the connection weight at present combined with the partial differential δqk and output hopk. η is a given learning rate.In the concrete implementation process, the parameter values ofk, p, and q are given in operations with respect to a particular neuron unit.In the neural network, the partial differential of error functionek with respect to wnp is also involved, and it is shown as follows:(10)∂ek∂wnp=∂ek∂hkpk⋅∂hnpk∂wnp.Similarly, considering formula (2) and that the processing procedure is focused on the connection weight between the nth specific input layer unit and the pth specific hidden layer unit, the following formula can be obtained:(11)∂hnpk∂wnp=∂∑i=1Nwnpxnk−bp∂wnp=xnk.Further, based on formulas (2)–(5), there is(12)∂ek∂hnpk=∂ek∂ynqk⋅∂ynqk∂hopk⋅∂hopk∂hnpk=−∑q=1Γδqkϖpqf1′hnpk,=−∑q=1Γδqkϖpqexp−hnpk1+exp−hnpk−2.Here, this result is marked asσpk.Ifσpk is obtained, it can be used to renew the weight between a hidden layer unit and an output layer unit, and the update rule is(13)wnp=wnp+η∂ek∂wnp=wnp+ησpkxnk.The connection weight between thenth hidden layer unit and the pth output layer unit in the next training process is the connection weight at present combined with the partial differential σpk and input xnk. η is also a given learning rate.


### 3.3. The Support Vector Machine (SVM) in This Paper

In this paper, a disease sample isxk=x1k,x2k,…,xNk,xN+1k, where x1k,x2k,…,xNk represents different symptoms and xN+1k is a disease or disease type.The hyperplane separating samples are depicted as follows:(14)fx=ωTx+c.The purpose is to get the classification parametersω and c. If there are Tb samples in the sample space, the specific problem should be solved:(15)minω,c12ω2,s.t.xN+1kωx1k,…,xNkT+c≥1,k=1,2,…,Tb.If the classification parameters have been obtained, and there is a symptom vectork=κ1,κ2,…,κN, while(16)ωκ+c=ω1κ1+ω2κ2+⋯+ωNκN+c>0,it can be determined that κ belongs to the disease category I, while(17)ωκ+c=ω1κ1+ω2κ2+⋯+ωNκN+c<0,and it can be determined that κ does not belong to the disease category I.In learning procedures, a one-against-the-rest SVM method [16] based on this basic form can be adopted to implement multiclassification.


## 3.1. The Diagnosis Problem in This Paper

The intelligent diagnosis problem to be solved in this paper includes two aspects. The first one is seeking diagnosis experience according to the relationships between symptoms and diseases. Here, supervised machine learning methods are adopted. The second one is disease prediction based on the symptoms provided by visitors. The first one is the main problem.In our research, symptoms have been extracted in data preprocessing. Consider that samples with respect to the same disease type are in a hyperplane and linearly separable, and a different symptom may make two similar samples refer to different disease types; the support vector machine (SVM) algorithm is an appropriate method. As the neural network is a generic method in multiclassification problems, this method is also adopted in this paper and compared with SVM [15].


## 3.2. The Neural Network in This Paper

To describe this method, symbolic notations are given firstly:N: there are N symptoms in each data itemΓ: the number of nodes in the output layer of a neural networkY: the number of nodes in the hidden layer of a neural network is Y, and Y=10+N+Thn=hn1,hn2,hn3,…,hnY: the input vector of the hidden layer is hn, and the input of the pth hidden layer unit is hnpho=ho1,ho2,ho3,…,hoY: the output vector of the hidden layer is ho, and the output of the pth hidden layer unit is hoPyn=yn1,yn2,yn3,…,ynΓ: the input vector of the output layer is yn, and the input of the qth output layer unit is ynqyo=yo1,yo2,yo3,…,yoΓ: the output vector of the output layer is yo, and the output of the qth output layer unit is yoqwnp: the connection weight between the nth input layer unit and the pth hidden layer unitϖpq: the connection weight between the pth hidden layer unit and the qth output layer unitbp: the threshold value of the pth hidden layerbq: the threshold value of the qth output layerxk=x1k,x2k,…,xNk: the kth symptom record, which contains N components, is xk, and each component represents a different symptomdk=d1k,d2k,…,dΓk: the expected output when xk is input to the neural network is dk, and if this record is about the r th disease or disease type, the component drk=1, other components djk=0j≠r,j∈1,2,3,…,Γok=xk,dk=x1k,x2k,…,xNk,d1k,d2k,…,dΓk: represents the kth training sampleIn the neural network, each nerve cell is actually an activation function. For thepth hidden layer unit, if sample ok is used, the input is(1)hnpk=∑n=1Nwnpxnk−bp.A sigmoid function is used as the activation function, and the output is(2)hkpk=fhnpk=11+exp−hnpk,where exp() is an exponential function. An output cell of the hidden layer is an input cell of the output layer, and for the qth output layer unit, if sample ok is used, the input is(3)ynqk=∑p=1Yϖpqhopk−θq,and a softmax output is(4)ykqk=f2ynqk=expynqk∑q=1Γexpynqk.Furthermore, in the neural network, a cross-entropy loss function is adopted:(5)ek=f3yoqk=−∑q=1Γdqklnykqk.In the neural network, some important differential equations are also involved. The first is the partial differential of error functionek with respect to ϖpq, and it is(6)∂ek∂ϖpq=∂ek∂ynqk⋅∂ynqk∂ϖpq.Considering formula (3) and that the processing procedure is focused on the connection weight between the pth specific hidden layer unit and the qth specific output layer unit, the following formula can be obtained:(7)∂ynqk∂ϖpq=∂∑p=1Yϖpqhkpk−θq∂ϖpq=hopk.Further, based on formulas (4) and (5), there is(8)∂ek∂ynqk=∂ek∂yοqk⋅∂yοqk∂ynqk=−dqk+ykqk∑q=1Γdqk.Here, this result is marked asδqk.Ifδqk is obtained, it can be used to renew the weight between a hidden layer unit and an output layer unit, and the update rule is(9)ϖpq=ϖpq+η∂ek∂ϖpq=ϖpq+ηδqkhkpk.The connection weight between thepth hidden layer unit and the qth output layer unit in the next training process is the connection weight at present combined with the partial differential δqk and output hopk. η is a given learning rate.In the concrete implementation process, the parameter values ofk, p, and q are given in operations with respect to a particular neuron unit.In the neural network, the partial differential of error functionek with respect to wnp is also involved, and it is shown as follows:(10)∂ek∂wnp=∂ek∂hkpk⋅∂hnpk∂wnp.Similarly, considering formula (2) and that the processing procedure is focused on the connection weight between the nth specific input layer unit and the pth specific hidden layer unit, the following formula can be obtained:(11)∂hnpk∂wnp=∂∑i=1Nwnpxnk−bp∂wnp=xnk.Further, based on formulas (2)–(5), there is(12)∂ek∂hnpk=∂ek∂ynqk⋅∂ynqk∂hopk⋅∂hopk∂hnpk=−∑q=1Γδqkϖpqf1′hnpk,=−∑q=1Γδqkϖpqexp−hnpk1+exp−hnpk−2.Here, this result is marked asσpk.Ifσpk is obtained, it can be used to renew the weight between a hidden layer unit and an output layer unit, and the update rule is(13)wnp=wnp+η∂ek∂wnp=wnp+ησpkxnk.The connection weight between thenth hidden layer unit and the pth output layer unit in the next training process is the connection weight at present combined with the partial differential σpk and input xnk. η is also a given learning rate.


## 3.3. The Support Vector Machine (SVM) in This Paper

In this paper, a disease sample isxk=x1k,x2k,…,xNk,xN+1k, where x1k,x2k,…,xNk represents different symptoms and xN+1k is a disease or disease type.The hyperplane separating samples are depicted as follows:(14)fx=ωTx+c.The purpose is to get the classification parametersω and c. If there are Tb samples in the sample space, the specific problem should be solved:(15)minω,c12ω2,s.t.xN+1kωx1k,…,xNkT+c≥1,k=1,2,…,Tb.If the classification parameters have been obtained, and there is a symptom vectork=κ1,κ2,…,κN, while(16)ωκ+c=ω1κ1+ω2κ2+⋯+ωNκN+c>0,it can be determined that κ belongs to the disease category I, while(17)ωκ+c=ω1κ1+ω2κ2+⋯+ωNκN+c<0,and it can be determined that κ does not belong to the disease category I.In learning procedures, a one-against-the-rest SVM method [16] based on this basic form can be adopted to implement multiclassification.


## 4. Disease Identification Methods

### 4.1. Preconditions

Suppose that a preprocess step has been implemented on existing electronic medical records. Disease symptoms, disease types, and relations between the two are known clearly.


### 4.2. Labelling

Number theN disease symptoms in the database, and the symptoms are numbered as 1,2,3,4,…,N, respectively. Considering that the same symptoms in different gender patients are often with regard to different common diseases or disease types, gender is deemed as a default “symptom,” which is labelled 1. Diseases in the database are divided into B main categories, which are numbered as N∗10+1, N∗10+2, …, N∗10+B. Each main disease category is further divided into several subclasses and numbered. There are Tb subtype diseases under the main disease category N∗10+b, and they are numbered as N∗10+b+1, N∗10+b+2, …, N∗10+b+Tb, b = 1, 2, 3, …, B. Tb,j diseases are related to the disease type N∗10+b∗10+j and numbered as N∗10+b∗10+j∗10+1, N∗10+b∗10+j∗10+2, …, N∗10+b∗10+j∗10+Tb,j, b=1,2,3,…,B, j=1,2,3,…,Tb.Establish a data relationship list, in which the data structure is (Symptom 1, Symptom 2, Symptom 3, …, SymptomN, Disease). Each entry contains N symptoms. If symptom n does exist in the item of a disease, the value below “Symptom n ” is 1, or else, the value is 0.For example, suppose that there are onlyN=11 symptoms in the current medical study records, the symptoms are male, fever, ulcer, pain, aching and limp, nasal congestion, diarrhea, bleeding, tumor, drowsiness, and face yellowing, and the label values of these symptoms are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, and 11. There are only B=10 major disease categories in the studied medical records, tumor disease, infectious disease, blood disease, cardiovascular disease, digestive disease, endocrine system disease, respiratory disease, urinary system disease, ophthalmic disease, and otolaryngology disease, and labelled numbers of these disease types are 101N∗10+1, 102N∗10+2, 103N∗10+3, 104N∗10+4,105N∗10+5, 106N∗10+6, 107N∗10+7, 108N∗10+8, 109N∗10+9, 110N∗10+10, respectively. Furthermore, suppose that there are T1=3 subtype diseases, benign tumor 1011N∗10+1∗10+1, borderline tumor 1012N∗10+1∗10+2, and malignant tumor 1013N∗10+1∗10+3 in tumor diseases. And T1,1=5 diseases, which are squamous cell carcinoma 10111N∗10+1∗10+1∗10+1, adenocarcinoma 10112N∗10+1∗10+1∗10+2, basal cell carcinoma 10113N∗10+1∗10+1∗10+3, transitional cell carcinoma 10114N∗10+1∗10+1∗10+4 and sarcoma 10115N∗10+1∗10+1∗10+5, are in the benign tumor disease. If there is a medical record about the squamous cell carcinoma disease, and the symptoms are fever, ulcers, pain, and tumor, there are three data items that are related to this case and shown in Table 1.Table 1
An example of disease records.
Sequence numberGenderFeverUlcerPainAching and limpNasal congestionDiarrheaBleedingTumorDrowsinessFace yellowingDisease111110000100101211110000100101331111000010010131A BP neural network that is shown in Figure1 is used for the disease type and specific disease identification. There are N input layer nodes, Γ output layer nodes, and Y=10+N+Γ hidden layer nodes. K training symptom samples ok=xk,dk, k=1,2,3,…,K are known. One medical record is related to a sample. When symptom xnk appears in the record xk, xnk=1, or else xnk=0. When a medical record is about the disease type dςk, dςk=1, and the rest items are zero, that is, dq≠ςk=0. The N+1 th input layer unit with an input value “−1” and the Y+1th hidden layer unit also with an input value “−1” are used to generate threshold values, and connection weights ωN+1p and ω–Y+1q are used as thresholds bp and θq, respectively.Figure 1
BP neural network in this paper.Specific training procedures are implemented according to formulas (1)–(13) in Section 3.2. Based on the data form in Table 1, the value of xnk is 0 or 1, n=1,2,…,N. If djk is in N∗10+1,N∗10+2,…,N∗10+B, it is the training procedure to identify main disease categories. An identification neural network NT is obtained. If djk is in N∗10+b∗10+1,N∗10+b∗10+2,…,N∗10+b∗10+Tb, it is the training procedure to identify subclass disease types under the main disease category N∗10+b. Identification neural networks NT−b, b=1,2,3,…,B are obtained. If djk is in N∗10+b∗10+j∗10+1,N∗10+b∗10+j∗10+2,…,N∗10+b∗10+j∗10+Tb,j, it is the training procedure to identify specific diseases under the subclass disease type N∗10+b∗10+j. Identification neural networks NT−b,j, b=1,2,3,…,B, j=1,2,3,…,Tb are obtained.While the SVM method mentioned in Section3.3 is used, classification parameters with respect to major disease types(18)ω,c1,ω,c2,…,ω,cB,classification parameters with respect to subcategory disease types(19)ω,c1,1,ω,c1,2,…,ω,c1,T1,ω,c2,1,ω,c2,2,…,ω,c2,T2,⋯ω,cB,1,ω,cB,2,…,ω,cB,TB.and classification parameters with respect to specific diseases(20)ω,c1,1,1,ω,c1,1,2,…,ω,c1,1,T1,1,ω,c1,2,1,ω,c1,2,2,…,ω,c1,2,T1,2,⋯ω,cB,TB,1,ω,cB,TB,2,…,ω,cB,TB,TB,TB,can be obtained.


## 4.1. Preconditions

Suppose that a preprocess step has been implemented on existing electronic medical records. Disease symptoms, disease types, and relations between the two are known clearly.


## 4.2. Labelling

Number theN disease symptoms in the database, and the symptoms are numbered as 1,2,3,4,…,N, respectively. Considering that the same symptoms in different gender patients are often with regard to different common diseases or disease types, gender is deemed as a default “symptom,” which is labelled 1. Diseases in the database are divided into B main categories, which are numbered as N∗10+1, N∗10+2, …, N∗10+B. Each main disease category is further divided into several subclasses and numbered. There are Tb subtype diseases under the main disease category N∗10+b, and they are numbered as N∗10+b+1, N∗10+b+2, …, N∗10+b+Tb, b = 1, 2, 3, …, B. Tb,j diseases are related to the disease type N∗10+b∗10+j and numbered as N∗10+b∗10+j∗10+1, N∗10+b∗10+j∗10+2, …, N∗10+b∗10+j∗10+Tb,j, b=1,2,3,…,B, j=1,2,3,…,Tb.Establish a data relationship list, in which the data structure is (Symptom 1, Symptom 2, Symptom 3, …, SymptomN, Disease). Each entry contains N symptoms. If symptom n does exist in the item of a disease, the value below “Symptom n ” is 1, or else, the value is 0.For example, suppose that there are onlyN=11 symptoms in the current medical study records, the symptoms are male, fever, ulcer, pain, aching and limp, nasal congestion, diarrhea, bleeding, tumor, drowsiness, and face yellowing, and the label values of these symptoms are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, and 11. There are only B=10 major disease categories in the studied medical records, tumor disease, infectious disease, blood disease, cardiovascular disease, digestive disease, endocrine system disease, respiratory disease, urinary system disease, ophthalmic disease, and otolaryngology disease, and labelled numbers of these disease types are 101N∗10+1, 102N∗10+2, 103N∗10+3, 104N∗10+4,105N∗10+5, 106N∗10+6, 107N∗10+7, 108N∗10+8, 109N∗10+9, 110N∗10+10, respectively. Furthermore, suppose that there are T1=3 subtype diseases, benign tumor 1011N∗10+1∗10+1, borderline tumor 1012N∗10+1∗10+2, and malignant tumor 1013N∗10+1∗10+3 in tumor diseases. And T1,1=5 diseases, which are squamous cell carcinoma 10111N∗10+1∗10+1∗10+1, adenocarcinoma 10112N∗10+1∗10+1∗10+2, basal cell carcinoma 10113N∗10+1∗10+1∗10+3, transitional cell carcinoma 10114N∗10+1∗10+1∗10+4 and sarcoma 10115N∗10+1∗10+1∗10+5, are in the benign tumor disease. If there is a medical record about the squamous cell carcinoma disease, and the symptoms are fever, ulcers, pain, and tumor, there are three data items that are related to this case and shown in Table 1.Table 1
An example of disease records.
Sequence numberGenderFeverUlcerPainAching and limpNasal congestionDiarrheaBleedingTumorDrowsinessFace yellowingDisease111110000100101211110000100101331111000010010131A BP neural network that is shown in Figure1 is used for the disease type and specific disease identification. There are N input layer nodes, Γ output layer nodes, and Y=10+N+Γ hidden layer nodes. K training symptom samples ok=xk,dk, k=1,2,3,…,K are known. One medical record is related to a sample. When symptom xnk appears in the record xk, xnk=1, or else xnk=0. When a medical record is about the disease type dςk, dςk=1, and the rest items are zero, that is, dq≠ςk=0. The N+1 th input layer unit with an input value “−1” and the Y+1th hidden layer unit also with an input value “−1” are used to generate threshold values, and connection weights ωN+1p and ω–Y+1q are used as thresholds bp and θq, respectively.Figure 1
BP neural network in this paper.Specific training procedures are implemented according to formulas (1)–(13) in Section 3.2. Based on the data form in Table 1, the value of xnk is 0 or 1, n=1,2,…,N. If djk is in N∗10+1,N∗10+2,…,N∗10+B, it is the training procedure to identify main disease categories. An identification neural network NT is obtained. If djk is in N∗10+b∗10+1,N∗10+b∗10+2,…,N∗10+b∗10+Tb, it is the training procedure to identify subclass disease types under the main disease category N∗10+b. Identification neural networks NT−b, b=1,2,3,…,B are obtained. If djk is in N∗10+b∗10+j∗10+1,N∗10+b∗10+j∗10+2,…,N∗10+b∗10+j∗10+Tb,j, it is the training procedure to identify specific diseases under the subclass disease type N∗10+b∗10+j. Identification neural networks NT−b,j, b=1,2,3,…,B, j=1,2,3,…,Tb are obtained.While the SVM method mentioned in Section3.3 is used, classification parameters with respect to major disease types(18)ω,c1,ω,c2,…,ω,cB,classification parameters with respect to subcategory disease types(19)ω,c1,1,ω,c1,2,…,ω,c1,T1,ω,c2,1,ω,c2,2,…,ω,c2,T2,⋯ω,cB,1,ω,cB,2,…,ω,cB,TB.and classification parameters with respect to specific diseases(20)ω,c1,1,1,ω,c1,1,2,…,ω,c1,1,T1,1,ω,c1,2,1,ω,c1,2,2,…,ω,c1,2,T1,2,⋯ω,cB,TB,1,ω,cB,TB,2,…,ω,cB,TB,TB,TB,can be obtained.


## 5. Diagnosis Implementations

### 5.1. Identification of Main Disease Categories

The symptoms, which are provided by a patient, areκ=κ1,κ2,…,κN.(1)
Identification based on the neutral network: putκ into the neutral network NT to estimate which main disease category the symptoms refer to(2)
Identification based on SVM: identify whether the disease category is based on vectorsω,cb, b=1,2,3,…,B by SVM


### 5.2. Identification of Subclass Disease Types

If the main disease category isb=ς and the symptoms provided by a patient are κ=κ1,κ2,…,κN, based on the neutral network NT−ς and SVM identification parameters ω,cς,τ,τ=1,2,3,…,Tς to identify subclass disease types.(1)
Subclass disease type identification based on the neutral networkPutκ=κ1,κ2,…,κN into the neutral network NT−ς to estimate which subclass disease type the symptoms refer to.(2)
Subclass disease type identification based on SVMStep 1: Initial value isτ=1.Step 2: Identify whether the disease type isτ based on vector ω,cς,τ in the SVM classification method. If the disease type is τ, go to Step 3, or else, make τ=τ+1. Verify that whether τ>Tς, and if it is, quit out the whole procedure, or else loop through Step 2.Step 3: The subclass disease typeτ is the output result.


### 5.3. Identification of Specific Diseases

Suppose that the main disease category isb=ς and the subclass type is j=τ. Based on the neutral network NT−ς,τ and SVM identification parameters ω,cς,τ,υ, υ=1,2,3,…,Tς,τ to identify specific diseases.(1)
Disease identification based on the neural networkPutκ=κ1,κ2,…,κN into the neutral network NT−ς,τ to estimate what disease it is.(2)
Disease identification based on SVMStep 1: Initial value isυ=1.Step 2: Identify whether the disease isυ based on vector ω,cς,τ,v in the SVM classification method. If the disease is υ, go to Step 3, or else make υ=υ+1. Verify that whether υ>Tς,τ, and if it is, quit out the whole procedure, or else loop through Step 2.Step 3: Diseaseυ is the output result.


## 5.1. Identification of Main Disease Categories

The symptoms, which are provided by a patient, areκ=κ1,κ2,…,κN.(1)
Identification based on the neutral network: putκ into the neutral network NT to estimate which main disease category the symptoms refer to(2)
Identification based on SVM: identify whether the disease category is based on vectorsω,cb, b=1,2,3,…,B by SVM


## 5.2. Identification of Subclass Disease Types

If the main disease category isb=ς and the symptoms provided by a patient are κ=κ1,κ2,…,κN, based on the neutral network NT−ς and SVM identification parameters ω,cς,τ,τ=1,2,3,…,Tς to identify subclass disease types.(1)
Subclass disease type identification based on the neutral networkPutκ=κ1,κ2,…,κN into the neutral network NT−ς to estimate which subclass disease type the symptoms refer to.(2)
Subclass disease type identification based on SVMStep 1: Initial value isτ=1.Step 2: Identify whether the disease type isτ based on vector ω,cς,τ in the SVM classification method. If the disease type is τ, go to Step 3, or else, make τ=τ+1. Verify that whether τ>Tς, and if it is, quit out the whole procedure, or else loop through Step 2.Step 3: The subclass disease typeτ is the output result.


## 5.3. Identification of Specific Diseases

Suppose that the main disease category isb=ς and the subclass type is j=τ. Based on the neutral network NT−ς,τ and SVM identification parameters ω,cς,τ,υ, υ=1,2,3,…,Tς,τ to identify specific diseases.(1)
Disease identification based on the neural networkPutκ=κ1,κ2,…,κN into the neutral network NT−ς,τ to estimate what disease it is.(2)
Disease identification based on SVMStep 1: Initial value isυ=1.Step 2: Identify whether the disease isυ based on vector ω,cς,τ,v in the SVM classification method. If the disease is υ, go to Step 3, or else make υ=υ+1. Verify that whether υ>Tς,τ, and if it is, quit out the whole procedure, or else loop through Step 2.Step 3: Diseaseυ is the output result.


## 6. Method Tests

In this part, the diagnosis methods are tested. The tests in this paper are implemented in digestive diseases, respiratory diseases, and urinary diseases and used as examples.


### 6.1. Leave-One-Out Cross Validation

The neural network disease identification method and the support vector machine (SVM) disease identification method are compared.Example 1.
If a test sample is given, distinguish it as a digestive disease, a respiratory disease, or a urinary disease. Test results are shown in Table2.
In Table2, the accuracy of the main disease category identification is 94.4%.
Disease triage is to estimate which subclass disease type consulting symptoms provided by the user refer to. Disease triage is tested in the following examples.Table 2
Diagnosis of main disease categories.
Number of test samplesWrong identified samplesMethods1699SVM1699Neural networkExample 2.
Tests are implemented in cases. Case 1: if a test sample has been diagnosed as a respiratory disease, distinguish it as a pulmonary disease, a respiratory tract infection, a chest disease, or a mediastinal disease. Case 2: if a test sample has been diagnosed as a digestive disease, distinguish it as an intestinal disease, a hepatic and gall disease, an epityphlon and pancreas disease, or a stomach disease. Case 3: If a test sample has been diagnosed as a urinary system disease, distinguish it as a bladder disease, a kidney disease, or an ureteral disease. The results are shown in Table3.
In Table3, the accuracy in disease subtype identification is higher than 80%, but lower than the accuracy in the main disease category identification.
Specific disease identification tests are carried on in Example3 and Example 4. In Example 3, binary classification tests are executed. Samples about a disease are one class, samples not related to this disease are “the other” one. Example 4 is a multiclassification test, and samples related to different diseases are different categories.Table 3
Disease triage.
CasesNumber of test samplesWrong identified samplesMethodsCase 17615SVM7615Neural networkCase 26012SVM6011Neural networkCase 3324SVM324Neural networkExample 3.
Tests are implemented in such cases. Case 1: Gastritis identification in stomach diseases; Case 2: Duodenal ulcer identification in stomach diseases. Case 3: Common cold identification in respiratory tract infections. Case 4: Pharyngitis disease identification in respiratory tract diseases; Case 5: Asthma identification in respiratory tract diseases. Case 6: Pneumonia identification in pulmonary diseases. Case 7: Pulmonary tuberculosis identification in pulmonary diseases. Case 8: Enteritis identification in intestinal diseases. Case 9: Intestinal obstruction identification in intestinal diseases. Case 10: Hepatitis identification in hepatic and gall diseases. Case 11: Gallstone identification in hepatic and gall diseases. Test results are shown in Table4.Table 4
Diagnosis of specific diseases in binary classifications.
CasesAccuracy (%)MethodsCase 180.48SVM82.93Neural networkCase 285.36SVM85.36Neural networkCase 391.43SVM88.57Neural networkCase 497.14SVM97.14Neural networkCase 588.00SVM88.00Neural networkCase 680.00SVM84.00Neural networkCase 780.00SVM80.00Neural networkCase 886.00SVM86.00Neural networkCase 988.00SVM90.00Neural networkCase 1095.00SVM93.33Neural networkCase 1183.33SVM83.33Neural networkExample 4.
Tests are implemented in such cases: Case 1: Gastritis, upper gastrointestinal bleeding, duodenal ulcer, and gastric ulcer identifications in stomach diseases; Case 2: Intestinal obstruction, intussusception, ulcerative colitis, common enteritis, and lower gastrointestinal bleeding identifications in intestinal diseases; Case 3: Viral hepatitis, cholangitis, gallstones, cholecystitis, liver abscess, and cirrhosis identifications in hepatic and gall diseases; Case 4: Pneumonia, emphysema, lung abscess, pulmonary thrombosis, and tuberculosis identifications in pulmonary diseases; Case 5: Upper respiratory tract infection and lower respiratory tract infection identifications in respiratory tract infections; Case 6: Renal failure, glomerulonephritis, pyelonephritis, kidney stones, and nephrotic syndrome identifications in kidney diseases. Test results are shown in Table5.
Comparing the results in Tables4 and 5, if the specific disease diagnosis is put into binary classifications, the accuracy is higher than 80%, and when it is put into multiclassification modules, the results are unsatisfactory. Without the support of detailed pathology data, specialized diseases actually cannot be accurately diagnosed by methods only based on symptoms. However, considering the result supports in Table 4, identifications of common diseases such as gastritis, common cold, pharyngitis, and common enteritis, which always do not need the support of detailed pathology data, can be provided to the user in an automatic disease diagnosis system.Table 5
Diagnosis of specific diseases in multiple classifications.
CasesAccuracy (%)MethodsCase 141.46SVM34.15Neural networkCase 278.00SVM70.00Neural networkCase 366.67SVM63.33Neural networkCase 460.00SVM56.00Neural networkCase 576.00SVM70.00Neural networkCase 670.00SVM60.00Neural network


### 6.2. Diagnosis with Weight Samples

In clinic, some diseases have high relational discrepancy symptoms. In a common disease diagnosis experiment, which we have carried out, sample weights are assigned to some samples artificially according to clinical experience, and these weights are added into loss functions in machine learning procedures [17]. In the test, binary classification results using samples with weights and without weights are similar, and the precision difference is less than 4%. Thus, high relational discrepancy degree samples are suggested to be put into test sample sets in validation procedures of machine learning methods.


### 6.3. Multitype Diseases Diagnosis

A person may have more than 1 disease, and these diseases refer to different types, and results also can be obtained whenκ=κ1,κ2,…,κN is put into classification modules identifying 1, 2, 3, …, N concurrence diseases successively.Example 5.
Suppose that a patient has two or three diseases, and these diseases belong to different disease subtypes. Case 1: If the diseases belong to digestive diseases, identify it as a concurrence case of intestinal disease, and hepatic and gall disease, a concurrence case of intestinal disease and stomach disease, or a concurrence case of stomach disease, and hepatic and gall disease. Case 2: If the diseases belong to respiratory diseases, identify it as a concurrence case of pulmonary disease and chest disease, a concurrence case of chest disease and respiratory tract infection, or a concurrence case of pulmonary disease and respiratory tract infection. Case 3: If the diseases belong to respiratory diseases, identify it as a concurrence case of pulmonary disease, upper respiratory tract disease, and trachea and bronchi disease, a concurrence case of pulmonary disease, upper respiratory tract disease, and pleura and chest disease, or a concurrence case of pulmonary disease, trachea and bronchi disease, and pleura and chest disease. Case 4: If the diseases belong to digestive diseases, identify it as a concurrence case of intestinal disease, hepatic and gall disease, and epityphlon and pancreas disease, a concurrence case of stomach disease, intestinal disease, and hepatic and gall disease, or a concurrence case of epityphlon and pancreas disease, stomach disease, and intestinal disease. The above cases are about disease subtype identifications, and the results are shown in Table6.
From the results in Table6, it can be seen that, in the identification of concurrence of multiple disease types, the accuracy of machine learning methods is dropping. When there is a concurrence of more than three disease types, the identification accuracy would be much lower.Table 6
Diagnosis of multiple diseases.
CasesNumber of test samplesWrong identified samplesMethodsCase 115054SVM15052Neural networkCase 215036SVM15036Neural networkCase 3180135SVM180133Neural networkCase 4200134SVM200136Neural network


### 6.4. Discussion on Test Results

(1)
For lacking pathologic support, the accuracy of the GP diagnosis methods based on symptoms for specific diseases is limited. In our tests, it is shown that this kind of methods can be used in the diagnosis of common diseases, such as cold, enteritis, and rhinitis, and for specialized diseases such as asthma, liver cancer, and psoriasis, these methods can be used to predict disease types and provide disease triage. Diagnosis methods, which identify disease types in this paper, can also be used in hospital guides.(2)
In consideration of sample characteristics, the neutral network and SVM machine learning methods are appropriate choices for the automatic prediagnosis problem in this paper. In our experiments, the accuracy of the neural network is close to that of SVM. Sometimes, the neutral network performs a litter better, and sometimes, it is the SVM. A corollary is that the accuracy of this kind of diagnosis methods is limited by the problem itself, and even another practicable machine learning method is adopted, and the performance is also similar with the neutral network and SVM method.(3)
From the experiment results, it can be seen that automatic prediagnosis methods only based on symptom data are suitable for single disease type identification, and it is also not difficult to infer that these methods are also only suitable for a specific common disease identification. If a symptom record is related to multiple disease types or multitype diseases, the availability is low.(4)
In our experiments, the feasibilities of diagnosis only based on symptoms using machine learning methods are tested. Even tests are carried out in digestive diseases, respiratory diseases, and urinary diseases, and without loss of generality, it can be deduced that this kind of diagnosis methods can be used in other disease categories. Test results would also be observed further in more kinds of disease types except for the cases in this paper.


## 6.1. Leave-One-Out Cross Validation

The neural network disease identification method and the support vector machine (SVM) disease identification method are compared.Example 1.
If a test sample is given, distinguish it as a digestive disease, a respiratory disease, or a urinary disease. Test results are shown in Table2.
In Table2, the accuracy of the main disease category identification is 94.4%.
Disease triage is to estimate which subclass disease type consulting symptoms provided by the user refer to. Disease triage is tested in the following examples.Table 2
Diagnosis of main disease categories.
Number of test samplesWrong identified samplesMethods1699SVM1699Neural networkExample 2.
Tests are implemented in cases. Case 1: if a test sample has been diagnosed as a respiratory disease, distinguish it as a pulmonary disease, a respiratory tract infection, a chest disease, or a mediastinal disease. Case 2: if a test sample has been diagnosed as a digestive disease, distinguish it as an intestinal disease, a hepatic and gall disease, an epityphlon and pancreas disease, or a stomach disease. Case 3: If a test sample has been diagnosed as a urinary system disease, distinguish it as a bladder disease, a kidney disease, or an ureteral disease. The results are shown in Table3.
In Table3, the accuracy in disease subtype identification is higher than 80%, but lower than the accuracy in the main disease category identification.
Specific disease identification tests are carried on in Example3 and Example 4. In Example 3, binary classification tests are executed. Samples about a disease are one class, samples not related to this disease are “the other” one. Example 4 is a multiclassification test, and samples related to different diseases are different categories.Table 3
Disease triage.
CasesNumber of test samplesWrong identified samplesMethodsCase 17615SVM7615Neural networkCase 26012SVM6011Neural networkCase 3324SVM324Neural networkExample 3.
Tests are implemented in such cases. Case 1: Gastritis identification in stomach diseases; Case 2: Duodenal ulcer identification in stomach diseases. Case 3: Common cold identification in respiratory tract infections. Case 4: Pharyngitis disease identification in respiratory tract diseases; Case 5: Asthma identification in respiratory tract diseases. Case 6: Pneumonia identification in pulmonary diseases. Case 7: Pulmonary tuberculosis identification in pulmonary diseases. Case 8: Enteritis identification in intestinal diseases. Case 9: Intestinal obstruction identification in intestinal diseases. Case 10: Hepatitis identification in hepatic and gall diseases. Case 11: Gallstone identification in hepatic and gall diseases. Test results are shown in Table4.Table 4
Diagnosis of specific diseases in binary classifications.
CasesAccuracy (%)MethodsCase 180.48SVM82.93Neural networkCase 285.36SVM85.36Neural networkCase 391.43SVM88.57Neural networkCase 497.14SVM97.14Neural networkCase 588.00SVM88.00Neural networkCase 680.00SVM84.00Neural networkCase 780.00SVM80.00Neural networkCase 886.00SVM86.00Neural networkCase 988.00SVM90.00Neural networkCase 1095.00SVM93.33Neural networkCase 1183.33SVM83.33Neural networkExample 4.
Tests are implemented in such cases: Case 1: Gastritis, upper gastrointestinal bleeding, duodenal ulcer, and gastric ulcer identifications in stomach diseases; Case 2: Intestinal obstruction, intussusception, ulcerative colitis, common enteritis, and lower gastrointestinal bleeding identifications in intestinal diseases; Case 3: Viral hepatitis, cholangitis, gallstones, cholecystitis, liver abscess, and cirrhosis identifications in hepatic and gall diseases; Case 4: Pneumonia, emphysema, lung abscess, pulmonary thrombosis, and tuberculosis identifications in pulmonary diseases; Case 5: Upper respiratory tract infection and lower respiratory tract infection identifications in respiratory tract infections; Case 6: Renal failure, glomerulonephritis, pyelonephritis, kidney stones, and nephrotic syndrome identifications in kidney diseases. Test results are shown in Table5.
Comparing the results in Tables4 and 5, if the specific disease diagnosis is put into binary classifications, the accuracy is higher than 80%, and when it is put into multiclassification modules, the results are unsatisfactory. Without the support of detailed pathology data, specialized diseases actually cannot be accurately diagnosed by methods only based on symptoms. However, considering the result supports in Table 4, identifications of common diseases such as gastritis, common cold, pharyngitis, and common enteritis, which always do not need the support of detailed pathology data, can be provided to the user in an automatic disease diagnosis system.Table 5
Diagnosis of specific diseases in multiple classifications.
CasesAccuracy (%)MethodsCase 141.46SVM34.15Neural networkCase 278.00SVM70.00Neural networkCase 366.67SVM63.33Neural networkCase 460.00SVM56.00Neural networkCase 576.00SVM70.00Neural networkCase 670.00SVM60.00Neural network


## 6.2. Diagnosis with Weight Samples

In clinic, some diseases have high relational discrepancy symptoms. In a common disease diagnosis experiment, which we have carried out, sample weights are assigned to some samples artificially according to clinical experience, and these weights are added into loss functions in machine learning procedures [17]. In the test, binary classification results using samples with weights and without weights are similar, and the precision difference is less than 4%. Thus, high relational discrepancy degree samples are suggested to be put into test sample sets in validation procedures of machine learning methods.


## 6.3. Multitype Diseases Diagnosis

A person may have more than 1 disease, and these diseases refer to different types, and results also can be obtained whenκ=κ1,κ2,…,κN is put into classification modules identifying 1, 2, 3, …, N concurrence diseases successively.Example 5.
Suppose that a patient has two or three diseases, and these diseases belong to different disease subtypes. Case 1: If the diseases belong to digestive diseases, identify it as a concurrence case of intestinal disease, and hepatic and gall disease, a concurrence case of intestinal disease and stomach disease, or a concurrence case of stomach disease, and hepatic and gall disease. Case 2: If the diseases belong to respiratory diseases, identify it as a concurrence case of pulmonary disease and chest disease, a concurrence case of chest disease and respiratory tract infection, or a concurrence case of pulmonary disease and respiratory tract infection. Case 3: If the diseases belong to respiratory diseases, identify it as a concurrence case of pulmonary disease, upper respiratory tract disease, and trachea and bronchi disease, a concurrence case of pulmonary disease, upper respiratory tract disease, and pleura and chest disease, or a concurrence case of pulmonary disease, trachea and bronchi disease, and pleura and chest disease. Case 4: If the diseases belong to digestive diseases, identify it as a concurrence case of intestinal disease, hepatic and gall disease, and epityphlon and pancreas disease, a concurrence case of stomach disease, intestinal disease, and hepatic and gall disease, or a concurrence case of epityphlon and pancreas disease, stomach disease, and intestinal disease. The above cases are about disease subtype identifications, and the results are shown in Table6.
From the results in Table6, it can be seen that, in the identification of concurrence of multiple disease types, the accuracy of machine learning methods is dropping. When there is a concurrence of more than three disease types, the identification accuracy would be much lower.Table 6
Diagnosis of multiple diseases.
CasesNumber of test samplesWrong identified samplesMethodsCase 115054SVM15052Neural networkCase 215036SVM15036Neural networkCase 3180135SVM180133Neural networkCase 4200134SVM200136Neural network


## 6.4. Discussion on Test Results

(1)
For lacking pathologic support, the accuracy of the GP diagnosis methods based on symptoms for specific diseases is limited. In our tests, it is shown that this kind of methods can be used in the diagnosis of common diseases, such as cold, enteritis, and rhinitis, and for specialized diseases such as asthma, liver cancer, and psoriasis, these methods can be used to predict disease types and provide disease triage. Diagnosis methods, which identify disease types in this paper, can also be used in hospital guides.(2)
In consideration of sample characteristics, the neutral network and SVM machine learning methods are appropriate choices for the automatic prediagnosis problem in this paper. In our experiments, the accuracy of the neural network is close to that of SVM. Sometimes, the neutral network performs a litter better, and sometimes, it is the SVM. A corollary is that the accuracy of this kind of diagnosis methods is limited by the problem itself, and even another practicable machine learning method is adopted, and the performance is also similar with the neutral network and SVM method.(3)
From the experiment results, it can be seen that automatic prediagnosis methods only based on symptom data are suitable for single disease type identification, and it is also not difficult to infer that these methods are also only suitable for a specific common disease identification. If a symptom record is related to multiple disease types or multitype diseases, the availability is low.(4)
In our experiments, the feasibilities of diagnosis only based on symptoms using machine learning methods are tested. Even tests are carried out in digestive diseases, respiratory diseases, and urinary diseases, and without loss of generality, it can be deduced that this kind of diagnosis methods can be used in other disease categories. Test results would also be observed further in more kinds of disease types except for the cases in this paper.


## 7. Conclusions

In this paper, neural network and SVM machine learning methods are given to solve the automatic disease diagnosis problem only based on symptoms. In our methods, each symptom is a feature. The methods work in three layers, which are main disease category identification, subclass disease type identification, and specific disease identification. The methods are suitable for the diagnosis of common diseases and disease triage for specialized diseases. The availability in practice is proved and analyzed in the experiments of this paper. In addition, future research is also required to investigate automatic symptom extraction and discuss the maximum number size of symptoms.



---

*Source: 9963576-2021-08-02.xml*