0% found this document useful (0 votes)
10 views9 pages

YOLOv8 for Brain Tumor Segmentation

This study presents a deep learning approach using the YOLOv8 model for segmenting gliomas in brain MRI images, addressing challenges such as irregular shapes and data imbalance. The proposed method incorporates a hybrid CNN architecture with dropout regularization and a two-phase training procedure, achieving a segmentation accuracy of 0.93 on the BRATS 2020 dataset. The research aims to enhance the efficiency and accuracy of automated brain tumor detection, ultimately improving patient outcomes.

Uploaded by

Savan kumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views9 pages

YOLOv8 for Brain Tumor Segmentation

This study presents a deep learning approach using the YOLOv8 model for segmenting gliomas in brain MRI images, addressing challenges such as irregular shapes and data imbalance. The proposed method incorporates a hybrid CNN architecture with dropout regularization and a two-phase training procedure, achieving a segmentation accuracy of 0.93 on the BRATS 2020 dataset. The research aims to enhance the efficiency and accuracy of automated brain tumor detection, ultimately improving patient outcomes.

Uploaded by

Savan kumar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Brain Cancer Segmentation Using YOLOv8 Deep

Neural Network

Savan Kumar,1 Umesh Chandra Pati,2 Pranshu Jena3

Department of Electronics and Communication Engineering


National Institute of Technology, Sector-1, Rourkela, Odisha, 769008
120EC0866@[Link]

Abstract. Gliomas are highly invasive and life-threatening brain tu-


mors characterized by exceptionally rapid growth. Segmenting gliomas
using computer-aided diagnosis is a challenging task due to their irregular
shapes and diffused boundaries with surrounding areas. Magnetic Reso-
nance Imaging (MRI) is the most widely employed method for imaging
structures of interest in the human brain. This study presents a deep
learning-based approach that utilizes different MRI modalities for brain
tumor [Link] proposed hybrid convolutional neural network
(CNN) architecture employs a patch-based approach, taking into account
both local and contextual information while predicting output labels.
To address overfitting, the network incorporates dropout regularization
alongside batch normalization, while a two-phase training procedure is
employed to tackle the data imbalance [Link] proposed method in-
cludes a preprocessing step, where images are normalized and bias field
corrected, followed by a feed-forward pass through the CNN, and a post-
processing step to remove small false positives around the skull portion.
Additionally, the YOLOv8 (You Only Look Once) model, a state-of-
the-art object recognition algorithm, is utilized to obtain segmentation
[Link] proposed method is validated on the BRATS 2020 dataset,
achieving a score of 0.93 accuracy for the whole tumor region. These re-
sults demonstrate an improvement compared to existing state-of-the-art
techniques.

Keywords: Convolutional Neural Network, Brain Tumors,Deep Learn-


ing Models, Classification, You Only Look Once[YOLO], YOLOv8 , Seg-
mentation, Object Detection

1 Introduction
Brain tumor is an abnormal growth of brain tissue. There are two types of
tumors i.e. benign and malignant. The most dangerous malignant type is glioma
which is difficult to trace because of its shape , size, texture being too similar
to normal brain tissue.[?,?,?,?,?,?]. Hence we use object detection techniques
for the detection of tumor. The You Only Look Once (YOLO) is a method that
provides object detection using neural networks. The popularity of this algorithm
is due to its accuracy and [Link] YOLO algorithm has earned acclaim for
2 Savan Kumar, Umesh Chandra Pati, Pranshu Jena

its prowess in object detection using neural networks, renowned for its precision,
speed, and versatile application across diverse objects. Its core attributes are:

• Speed: YOLO’s predictive capabilities accelerate object detection processes.


• High accuracy: YOLO consistently delivers precise results with minimal
background errors.
• Learning capabilities: With robust learning abilities, YOLO efficiently dis-
cerns object representations, enhancing its detection accuracy.

In the area of medical imaging, early detection and precise diagnosis of brain
tumors are paramount for effective treatment planning and patient outcomes.
Leveraging meticulous digital processing, medical image analysis endeavors to
discern abnormal brain tissues from healthy ones. Automated methods, such as
those employing YOLO, have garnered attention for their potential to streamline
brain tumor segmentation and detection processes. Notably, YOLO has evolved
through successive versions, with YOLOv8 representing the latest advancement.
Compared to its predecessors, YOLOv8 boasts enhanced speed and efficiency, op-
timizing computational resources to facilitate processing of large medical imag-
ing datasets. Its refined architecture integrates [?] state-of-the-art techniques,
augmenting accuracy in object detection, particularly in identifying brain tu-
mors with precision while minimizing false positives, harnessing the capabilities
of YOLOv8. This project endeavors to advance the frontier of automated brain
tumor detection and classification. Through this exploration, we aim to enhance
the efficiency, accuracy, and reliability of medical image analysis, ultimately im-
proving patient outcomes in the diagnosis and treatment of brain tumors. Please
note that the first paragraph of a section or subsection is not indented. The first
paragraph that follows a table, figure, equation etc. does not need an indent,
either.

