# Mathematical Modeling of the Expert System Predicting the Severity of Acute Pancreatitis

Authors: Maria A. Ivanchuk; Vitalij V. Maksimyuk; Igor V. Malyk
Journal: Journal of Computational Medicine
 (2014)

---

## Abstract

The method of building the hyperplane which separates the convex hulls in the Euclidean spaceR
n is proposed. The algorithm of prediction of the presence of severity in patients based on this method is developed and applied in practice to predict the presence of severity in patients with acute pancreatitis.


---

## Body

## 1. Introduction

During the last decades, pronounced tendency to the relentless increase in morbidity in acute pancreatitis is observed. Thus, the depth of pathomorphological pancreatic parenchyma lesions can vary from the development of edematous pancreatitis up to pancreatic necrosis. However, accurate predicting of the probable nature of the lesion of the pancreas in the early stages of acute pancreatitis is one of the most difficult problems of modern pancreatology. Diagnostic and the predictive probability of existing laboratory and instrumental diagnostic markers and rating scales does not exceed 70–80% [1–3]. Such situation is a major difficulty in selecting the adequate treatment strategy in the initial stages of acute pancreatitis. Thus the search for new methods of accurate predicting of acute pancreatitis’ severity becomes an urgent problem.Development of mathematical approaches for prediction in medicine was developed by Fisher, the father of the linear discriminant analysis [4]. Currently, there are many approaches to solving this problem: cluster analysis, the construction of predictive tables, image recognition, and linear programming. Fundamentals of building the prognostic tables and Wald serial analysis are described in [5]. Cluster analysis is commonly used for solving the tasks of medical prediction.In the paper [6], the procedure of cluster analysis with a study of the indices of the daily variability of cardiac rhythm in patients with the ischemic disease of heart is examined. In [7] using national data from the Scientific Registry of Transplant Recipients authors compare transplant and wait-list hospitalization rates. They suggest two marginal methods to analyze such clustered recurrent event data; the first model postulates a common baseline event rate, while the second features cluster-specific baseline rates. Results from the proposed models to those based on a frailty model were compared with the various methods compared and contrasted. Three major considerations in designing a cluster analysis are described in [8]. The first relates to selection of the individuals. The second consideration is selection of variables for measurement and the third consideration is how many variables to choose to enter into a cluster analysis. To classify clinical phenotypes of anti-neutrophil cytoplasmic antibody-associated vasculitis, cluster analysis was used in [9]. Researches on the general theory of diagnosis, classification, and application of optimization methods for pattern recognition, solving applied problems in medicine and biology, are conducted by Mangasarian et al. for many years [10].But universal method for solving problems of recognition, identification, and diagnosis does not exist. Therefore, development of methods for predicting in medicine still remains relevant. One among the many challenges of recognition is the task of constructing hyperplanes which separate two convex sets. Many manuscripts [11–16] are devoted to the solution of this problem.We propose a methodology for constructing convex hulls and their separation, which can be used for modeling expert medical prognostic systems (e.g., to separate groups of patients with different degrees of severity of the disease for prediction of severity in patients).


## 2. Methods

### 2.1. Separation of the Convex Hulls

