0% found this document useful (0 votes)
9 views

Srs

Uploaded by

mohi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Srs

Uploaded by

mohi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 36

3D MRI Brain Tumor Segmentation

Software Requirements Specification

VERSION 1.0

Group Id: F24PROJECT50F63

Supervisor Name: Muhammad Hashir Khan

1
Revision History

Date Version Description Author


(dd/mm/yyyy)
04/12/2024 1.0 This project explores the use of BC210209889
deep learning techniques for
3D segmentation of brain
tumors, enabling the
development of automated and
efficient diagnostic tools. Using
the BraTS2019 dataset, the
project incorporates advanced
models such as Capsule
Networks to achieve accurate
tumor delineation. The
segmentation results are
evaluated using robust metrics
like the Dice Score and
Hausdorff Distance to ensure
reliability.

2
Table of Contents

Introduction.................................................................................................................... 5
Scope of Project.............................................................................................................6
Functional and Non Functional Requirements............................................................7
Functional Requirements:........................................................................................................7
Non-Functional Requirements:................................................................................................8
Use Case Diagram(s)..................................................................................................... 9
Dataset.......................................................................................................................... 10
1. Total Patients......................................................................................................................10
2. MRI Modalities..................................................................................................................10
3. Data Format........................................................................................................................10
Usage Scenarios.......................................................................................................... 14
Use Case 1: Data Collection...................................................................................................14
Use Case 2: Data Integrity Verification.................................................................................15
Use Case 3: Image Preprocessing..........................................................................................16
Use Case 4: Dataset Splitting.................................................................................................17
Use Case 5: Deep Learning Model Training..........................................................................18
Use Case 6: Model Evaluation...............................................................................................19
Use Case 7: Noise Reduction.................................................................................................20
Use Case 8: Image Resizing...................................................................................................21
Use Case 9: Tumor Segmentation..........................................................................................22
Use Case 10: Tumor Classification........................................................................................23
Use Case 11: Generate Tumor Report....................................................................................24
Use Case 12: View Tumor Report.........................................................................................25
Use Case 13: Treatment Planning..........................................................................................26
Use Case 14: Download Report.............................................................................................27
Adopted Methodology................................................................................................. 29
Waterfall Model:....................................................................................................................29

3
Agile Model:..........................................................................................................................31
VU Process Model........................................................................................................33
The VU Process Model Phases...................................................................................34
Work Plan (Use Ms Project to Create Schedule/ Work Plan)....................................36

4
Introduction

The primary objective of this project is to develop an advanced brain tumor segmentation model
using deep learning and image processing techniques. This project focuses on processing brain
MRI scans to identify and segment brain tumors accurately, providing valuable insights for
medical diagnoses. The scope includes the collection and preprocessing of MRI images from a
reliable dataset, such as the BraTs2019 dataset, which contains annotated MRI images of brain
tumors. These images will be carefully pre-processed to enhance their quality and suitability for
analysis, including operations such as noise reduction, normalization, and resizing.

Next, the dataset will be divided into training, validation, and testing subsets to ensure that the
deep learning model is properly trained and validated while preventing overfitting. The
segmentation task will be tackled using state-of-the-art deep learning models, with a focus on
advanced architectures like Capsule Networks (CapsNet), which have shown promise in medical
image segmentation tasks. The model will be trained to accurately segment various types of
brain tumors, including gliomas, meningiomas, and pituitary tumors.

The evaluation of the model will be a critical aspect of this project, and it will be conducted
using robust metrics such as Dice Score and Hausdorff Distance, which are specifically designed
to assess the accuracy and precision of segmentation results. These metrics will ensure that the
model's performance is not only reliable but also clinically relevant. Ultimately, the project aims
to contribute to the field of medical image processing by improving the accuracy and efficiency
of brain tumor segmentation, which can lead to better diagnoses, treatment planning, and patient
outcomes. By leveraging deep learning techniques in combination with the BraTs2019 dataset,
the project aspires to advance the capabilities of AI in healthcare and medical imaging.

5
Scope of Project