2 METHODOLOGY

2.1 YOLOv8

YOLO (You Only Look Once), a popular object detection and image segmen-
tation model, was developed by Joseph Redmon and Ali Farhadi at the Univer-
sity of Washington. Launched in 2015, YOLO quickly gained popularity for its
high speed and accuracy.YOLOv8 is the latest version of YOLO by Ultralytics.
Nano(n),Small(s),Medium(m),Large(l), and extra-large (x) are the four major
variants of YOLOv5, each of which offers increasingly higher accuracy rates. As
a cutting-edge, state-of-the-art (SOTA) model, YOLOv8 builds on the success
of previous versions, introducing new features and improvements for enhanced
performance, flexibility, and efficiency. YOLOv8 supports a full range of vision
AI tasks, including detection, segmentation, pose estimation, tracking, and clas-
sification. This versatility allows users to leverage YOLOv8’s capabilities across
diverse applications and domains.
Brain Cancer Segmentation Using YOLOv8 Deep Neural Network 3

Fig. 1. YOLOv8 Architecture

2.2 Attention Module


The attention mechanism in computer vision is inspired by the way humans
focus visually. Its main purpose is to filter out the most relevant information
for a given task from a large dataset. There are two primary types of atten-
tion mechanisms: soft and hard. The soft attention mechanism assigns varying
degrees of importance to different parts of the output data, while the hard at-
tention mechanism only provides binary outputs of 0 or 1. The soft attention
is commonly used because it facilitates easier back-propagation in the network.
For instance, Chen et al[] and colleagues developed an innovative convolutional
network for generating image captions by incorporating spatial and channel at-
tention modules. In[], Schlemper et al. proposed a gated attention module that
allows a model to focus on specific areas of an image, thus making the model’s
decision-making process more interpretable. Additionally, Fu et al.[] employed
a self-attention mechanism to effectively capture the complex interdependencies
within a scene for better segmentation.

Spatial Attention The channel attention block primarily amplifies features


associated with gliomas while attenuating irrelevant ones. However, it faces chal-
lenges in precisely localizing the spatial location of the glioma. To address this
limitation, we incorporated a spatial attention block into our attention layer,
offering several [Link] spatial attention block enhances segmentation ac-
curacy by emphasizing pivotal input features. Additionally, it effectively miti-
gates the influence of noisy or inconsequential features by selectively amplifying
or attenuating them based on their relevance. Moreover, it expedites both the
training and inference processes by reducing the volume of data processed by the
4 Savan Kumar, Umesh Chandra Pati, Pranshu Jena

model. Furthermore, it provides transparency into the model’s decision-making


process by visualizing the attention weights assigned to different input regions.

2.3 Dataset

The dataset selected for the implementation of the YOLOv8 architecture was
the BraTS2020 [20], which was introduced as part of the MICCAI BraTS Chal-
lenge 2020. The BraTS2020 dataset comprises multimodal scans stored in the
NIfTI file format, a widely adopted format for brain image data. Various pa-
rameters were included in the dataset release, such as T1 (native images), T2
FLAIR (Fluid Attenuated Inversion Recovery), T2 (weighted image), and T1c
(contrast-enhanced image). Originating from 19 different institutions using var-
ious scanners, the BraTS2020 dataset was primarily divided into tasks focused
on predicting patient survival, segmenting sub-regions of tumors, and analyzing
pre-operative MRI images. Given the prominent reputation and quality of the
BraTS challenges, the BraTS2020 dataset was chosen for this research.A sample
image of the training dataset has shown in Fig.2.

Fig. 2. Sample image of BraTS2020 training dataset

3 Experiment Description

3.1 Train and Validation ratio

In this study, we utilized YOLOv8 from Ultralytics for segmentation tasks,


achieving competitive results. YOLO requires image datasets paired with corre-
sponding text files, organized into training and validation folders. A (.yaml) file
Brain Cancer Segmentation Using YOLOv8 Deep Neural Network 5

specified paths and classes, a feature essential in newer YOLO versions. After
preprocessing and segmentation, the dataset was split 80:20 for training and val-
idation, enabling assessment of the model’s performance on unseen data during
training.

3.2 Hyper-parameters and Hardware Setup