Let us have two sets of pointsA
=
{
a
i
=
(
a
i
1
,
a
i
2
,
…
,
a
i
n
)
,
i
=
1
,
m
A
¯
} and B
=
{
b
i
=
(
b
i
1
,
b
i
2
,
…
,
b
i
n
)
,
i
=
1
,
m
B
¯
} in Euclidean space R
n. Let m be number of points in the set. We must find the separate hyperplane:
(1)
L
p
=
{
x
∈
R
n
:
〈
p
,
x
〉
=
γ
}
,
p
≠
0
,
where 〈
p
,
x
〉 is the scalar product of the vectors p and x such that sets A and B can be placed in the different half-spaces:
(2)
L
p
+
=
{
x
∈
R
n
:
〈
p
,
x
〉
>
γ
}
,
L
p
-
=
{
x
∈
R
n
:
〈
p
,
x
〉
<
γ
}
.To build the convex hullcon
v
A for the set A, for each of C
m
A
n points’ combinations from the set A, if it is possible, build the hyperplane
(3)
H
p
=
{
x
∈
R
n
:
〈
p
,
x
〉
=
β
}
,
p
≠
0
.
Coordinates of the vector p
=
(
p
1
,
…
,
p
n
) are found as minors (
n
-
1
) order for elements of the first row of the matrix:
(4)
(
x
1
-
a
1
1
x
2
-
a
1
2
⋯
x
n
-
a
1
n
a
2
1
-
a
1
1
a
2
2
-
a
1
2
⋯
a
2
n
-
a
1
n
⋯
⋯
⋯
⋯
a
n
1
-
a
1
1
a
n
2
-
a
1
2
⋯
a
n
n
-
a
1
n
)
,
where x
∈
R
n, a
i
∈
A, i
=
1
,
n
¯. Coefficient β is determined from the following equation:
(5)
β
=
-
(
a
1
1
p
1
+
a
1
2
p
2
+
⋯
+
a
1
n
p
n
)
.If all points of the setA are in the one of half-spaces of hyperplane H
P, then polygon a
1
a
2
⋯
a
n is one of the convex hull’s hyperfaces. The complex of all hyperfaces is the convex hull con
v
A.Pointb
i
∈
B is called outlier if point b
i is internal for the con
v
A. Point b
i is outlier if there is at least one hyperface a
1
a
2
⋯
a
n
∈
con
v
A that
(6)
|
c
f
→
|
=
|
c
b
i
→
|
+
|
b
i
f
→
|
,
where point c
∈
int
⁡
con
v
A, point f is the intersection point of the hyperplane H
p (a
1
a
2
⋯
a
n
∈
H
p), and line
(7)
x
1
-
c
1
b
1
-
c
1
=
x
2
-
c
2
b
2
-
c
2
=
⋯
=
x
n
-
c
n
b
n
-
c
n
.
To find the point f let us write (3) in parametric form:
(8)
x
1
=
c
1
+
(
b
1
-
c
1
)
t
x
2
=
c
2
+
(
b
2
-
c
2
)
t
hhhlhhh
⋯
x
n
=
c
n
+
(
b
n
-
c
n
)
t
.
Put (8) in the hyperplane equation (3) and find parameter t:
(9)
t
*
=
p
1
c
1
+
p
2
c
2
+
⋯
+
p
n
c
n
+
β
p
1
(
c
1
-
b
1
)
+
p
2
(
c
2
-
b
2
)
+
⋯
+
p
n
(
c
n
-
b
n
)
.
To find coordinates of the point f let us put (9) in (8):
(10)
f
1
=
c
1
+
(
b
1
-
c
1
)
t
*
f
2
=
c
2
+
(
b
2
-
c
2
)
t
*
hhhlhhh
⋮
f
n
=
c
n
+
(
b
n
-
c
n
)
t
*
.After finding all outliers from the setsA and B eject outliers from the set, with less number of outliers. Build the new convex hulls and find the outliers. If there are outliers in the new convex hulls, eject them. If there are not any outliers, the convex hulls do not intersect. According to consequence of Hahn-Banach theorem there is a nonzero linear functional L
p that separates con
v
A and conv
B [17].Find the separating functionalL
p as hyperplane parallel to one of convex hulls’ hyperfaces. Choose hyperface so that convex hulls con
v
A and con
v
B are in different half-spaces formed by hyperplane parallel to this hyperface. Find points a
min
⁡
∈
con
v
A and b
min
⁡
∈
con
v
B so that |
a
min
⁡
b
min
⁡
→
|
=
min
⁡
(
|
a
i
b
j
→
|
:
a
i
∈
con
v
A
,
b
j
∈
con
v
B
,
i
=
1
,
m
A
¯
,
j
=
1
,
m
B
¯
). Let d
min
⁡
∈
a
min
⁡
b
min
⁡
→. For each hyperface {
H
A
min
⁡
:
H
A
min
⁡
⊂
con
v
A
;
a
min
⁡
∈
H
A
min
⁡
} and {
H
B
min
⁡
:
H
B
min
⁡
⊂
con
v
B
;
b
min
⁡
∈
H
B
min
⁡
} build the parallel hyperplane {
L
p
:
d
min
⁡
∈
L
p
;
L
p
∥
H
A
min
⁡
or
L
p
∥
H
B
min
⁡
}. If a
i
∈
L
p
+, for all a
i
∈
A, i
=
1
,
m
A
¯, and b
j
∈
L
p
-, for all b
j
∈
B, j
=
1
,
m
B
,
¯ then L
p is separating hyperplane.