Brain tumor segmentation is a crucial task in medical image analysis, and it has significant
implications for diagnosis, treatment planning, and monitoring the progression of brain tumors.
Image processing is a powerful field of study that has numerous real-world applications. It
involves the manipulation of digital images to extract useful information or enhance specific
features. In this project, we aim to explore the fascinating realm of image processing and its
applications in the healthcare domain, specifically in the context of brain tumor segmentation.
This project centres on the realm of medical imaging, specifically the challenging task of brain
tumor segmentation using deep learning techniques. Brain tumors are abnormal growths of tissue
within the brain that can be cancerous or non-cancerous. Accurate and early diagnosis is
essential for timely treatment and improved patient outcomes.

The scope of a brain tumor segmentation project typically involves several key aspects:

 Image acquisitions
 Pre-processing
 Data annotation
 Algorithm development
 Integration with clinical workflow
 Real – time processing
 Multi- modality integrations
 Post-processing and visualization
 Clinical application

Brain tumor segmentation projects often require collaboration between computer scientists,
medical professionals, and imaging experts to ensure the development of robust and clinically
relevant solutions. The scope can vary depending on the specific goals of the project and the
available data and resources.

6
Functional and Non Functional Requirements

Functional Requirements:

1. Data Collection and Preprocessing:


o Import the BraTS2019 dataset from BraTS2019 Dataset.
o Ensure data integrity by verifying completeness and quality of MRI scans.
o Preprocess the images, including:
 Intensity normalization.
 Noise reduction using filters.
 Resizing to ensure uniform dimensions across the dataset.

2. Dataset Splitting:
o Divide the dataset into the following sets:
 Training Set (70%): For model training.
 Validation Set (20%): For hyperparameter tuning.
 Testing Set (10%): For performance evaluation.
o Use stratified sampling to maintain class distributions across sets.

3. Deep Learning Model Development:


o Design and implement a Capsule Network architecture for 3D tumor
segmentation.
o Incorporate 3D convolutional layers to capture volumetric features of brain MRI
scans.
o Use transfer learning to fine-tune the model on the BraTS2019 dataset.

4. Model Training:
o Employ advanced optimization techniques like Adam Optimizer with a
scheduled learning rate decay.
o Use loss functions tailored for segmentation, such as Dice Loss and Binary
Cross-Entropy Loss.

7
o Implement real-time data augmentation to improve generalization, including
rotation, flipping, and random cropping.

5. Model Evaluation:
o Evaluate the model using key metrics:
 Dice Score: To measure segmentation overlap.
 Hausdorff Distance: To assess the spatial accuracy of segmentation.
o Generate visual outputs to compare ground truth and model predictions.

6. User Interface:
o Develop a simple user interface (UI) using tools like Flask or Streamlit.
o Allow users to:
 Upload an MRI scan.
 View segmented output along with a confidence score.
 Download the processed image.

7. Accessibility and Optimization:


o Ensure the system supports GPU acceleration for faster training and inference.
o Optimize the model for deployment, reducing inference time while maintaining
accuracy.

Non-Functional Requirements:

1. Performance: The system should process a 3D MRI scan within 2-3 seconds during
inference.
2. Scalability: The model and infrastructure should support the addition of more MRI
datasets and segmentation types.
3. Reliability: Maintain consistent and accurate segmentation results across all scans.
4. Usability: The UI should be intuitive, allowing medical professionals to upload, analyze,
and download results with ease.
5. Security: Ensure all uploaded medical data is stored securely and complies with privacy
standards (e.g., HIPAA).

8
6. Maintainability: The codebase should be modular and well-documented for future
enhancements.
7. Portability: The system should be deployable across various platforms, including local
machines and cloud environments.

Use Case Diagram(s)

Figure 01: Use case diagram

9
Dataset
The dataset used in this project is the BraTS 2019 Dataset (Brain Tumor Segmentation
Challenge), which is widely recognized for benchmarking brain tumor segmentation tasks in
medical imaging. This dataset includes MRI scans of patients diagnosed with High-Grade
Gliomas (HGG) and Low-Grade Gliomas (LGG). It provides multimodal imaging data,
segmented tumor regions, and other annotations essential for training and evaluating machine
learning models.

1. Total Patients

 The dataset comprises a total of 214 patients, categorized as follows:


