1 Introduction

Liver cancer was the second leading cause of cancer-related death worldwide in 2012 [1]. Liver cancer is a malignant tumor that grows rapidly and commonly occurs after the age of 45 [2]. There may be no obvious symptoms in the early stage of liver cancer. As advanced cancer grows, symptoms may include weight loss, loss of appetite, nausea or vomiting, and yellowing of the skin and eyes [3]. Without early diagnosis and proper medical treatment, a patient often dies within 6 months after liver cancer has been initially diagnosed [2]. The survival rate of liver cancer has gradually improved in recent decades. For example, in Korea, the 5-year survival rate of liver cancer has slightly improved from 11.0% in 1993–1997 to 14.7% in 1998–2002 [4]; in a study cohort of 1115 liver cancer patients who underwent hepatectomy between 1981 and 2008 at five hepatobiliary centers in France, China, and the USA, the results showed that after major hepatectomy, the 5-year overall survival rate was 40%, and the 5-year survival rates were 30, 40, and 51% in 1981–1989, 1990–1999, and 2000–2008, respectively [5]. The prevention and treatment of liver cancer have become important issues.

Liver cirrhosis is one of the major causes of liver cancer [6,7,8]. The cause of liver cirrhosis can be attributed to several factors, including alcoholic liver diseases, chronic viral hepatitis, obesity, and nonalcoholic fatty liver disease. These factors may lead to chronic liver inflammation [6, 7, 9]. Evidence shows that the inflammatory response of liver parenchymal injury leads to hepatic fibrosis [10]. Liver inflammation will stimulate the proliferation of fibrous tissue in the liver, and these fibrous tissues then become scar tissues. They surround the normal liver cells, transform into the fake hepatic lobule, and then lead to liver cirrhosis and eventually liver cancer [6, 7]. For example, excess fat accumulation in the liver cells results in a fatty liver. The cells of normal liver tissues and tissues around the liver will be transformed into fat organizations for storing fat. In these circumstances, the liver cells cannot obtain a sufficient blood supply, nutrients and oxygen and become prone to inflammation or necrosis [6].

To understand the pathology of liver fibrosis and cirrhosis, animal models such as rats, have been introduced to examine the pathogenesis of liver cirrhosis and liver cancer. Different chemical substances were given to animals to induce liver diseases. For example, carbon tetrachloride (CCl4) is a common chemical substance used to induce rat liver fibrosis, liver cirrhosis, and subsequent liver cancer progression. In these experiments, CCl4 was repeatedly given to rats by gavage at different time points, and their livers were then extracted and observed by a microscope. The results showed that the area and quantity of the scar tissues increased when the treatment time was expanded [11, 12].

Traditionally, judging the phases of liver cirrhosis or liver cancer usually takes a considerable amount of time for doctors to observe many medical images. Current technologies, such as X-ray and magnetic resonance imaging (MRI), are applied to observe the roughness of the liver surface and check whether cirrhosis or tumors exist. In some serious circumstances, a surgical puncture is used to remove the liver slices, and the scar tissues are examined under a microscope [13].

For liver cirrhosis pathology, the areas of scar tissues are different in various stages of liver cirrhosis. In a liver cirrhosis tissue image, the area of the scar tissues from the first to the third stages will become more numerous and larger. Figure 1 shows a healthy liver tissue image and a scar liver tissue image, on which the blue arrow indicates the healthy liver tissue region and the red arrow indicates the liver scar tissue region. However, it is difficult for the human eye to justify the severity of liver tissue injury from a liver tissue section image, especially for a junior physician. Therefore, developing an automatic system to identify the scar stages of liver tissue is necessary.

Fig. 1
figure 1

Two liver tissue section images. a Healthy rat liver tissue section. b Injured rat liver tissue section. The blue arrow indicates the healthy liver tissue region and the red arrow indicates the scar liver tissue

In this study, a tissue section image-based liver scar stage (TSILSS) diagnosis system was proposed to diagnose the liver scar stage from the liver tissue section images. The TSILSS diagnosis system automatically segments the scar regions on the liver tissue section image, extracts the features from the segmented the scar regions, and then identifies the liver scar stage based on the extracted features. The TSILSS diagnosis system can reduce the processing time, error of human judgment, and human resources. It can also efficiently assist a doctor in diagnosing the liver scar stages.

