# TumourScope - Mapping Tumors with Precision
## Early Breast Cancer Detection Using Ultrasound Images
.png?raw=true)
### Overview :
Tumourscope is an advanced AI-powered diagnostic tool designed specifically
to aid medical professionals in the detection and evaluation of breast tumors
using ultrasound scans. Unlike traditional diagnostic methods, this model not
only classifies tumors as benign, malignant, or normal but also highlights the
precise regions of interest where tumor densities are significantly higher
compared to surrounding tissues. This feature provides a visual aid for
radiologists and oncologists, enabling them to pinpoint suspicious areas with
greater accuracy. By improving the localization of tumors, Tumourscope
enhances the efficiency of biopsy procedures, reducing the risk of false
negatives and supporting early and accurate diagnosis.
### Problem Statement

Breast cancer remains a significant health challenge, with delayed diagnosis
leading to reduced survival rates and increased mortality. Studies show that
nearly 70% of women with breast cancer face diagnostic delays, leading to a
73% higher risk of death compared to those diagnosed promptly.
Early and accurate detection of breast tumors is critical for improving patient
outcomes and reducing mortality rates. However, current diagnostic
procedures, such as Fine-Needle Aspiration (FNA), are prone to high false negative rates (ranging from 2% to 25%) due to challenges like tumor size,
location, and operator experience. Furthermore, delays in diagnosis and the
inability to precisely localize tumor regions complicate biopsy procedures,
leading to late-stage cancer detection and suboptimal treatment outcomes.
There is a pressing need for a solution that not only identifies
tumors in ultrasound scans but also highlights the precise regions of interest,
assisting medical professionals in performing accurate and targeted biopsies.
Such a tool can significantly enhance diagnostic efficiency, reduce delays, and
improve the accuracy of early-stage breast cancer detection, ultimately aiding
in better treatment planning and patient care.
### Scope :
The Tumourscope project aims to develop an AI-powered diagnostic tool for breast tumor detection using ultrasound scans, classifying tumors as benign,
malignant, or normal, and highlighting regions of interest with higher tumor
densities for improved localization. The deliverables include a trained model, an
algorithm for tumor region highlighting, a user interface in the form of a website for medical professionals, and documentation. Additionally , a Medical Report can be downloaded as a PDF from the website .
### Target Audience:

The target audience for TumourScope is healthcare professionals specializing in oncology and radiology , and diagnostic technicians, who require advanced tools to assist in professional breast cancer diagnosis.
Designed exclusively for clinical settings, TumourScope aims to enhance
diagnostic accuracy and efficiency, particularly in identifying malignant tumors
through ultrasound scans. It is intended for use in hospitals, specialized cancer
treatment centers, and diagnostic labs, supporting professionals in making
informed decisions and improving early detection rates.
### System Architecture

**1.Frontend (Client-Side):**
-Developed using React and Material-UI, providing the user interface for medical professionals.
-Handles user interactions such as registration, login, image uploads, and viewing analysis results.
-Communicates with the Node.js backend for user authentication and data management.
**2.Node.js Backend (API Server):**
-Serves as the primary API gateway for the frontend.
-Manages user authentication (login, registration) and authorization.
-Handles the storage and retrieval of detection results in the SQLite database.
-Receives processed image data and analysis results from the Python backend.
**3.Python Backend (AI/Image Processing Service):**
-A Flask application dedicated to image processing and AI-driven tumor detection.
-Utilizes a Random Forest model , trained on medical image datasets.
-Receives raw image data from the Node.js backend.
-Performs image preprocessing, runs the tumor detection algorithm, and generates various processed image outputs (binary, contours, overlay) along with prediction and confidence scores.
-Sends these comprehensive results back to the Node.js backend for storage and display.
**4.SQLite Database:**
-A lightweight, file-based database used for persistent storage.
-Stores user information and all detection results, including prediction, confidence, timestamps, and base64 encoded image data.
### Data Flow Diagram

### Technology Stack
### Frontend (React)
- React 18.2.0
- Material-UI (MUI) for UI components
- React Router for navigation
- Axios for API requests
- jsPDF for report generation
### Backend (Node.js)
- Express.js server
- SQLite database
- JWT authentication
- Multer for file uploads
- Python-Shell for Python script integration
### Image Processing (Python)
- Flask server
- OpenCV for image processing
- NumPy for numerical operations
- Custom tumor detection model
### Core Features
- 1.**User Authentication:** Users can register for new accounts and log in to access the application's functionalities securely.
- 2.**Image Upload:** Medical professionals can upload medical images (e.g., scans) for analysis.
- 3.**AI-Powered Tumor Detection:** The core functionality involves an AI model that processes uploaded images to detect tumors. It provides predictions and confidence scores.
- 4.**Result Viewing:** Users can view the results of their image uploads, including the AI's detection output and processed images.
- 5.**Privacy Policy & Terms and Conditions:** The application includes blocks for users to review the privacy policy and terms and conditions, ensuring transparency and compliance.
- 6.**Download Medical Report:** A precise medical report can be downloaded which contains user details , timestamp of result, interpretation ,prediction ,confidence and Images.
### Security:

The **Digital Personal Data Protection (DPDP) Act, 2023** is India’s law for protecting personal data. It governs how websites, apps, or organizations collect, store, process, and transfer digital personal data of individuals and places obligations on those processing the data.
Regulations implemented according to the Act:
1. **Obtain Valid Consent (Section 6–7)**
Status: Implemented.
- The `Register.jsx` file now includes a consent checkbox that users must check before registering. If not checked, an error "You must agree to the terms and conditions." is displayed.
- The consent is tied to a clear action (checking a box) and is required for registration.
2. **Notice to Users (Section 5)**
Current Status: Implemented.
- The `Register.jsx` file links to "Privacy Policy" and "Terms and Conditions" via modals.
- The content of these sections mentions data usage and contact information.
3. **Implement Reasonable Security Measures (Section 8(5))**
Current Status: Partially Implemented.
- HTTPS (SSL encryption): To be handled at the deployment/server level.
- Strong authentication mechanisms (hashed passwords): Implemented. The `auth.js` file interacts with a User model that handles password hashing.
encryption at rest and in transit: In transit is assumed via HTTPS. At rest, passwords are hashed, but other data (user details, detection results, images) is stored in SQLite ( `tumorscope.db` )
- Access control for admin/backend: The `auth.js` uses JWT tokens for authentication and authorization.
4. **Data Localization or Cross-border Transfer (Section 16)**
Current Status: Partially Implemented.
- The project uses SQLite, which stores data locally within the application's environment. The location of deployment (server hosting) would determine final data localization.
5. **Grievance Redressal Mechanism (Section 11)**
Current Status: Implemented.
- A "Contact Us" section with an email ( tumourscope@gmail.com ) has been mentioned in the Privacy Policy modal. This serves as a basic grievance redressal point.
### Proposed Features vs Additional Features
| PROPOSED | ADDITIONAL |
| ------------------------------------------------ | -------------------------------------------------------------------------- |
| Result = only numerical prediction value | Result = prediction value + processed image showing probable tumour region |
| Webpage only as UI to upload image and get result | Webpage fully developed with User Authentication and database management |
| No Cybersecurity measures | Cybersecurity measures according to DPDP Act 2023 |
| Training of Model with every upload | Train once , upload infinite times |
| Results only displayed on screen | Results can be downloaded as PDF as Medical Report |
### Future Improvements
- **Enhanced AI Model:** Integrate more advanced deep learning models (e.g., CNNs) for improved accuracy and robustness in tumor detection.
- **Multi-Modal Data Support:** Allow upload and analysis of other medical data types (e.g., MRI, CT scans, pathology reports) alongside ultrasound images.
- **Internationalization/Localization:** Support multiple languages for the user interface and medical reports.
- **Breach Notification System:** Establish a system for detecting data breaches and promptly notifying affected users and relevant authorities (Data Protection Board).
- **Cloud Deployment:** Deploy the application to a cloud platform (e.g., AWS, Azure, Google Cloud) for better scalability, reliability, and managed services.
### [User Manual](https://hackmd.io/@hWnKIxm9QpGshi8_iz0VQA/B1NaurwPgl)
### Video Demonstration
<iframe width="560" height="315" src="https://www.youtube.com/embed/GuWddqZC1qY?si=0taZYIKM7Fuucirr&start=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
### [GitHub Repository](https://github.com/AV-Sohan-Aiyappa/TumourScope/tree/main)
### Conclusion
The TumourScope project is a robust web application designed to assist medical professionals in the early detection of tumors through AI-powered image analysis. Leveraging a multi-tiered architecture with a React.js frontend, Node.js backend, and a Python-based AI processing unit, it provides a streamlined workflow for image upload, AI detection, and report generation.
Furthermore, the project demonstrates a foundational commitment to data privacy and security, with explicit consent mechanisms and secure password handling. Future enhancements, particularly in comprehensive DPDP Act compliance, scalability, and advanced AI integration, will further solidify its position as a valuable tool in medical diagnostics, ultimately contributing to better patient outcomes through efficient and accurate tumor detection.
### References
- https://pmc.ncbi.nlm.nih.gov/articles/PMC4114209/#:~:text=Median
- https://drjayanam.com/blogs/can-breast-biopsy-results-beinaccurate/#:~:text=Studies
- https://ascopubs.org/doi/10.1200/GO.23.00148#:~:text=Nearly
- https://www.kaggle.com/datasets/fhabibimoghaddam/breast-ultrasoundimages
- https://www.datacamp.com/tutorial/random-forests-classifier-python
- https://nodejs.org/en
- https://react.dev/
- https://www.sqlite.org/
- https://expressjs.com/
- https://www.npmjs.com/package/jspdf
- https://mui.com/material-ui/
- https://www.npmjs.com/package/axios