The script handles data through annotations_path, a JSON file with anno-
tations, and images_path and path, directories containing image data. For
image visualization and processing, it utilizes matplotlib, PIL, and cv2, en-
abling tasks like drawing bounding boxes and displaying images. Object de-
tection is performed using the Ultralytics YOLO model, with the pre-trained
detection_model loaded from “[Link]”, and predictions made via detection
_model.predict().
Annotation processing features functions such as convert() for bounding
box coordinates and plot_annotations() for visualizing annotations. Data pre-
processing is supported by create_bbox_json() and show_image() for generat-
ing annotations and displaying images, respectively. Model training employs the
SiameseResNet, a Siamese network based on ResNet, and the TripletLoss func-
tion, optimized using [Link](). Additional components like Spatial
Attention Block and SSEBlock enhance feature representation, while utility
functions like get_activation() and compute_results() aid in convolutional
layer operations and result computation. The script also uses [Link]() and
[Link]() for directory operations and tabulate for data display.

Fig. 3. Sample image of BraTS2020 training dataset


6 Savan Kumar, Umesh Chandra Pati, Pranshu Jena

For the hardware setup on Kaggle , a dual GPU configuration with two
NVIDIA T4 GPUs was utilized. This high-performance GPU setup enhances the
computational capabilities required for intensive machine learning tasks, such as
object detection in brain tumor images. The use of dual NVIDIA T4 GPUs
enables efficient parallel processing, accelerating the prediction and inference
processes of the object detection model. This hardware configuration ensures
faster model training and inference, contributing to more efficient and timely
analysis of medical imaging data for brain tumor detection as shown in Fig[3].

3.3 Proposed Approach

The provided methodology outlines a systematic strategy for brain tumor de-
tection within a Kaggle environment, leveraging a dual GPU setup with two
NVIDIA T4 GPUs for robust computational power. Central to this approach is
the utilization of the YOLOv8 architecture, a cutting-edge real-time object de-
tection system employed to discern bounding boxes and labels in brain tumor im-
ages. Furthermore, this methodology integrates sophisticated feature representa-
tion methods by embedding a Spatial Attention Module within a SiameseResNet
model. This model enhancement incorporates attention mechanisms, including
the Spatial Squeeze and Spatial Excitation (SSE) Block, and a Spatial Atten-
tion Block. These mechanisms optimize the model’s focus on pertinent features
in the input data, potentially enhancing tumor detection accuracy by highlight-
ing critical regions in medical [Link] preprocessing segment manages the
conversion of annotations for training and the generation of bounding box labels
in JSON format. Additionally, it offers data visualization features, facilitating
the inspection of randomly chosen training images with annotations to con-
firm preprocessing accuracy. Subsequent to preprocessing and visualization, the
attention-enriched SiameseResNet model is defined and trained using a triplet
loss function. This loss function is tailored for triplet-based learning, designed
to reduce the distance between anchor-positive pairs and increase the distance
between anchor-negative pairs, thereby promoting effective feature learning.

Fig. 4. Proposed Architecture Flowchart


Brain Cancer Segmentation Using YOLOv8 Deep Neural Network 7

4 Results and Discussion

Fig. 5. Proposed Architecture


Fig. 6. Second Architecture Flowchart
Flowchart

Fig. 7. Proposed Architecture


Fig. 8. Second Architecture Flowchart
Flowchart

Displayed equations are centered and set on a separate line.

x+y =z (1)

Please try to avoid rasterized images for line-art diagrams and schemas. When-
ever possible, use vector graphics instead (see Fig. 11).

Theorem 1. This is a sample theorem. The run-in heading is set in bold, while
the following text appears in italics. Definitions, lemmas, propositions, and corol-
laries are styled the same way.
8 Savan Kumar, Umesh Chandra Pati, Pranshu Jena

Fig. 9. Proposed Architecture Fig. 10. Second Architecture


Flowchart Flowchart
Table 1. Table captions should be placed above the tables.

Heading level Example Font size and style


Title (centered) Lecture Notes 14 point, bold
1st-level heading 1 Introduction 12 point, bold
2nd-level heading 2.1 Printing Area 10 point, bold
3rd-level heading Run-in Heading in Bold. Text follows 10 point, bold
4th-level heading Lowest Level Heading. Text follows 10 point, italic

Proof. Proofs, examples, and remarks have the initial word in italics, while the
following text appears in normal font.
For citations of references, we prefer the use of square brackets and consecutive
numbers. Citations using labels or the author/year convention are also accept-
able. The following bibliography provides a sample reference list with entries
for journal articles [1], an LNCS chapter [2], a book [3], proceedings without
editors [4], and a homepage [5]. Multiple citations are grouped [1–3], [1, 3–5].

Acknowledgments. A bold run-in heading in small font size at the end of the paper
is used for general acknowledgments, for example: This study was funded by X (grant
number Y).