### 2.2. Modeling the Expert System of Predicting the Presence of Severity in Patients

Let us have two groups of patients:A, patients with severity, and B, patients without severity. There are n
0 parameters (factors which affect the severity) known for each patient.During modelling we used the terms sensitivity (Se) and specificity (Sp):
(11)
Se
=
a
a
+
c
,
Sp
=
d
b
+
d
,
where a is the true positives, b is the false positives (overdiagnosis errors), c is the false negatives (underdiagnosis errors), and d is the true negatives. The sensitivity of a clinical test refers to the ability of the test to correctly identify those patients with the disease. The specificity of a clinical test refers to the ability of the test to correctly identify those patients without the disease [18].We created an algorithm of modelling the expert system in a way that uses the least amount of features for the best result. Information of the parameters was found using Kulback’s information measure [5]. We built convex hulls for the most informative factor. If convex hulls intersect, we found outliers—the points from the set A that are internal to con
v
B and the points from the set B that are internal to con
v
A. The set A outliers are underdiagnosis errors. The set B outliers are overdiagnosis errors. We built the prognostic system to find the patients with severity, so we rejected the outliers from the set B. Let the set O
B
=
{
o
i
:
o
i
∈
B
∩
int
⁡
con
v
A
,
i
=
1
,
m
O
B
¯
} be the set of outliers from B. After rejecting, we get a new set B
′
=
B
/
O
B.If you build the expert system for differential diagnosis, you reject outliers out of the set where there are less of them.If the percentage of rejected points is more than the significance level(12)
m
O
B
m
B
>
α
,
the next (the most informative) factor was added. The space dimension is increased by 1. In the new space convex hulls were built and the outliers were rejected. The space dimension was increased until preassigned significance level. If all available diagnostic information was used, but preassigned significance level was not reached, then decision of not sufficient information was taken. When preassigned significance level was reached, we found the separating hyperplanes. The algorithm for modelling the prognostic system is represented on the Figure 1. The results were checked in the control group and the hyperplane with maximal sensitivity was chosen.Figure 1
Algorithm for modelling the prognostic system.The complexity of this algorithm isO
(
m
n
+
1
) [19] if the convex hulls are built by search of all combinations of points. The complexity of this algorithm is O
(
m
2
) if the convex hulls are built by Jarvis march or “gift wrapping” algorithm [20].


## 2.1. Separation of the Convex Hulls