In this study, the rat liver tissue section images were used as the test data for investigating the performance of the TSILSS diagnosis system. In these experiments, CCl4 was administered to rats for a period of time. After that, the TSILSS diagnosis system was employed to extract the scar tissue regions from a liver tissue section image, compute the features of the segmented scar tissues, and then recognize the scar stage of the liver based on the extracted features to assist the doctor in determining the stage of liver cirrhosis. In this study, a genetic-based algorithm is also proposed to determine the fittest values of the parameters used in the TSILSS diagnosis system.

2 Methods

2.1 Animals and Treatment

Male Sprague–Dawley rats were purchased and housed in cages under constant conditions of temperature (22 °C) and humidity (60%) with light illumination for a 12-h light/dark cycle. CCl4 was prepared as a 50% solution by mixing with an equal volume of olive oil. All rats were divided into four groups (each group has 8 rats). The negative control group remained untreated for 20 weeks. Rats 8, 12, and 16 weeks of age were treated with 50% CCl4 solution for 12, 8 and 4 weeks, respectively. Then, 0.2 ml 50% CCl4 solution was administered per 100 g rat weight by gavage twice a week. After all rats had reached the age of 20 weeks, rats were euthanatized by CO2. Adequate size liver samples were fixed with 10% buffer-formaldehyde solution and then embedded in paraffin blocks. The paraffin-embedded liver samples were sectioned and stained with hematoxylin and eosin (H&E) and Sirius red following standard procedures. The stages of rat liver scars were determined according to the methods proposed by Ruwart et al. [14]. All animal experiments were carried out following the guidelines of the Laboratory Animal Center of Taichung Veterans General Hospital, ROC.

2.2 TSILSS Diagnosis System

The TSILSS diagnosis system contains three approaches, respectively to segment the scar liver tissue regions from the liver tissue section images, compute the features of the extracted scar liver tissue regions, and discriminate the stage of liver scars based on the extracted features. This subsection will describe these three approaches in detail.

2.2.1 Liver Scar Tissue Segmentation

2.2.1.1 Pre-processing

To make scar liver tissue region segmentation easier, the TSILSS diagnosis system transforms each color liver tissue section image I RGB into a gray-level one. The TSILSS diagnosis system first separates the RGB color mode liver tissue section image I RGB into R, G, and B color components images R-, G-, and B-images, respectively, composed of the red, green, and blue color components of all the pixels in I RGB . It also transforms I RGB into an HSV color mode image I HSV , isolates the H, S, and V color components from I HSV , and then respectively combines the H, S, and B color components into H-, S-, and B-images [15, 16]. Figure 2 shows a color liver tissue section image and its R-, G-, B-, H-, S-, and B-images.

Fig. 2
figure 2

An original color liver tissue section image and its derivative images. a Original image. b R-image. c G-image. d B-image. e H-image. f S-image. g B-image. The arrow indicates the liver scar tissue

Obviously one can observe that the difference in the contrast of the health and scar liver tissue regions is large in the G-image. The difference in the contrast of the health and scar liver tissue regions in the H-image is also large, but some pixels in the healthy liver tissue region may be lost, i.e., the regions indicated by red arrows. To facilitate scar liver tissue region segmentation, the TSILSS diagnosis system will isolate the scar liver tissue regions from the healthy liver tissue regions on the G-image of each color liver tissue section image. We can consider the G-image as a gray-level image I 0 .

2.2.1.2 Contrast Enhancement

The TSILSS diagnosis system then uses Gamma equalization [17] to enhance the contrast of I 0 to make the liver tissues clearer. Let I 0 (x, y) be the gray level of the pixel located at the coordinates (x, y) on I 0 . Gamma equalization is then adopted to transfer I 0 into I r by:

$$I_{r} \left( {x,\;y} \right) = \left( {\frac{{I_{0} \left( {x,\;y} \right) - min_{0} }}{{max_{0} - min_{0} }}} \right)^{{r_{G} }} \times 255 ,$$
(1)

where max 0 and min 0 are the maximal and minimal gray levels of all the pixels in I 0 , and r G is a given constant. Figure 3b is the image obtained by running the Gamma equalization operation on the image in Fig. 3a.

Fig. 3
figure 3

The procedures of the image preprocessing approach. a G-Image, b Image of I r , c I O , d I b , and e I b after removing noise

2.2.1.3 Local Cross Thresholding

