Data Augmentation for Ultrasound Foetal Echography Images using Conditional Variational Autoencoders
This GitHub repository contains code and resources for data augmentation of ultrasound foetal echography images using conditional variational autoencoders (cVAEs). Data augmentation is a critical step in machine learning, especially in medical imaging tasks, where obtaining a large and diverse dataset is often challenging. This repository provides a solution to enhance the dataset for training ultrasound foetal echography image analysis models using cVAEs.
A conditional variational autoencoder (cVAE) is a type of generative model that extends the capabilities of a standard VAE. It allows us to generate new data points based on specific conditions or labels. In this context, we can use cVAEs to generate augmented ultrasound foetal echography images conditioned on various factors like gestational age, pathology type, and more.
- Data Augmentation: Generate synthetic ultrasound foetal echography images to diversify your dataset.
- Conditioned Generation: Generate images based on specific conditions, such as machine constructor, pathology type, etc.
- Variational Latent Space: Explore the latent space of the cVAE model to understand the image generation process.
The repository is structured as follows:
data/
: This directory contains example ultrasound foetal echography images for training and evaluation.notebooks/
: Jupyter notebooks with example code for using the cVAE for data augmentation and latent space exploration.src/
: Python source code for the conditional variational autoencoder implementation.models/
: Pretrained cVAE models for ultrasound foetal echography data.pyproject.toml
: List of Python dependencies to run the code in this repository.README.md
: This README file, providing an overview of the repository and usage instructions.
To use the code and resources in this repository, follow these steps:
-
Clone this repository to your local machine:
git clone https://github.com/pbarbarant/data_augmentation_sonio.git cd data_augmentation_sonio
-
Install the requirements in a dedicated Python environment:
pip install -e .
-
For development purposes, contributors should run:
pip install -e ".[dev]" pre-commit install
-
Explore the provided Jupyter notebooks in the
notebooks/
directory to understand how to train and use cVAE models for data augmentation. -
Use the pretrained cVAE models in the
models/
directory for generating augmented ultrasound foetal echography images.
If you're new to conditional variational autoencoders or need a quick introduction to the concept, please refer to the documentation and resources below:
- Conditional Variational Autoencoders - Understanding cVAEs
- Deep Learning with PyTorch - Official PyTorch Tutorials
If you would like to contribute to this project or report issues, please follow these guidelines:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with clear, concise commit messages.
- Create a pull request to merge your changes into the main branch of this repository.
This project is licensed under the MIT License. For more details, please see the LICENSE file.
We would like to acknowledge the contributions of the open-source community, as this project builds upon the work of many researchers and developers in the fields of computer vision, deep learning, and medical imaging.
For any questions or inquiries related to this project, feel free to contact the project maintainers:
Thank you for your interest in our project!
Happy data augmentation and ultrasound foetal echography image analysis!