Coder Social home page Coder Social logo

spaco67 / breast-cancer-analyzer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vbookshelf/breast-cancer-analyzer

0.0 0.0 0.0 7.87 MB

Ai powered web app to detect Metastatic Cancer and Invasive Ductal Carcinoma in histopathology tissue images.

Home Page: http://histo.test.woza.work/

JavaScript 10.81% CSS 28.26% HTML 4.20% Jupyter Notebook 56.73%

breast-cancer-analyzer's Introduction

Breast-Cancer-Analyzer

Live Web App: http://histo.test.woza.work/



This is a prototype for a freely available online tool that can detect two forms of Breast Cancer in histopathology image patches. The current histopathology process is time consuming and small malignant areas can be missed. This app can help speed up a pathologist's workflow and provide diagnosis support.


The app has two models. Each model can detect one of the following:

  1. Metastatic Cancer - Cancer that has spread from the site of origin to other area/s of the body.
  2. Invasive Ductal Carcinoma - The most common subtype of breast cancer.

These are the papers that discuss the datasets that I used to train the two models:

1399 H&E-stained sentinel lymph node sections of breast cancer patients: the CAMELYON dataset
https://academic.oup.com/gigascience/article/7/6/giy065/5026175

Automatic detection of invasive ductal carcinoma in whole slide images with Convolutional Neural Networks
https://www.researchgate.net/publication/263052166_Automatic_detection_of_invasive_ductal_carcinoma_in_whole_slide_images_with_Convolutional_Neural_Networks

These are the links to the datasets:

https://www.kaggle.com/c/histopathologic-cancer-detection
(.tiff image format)

https://www.kaggle.com/paultimothymooney/breast-histopathology-images
(.png image format)

The entire model building and training process is described in these two Kaggle kernels:

Part 1 : Breast Cancer Analyzer + Web App
https://www.kaggle.com/vbookshelf/part-1-breast-cancer-analyzer-web-app/notebook

Part 2 : Breast Cancer Analyzer + Web App
https://www.kaggle.com/vbookshelf/part-2-breast-cancer-analyzer-web-app/notebook

The python code to build and train the models is included in the Jupyter notebook. All the javascript, css and html files are also freely available here. The trained models are also available.


Bugs & Lessons Learned:

  1. A large part of the web, including the web app for this project uses the Javascript language. I used Javascript to feed the images to the model. The challenge lies in the fact that Javascript is very fast whereas the model is not. This difference in speed can lead to incorrect predictions.
    For example, say we are using a loop to feed ten images to the model for prediction. Because of the realtively slower prediction speed, the model may end up making all of it's ten predictions using only image1 or image10. To solve this problem, on each iteration of the loop, we must make the code wait for the model to finish a prediction before the next loop begins i.e. before feeding it the next image.
    In the app I used async/await to achieve this. Because my Javascript knowledge is very basic, you should check the Javascript code thoroughly before using it in one of your own projects.

  2. I think there is one other potential source of prediction errors. In order to read an image Tensorflowjs needs the image to first be made part of an html image element. It then reads this image element and converts it into a tensor. When using multiple images, delays relating to putting an image into an html element (setting the src attribute) could also cause prediction errors. The programmer needs to keep this in mind especially if the image sizes are large.

  3. Most web browsers don't support the tiff image format. This needs to be kept in mind when pre-processing training data if the intention is to build a web app.

  4. Because Tensorflowjs is a new technology, web apps bulit using it may not work in some browsers. The user will see a message saying the "Ai is loading..." but that message will never go away because the app is actually frozen. It's better to advise users to use the latest version of Chrome.

breast-cancer-analyzer's People

Contributors

vbookshelf 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.