This repository shows an example of how to use MATLAB to generate synthetic images of skin lesions.
The code is based on an example using the flowers dataset available online.
|Snapshot of the GAN after training. (L) generated images; (R) generator (blue) and discriminator (red) curves showing score (between 0 and 1, where 0.5 is best) for each iteration.|
|Examples of synthetically generated images.|
- MATLAB 2021a or later
- Deep Learning Toolbox
- Parallel Computing Toolbox (only required for training using a GPU)
- Download or clone the repository.
- Open MATLAB.
- Edit the contents of the
imageFoldervariable in the
skin_lesion_gan.mlxfile to reflect the path to your selected dataset.
- Run the
skin_lesion_gan.mlxscript and inspect results.
- You are encouraged to expand and adapt the example to your needs.
- The choice of network architectures for both the generator and discriminator was inspired by the DCGAN.
- The choice of hyperparameters (learning rate, mini-batch size, number of epochs, etc.) is merely illustrative. You are encouraged to (use Experiment Manager to) tweak those choices and find a better solution 2.
 This example uses a fairly small subset of images to make it easier to get started without having to worry about large downloads and long training times.
Oge Marques (2021). Synthetic skin lesion image generation using GANs (https://github.com/ogemarques/gan-skin-matlab/releases/tag/1.01), GitHub. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!