larahabashy / capstone-diabetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MDS Capstone : Diagnosing Lipohypertrophy

Capstone project in collaboration with the Gerontology and Diabetes Research Laboratory (GDRL). Using Machine Learning Approaches to Diagnosing Lipohypertrophy at the bedside.

  • contributors: Ela Bandari, Lara Habashy, Javairia Raza, Peter Yang

About

Lipohypertrophy is a common complication among diabetes patients who inject insulin. It is classified as the development of fat cells/fibrous tissue following repeated injections at the same area of the skin. Avoiding the areas where lipohypertrophy is present when injecting insulin is crucial for diabetes control, since injecting on a lipohypertrophy will make the insulin less effective and lead to fluctuations of blood sugar level. Subclinical lipohypertrophic masses are relatively small in size and occur in the deepest layer of the skin, which makes it hard to detect through the current practice of physical examination. Research has found good results in using ultrasound imaging techniques for subclinical lipohypertrophy classification. However, the criteria used to classify whether an image contains lipohypertrophy or not is currently implemented by a small group of physicians only.

This project leverages machine learning techniques to accurately classify the existence and detect the location of lipohypertrophy given ultrasound images.

Data Product

An easy-to-use web application has been developed by the team so that a healthcare professional can use it for swift diagnosis of lipohypertrophy presence without any data science or Python knowledge. The web app can be accessed here. The user is able to open the side bar, upload one or multiple images, and select one of the uploaded images to obtain classification and object detection results. Demo below: alt text

Data Analysis

The notebooks that explores data science methods can be found here.

The research and discussion on the choice of data science pipeline can be found here.

The source code can be found here.

Usage

  1. Open a terminal and clone this GitHub repository
git clone https://github.com/UBC-MDS/capstone-diabetes.git
  1. Navigate to project root directory (code below)
cd capstone-diabetes
  1. Create and activate the required conda environment:
  • if non-Mac user, run the code below:
conda env create -f environment.yaml
conda activate lipoenv
  • if Mac user, run the code below:
conda env create -f environment_mac.yaml
conda activate lipoenv

If using a Mac with M1 chip, please make sure miniconda is installed.

  1. If the images contain borders and anotated information generated by ultrasound machines, crop the images to retrieve only the ultrasound image parts.

  2. Make sure there are 2 folders in the root directory: 1 folder with images of positive cases and named as 'positive'; 1 folder with images of negative cases and named as 'negative'.

  3. Run make clean

  4. Run make all

  5. To use different hyperparameters/models in the machine learning pipeline, please read the 'Usage' and 'Options' sections in the scripts and look for available optional arguments.

    For exmaple, 'model.py' specifies an optional argument for hyperparamter 'epoch' with default value 50 in the 'Usage' and 'Options' sections. To use a different value such as 20 for argument 'epoch' in the machine learning pipeline, please open the Makefile and change line 17 to python src/model.py --train_dir=data/train/ --valid_dir=data/val/ --epoch=20. After that, please save the Makefile and rerun step 6 and step 7 to rebuild the machine learning pipeline and obtain the results.

Future Work

The model should be re-trained once more ultrasound images become available at a later time. We also recommend an in-depth ethics analysis to ensure that the model does not unfairly bias against specific patient populations prior to deployment.

Although the model is performing well on uncropped ultrasound images, additional functionality to crop images can be added to the web application given the model is trained on cropped images.

The project uses MIT license. It can be found here.

Code of Conduct can be found here.

About

License:MIT License


Languages

Language:Jupyter Notebook 99.6%Language:Python 0.4%Language:Makefile 0.0%