Let us have two sets of pointsA
=
{
a
i
=
(
a
i
1
,
a
i
2
,
…
,
a
i
n
)
,
i
=
1
,
m
A
¯
} and B
=
{
b
i
=
(
b
i
1
,
b
i
2
,
…
,
b
i
n
)
,
i
=
1
,
m
B
¯
} in Euclidean space R
n. Let m be number of points in the set. We must find the separate hyperplane:
(1)
L
p
=
{
x
∈
R
n
:
〈
p
,
x
〉
=
γ
}
,
p
≠
0
,
where 〈
p
,
x
〉 is the scalar product of the vectors p and x such that sets A and B can be placed in the different half-spaces:
(2)
L
p
+
=
{
x
∈
R
n
:
〈
p
,
x
〉
>
γ
}
,
L
p
-
=
{
x
∈
R
n
:
〈
p
,
x
〉
<
γ
}
.To build the convex hullcon
v
A for the set A, for each of C
m
A
n points’ combinations from the set A, if it is possible, build the hyperplane
(3)
H
p
=
{
x
∈
R
n
:
〈
p
,
x
〉
=
β
}
,
p
≠
0
.
Coordinates of the vector p
=
(
p
1
,
…
,
p
n
) are found as minors (
n
-
1
) order for elements of the first row of the matrix:
(4)
(
x
1
-
a
1
1
x
2
-
a
1
2
⋯
x
n
-
a
1
n
a
2
1
-
a
1
1
a
2
2
-
a
1
2
⋯
a
2
n
-
a
1
n
⋯
⋯
⋯
⋯
a
n
1
-
a
1
1
a
n
2
-
a
1
2
⋯
a
n
n
-
a
1
n
)
,
where x
∈
R
n, a
i
∈
A, i
=
1
,
n
¯. Coefficient β is determined from the following equation:
(5)
β
=
-
(
a
1
1
p
1
+
a
1
2
p
2
+
⋯
+
a
1
n
p
n
)
.If all points of the setA are in the one of half-spaces of hyperplane H
P, then polygon a
1
a
2
⋯
a
n is one of the convex hull’s hyperfaces. The complex of all hyperfaces is the convex hull con
v
A.Pointb
i
∈
B is called outlier if point b
i is internal for the con
v
A. Point b
i is outlier if there is at least one hyperface a
1
a
2
⋯
a
n
∈
con
v
A that
(6)
|
c
f
→
|
=
|
c
b
i
→
|
+
|
b
i
f
→
|
,
where point c
∈
int
⁡
con
v
A, point f is the intersection point of the hyperplane H
p (a
1
a
2
⋯
a
n
∈
H
p), and line
(7)
x
1
-
c
1
b
1
-
c
1
=
x
2
-
c
2
b
2
-
c
2
=
⋯
=
x
n
-
c
n
b
n
-
c
n
.
To find the point f let us write (3) in parametric form:
(8)
x
1
=
c
1
+
(
b
1
-
c
1
)
t
x
2
=
c
2
+
(
b
2
-
c
2
)
t
hhhlhhh
⋯
x
n
=
c
n
+
(
b
n
-
c
n
)
t
.
Put (8) in the hyperplane equation (3) and find parameter t:
(9)
t
*
=
p
1
c
1
+
p
2
c
2
+
⋯
+
p
n
c
n
+
β
p
1
(
c
1
-
b
1
)
+
p
2
(
c
2
-
b
2
)
+
⋯
+
p
n
(
c
n
-
b
n
)
.
To find coordinates of the point f let us put (9) in (8):
(10)
f
1
=
c
1
+
(
b
1
-
c
1
)
t
*
f
2
=
c
2
+
(
b
2
-
c
2
)
t
*
hhhlhhh
⋮
f
n
=
c
n
+
(
b
n
-
c
n
)
t
*
.After finding all outliers from the setsA and B eject outliers from the set, with less number of outliers. Build the new convex hulls and find the outliers. If there are outliers in the new convex hulls, eject them. If there are not any outliers, the convex hulls do not intersect. According to consequence of Hahn-Banach theorem there is a nonzero linear functional L
p that separates con
v
A and conv
B [17].Find the separating functionalL
p as hyperplane parallel to one of convex hulls’ hyperfaces. Choose hyperface so that convex hulls con
v
A and con
v
B are in different half-spaces formed by hyperplane parallel to this hyperface. Find points a
min
⁡
∈
con
v
A and b
min
⁡
∈
con
v
B so that |
a
min
⁡
b
min
⁡
→
|
=
min
⁡
(
|
a
i
b
j
→
|
:
a
i
∈
con
v
A
,
b
j
∈
con
v
B
,
i
=
1
,
m
A
¯
,
j
=
1
,
m
B
¯
). Let d
min
⁡
∈
a
min
⁡
b
min
⁡
→. For each hyperface {
H
A
min
⁡
:
H
A
min
⁡
⊂
con
v
A
;
a
min
⁡
∈
H
A
min
⁡
} and {
H
B
min
⁡
:
H
B
min
⁡
⊂
con
v
B
;
b
min
⁡
∈
H
B
min
⁡
} build the parallel hyperplane {
L
p
:
d
min
⁡
∈
L
p
;
L
p
∥
H
A
min
⁡
or
L
p
∥
H
B
min
⁡
}. If a
i
∈
L
p
+, for all a
i
∈
A, i
=
1
,
m
A
¯, and b
j
∈
L
p
-, for all b
j
∈
B, j
=
1
,
m
B
,
¯ then L
p is separating hyperplane.


## 2.2. Modeling the Expert System of Predicting the Presence of Severity in Patients

