Giter VIP home page Giter VIP logo

artefact_insertion's Introduction

Dermatoscopic artefact insertion

DOI:10.5826/dpc.1203a126 License: CC BY-NC 4.0 No maintenance intended

Katsch F, Rinner C, Tschandl P. Comparison of convolutional neural network architectures for robustness against common artefacts in dermatoscopic images. Dermatol Pract Concept. 2022;12(3):e2022126. DOI: https://doi.org/10.5826/dpc.1203a126

What it does

This tool inserts clinically meaningful artefacts to dermatoscopic images. We focused on three artefact types commonly present in dermatoscopic images: bubbles, rulers (with two subcategories horizontal & vertical rulers) and ink markings (divided in spot & circle markings).

To achieve this, templates were extracted from artefacts in dermatoscopic images. The folder /data/artefacts contains 51 instances of source images and extracted artefacts thereof. Basically, the regions of artefacts were isolated from source images and repaired with Adobe Photoshops content aware image restoration mechanism - "spot healing brush". A more detailed description of this process can be found in data/artefacts/README.md.

Those templates are then superimposed into new images, in a pseudo random process (e.g. position and orientation of artefacts in the image) as defined in src/types.py.

The figure below shows examples of automatically superimposed artefacts on a dermatoscopic image. In the top left (A) the original image without artefact is shown. The other three images show the lesion with the superimposed artefacts bubbles (B), ink markings (C) and a ruler (D).

Figure3_ArtifactInsertions

How to install

Use the provided Pipfile to install dependencies:

$ pipenv install

You can then try out the demo with the following command:

$ pipenv run python ./demo.py

How to use

Each artefact template is abstracted as an Artefact class (and specializations thereof, see src/types.py) which can be obtained from the ArtefactsRepository. Each artefact template implements the __call__ operation which can be used with an image and optionally with a mask as parameter and returns an image with inserted artefacts.

See demo.py for more examples:

# load image and repository
im = Image.open('data/test_images/ISIC_0024311.jpg')
mask = Image.open('data/test_masks/ISIC_0024311.png')
repo = artefactsRepository('data/artefacts/meta.json', seed=2022)

# for all available artefact classes
for type in [Bubble, RulerVertical, RulerHorizontal, MarkingCircle, MarkingSpot]:

  # obtain artefact object of type t
  artefact = repo.get_random_instance(type)

  # apply artefact to image
  im_with = artefact(im, mask)

  im_with.show()

Credits

All image files and segmentation masks contained in this package originate from the HAM10000 dataset, obtained from dataverse.harvard.edu. Those images are published under the CC BY-NC-SA 4.0 license by the Medical University of Vienna. Thank you!

Tschandl, P., Rosendahl, C. & Kittler, H. The HAM10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions. Sci Data 5, 180161 (2018). https://doi.org/10.1038/sdata.2018.161

How to reference

This project is released under the CC BY-NC 4.0 license - see LICENSE

It was developed in the context of my master thesis, with the title "Analysis of image classification, object detection and instance segmentation in terms of robustness to artefacts in automated pigmented skin lesion classification" at the Medical University of Vienna in 2020, and used in this paper:

Katsch F, Rinner C, Tschandl P. Comparison of convolutional neural network architectures for robustness against common artefacts in dermatoscopic images. Dermatol Pract Concept. 2022;12(3):e2022126. DOI: https://doi.org/10.5826/dpc.1203a126

artefact_insertion's People

Contributors

dependabot[bot] avatar thisismexp avatar

Stargazers

 avatar  avatar

Watchers

 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.