2.4 Learning Phase
From training data illustrated as Table 2, in the learn-
ing phase, we construct the classifiers by using SVM
(support vector machine) and DNN (deep neural net-
work). Here, we adopt SVM as the library pro-
vided from OpenCV (Keahler and Bradski, 2013)
whose kernel is CHI2 (Li et al., 2010). Also we
adopt DNN as Caffe (convolutional architecture for
fast feature embedding) based on the rayer structure
of AlexNet (Krizhevsky et al., 2017).
For SVM, we construct the classifier to detect
Gram types by using feature values as features for
candidate regions of bacteria. Here, we adopt features
as the area, the aspect size, the aspect ratio, the color
and the circularity of the region, and also the number
of detected bacteria in the region.
On the other hand, for DNN, we construct the
classifier to detect Gram types by using images for
candidate regions of bacteria as training data.
2.5 Detecting and Retrieving Phase
In the detecting and retrieving phase, after setting a
sample and a file path, referring to the button “Re-
fer,” on GUI, our system starts to detect four Gram
types. Then, it outputs, for each of SVM and DNN,
the occurrence ratio of every Gram type, the main im-
age such that the substance is enclosed by a colored
rectangle if it belongs to one Gram type and the three
subimages whose occurrence ratio is similar. Here,
we can change the main image or subimages by SVM
and DNN.
Figure 2 illustrates the output of our detection sys-
tem for the sample of blood and DNN. Here, in the
main image, the Gram types of GPC, GPB, GNC,
GNB, GPU and GNU are enclosed by frames colored
by blue, light blue, red, pink, light green and black,
respectively.
In Figure 2, the left windows in the detection sys-
tem represents the occurrence ratio for every Gram
type. The upper three images are the original image,
the result by SVM and the result by DNN from left to
right. The right three images are similar images as the
original image.
3 EXPERIMENTAL RESULTS
In this section, we give experimental results for our
detecting system of Gram types. Here, computer
environment to the learning phase is CPU Intel(R)
Xeon(R) E5-1603 v3 @2.80GHz, RAM 32.0GB and
OS Windows 10 Pro for Workstations. The samples
consist of blood, sputum, feces, pus and urine. In this
section, we use the images to assigned the occurrence
ratio of Gram types by the professional technician,
which we call the images to assigned ratios. Then,
the number of the images to assigned ratios for blood,
sputum, feces, pus and urine is 42, 40, 10, 40 and 69,
respectively, and the total number of the images to as-
signed ratios is 201.
3.1 Parameters
Table 3 illustrates the parameters for image process-
ing for Section 2.2 applied to experimental results.
Here, we denote the size of neighbor for adaptive
thresholding by N, the subtractive constant by C and
the number of opening processings by P. Also we de-
note the upperbound an the lowerbound for the area
as the candidate regions of bacteria by S
min
and S
max
,
those for the aspect ratio by A
min
and A
max
, and those
for the circularity by C
min
and C
max
.
Table 3: The parameters for image processing applied to
experimental results.
sample N C P S
min
S
max
A
min
A
max
C
min
C
max
blood 257 37 2 200 30000 0.1 1.0 0.1 1.0
sputum 431 37 2 130 30000 0.1 1.0 0.1 1.0
feces 281 18 2 300 30000 0.1 1.0 0.1 1.0
pus 301 38 2 150 15000 0.1 1.0 0.1 1.0
urine 581 35 2 200 50000 0.1 1.0 0.1 1.0
3.2 Detection of Gram Classes
Figures 3, 4 and 5 illustrate the results obtained by de-
tecting Gram types by SVM and DNN from arbitrary
selected images for blood, sputum and feces and by
searching their similar images.
The images in Figures 3, 4 and 5 are those to as-
signed ratios. Then, Table 4 illustrates the assigned
and detected occurrence ratios of Gram types for
blood (Figure 3), sputum (Figure 4) and feces (Fig-
ure 5) by SVM and DNN.
Table 4 shows that, in these images, whereas the
detected occurrence ratios by SVM is more similar
as the assigned occurrence ratios than those by DNN,
the accuracy is too insufficient to detect Gram types
exactly. For all the cases, every detected Gram type
contains GPU and GNU. A large ratio of GNU fol-
lows that the stained dusts are detected as GNU.
3.3 Evaluation for Detection
In order to evaluate the method to detect the Gram
types, by using the assigned ratio of the occurrences