Let us have two groups of patients:A, patients with severity, and B, patients without severity. There are n
0 parameters (factors which affect the severity) known for each patient.During modelling we used the terms sensitivity (Se) and specificity (Sp):
(11)
Se
=
a
a
+
c
,
Sp
=
d
b
+
d
,
where a is the true positives, b is the false positives (overdiagnosis errors), c is the false negatives (underdiagnosis errors), and d is the true negatives. The sensitivity of a clinical test refers to the ability of the test to correctly identify those patients with the disease. The specificity of a clinical test refers to the ability of the test to correctly identify those patients without the disease [18].We created an algorithm of modelling the expert system in a way that uses the least amount of features for the best result. Information of the parameters was found using Kulback’s information measure [5]. We built convex hulls for the most informative factor. If convex hulls intersect, we found outliers—the points from the set A that are internal to con
v
B and the points from the set B that are internal to con
v
A. The set A outliers are underdiagnosis errors. The set B outliers are overdiagnosis errors. We built the prognostic system to find the patients with severity, so we rejected the outliers from the set B. Let the set O
B
=
{
o
i
:
o
i
∈
B
∩
int
⁡
con
v
A
,
i
=
1
,
m
O
B
¯
} be the set of outliers from B. After rejecting, we get a new set B
′
=
B
/
O
B.If you build the expert system for differential diagnosis, you reject outliers out of the set where there are less of them.If the percentage of rejected points is more than the significance level(12)
m
O
B
m
B
>
α
,
the next (the most informative) factor was added. The space dimension is increased by 1. In the new space convex hulls were built and the outliers were rejected. The space dimension was increased until preassigned significance level. If all available diagnostic information was used, but preassigned significance level was not reached, then decision of not sufficient information was taken. When preassigned significance level was reached, we found the separating hyperplanes. The algorithm for modelling the prognostic system is represented on the Figure 1. The results were checked in the control group and the hyperplane with maximal sensitivity was chosen.Figure 1
Algorithm for modelling the prognostic system.The complexity of this algorithm isO
(
m
n
+
1
) [19] if the convex hulls are built by search of all combinations of points. The complexity of this algorithm is O
(
m
2
) if the convex hulls are built by Jarvis march or “gift wrapping” algorithm [20].


## 3. Results

### 3.1. The Expert System of Predicting the Presence of Severity in Patients with Acute Pancreatitis

The research involved 60 persons with severe and 28 patients with nonsevere acute pancreatitis. Among them, there were 57 (64.8%) men and 31 (35.2%) women. The mean age was 48.54 years (±15.18) in males and 56.21 (±17.91) in females. The most common etiology was alcohol consumption (48.3%), followed by gallstones (34.2%). In 17.5% no identifiable cause was found.The diagnostic criteria for acute pancreatitis were those defined by the 2006 AP Guidelines, as the presence of at least two of the following features: (1) characteristic abdominal pain, (2) elevation over 3 times the upper normal limit of serum amylase/lipase, and (3) characteristic features on computer tomography (CT) scan [21]. Severe acute pancreatitis was diagnosed according strictly to Atlanta criteria: Early Prognostic Scores, APACHE II ≥ 8, Ranson ≥ 3; Organ Failure, systolic pressure < 90 mmHg, creatinine > 2.0 mg/L after rehydration, PaO2 ≤ 60 mmHg; Local Complications (on CT scan), Necrosis, Abscess, and Pseudocyst [22].Patients were divided into two samples—training (50 patients with severity and 20 without them) and control (10 patients with severity and 8 without). The level of significance wasα = 0,01. The algorithm presented above was used for patients with training set.Forn
=
1, the percentage of outliers was 29.5%.
Forn
=
2, the percentage of outliers was 3%.
Forn
=
3, the percentage of outliers was 1.4%.
Forn
=
4, the percentage of outliers was 0%.We got 8 hyperplanes which separate the convex hulls of the training samples. Two of them had higher sensitivity and specificity (we got only 1 (6%) of underdiagnosis errors and there were no overdiagnosis errors for the control sample with these hyperplanes):(13)
-
18937.5
x
1
-
200.3
x
2
+
5007.3
x
3
+
42348
x
4
+
310958.6
=
0
,
-
4802.5
x
1
-
142.8
x
2
+
5007.3
x
3
+
2158.1
x
4
+
177176.4
=
0
,
where x
1 is time before hospitalization, x
2 is blood lipase, x
3 is amylase urine, and x
4 is BMI.So, we built the expert system with sensitivitySe
=
94
%.Statistical errors are seen only in 1 patient in the control group, who were diagnosed with interstitial edematous pancreatitis development on the background severe diabetes mellitus. According to Expert System the acute pancreatitis without severity was predicted. This error, in our view, is associated with late ambulation of the patient for medical care as a result of atypical course of acute pancreatitis, increased blood and urine amylase, and increased BMI, which is the characteristic signs of diabetes mellitus. That is, in this case, some of the most important prognostic parameters of acute pancreatitis have been characterized by different diseases in particular of diabetes mellitus, which caused the error.