o 165 patients with High-Grade Gliomas (HGG).
o 49 patients with Low-Grade Gliomas (LGG).

2. MRI Modalities

Each patient has five different MRI scans, covering the following modalities:

 FLAIR: Fluid Attenuated Inversion Recovery.


 T1: T1-weighted imaging.
 T1CE: T1-weighted imaging with contrast enhancement.
 T2: T2-weighted imaging.
 SEG: Ground-truth segmentation mask (annotated by experts).

10
3. Data Format

 All images are stored in the .nii.gz (NIfTI) format, which is widely used for medical
imaging data.
 Files are named based on the patient ID and MRI modality. Examples of file names:
o BraTS19_2013_10_1_flair.nii.gz
o BraTS19_2013_10_1_t1.nii.gz
o BraTS19_2013_10_1_t1ce.nii.gz
o BraTS19_2013_10_1_t2.nii.gz
o BraTS19_2013_10_1_seg.nii.gz

Dataset Details:

1. Source

The dataset is provided by the Medical Image Computing and Computer-Assisted


Intervention (MICCAI) Society as part of the BraTS 2019 Challenge.

It can be accessed from the BraTS 2019 Data Repository.

2. Image Modalities

Each patient scan includes the following four MRI modalities:

T1-weighted (T1): Native anatomical imaging.

Post-contrast T1-weighted (T1Gd): Highlights enhancing tumor regions.

T2-weighted (T2): Highlights fluid-filled regions.

T2-FLAIR: Suppresses fluid signals and highlights abnormalities.

3. Image Preprocessing

Co-registered to a common anatomical template.

11
Interpolated to a voxel size of 1 mm³ resolution.

Skull-stripped to remove non-brain tissues.

Ground Truth Annotations

1. Segmentation Labels

Label 1: Necrotic and non-enhancing tumor core (NCR/NET).

Label 2: Peritumoral edema (ED).

Label 4: GD-enhancing tumor (ET).

2. Annotation Process

Performed manually by 1 to 4 expert raters.

Approved by board-certified neuroradiologists.

3. Tumor Sub-Regions

The dataset supports the segmentation of three distinct glioma sub-regions:

Enhancing tumor.

Edema.

Tumor core.

Data Splitting

1. Training Set

12
Includes MRI scans with ground truth labels.

Used for model training and internal evaluation.

2. Validation Set

MRI scans provided without ground truth labels.

Used for preliminary evaluation on unseen data.

3. Testing Set

Includes MRI scans with a limited-time availability (48 hours).

Participants must upload predictions for final evaluation.

Data Accessibility

Participants are permitted to use only the provided dataset, unless explicitly stated otherwise. If
additional private data is used for augmentation, results must also include experiments based
solely on the BraTS 2019 dataset to ensure fairness and comparability.

13
Usage Scenarios

Use Case 1: Data Collection


 Use Case Title: Data Collection

 Use Case ID: US-01

 Actors: Admin

 Description:
The admin collects data from the BraTS2019 dataset for brain tumor segmentation.

 Pre-conditions:

o Admin has access to the BraTS2019 dataset link.

 Task Sequence:

1. Admin accesses the BraTS2019 dataset link.

2. Admin downloads the dataset.

3. Admin verifies the dataset for completeness.

 Alternative Paths:

o If the dataset link is broken, the admin selects an alternative source.

 Exceptions:

14
o The dataset may be unavailable due to network issues.

 Post-conditions:

o Dataset containing MRI scans is obtained and ready for preprocessing.

 Author: BC210209889

Use Case 2: Data Integrity Verification


 Use Case Title: Data Integrity Verification

 Use Case ID: US-02

 Actors: Admin

 Description:
The admin verifies the integrity of the MRI scans to ensure quality for further analysis.

 Pre-conditions:

o Dataset is successfully downloaded.

 Task Sequence:

1. Admin checks the completeness of the dataset.

2. Admin verifies the quality of MRI images.

3. Admin filters out corrupted or incomplete scans.

 Alternative Paths:

o If corrupted data is found, the admin replaces it with correct data.

 Exceptions:

15
o Corrupted MRI files may need to be excluded from further analysis.

 Post-conditions:

o High-quality, complete MRI scans are available for processing.

 Author: BC210209889

Use Case 3: Image Preprocessing


 Use Case Title: Image Preprocessing

 Use Case ID: US-03

 Actors: Doctor

 Description:
The doctor preprocesses the MRI scans to enhance their quality for segmentation.

 Pre-conditions:

o Verified dataset with complete MRI scans is available.

 Task Sequence:

1. Doctor uploads MRI scans into the preprocessing module.

2. System normalizes image intensity.

3. System reduces noise using filters.

4. System resizes images for uniformity.

 Alternative Paths:

o If noise reduction is ineffective, the doctor adjusts filter settings.

16
 Exceptions:

o If resizing causes significant distortion, alternate dimensions are chosen.

 Post-conditions:

o Pre-processed MRI images are ready for segmentation.

 Author: BC210209889

Use Case 4: Dataset Splitting


 Use Case Title: Dataset Splitting

 Use Case ID: US-04

 Actors: Admin

 Description:
The admin splits the dataset into training, validation, and testing sets.

 Pre-conditions:

o Pre-processed MRI images are ready.

 Task Sequence:

1. Admin splits the dataset into 70% training, 20% validation, and 10% testing.

2. Admin ensures the distribution of tumor types is consistent across the sets.

3. Admin stores each set in separate directories.

 Alternative Paths:

o If imbalance occurs, the admin adjusts the splitting strategy.

17
 Exceptions:

o The splitting may fail if data is not structured correctly.

 Post-conditions:

o Dataset is divided into training, validation, and test sets.

 Author: BC210209889

Use Case 5: Deep Learning Model Training


 Use Case Title: Deep Learning Model Training

 Use Case ID: US-05

 Actors: Doctor

 Description:
The doctor trains a Capsule Network model for 3D tumor segmentation.

 Pre-conditions:

o Dataset is split and pre-processed.

 Task Sequence:

1. Doctor sets up the Capsule Network model.

2. System trains the model on the training dataset.

3. Model's performance is evaluated on the validation dataset.

 Alternative Paths:

o If the model underperforms, the doctor tunes hyperparameters.

18
 Exceptions:

o Insufficient hardware resources may cause training failure.

 Post-conditions:

o A trained model is ready for tumor segmentation.

 Author: BC210209889

Use Case 6: Model Evaluation


 Use Case Title: Model Evaluation

 Use Case ID: US-06

 Actors: Doctor

 Description:
The doctor evaluates the trained model's performance using evaluation metrics.

 Pre-conditions:

o The model is trained and ready for evaluation.

 Task Sequence:

1. Doctor runs the model on the testing dataset.

2. System calculates Dice Score and Hausdorff Distance.

3. Doctor reviews the evaluation results.

 Alternative Paths:

o If performance is insufficient, the doctor retrains the model with adjusted parameters.

19
 Exceptions:

o Evaluation may fail if the model is incompatible with the testing set.

 Post-conditions:

o Model performance is assessed and documented.

 Author: BC210209889

Use Case 7: Noise Reduction


 Use Case Title: Noise Reduction

 Use Case ID: US-07

 Actors: Doctor

 Description:
The system reduces noise in MRI scans using advanced filtering techniques.

 Pre-conditions:

o Pre-processed MRI images are available.

 Task Sequence:

1. The doctor loads MRI images into the noise reduction module.

2. The system applies noise filters (e.g., Gaussian or median filters).

3. The doctor verifies the denoised images.

 Alternative Paths:

o If noise persists, the doctor adjusts filter parameters.

20
 Exceptions:

o Highly noisy images may not be completely recoverable.

 Post-conditions:
Noise-free MRI images are generated.

 Author: BC210209889

Use Case 8: Image Resizing


 Use Case Title: Image Resizing

 Use Case ID: US-08

 Actors: Doctor

 Description:
MRI scans are resized to ensure uniform dimensions for model input.

 Pre-conditions:

o Pre-processed MRI images are available.

 Task Sequence:

1. The doctor loads MRI images into the resizing module.

2. The system resizes images to predefined dimensions.

3. The doctor reviews resized images for consistency.

 Alternative Paths:

o If resizing results in loss of important details, the doctor may adjust dimensions.

 Exceptions:

21
o Corrupted images cannot be resized.

 Post-conditions:
Uniformly resized MRI images are generated.

 Author: BC210209889

Use Case 9: Tumor Segmentation


 Use Case Title: Tumor Segmentation

 Use Case ID: US-09

 Actors: Doctor

 Description:
The system segments brain tumors from MRI images using the trained model.

 Pre-conditions:

o A trained segmentation model is available.

o Pre-processed MRI images are ready for input.

 Task Sequence:

1. The doctor uploads MRI images into the segmentation module.

2. The system applies the segmentation model to detect tumors.

3. The doctor reviews segmented outputs.

 Alternative Paths:

o If segmentation is inaccurate, the doctor adjusts preprocessing or model settings.

22
 Exceptions:

o Errors in the segmentation module may halt the process.

 Post-conditions:
Accurate tumor segmentation results are generated.

 Author: BC210209889

Use Case 10: Tumor Classification


 Use Case Title: Tumor Classification

 Use Case ID: US-10

 Actors: Doctor

 Description:
The system classifies segmented tumors as malignant or benign.

 Pre-conditions:

o Tumor segmentation is complete.

 Task Sequence:

1. The doctor loads segmented tumor data into the classification module.

2. The system applies the classification model to determine tumor type.

3. The doctor reviews the classification results.

 Alternative Paths:

o If classification confidence is low, the doctor re-evaluates the segmentation process.

23
 Exceptions:

o The system cannot classify poorly segmented tumors.

 Post-conditions:
Tumors are classified accurately.

 Author: BC210209889

Use Case 11: Generate Tumor Report


 Use Case Title: Generate Tumor Report

 Use Case ID: US-11

 Actors: Doctor, Patient

 Description:
The system generates a report detailing the segmentation and classification results.

 Pre-conditions:

o Tumor segmentation and classification are complete.

 Task Sequence:

1. The doctor initiates the report generation.

2. The system compiles segmentation metrics, tumor type, and size.

3. The doctor reviews and approves the report.

 Alternative Paths:

o If report generation fails, the doctor retries the process.

24
 Exceptions:

o Corrupted output data prevents report generation.

 Post-conditions:
A detailed tumor report is generated and ready for sharing.

 Author: BC210209889

Use Case 12: View Tumor Report


 Use Case Title: View Tumor Report

 Use Case ID: US-12

 Actors: Patient, Doctor

 Description:
The patient and doctor access the generated tumor report.

 Pre-conditions:

o A tumor report is available.

 Task Sequence:

1. The patient or doctor logs into the system.

2. The system displays the tumor report.

3. The user reviews the report details.

 Alternative Paths:

o If the report is inaccessible, the system retries loading it.

25
 Exceptions:

o System downtime prevents report viewing.

 Post-conditions:
The tumor report is successfully reviewed.

 Author: BC210209889

Use Case 13: Treatment Planning


 Use Case Title: Treatment Planning

 Use Case ID: US-13

 Actors: Doctor

 Description:
The doctor uses segmentation and classification results to create a treatment plan.

 Pre-conditions:

o Tumor reports are available.

 Task Sequence:

1. The doctor reviews tumor segmentation and classification results.

2. The doctor formulates a treatment plan based on tumor size and type.

3. The treatment plan is documented and shared with the patient.

 Alternative Paths:

o If report details are unclear, the doctor may conduct further analysis.

26
 Exceptions:

o Missing data delays treatment planning.

 Post-conditions:
A comprehensive treatment plan is created.

 Author: BC210209889

Use Case 14: Download Report


 Use Case Title: Download Report

 Use Case ID: US-14

 Actors: Patient, Doctor

 Description:
The patient or doctor downloads the generated tumor report for offline use.

 Pre-conditions:

o A tumor report is available in the system.

 Task Sequence:

1. The user logs into the system.

2. The user selects the download option for the tumor report.

3. The system provides the report in a downloadable format (e.g., PDF).

 Alternative Paths:

o If download fails, the user retries.

27
 Exceptions:

o System downtime prevents the report from being downloaded.

 Post-conditions:
