Professional Documents
Culture Documents
Grammarly (IEEE-1) Detection of Acid-Fast Bacilli (AFB) in Slit Skin Smear Microscopy Using MASK R-CNN Algorithm
Grammarly (IEEE-1) Detection of Acid-Fast Bacilli (AFB) in Slit Skin Smear Microscopy Using MASK R-CNN Algorithm
[IEEE-1] Detection Of Acid-Fast Bacilli (AFB) In Slit Skin Smear Microscopy Using M…
General metrics
29,716 4,521 225 18 min 5 sec 34 min 46 sec
characters words sentences reading
speaking
time time
95 103 103
Issues left Critical Advanced
Plagiarism
This text hasn’t been checked for plagiarism
Writing Issues
60 Clarity
7 Wordy sentences
47 Passive voice misuse
4 Intricate text
2 Unclear sentences
41 Engagement
41 Word choice
2 Delivery
1 Tone suggestions
1 Incomplete sentences
Word Length 5
Measures average word length characters per word
1
Detection of Acid-Fast Bacilli (AFB) In Slit-Skin Smear Microscopy Using MASK
R-CNN Algorithm
Joshua John L. Cabunilas, Kean Jayther P. Ponio, Jocelyn F. Villaverde, Belen
Lardizabal Dofitas
School of Electrical, Electronics, and Computer Engineering, Mapua University
658 Muralla St, Intramuros, Manila, 1002 Metro Manila
1jjcabunilas@mymail.mapua.edu.ph
2kjpponio@mymail.mapua.edu.ph
3jfvillaverde@mapua.edu.ph
4belendofitas@gmail.com
1
Abstract— This study focuses on the development of a diagnostic system for
acid-fast bacilli (AFB) detection in leprosy cases. AFB, known to be responsible
for causing Leprosy, can be identified and quantified through slit skin smear
2
examinations. To automate this process, we propose the implementation of a
Mask R-CNN (Region-based Convolutional Neural Network) model with a
RESNET50 backbone architecture. The Model generates three outputs:
classification, bounding boxes, and instance segmentation, enabling the
3
detection, classification, and quantification of AFB. To train the Model, a
dataset of over 300 images of AFB was collected and manually annotated. Data
4
augmentation techniques were applied to increase the dataset size. The Model
5
was trained to classify AFB into three categories: solids, fragmented, and
clumps. The proposed system provides a reliable and automated AFB detection
and classification solution, enhancing Leprosy's diagnostic process. It
demonstrates the feasibility of using a compact and cost-effective Raspberry
Pi setup for image processing, making it accessible in resource-limited
settings. Furthermore, the evaluation of the system shows a percent difference
of 21.74%, indicating its effectiveness compared to traditional methods.
skin, which is then stained and examined under a microscope. The presence of
acid-fast bacilli, indicated by fine red rods, confirms the presence of
Mycobacterium leprae and, thus, the diagnosis of leprosy. It is worth noting
that Mycobacterium leprae has the slowest doubling time of any known
organism and has proven difficult to cultivate in laboratory settings [1].
13
Such methods that were performed are artificial neural networks and machine
14
learning which the studies were very promising. The artificial neural network
method performed better than machine learning since the artificial neural
network showed multiclass attributes. However, the machine learning
approach has an advantage because of automatically selecting parameters.
Other methods focused on random forest (RF) as one of the most effective
algorithms developed by Leo Breiman [2]. The research focused on predicting
the operational classification of a given leprosy case [3]. Another method
15 16
focused on image processing, RGB image analysis, is performed. A binary
17
picture is constructed to extract data from pixels belonging to the bacilli class,
with the coordinates of these pixels specified. Conversion from RGB to HSV is
18
performed, and contrast enhancement is processed and then converted back
from HSV to RGB [4]. The present method used for the detection of Acid-fast
Bacilli is by a Derma Pathologist who can detect, classify, and quantify the
Acid-fast Bacilli seen in the microscope, quantifying and classifying the AFB
matters, which helps in the diagnosis process. This method is done manually by
19
classifying and counting each of the AFB seen by the Derma Pathologist, which
results in a heavy workload in the diagnosis process, and the technology
involved for detection is only a microscope. Previous studies suggested that
microscopic image processing is reliable and efficient in laboratory diagnosis
tests, and it has shown a significant improvement in Biotechnology.
classifying and quantifying Acid-Fast Bacilli (AFB). (3) To validate and quantify
the system's output using percent difference.
Hence, this study served as a basis and reference for other researchers in the
20
field of Image Recognition with the use of MASK R-CNN in extracting the slit
skin smear to determine the classification and quantification of Acid-fast
Bacilli. With the development of image recognition algorithms, this could have
become more convenient and less time-consuming. The purpose was to know
21
and understand whether the use of the MASK R-CNN Algorithm was significant.
However, this study is limited to identifying the classification and
22
quantification of Acid-fast Bacilli. Since it is based on a neural network, the
23
performance is dependent on the quantity of dataset to be trained. The more
24
dataset, the more accurate the result is. Since the dataset of AFB is limited on
the internet, Derma Pathologist will provide us with the dataset taken from
25
their archives. The system will be written in Python with KERAS and
TensorFlow. The image recognition will not include other bacteria in the slit skin
smear. The hardware of the system will use a raspberry pi camera.
Methodology
Conceptual Framework
Figure 1 shows the conceptual framework of the hardware prototype. For the
26
input, the captured stock images of acid-fast bacilli will be needed to train and
27
test the Model. The stock images will be provided by our adviser derma
pathologist Dra. Belen Dofitas.
Software Development
48
400+ images which is not enough to train from scratch; therefore the purpose
of pre-trained Model is to reduce the time of training and fine tunes the pre-
49
trained Model to match the features of the Bacilli. A new model is created after
training the Model. This Model is exclusive only in detecting three objects
50
which are "SOLIDS," "CLUMP," and "FRAGMENTED" the Model plays a big role in
classification and quantification.
51
Model validation is where the validation dataset will be used, and these
datasets are images that do not belong to training the Model. Validation
52
datasets also undergo image preprocessing before feeding to the algorithm,
53 54,55
trained model weights are loaded, and preprocessed images are fed to MASK
R-CNN. If the algorithm does not detect any Bacilli, it will proceed to dataset
validation. A derma pathologist will confirm that there are no Bacilli in the
56 57
image. If the algorithm does detect Bacilli, it will then proceed to a conditional
statement that asks if the accuracy is acceptable. The accuracy is determined
by how many the algorithm counted and compared to counted Bacilli by the
58
derma pathologist. The accuracy is acceptable if the difference between the
59
actual and experimental is very small.
This module's input is the image captured by the Raspberry camera. The image
undergoes image processing, including converting BGR to RGB color format and
60
resizing it. The most important object detection process is loading the Model of
the trained weight. This Model contains the data to be able to detect a specific
61 61
object. Without the trained Model, the algorithm will be useless. The
62
preprocessed image is fed to the MASK R-CNN algorithm. Then its output will
be the bounding box, classification, and instance segmentation (MASK),
detecting whether it is single bacilli, clumps, or both, then proceeds to count
objects detected. If no Bacilli is detected, it outputs no Bacilli detected. The
counting process is storing of names of the detected object in an array and
getting the size of that array, therefore, identifying the number of Bacilli
63
detected.
Training The Model
Roboflow. The image is labeled by tracing each Bacilli and naming its classes.
70
The annotation data will be in a JSON file format which will be extracted in the
71
image and annotations preprocessing.
78
between accuracy and speed. It shows the results when setting the image
79 80
resolution. When the resolution is set to the highest (2560 x 1920), the number
of sliced images is 18 slices, thus increasing the accuracy of the Mask RCNN.
Still, the results may take longer to show, and, on some occasions, the
raspberry pi fails to process the image due to memory error.
The GUI also consists of a browse button that allows one to browse the
captured image in the raspberry pi. It will show an image preview when an
81
image is selected. After processing the image, it will show the number of Bacilli
detected, the Bacilli classification, and the results. The prediction results will
not show up automatically after it processes the image. It will only save the
82
predictions to your local drive. The result based on Figure 5 is shown below.
Testing Datasets were used for comparing MASK R-CNN quantifications and
83
actual quantifications. These datasets were not used in training the Model, and
it also shows the percentage difference between the two quantifications, which
84
is calculated using equation 3.5. Based on the actual classification, MASK R-
CNN performs well in classifying the Bacilli, whether clumps, solids, or
fragments. However, in terms of quantifications, it cannot detect some very
small and faded Bacilli. Images with a 0% difference between the actual and
predicted are images containing very large and not faded Bacilli, which is
distinguishable. To calculate for overall percent difference of the system, use
equation 3.6, shown below.
To calculate the overall percent difference, it must take the sum of all percent
differences per classification, in this case, 7.39257, and divide by the total
85 86
number of classifications per image which is 34 since some of the images
87
contains 2 – 3 classifications, the overall percent difference of the system is
88
21.74%. Based on the overall difference of the system, the Model was able to
classify and quantify the Bacilli. To improve the overall accuracy of the Model,
more datasets that include clear images are needed.
Conclusion
The Model performs well in classifying the Bacilli based on the result table.
Sometimes, the Model has difficulty distinguishing the solids and the
fragmented Bacilli because they look similar. The factor that affects the Model
89
from distinguishing the solids and fragmented is that some Bacilli show as
91 90
faded and are classified as solids in actuality. Still, the Model predicts that
92
faded Bacilli are considered fragmented. Since the Model was trained using a
medium to large-looking Bacilli, factors that affect the accuracy of the Model
93
are a test or actual images having a very small and complex-looking Bacilli
example of this is if 3-5 Bacilli are stacked together, the Model is not able to
detect. Another factor is the quality of the captured image. Since the camera
used is a Raspberry version 1 camera, having 5 megapixels does not produce
high-quality images, which loses the detail of a very small Bacilli. The solution
94
to this problem is we use image preprocessing, where the input image is sliced
95 96
into parts depending on the image size, and each sliced image is fed to the
97
Model one by one. This slightly increases its accuracy and time it shows the
predictions. We conclude that the Model needs to be trained again, with a
much more dataset containing very small to large Bacilli and complex-looking
98
Bacilli. We also conclude that there will be trade-offs between accuracy,
quality of the image, and performance. The higher the image quality, the more
accurate the predictions, but the time of results may take a long time because
of the limited processing power of the Raspberry Pi 4. We conclude that a
99
Raspberry Pi camera was used to capture Acid-Fast Bacilli, the MASK R-CNN
algorithm was used for classifying and quantifying Acid-Fast Bacilli, and we
were able to validate and quantify the output using percent difference, the
overall percent difference based on the result is 21.74%.
Recommendation
These are ways to improve the build quality and software of the device. The
current researchers advise future researchers to use the YOLO (You Only Look
Once) Algorithm. Due to its ability to provide a satisfactory trade-off between
100
accuracy and real-time processing, it has become a widely favored option for
object detection. This characteristic makes it well-suited for various
applications. Also, the device can detect the same datasets faster and is
101 102
cheaper since the device needed will only be used on Raspberry Pi 3b+ and not
the latest Raspberry Pi 4. The device can be fixed onto the microscope so that
103
the researchers will not have a hard time placing the device onto the
microscope lens when detecting live acid-fast bacilli datasets. We also
recommend using a laptop or PC on our algorithm since running the algorithm
is much more convenient and faster. Another thing is the camera of the device.
Since we are detecting bacteria from the microscope, we need a better
megapixel camera for a better resolution and a much more accurate reading.
References
S. T. Cole et al., "Massive gene decay in the leprosy bacillus," Nature,
vol. 409, no. 6823, 2001, doi: 10.1038/35059006
J. Dharamsey, M. J. Mehta, M. J. Dharamsey, and P. Domal, "Classification of
Leprosy using Artificial Neural Networks and Machine Learning Clinical Text
Mining of Electronic Health Records to Classify Leprosy Patients Cases View
misuse
26. the captured stock images of acid-fast bacilli will be Passive voice Clarity
needed misuse
misuse
91. The factor that affects the Model from distinguishing Unclear Clarity
the solids and fragmented is that some Bacilli show sentences
as faded and are classified as solids in actuality.
102. the device needed will only be used Passive voice Clarity
misuse