Code Monkey home page Code Monkey logo

gan-universe's Introduction

Generative Adversarial Network - Generating Universe

This repository contains part of the code used to make the images visible in the article "How does an AI Imagine the Universe?" published on Towards Data Science: https://towardsdatascience.com/how-does-an-ai-imagine-the-universe-d1d01139b50a

You can also explore the dataset on https://davide-coccomini.github.io/GAN-Universe/

The aim of the article was to create a dataset of celestial bodies and then train a Generative Adversarial Network to generate new ones. Then real galaxy images were used to generate new ones and merge them into a single wide view of space.

Images Scraping

The first step is to build the dataset. For this purpose, the following methods may be used:

Always make sure you have the right to use the images you download before starting training.

In order to be able to generate credible galaxies in our case, the Galaxy Zoo dataset was also used as a dataset in one of the experiments: https://www.kaggle.com/c/galaxy-zoo-the-galaxy-challenge

Images preparation

The images obtained should be carefully checked to ensure consistency and good quality of the dataset. A dataset that is too heterogeneous, too small or at too low a resolution may not lead to the desired results. In our case, a crop_images.py file has been written to crop the images in a squared way in order to avoid deformations when resizing.

Training

The gan.py file was used to train an initial model capable of generating 128x128 images. Experiments were also carried out using the following networks:

Presenting the results

The repositories used already offer some approaches for generating grids or evolutions of the images obtained. For our own needs, we have created the file create_grid.py which generates a grid of NxM images.

Below we show some of the results obtained from the GANs:

GENERATED CELESTIAL BODIES V1 GENERATED CELESTIAL BODIES V1

GENERATED CELESTIAL BODIES LIGHTWEIGHT GAN GENERATED CELESTIAL BODIES LIGHTWEIGHT GAN

GENERATED GALAXIES GENERATED GALAXIES

Since our aim was also to obtain a wide view of the universe, we created the file generate_universe.py which combines the galaxies generated by the network in a chaotic manner, thus obtaining the following result:

GENERATED UNIVERSE GENERATED UNIVERSE

gan-universe's People

Contributors

davide-coccomini 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.