Disclosure of Interests. It is now necessary to declare any competing interests


or to specifically state that the authors have no competing interests. Please place
the statement with a bold run-in heading in small font size beneath the (optional)
acknowledgments1 , for example: The authors have no competing interests to declare
that are relevant to the content of this article. Or: Author A has received research
grants from Company W. Author B has received a speaker honorarium from Company
X and owns stock in Company Y. Author C is a member of committee Z.

References
1. Author, F.: Article title. Journal 2(5), 99–110 (2016)
1
If EquinOCS, our proceedings submission system, is used, then the disclaimer can
be provided directly in the system.
Brain Cancer Segmentation Using YOLOv8 Deep Neural Network 9

ϱϬ
ϰϱ
ϰϬ ĂƚĂ
ϯϱ ĂƚĂ
ϯϬ
Ϯϱ
ϮϬ
ϭϱ
ϭϬ
ϱ
Ϭ
Ϭ ϱ ϭϬ ϭϱ ϮϬ Ϯϱ ϯϬ

Fig. 11. A figure caption is always placed below the illustration. Please note that short
captions are centered, while long ones are justified by the macro package automatically.

2. Author, F., Author, S.: Title of a proceedings paper. In: Editor, F., Editor, S.
(eds.) CONFERENCE 2016, LNCS, vol. 9999, pp. 1–13. Springer, Heidelberg (2016).
[Link]
3. Author, F., Author, S., Author, T.: Book title. 2nd edn. Publisher, Location (1999)
4. Author, A.-B.: Contribution title. In: 9th International Proceedings on Proceedings,
pp. 1–2. Publisher, Location (2010)
5. LNCS Homepage, [Link] last accessed 2023/10/25

Common questions

Powered by AI

Gliomas' irregular shapes and diffuse boundaries make them difficult to differentiate from normal brain tissue. Their resemblance in texture and appearance to healthy tissues challenges segmentation models in effectively delineating tumor margins, requiring sophisticated algorithms and preprocessing techniques to improve detection accuracy .

Attention mechanisms in YOLOv8 aid brain tumor segmentation by filtering out the most relevant information from datasets. The spatial attention block, in particular, enhances segmentation accuracy by highlighting critical features and mitigating the impact of irrelevant features, thereby expediting training and inference processes while providing interpretability of the model's decision-making .

The BraTS2020 dataset is suitable because it comprises multimodal MRI scans in a widely adopted format, which are essential for comprehensive analysis in medical imaging. Featuring a variety of parameters and originating from multiple institutions, this dataset supports robust training and evaluation of segmentation models, such as YOLOv8, in predicting patient survival and segmenting tumor sub-regions .

YOLOv8 achieves high processing speed by optimizing its architecture for efficient computation across large datasets. The integration of advanced features and streamlined resource use allows for real-time object detection without sacrificing accuracy, making it suitable for processing extensive medical imaging datasets with minimal delay .

SiameseResNet, when combined with YOLOv8, leverages advanced feature representation techniques. Attention mechanisms such as the Spatial Squeeze and Spatial Excitation (SSE) Block focus the model on relevant features, improving detection accuracy by highlighting critical regions in medical images. This integration promotes effective learning of features pertinent to tumor detection, enhancing overall model performance .

Using dual NVIDIA T4 GPUs offers substantial computational power, enabling efficient parallel processing which accelerates the training and inference of the YOLOv8 model. This setup supports intensive deep learning tasks, reduces training times, and enhances the throughput of medical image analysis, leading to faster and more effective brain tumor detection .

Dropout regularization and batch normalization mitigate overfitting by introducing randomness and maintaining mean and variance in activations, respectively. Dropout prevents reliance on specific neurons by randomly disabling them during training, promoting generalized learning. Batch normalization stabilizes learning across different mini-batches, allowing for higher learning rates and reducing the likelihood of overfitting .

YOLOv8 enhances brain tumor segmentation through its refined architecture that integrates state-of-the-art techniques, which optimize computational resources and improve object detection accuracy with precision. Compared to its predecessors, YOLOv8 offers enhanced speed and efficiency, facilitating the processing of large medical imaging datasets and minimizing false positives .

The Spatial Attention Block improves accuracy by selectively emphasizing critical input features associated with gliomas while reducing the influence of noisy elements. This targeted focus facilitates precise localization of tumors and enhances model efficiency by reducing data volume during processing, leading to better accuracy and faster inference times .

Preprocessing assists YOLOv8 by normalizing images and correcting bias fields, preparing data before it is fed into the network. This step reduces noise and standardizes input images, ensuring that the network trains effectively and reduces false positives, thereby improving the model's accuracy in detecting brain tumors .

You might also like