Coder Social home page Coder Social logo

papafranku4647 / cancerdetectnet Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 1.41 GB

Harnessing Deep Learning for Enhanced Mammogram Analysis

License: MIT License

Python 100.00%
breast-cancer-classification convolutional-neural-network deep-learning machine-learning neural-network pytorch pytorch-implementation classification models pretrained-models

cancerdetectnet's Introduction

CancerDetectNet

CancerDetectNet is a mammogram classifier built with PyTorch. The model uses a Convolutional Neural Network to determine whether a given mammogram image shows normal breast tissue, a malignant mass, or a benign mass. The model is quite accurate, and was trained using over 16,000 unique images pulled from various online sources.

Table of Contents

Introduction

The concept of using Neural Networks in the medical field is nothing new. The idea is actually quite popular, because gaining knowledge and actionable insights from complex data remains a key challenge in transforming health care. The importance of early and accurate breast cancer detection can not be understated, as breast cancer is the second leading cause of death among women globally. This project aims to tackle the classification of mammogram images taken by x-ray machines, and classify them into their respective categories. The categories are Malignant, Benign, and Normal. The model was trained on the images from the CBIS Dataset, the INbreast Dataset, and the MIAS Dataset.


Examples of Training Images

Implementation

CancerDetectNet was developed using Python 3.10 and PyTorch. The model's training and validation were performed using datasets from CBIS, INbreast, and MIAS, among others, to ensure comprehensive learning and accuracy.

Results

The model achieved a remarkable accuracy of 94.2% on a validation set of approximately 5,000 unseen images, effectively diagnosing 19 out of every 20 mammograms.

  • Training Time: 1.5 hours on an NVIDIA 4080 GPU
  • Training Epochs: 100
  • Final Accuracy: 94.2%

Training Loss and Accuracy Over Time

Model Evaluation

Installation

For Windows Users:

Step 1: Install Python 3.10.6 from the official Python website.

Step 2: Install Git from its official website or use your package manager of choice.

Step 4: Open cmd using the Windows Start Button: cmd

Step 3: Clone the repository: git clone https://github.com/PapaFranku4647/CancerDetectNet.git

Step 4: Navigate to the CancerDetectNet directory: cd CancerDetectNet

Step 5: Install the required Python dependencies: pip install -r requirements.txt

To Download Training Images (Requires a Wi-Fi connection):

  • cd Downloading
  • python download_pics.py

Using the Model:

To use the model on the downloaded test images, follow these instructions:

For pre-downloaded or sample images: Execute the provided command scripts or use the Python interface as documented.

For custom images: Modify the evaluate_model.py file to point to your image directory: test_dataset = datasets.ImageFolder(root='../Augmented_Images', transform=test_transform)

Ensure the directory structure follows this format, with subfolders for each image category:

  • Normal_Pics
  • Benign_Pics
  • Malignant_Pics

Note: Images must be 256x256 grayscale PNG images for compatibility with the model.

Technical Details

The model's architecture includes:

  • 2 Convolutional Layers
  • 2 Max Pooling Layers
  • 2 Fully Connected Layers

Training was conducted on an NVIDIA 4080 GPU, taking approximately 1.5 hours to complete.

Model Architecture

Citations

Contributing

I am eager to form a community around this project. If you've developed a custom-trained model and want to contribute, or if you have any other contributions in mind, please see my Contributing Guidelines for more details on how you can participate.

Next Steps

  • Hopefully form community around project
  • Expand datasets and train another, more versatile model
  • Create a site to host results and demos of community created models

cancerdetectnet's People

Contributors

papafranku4647 avatar

Stargazers

Cameron Stone avatar  avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.