## 3.1. The Expert System of Predicting the Presence of Severity in Patients with Acute Pancreatitis

The research involved 60 persons with severe and 28 patients with nonsevere acute pancreatitis. Among them, there were 57 (64.8%) men and 31 (35.2%) women. The mean age was 48.54 years (±15.18) in males and 56.21 (±17.91) in females. The most common etiology was alcohol consumption (48.3%), followed by gallstones (34.2%). In 17.5% no identifiable cause was found.The diagnostic criteria for acute pancreatitis were those defined by the 2006 AP Guidelines, as the presence of at least two of the following features: (1) characteristic abdominal pain, (2) elevation over 3 times the upper normal limit of serum amylase/lipase, and (3) characteristic features on computer tomography (CT) scan [21]. Severe acute pancreatitis was diagnosed according strictly to Atlanta criteria: Early Prognostic Scores, APACHE II ≥ 8, Ranson ≥ 3; Organ Failure, systolic pressure < 90 mmHg, creatinine > 2.0 mg/L after rehydration, PaO2 ≤ 60 mmHg; Local Complications (on CT scan), Necrosis, Abscess, and Pseudocyst [22].Patients were divided into two samples—training (50 patients with severity and 20 without them) and control (10 patients with severity and 8 without). The level of significance wasα = 0,01. The algorithm presented above was used for patients with training set.Forn
=
1, the percentage of outliers was 29.5%.
Forn
=
2, the percentage of outliers was 3%.
Forn
=
3, the percentage of outliers was 1.4%.
Forn
=
4, the percentage of outliers was 0%.We got 8 hyperplanes which separate the convex hulls of the training samples. Two of them had higher sensitivity and specificity (we got only 1 (6%) of underdiagnosis errors and there were no overdiagnosis errors for the control sample with these hyperplanes):(13)
-
18937.5
x
1
-
200.3
x
2
+
5007.3
x
3
+
42348
x
4
+
310958.6
=
0
,
-
4802.5
x
1
-
142.8
x
2
+
5007.3
x
3
+
2158.1
x
4
+
177176.4
=
0
,
where x
1 is time before hospitalization, x
2 is blood lipase, x
3 is amylase urine, and x
4 is BMI.So, we built the expert system with sensitivitySe
=
94
%.Statistical errors are seen only in 1 patient in the control group, who were diagnosed with interstitial edematous pancreatitis development on the background severe diabetes mellitus. According to Expert System the acute pancreatitis without severity was predicted. This error, in our view, is associated with late ambulation of the patient for medical care as a result of atypical course of acute pancreatitis, increased blood and urine amylase, and increased BMI, which is the characteristic signs of diabetes mellitus. That is, in this case, some of the most important prognostic parameters of acute pancreatitis have been characterized by different diseases in particular of diabetes mellitus, which caused the error.


## 4. Conclusions

The method of separation of convex hulls in Euclidean space by constructing a separating hyperplane parallel to one of the convex hulls hyperfaces is proposed. On the basis of this method the algorithm for modelling the prognostic system is stated. The proposed algorithm is applied in practice to predict the presence of severity in patients with acute pancreatitis and gives 94% correct results for the control sample, while diagnostic and the predictive probability of existing laboratory and instrumental diagnostic markers and rating scales does not exceed 70–80%. Clinical application of the developed mathematical model predicting the severity of acute pancreatitis promotes proper choice of treatment tactics and allows improving final results of these patients’ treatment.



---

*Source: 532453-2014-06-09.xml*