The report is successfully downloaded and stored offline.

 Author: BC210209889

28
Adopted Methodology

Waterfall Model:

The waterfall model is a linear or sequential approach to project management and work
based on fixed dates, requirements and outcomes. It’s made up of the following phases:
Requirements, Design, Implementations, Verification and Maintenance. Each phase is run
through only once. The results of each preceding phase are used as assumptions in the
subsequent phase. The waterfall model is one of the earliest models of software development,
and tasks are executed in a sequence manner where we start from the top with feasibility and
flow down through various tasks with implementation into live environment.

Advantages:

 Clear structure: The waterfall model uses a clear and defined set of steps

 Predictability: The model is reliable and predictable.

 Minimal scope creep: The model has well-defined roles and responsibilities.

 Precise project plans and firm deadlines

Disadvantages:

 Lack of flexibility: Once a phase is complete, changes are not allowed

 Fewer opportunities to course correct.

 Unsuitable for project with changing requirements

29
Figure 02: Waterfall model

Agile Model:

30
The agile method refers to a software development approach based on iterative
development. It breaks tasks into smaller iterations or parts which do not directly involve long-
term planning. It is a continuous iterative process that involves development and testing activities
together. It is a combination of both iterative and spiral model. It is people-focused and results-
focused.

Advantages:

 Speed: agile model allows for rapid development

 Flexibility: The model is adapted to changes

 Improved quality

 Complex visibility of the progress of each project in real-time

 Stakeholder’s engagement

Disadvantages:

 Difficult in project management and scaling for large projects

 Lack of predictability

 Difficulty in measuring progress

 Documentation tends to get sidetracked, which makes it harder for new members to get
up to speed.

31
Figure 03: Agile Model

VU Process Model

The VU Process Model is a comprehensive approach that merges the benefits of both the
Waterfall and Agile models, making it an ideal choice for complex projects such as brain tumor
segmentation. The project initiation begins with a meticulous definition of the requirements,

32
followed by the design of the software architecture, adhering to the principles of the Waterfall
model. This step ensures that the project has a well-defined scope and a robust plan in place. The
next phase involves translating the design into code. This is done using the Agile model, which is
characterized by small, frequent iterations of development and testing. This approach allows for
quick feedback and adjustments to be made in response to changing needs or challenges that may
arise during the development process.

Once the code units are developed, they are integrated and tested as a complete system.
This crucial step ensures that the software meets the predefined quality standards and functions
as expected. Following the testing phase, the software is deployed, and its performance is closely
monitored and evaluated. This allows the team to identify any areas of improvement or potential
issues that may impact the software’s performance. Post-deployment, any updates or fixes are
implemented using the Agile model. This ensures that the software is continuously improved and
maintained, thereby enhancing its efficiency and usability. The VU Process Model is particularly
suitable for this project as it offers a clear structure and predictability from the Waterfall model,
while also providing the flexibility and adaptability of the Agile model. This hybrid approach
ensures that the project is well-managed, adaptable to changes, and results in high-quality,
efficient software.

The VU Process Model Phases

1. Requirements Analysis:
Define the requirements for the brain tumor segmentation. This could include the type of
images the software should be able to process, the accuracy of the segmentation, etc.

2. System and Software Design:


Design the software architecture. This could involve choosing the algorithms for image

33
processing, machine learning models for segmentation, etc.

3. Implementation and Unit Testing:


Implement the design into code in small, manageable iterations. Each iteration could
involve a specific aspect of the brain tumor segmentation process, such as improving the
accuracy of the segmentation algorithm, optimizing the software for speed, etc. Unit
testing is done concurrently to ensure that each unit functions as expected.

4. Integration and System Testing:


After all units are implemented, they are integrated and the software as a whole is tested
to ensure it meets the requirements. This could involve using a test dataset of brain
images to evaluate the performance of the segmentation.

5. Operation and Maintenance:


Once the software is deployed, its performance is monitored in an iterative manner.
Necessary updates or fixes are made based on feedback from users or new findings in the
field of brain tumor segmentation.

34
Figure 04: VU Process Model

35
Work Plan (Use Ms Project to Create Schedule/ Work Plan)

Figure 05: Work plan

36

You might also like