Git Product home page Git Product logo

nestle-acne-assessment's Introduction

Spatially Robust Deep Learning Application for Assessing the Facial Acne Severity Using Selfie Images

Microsoft collaborates with Nestlé Skin Health SHIELD (Skin Health, Innovation, Education, and Longevity Development, NSH) to develop a mobile app powered by deep learning models.

There are two main functions of the mobile app:

  1. assess the acne severity of users based on uploaded selfie images as accurately as a dermatologist.
  2. recommend treatment plans appropriate to the specific level of severity of the user’s acne and skin care products with the additional demographic information such as gender, age, skin type, etc.

It allows Nestlé Skin Health to actively engage with their customers, make dermatological expertise user-friendly and accessible at the palms of hands, and address their customers’ needs promptly (as shown in the following Figure). This application significantly shortens the feedback loop for their products with real-time customer data, thus enabling the company to proactively design new or improve existing products.

Screenshot

Here is the Decoded Show for this work:

The New Face of Computer Vision - DECODED S3E2

Getting Started

Nestlé Skin Health (NSH) provides 4700 selfie images for this work, labeled in five categories: 1-Clear, 2-Almost Clear, 3-Mild, 4-Moderate, 5-Severe.

There are a few challenges in this work:

  1. insufficient training data: The number of selfie images (=4700) is small to train a deep learning model from scrach.
  2. poor quality of images and labels: some selfile images are with bad environment control and human labels from dermatolgists are noisy.

To tackle these challenges:

  1. We propose a novel image augmentation approach for face images which addresses the spatial sensitivity problem of CNN models on small training data. It significantly improves the generality of the model on testing images.
  2. We convert the classification problem to a regression model by assigning ordinary numerical values to the five acne severity levels.

In the end, we build a real-world skin management mobile application including the whole cycle of dermatologists, users, skin care products.

Step by step instructions

data_processing_demo.ipynb is the easiest way to check our proposed image augmentation approach. It shows both extracting skin patch and rolling approach on the demo image. As the acne images in this work cannot be shared, an image from Bing Image is provided for demo.

Step1_Data_RemoveNoise.ipynb shows the code for extracting skin patches using acne images

Step2_Data_Augmentation.ipynb goes deeper in rolling approach considering the number of rolling times for each class of acne images.

Step3_Training_Pipeline.ipynb shows how to apply transfer learning and train the fullly connected neural network on acne dataset.

Step4_Scoring_Pipeline.ipynb is used to score test images

Step5_Deployment_Pipeline.ipynb with supporting python files (getPatches.py, model.py, regressionModel.py) shows how to deploy the model to Azure.

nestle-acne-assessment's People

Contributors

hangzh-msft avatar microsoft-github-policy-service[bot] avatar msftgits avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nestle-acne-assessment's Issues

Built the docker image successfully, but it didn't run on Docker Desktop/Engine [Win 11 and Ubuntu 20.04]

Hello,

I know that this repository is no longer maintained. I was trying to run the program via Docker Desktop on Windows 11 and Ubuntu 20.04 LTS, experiencing multiple errors, but I resolved all the errors by:

  • changing FROM microsoft/cntk:2.5.1-cpu-python3.5 to FROM mcr.microsoft.com/cntk/release:2.5.1-cpu-python3.5
  • upgrading pip to pip==19.3.1 'cause that's the only version that made the docker image building work.
  • creating models folder to the same directory of the Step5_Deployment_Pipeline.ipynb

Those three workarounds above made the docker image building work. However, when I ran the docker image locally via Docker Desktop on Windows, it threw an error.

Troubleshooting:

  • I also tried to build the docker image on Linux and experienced the same error.
  • I also tried to push the docker image on Docker Hub and pulled it on the Linux server, but it had the same error.

Here's the error:

Traceback (most recent call last):
  File "/workspace/main.py", line 6, in <module>
    from model import extract_patches, score_patch, del_cache
  File "/workspace/model.py", line 2, in <module>
    import getPatches
  File "/workspace/getPatches.py", line 3, in <module>
    from skimage import io
  File "/usr/local/lib/python3.5/dist-packages/skimage/__init__.py", line 135, in <module>
    from .data import data_dir
  File "/usr/local/lib/python3.5/dist-packages/skimage/data/__init__.py", line 13, in <module>
    from ..io import imread, use_plugin
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/__init__.py", line 15, in <module>
    reset_plugins()
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/manage_plugins.py", line 91, in reset_plugins
    _load_preferred_plugins()
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/manage_plugins.py", line 71, in _load_preferred_plugins
    _set_plugin(p_type, preferred_plugins['all'])
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/manage_plugins.py", line 83, in _set_plugin
    use_plugin(plugin, kind=plugin_type)
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/manage_plugins.py", line 254, in use_plugin
    _load(name)
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/manage_plugins.py", line 298, in _load
    fromlist=[modname])
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/_plugins/imageio_plugin.py", line 3, in <module>
    from imageio import imread, imsave
  File "/usr/local/lib/python3.5/dist-packages/imageio/__init__.py", line 22, in <module>
    from .core.imopen import imopen
  File "/usr/local/lib/python3.5/dist-packages/imageio/core/__init__.py", line 15, in <module>
    from .request import Request, read_n_bytes, RETURN_BYTES
  File "/usr/local/lib/python3.5/dist-packages/imageio/core/request.py", line 136
    raise ValueError(f"{value} is no valid Mode.")
                                                ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "/workspace/main.py", line 6, in <module>
    from model import extract_patches, score_patch, del_cache
  File "/workspace/model.py", line 2, in <module>
    import getPatches
  File "/workspace/getPatches.py", line 3, in <module>
    from skimage import io
  File "/usr/local/lib/python3.5/dist-packages/skimage/__init__.py", line 135, in <module>
    from .data import data_dir
  File "/usr/local/lib/python3.5/dist-packages/skimage/data/__init__.py", line 13, in <module>
    from ..io import imread, use_plugin
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/__init__.py", line 15, in <module>
    reset_plugins()
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/manage_plugins.py", line 91, in reset_plugins
    _load_preferred_plugins()
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/manage_plugins.py", line 71, in _load_preferred_plugins
    _set_plugin(p_type, preferred_plugins['all'])
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/manage_plugins.py", line 83, in _set_plugin
    use_plugin(plugin, kind=plugin_type)
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/manage_plugins.py", line 254, in use_plugin
    _load(name)
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/manage_plugins.py", line 298, in _load
    fromlist=[modname])
  File "/usr/local/lib/python3.5/dist-packages/skimage/io/_plugins/imageio_plugin.py", line 3, in <module>
    from imageio import imread, imsave
  File "/usr/local/lib/python3.5/dist-packages/imageio/__init__.py", line 22, in <module>
    from .core.imopen import imopen
  File "/usr/local/lib/python3.5/dist-packages/imageio/core/__init__.py", line 15, in <module>
    from .request import Request, read_n_bytes, RETURN_BYTES
  File "/usr/local/lib/python3.5/dist-packages/imageio/core/request.py", line 136
    raise ValueError(f"{value} is no valid Mode.")
                                                ^
SyntaxError: invalid syntax

Regression?

May I ask how you labeled the data while training regression model? Just labeled every image with a score between 0 - 5, right? And then graded them using the score like grade 1.8 to level 2?

STEP 4 error

Hello!
I do not know if I did something wrong but when using getPatches.extract_patches(join(img_path, imagefile), {}, patch_path, eye_cascade) at STEP 4, 1 positional argument is missing. The function extract_patches is defined in getPatches.py and takes 5 positional arguments, not 4.

Am I missing smth or the script is not complete?

Can you share the dataset?

I am very interested in this dataset and I want to ask you if you can share it!

I want to try a few things for an experiment

Could you share the dataset? Or is it not possible?

=> ERROR [ 4/22] RUN pip3 install -U scikit-learn

Hello!

I edited the Dockerfile's FROM to mcr.microsoft.com/cntk/release:latest and added RUN pip3 install --upgrade pip to fix the pip error, but I received this error.

=> ERROR [ 4/22] RUN pip3 install -U scikit-learn                                                                 0.5s
------
> [ 4/22] RUN pip3 install -U scikit-learn:
#7 0.513 Traceback (most recent call last):
#7 0.513   File "/usr/local/bin/pip3", line 7, in <module>
#7 0.513     from pip._internal.cli.main import main
#7 0.513   File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 57
#7 0.513     sys.stderr.write(f"ERROR: {exc}")
#7 0.513                                    ^
#7 0.513 SyntaxError: invalid syntax
------
executor failed running [/bin/sh -c pip3 install -U scikit-learn]: exit code: 1

How to fix the error? Thank you.

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.