Figure 3b shows that the healthy liver tissue is brighter than the region of the scar liver tissue. The TSILSS diagnosis system intends to use bi-level thresholding method to label the scar liver tissue. Figure 3d demonstrates the binary image I O obtained by

$$I_{O} \left( {x,\;y} \right) = \left\{ {\begin{array}{ll} 1,& {\text{if}}\, I_{r} ( x,\;y) > T_{O} , \\ 0 ,& {\text{otherwise}} . \end{array} } \right.$$
(2)

where T O is the threshold provided by the Otsu thresholding method [18, 19] on image I r .

The areas on the right side and at the bottom left corner of the image in Fig. 3d are almost resemble the scar liver tissue, which was caused by uneven lighting. Usually, the global thresholding method cannot produce a proper result for the unevenly lit images [20]. In this study, an adaptive thresholding method was hence provided; we call it the local cross-thresholding method.

For each pixel I r (x, y) in I r , a cross region R C is given, where R C consists of all the pixels in \(\left\{ {I_{r} \left( {x + i,y} \right) \, | \, - \frac{{m_{c} - 1}}{2} \le i \le \frac{{m_{c} - 1}}{2}} \right\}{\text{ and }}\left\{ {I_{r} \left( {x,y + j} \right) \, | \, - \frac{{m_{c} - 1}}{2} \le j \le \frac{{m_{c} - 1}}{2}} \right\}.\) Let Mean g and Std g be the mean and standard deviation of the gray levels of all the pixels in I r and Mean l and Std l be the mean and standard deviation of the gray levels of all the pixels in R C . If \(\frac{{Mean_{l} }}{{Mean_{g} }} > 1,I_{r} \left( {x,y} \right)\) is located at a bright area, and a bigger threshold \(T_{b} = \frac{{Mean_{l} }}{{Std_{g}^{{r_{b} }} }}\) is given; otherwise, a smaller threshold \(T_{s} = \frac{{Mean_{l} }}{{Std_{g}^{{r_{s} }} }}\) is specified. The local cross thresholding method transfers I r into a binary image I b as follows:

If \(\frac{{Mean_{l} }}{{Mean_{g} }} > 1\), then

$$I_{b} ({\text{x, y}}) = \left\{ {\begin{array}{ll} 1 & {{\text{if}}\, I_{r} (x,\, y) > T_{b} ,} \hfill \\ 0 & {{\text{otherwise}}; } \hfill \\ \end{array} } \right.$$
(3)

else

$$I_{b} \left( {x,\;y} \right) = \left\{ {\begin{array}{*{20}l} {1,} \hfill & {\text{if }I_{r} \left( {x\text{,}\;\text{y}} \right) > T_{s} ,} \hfill \\ {0,} \hfill & {{\text{otherwise}} .} \hfill \\ \end{array} } \right.$$
(4)

Figure 3d displays the I b obtained by the local cross thresholding method on I r , where the white pixels represent the healthy liver tissue pixels, while the black pixels signify the liver scar tissue pixels.

There are tiny scar liver tissue regions with very small areas on I b in Fig. 3d. The tiny regions are considered as noise and are removed. The TSILSS diagnosis system uses a closing operation to eliminate the noise. It performs the dilation operation [21] twice and then the erosion operation twice on I b based on the 3 × 3 structure element, including 9 1-bits. Figure 3e illustrates the I b after removing noise.

2.2.2 Feature Extraction

Figure 4 presents the liver scar tissue section images with stages I, II, and III, respectively. The G-image of the liver tissue sliced from a healthy liver contains a few large uniform color regions, while the liver tissue sliced from a scarred liver consists of some healthy tissue regions and many small scar tissue regions scattered throughout the image, where the healthy tissue regions are brighter than the scar tissue regions.

Fig. 4
figure 4

The examples of the tissue section images with different liver scar stages. a Scar liver tissue at Stage I. b Scar liver tissue at Stage II. c Scar liver tissue at Stage III

The TSILSS diagnosis system, therefore, adopts five features, µ G , σ G , R A , D h , and D s , to characterize a liver tissue section image I 0 to identify the scar stage of the liver. µ G and σ G are the average and standard deviation of the gray levels of the G-image of the liver tissue section image. R A is the ratio of the areas of scar tissue regions to the areas of the healthy tissue regions.

Let h(x i , y j ) be the gray-level of the ith pixel located at coordinates (x i , y j ) on all the healthy tissue regions. Additionally, let (x h , y h ) be the central pixel of all the h(x i , y j )s, which is defined as:

$$\left\{ {\begin{array}{*{20}c} {x_{h} = \frac{{\sum\nolimits_{i = 1}^{{n_{h} }} {x_{i} } }}{{n_{h} }},} \\ {y_{h} = \frac{{\sum\nolimits_{i = 1}^{{n_{h} }} {y_{i} } }}{{n_{h} }},} \\ \end{array} } \right.$$
(5)

where n h is the number of pixels in all of the healthy tissue regions. D h is defined as follows:

$$D_{h} = \frac{{\sum\nolimits_{i = 1}^{{n_{h} }} {\sqrt {\left( {x_{i} - x_{h} } \right)^{2} + \left( {y_{i} - y_{h} } \right)^{2} } } }}{{n_{h} }} .$$
(6)

Let s(x i , y j ) be the gray-level of the ith pixel located at coordinates (x i , y j ) on all the scar tissue regions. Additionally, let (x s , y s ) be the central pixel of all the s(x i , y j )s, which is defined as:

$$\left\{ {\begin{array}{*{20}c} {x_{s} = \frac{{\sum\nolimits_{i = 1}^{{n_{s} }} {x_{i} } }}{{n_{s} }},} \\ {y_{s} = \frac{{\sum\nolimits_{i = 1}^{{n_{s} }} {y_{i} } }}{{n_{s} }},} \\ \end{array} } \right.$$
(7)

where n s is the number of pixels in all of the healthy tissue regions. D s is defined as follows:

$$D_{s} = \frac{{\sum\nolimits_{i = 1}^{{n_{s} }} {\sqrt {\left( {x_{i} - x_{s} } \right)^{2} + \left( {y_{i} - y_{s} } \right)^{2} } } }}{{n_{s} }} .$$
(8)

2.2.3 Liver Tissue Scar Stage Identification

In pattern recognition, a set of historical data is collected in advance. Let f cik be the kth feature of the ith datum in the cth cluster. Assume that there are N C clusters in the set of historical data. The center \(\left( {\bar{f}_{c1} ,\bar{f}_{c2} , \ldots ,\bar{f}_{cK} } \right)\) of the cth cluster is often used to represent each datum in the cluster, where

$$\overline{f}_{ck} = \frac{{\sum\limits_{i = 1}^{{N_{c} }} {f_{cik} } }}{{N_{c} }} ,$$
(9)

and N c is the number of data in cluster c. Each liver section image can be described by five features, µ G , σ G , R A , D h , and D s . For the ith liver section image in cluster c, (f ci1 , f ci2 , …, f ci5 ) maps to the five features (c, µ G , σ G , R A , D h , D s ) of the image.

When given a liver section image I 0 has five features (f 1 , f 2 , …, f 5 ), the TSILSS diagnosis system computes the distance d c between (f 1 , f 2 , …, f 5 ) and each cluster center as follows:

$$d_{c} = \sum\limits_{k = 1}^{K} {w_{k} \left| {f_{k} - \bar{f}_{ck} } \right|}^{{r_{k} }}$$
(10)

Here, w k and r k are the given constants. The TSILSS diagnosis system then considers I 0 to the cluster (stage) \(c^{\prime}\), while \(c^{\prime} = ARG\left( {MIN_{c = 1}^{C} d_{c} } \right)\).

If the data in a cluster are quite different, the cluster center cannot precisely depict the data in the cluster. For example, there are two clusters C 1 and C 2. The data in C 1 are very distinct, and the data in C 2 are similar. For datum X in C 1 farther from the cluster center of C 1 but closer to that of C 2, X will be mistakenly regarded as a datum in C 2, i.e., the datum X in Fig. 5a. When the data in C 1 are categorized into smaller sub-clusters, X will be specified to one of the sub-clusters in C 1 as Fig. 5b; then, one can correctly assign X to cluster C 1. Based on this property, in this paper, a two-layer recognition algorithm is provided. In the two-layer recognition algorithm, the k-means algorithm [22] is used to separate the data in each cluster into sub-clusters.

Fig. 5
figure 5

Illustrations of two clusters, C1 and C2, and datum X. a Two clusters, C 1 and C 2. b C 1 and C 2 are re-clustered into sub-clusters

The two-layer recognition algorithm uses the k-means algorithm to classify the data in the cth cluster into N cs sub-clusters. When given a liver section image I 0 has five features (f 1 , f 2 , …, f 5 ), the TSILSS diagnosis system computes the distance between (f 1 , f 2 , …, f 5 ) and the center of each sub-cluster by:

$$d_{c} = MIN_{s = 1}^{{N_{CS} }} \sum\nolimits_{k = 1}^{K} {w_{k} \left| {f_{k} - \bar{f}_{csk} } \right|}^{{r_{k} }}$$
(11)

where \(\bar{f}_{csk}\) is the kth feature of the center of the sth sub-cluster in cluster c. The two-layer recognition algorithm then considers I 0 to one element of \(c^{\prime}\), where \(c^{\prime} = ARG\left( {MIN_{c = 1}^{{N_{C} }} d_{c} } \right).\)

2.3 Parameter Decider Genetic Algorithm (PDGA)

The performance of the TSILSS diagnosis system is deeply affected by the parameters rG, mc, rb, r s , r 1 , w 1 , r 2 , w 2 , …, r 5 , and w 5 . In this study, a parameter decider genetic algorithm (PDGA) is presented to give the fittest values of r G , m c , r b , r s , r 1 , w 1 , r 2 , w 2 , …, r 5 , and w 5 .

A genetic algorithm [23,24,25] is a heuristic optimization method where a set of possible solutions represents a population of individuals. The fitness of an individual describes its degree of adaptation to the environment. A chromosome is the coordinate of an individual in the search space. A gene, encoding the value of a parameter, is a subsection of a chromosome being optimized. When given a certain population, only the individuals that adapt well to their environment can survive and transmit their characteristics to their descendants. Generally, a genetic algorithm alternatively and repetitively performs three operations, crossover, mutation, and selection, to derive the best solution.

In PDGA, each chromosome, represented by a binary string concatenated by 15 binary substrings \(s_{G} ,\,s_{c} ,\,s_{b} ,\,s_{s} ,\,s_{{r_{1} }} ,\,s_{{w_{1} }} ,\,s_{{r_{2} }} ,\,s_{{w_{2} }} , \ldots, s_{{r_{5} }} ,\,s_{{w_{5} }} ,\) and s d , consisting of \(n_{G} ,\,n_{c} ,\,n_{b} ,\,n_{s} ,\,n_{{r_{1} }} ,\,n_{{w_{1} }} ,\,n_{{r_{2} }} ,\,n_{{w_{2} }} , \ldots, n_{{r_{5} }} ,\,n_{{w_{5} }} ,\) and n d binary bits, respectively, are designated to describe \(r_{G} ,\,m_{c} ,\,r_{b} ,\,r_{s} ,\,r_{1} ,\,w_{1} ,\,r_{2} ,\,w_{2} , \ldots ,r_{5} ,\,w_{5} ,\) and dum, respectively. Here dum is a dummy value which is not a parameter in the TSILSS diagnosis system but will be used to determine the values of r G , r b , and r s . Let \(v_{G} ,\,v_{c} ,\,v_{b} ,\,v_{s} ,\,v_{{r_{1} }} ,\,v_{{w_{1} }} ,\,v_{{r_{2} }} ,\,v_{{w_{2} }} , \ldots ,v_{{r_{5} }} ,\,v_{{w_{5} }} ,\) and v d be the decimal values that \(s_{G} ,\,s_{c} ,\,s_{b} ,\,s_{s} ,\,s_{{r_{1} }} ,\,s_{{w_{1} }} ,\,s_{{r_{2} }} ,\,s_{{w_{2} }} , \ldots ,\,s_{{r_{5} }} ,\,s_{{w_{5} }} ,\) and s d describe. For each chromosome Ch, a set of \(r_{G} ,\,m_{c} ,\,r_{b} ,\,r_{s} ,\,r_{1} ,\,w_{1} ,\,r_{2} ,\,w_{2} , \ldots ,r_{5} ,\) and w 5 can be encoded as

$$r_{G} = \frac{{v_{G} }}{{v_{G} + v_{b} + v_{s} }} \times v_{d} ,$$
(12)
$$m_{c} = 2\times v_{c} + 1,$$
(13)
$$r_{b} = \frac{{v_{b} }}{{v_{G} + v_{b} + v_{s} }} \times v_{d} ,$$
(14)
$$r_{s} = \frac{{v_{s} }}{{v_{G} + v_{b} + v_{s} }} \times v_{d} ,$$
(15)
$$r_{i} = \frac{{v_{{r_{i} }} }}{{v_{{r_{1} }} + v_{{r_{2} }} + \cdots + v_{{r_{5} }} }} \times v_{d} , \,{\text{for}}\,i = 1 {\text{ to 5}},$$
(16)
$$w_{i} = \frac{{v_{{w_{i} }} }}{{v_{{w_{1} }} + v_{{w_{2} }} + \cdots + v_{{w_{5} }} }}\,,{\text{for}}\,i = 1 {\text{ to 5}} .$$
(17)

Based on the \(r_{G} ,m_{c} ,r_{b} ,r_{s} ,r_{1} ,w_{1} ,r_{2} ,w_{2} , \ldots ,r_{5} ,\) and w 5 , the TSILSS diagnosis system can be used to identify the liver scar stages and the obtained accurate rate is regarded as the fitness of the chromosome. Initially, PDGA randomly creates N c chromosomes, and we call them initial chromosomes. Then, PDGA alternatively and repeatedly performs mutation, crossover, and selection operations to determine the optimal solution:

  1. (A)

    In mutation operation:

    1. (a)

      For each chromosome Ch in the N c initial chromosomes, PDGA randomly selects one bit b from each substring in Ch.

    2. (b)

      Set each b = \(\bar{b}\), where \(\bar{b}\) is the logical complement of b.

  2. (B)

    In the crossover operation:

    1. (a)

      PDGA randomly selects N c chromosome pairs from the N c initial chromosomes.

    2. (b)

      A binary string S M is given for each selected chromosome pair Ch 1 and Ch 2 , and |S M | = |Ch 1 | = |Ch 2 |, where |S M | is the number of bits in S M .

    3. (c)

      |S M |/2 bits in S M are randomly selected.

    4. (d)

      The selected bits in S M are set to 1, while the other bits in S M are set to 0.

    5. (e)

      After that, a new chromosome Ch is created by:

      $$Ch = \left( {Ch_{1} \wedge S_{M} } \right) \vee (Ch_{2} \wedge \overline{{S_{M} }} ),$$
      (18)

      where ∧ and ∨ are “AND” and “OR” bit-logic operators.

  3. (C)

    In the selection operation: a chromosome set \(S_{c}^{'}\) with N c chromosomes is created.

    1. (a)

      Eighty percent of the chromosomes in \(S^{\prime}_{c}\) are the chromosomes with the highest fitness, selected from the N c initial chromosomes, the N c chromosomes created in the mutation operation, and the N c chromosomes produced in the crossover operation.

    2. (b)

      Twenty percent of the chromosomes in \(S^{\prime}_{c}\) are generated by a random number generator. \(S^{\prime}_{c}\) then replaces S c as the new initial chromosome set.

Furthermore, PDGA alternatively and repeatedly executes the mutation, crossover, and selection operations until the related fitnesses of the chromosomes in the initial chromosome set are very close to one another or until the number of iterations is equal to a specified constant.

3 Results and Discussion

The performances of the TSILSS diagnosis system were investigated in these experiments. In total, 108 rat liver tissue section images were used as the test data, provided by Laboratory Animal Center of Taichung Veterans General Hospital, ROC, in which 36 images were taken from the liver tissue sections of the rats in the first stage (GC1), 37 images from the liver tissue sections of the rats in the second stage (GC2), and 35 images from the liver tissue sections of the rats in the third stage (GC3).

Three experiments, A, B, and C, are performed by PDGA to probe the fittest values of the parameters used in the TSILSS diagnosis system. In experiment A, the image set S A , including all 108 images, was used as the training data; in experiment B, the image set S B , consisting of 18, 19, and 17 images randomly selected from GC1, GC2, and GC3, respectively, was applied as the training data; in experiment C, the image set S C , comprising all the images in S A but not in S B , was employed as the training data. Table 1 demonstrates the fittest values of the parameters used in the TSILSS diagnosis system, which were derived by PDGA. In this study, the following experiments adopted these obtained parameter values.

Table 1 The fittest parameter values derived by PDGA

Precision, recall, F-measure, and accuracy are frequently used statistical measures of the performance of a binary classification test [26, 27]. A true positive (TP) occurs when the condition is detected, and the condition is also actually present. A true negative (TN occurs when the condition is not detected, and the condition is actually absent. A false positive (FP) occurs when the condition is detected, but the condition is actually absent. A false negative (FN) occurs when the condition is not detected, but the condition is actually present. Precision (P), recall (R), F-measure (F), and accuracy (ACC) can be defined as:

$$P = TP/\left( {TP + FP} \right),$$
(19)
$$R = TP/\left( {TP + FN} \right),$$
(20)
$$F = { 2} \times P \times R/\left( {P + R} \right),{\text{ and}}$$
(21)
$$Acc = \, \left( {TP + TN} \right)/\left( {TP + TN + FP + FN} \right).$$
(22)

In this study, precision, recall, F-measure, and accuracy were used to measure the performances of the TSILSS diagnosis system.

Next, three experiments \(A^{\prime}\), \(B^{\prime}\), and \(C^{\prime}\) were performed to scrutinize the performances of the TSILSS diagnosis system. In experiment \(A^{\prime}\), the parameters in column Exp. A in Table 1 were adopted, and the data in S A were used as the testing data. In experiment \(B^{\prime}\), the parameters in column Exp. B in Table 1 were used and the data in S C were used as the testing data. In experiment \(C^{\prime}\), the parameters in column Exp. C in Table 1 were employed and the data in S B were used as the testing data. Table 2 shows that all the precision, recall, and F-measures provided by the TSILSS diagnosis system were over 92%, and the accuracy was over 86%. The Average column in Table 2 displays the averages of the precision, recall, F-measure, and accuracy obtained by the TSILSS diagnosis system. On average, the precision, recall, and F-measure offered by the TSILSS diagnosis system were greater than 94.80, and the accuracy was close to 90%.

Table 2 The experimental results obtained by the TSILSS diagnosis system

To investigate the performance of the local cross-thresholding method, in this study, the Otsu thresholding method was also used to derive the threshold on image I r to transform I r into I b . Column Otsu in Table 2 shows that the average results obtained by the method were identical to the TSILSS diagnosis system, except that the local cross-thresholding method was replaced by the Otsu thresholding method.

In this experiment, I r was partitioned into 5 × 5 regions, shown in Fig. 6. For each pixel in R(i, j), the threshold T R was set to the average gray-level of all the pixels in all the regions R(x + i, y + j), for -1 ≤ i, j ≤ 1. Then, I r was converted into I b by

Fig. 6
figure 6

Partitioning I r into 5 × 5 regions

$$I_{b} \left( {x,\;y} \right) = \left\{ {\begin{array}{*{20}l} {1,} \hfill & {\text{if }I_{r} \left( {x\text{,}\;\text{y}} \right) > T_{R} , } \hfill \\ {0,} \hfill & {{\text{otherwise}} .} \hfill \\ \end{array} } \right.$$
(23)

We call this method the local region thresholding method. The Region column in Table 2 illustrates that the experimental results obtained by the method were identical to the TSILSS diagnosis system, except that the local region thresholding method was substituted for the local cross-thresholding method. Obviously, one can observe that the local cross-thresholding method can provide much better results than the Otsu thresholding method and the local region thresholding method.

4 Conclusions

In this study, the TSILSS diagnosis system was used to identify the liver scar stage from liver tissue section images. In the TSILSS diagnosis system, the local cross-thresholding method is proposed to determine the fittest threshold. The TSILSS diagnosis system employs five features, µ G , σ G , R A , D h , and D s , to characterize a liver scar tissue section image. In addition, a two-layer recognition algorithm is proposed to distinguish the liver scar stage. A genetic-based algorithm, PDGA, is presented to derive the most suitable parameters used in the TSILSS diagnosis system as well. The experimental results also show that the TSILSS diagnosis system can provide impressive results.

The traditional manual stage detection of liver cirrhosis or liver cancer is an expensive, time-consuming, labor-intensive, and subjective task for doctors to observe a large number of medical images. The scar liver tissue areas are distinct in different liver cirrhosis stages; nevertheless, for the human eye, it is difficult to verify the severity of liver tissue injury from a liver tissue section image, especially for an inexperienced physician. The TSILSS diagnosis system will be of great assistance for doctors if the method is used in medical diagnoses. It is also helpful for exploring the effects of a new medicine in animals.