deeplearningunb / deeplearningunb/kara

Show me the solution #1

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
No language data
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Description

# Problem: Colorizing black and white images
- Default solution: Colorize by hand, with photo editors
- Proposed solution: Colorize automatically by previous experiences (based on a [tutorial](https://medium.com/@emilwallner/colorize-b-w-photos-with-a-100-line-neural-network-53d9b4449f8d) by Emil Wallner)

# Techincal explanation
1. Getting the dataset
- Public image dataset made available by Emil
2. Convert colored images from RGB to Lab
- L: Lightness (Black and white picture)
- a: green-red
- b: blue-yellow

![image](https://user-images.githubusercontent.com/26290053/70365680-66020180-1871-11ea-8309-c637bd73b4f6.png)

This way, instead of predicting 3 channels (red, green, blue), there remains only two.

![image](https://user-images.githubusercontent.com/26290053/70365726-a3ff2580-1871-11ea-9fcb-8decb78661b3.png)

3. Max-pooling
- Technique used to increase detail density.

![image](https://user-images.githubusercontent.com/26290053/70365980-f55be480-1872-11ea-9b29-75d604989549.png)

4. Fusion architecture
- Encoder (Smaller image patches)
- Decoder (Global priors)
- Fusion

5. Software Engineering improvements
- Instead of a jupyter notebook, the code has been transformed into a Python package
- Pipenv has been used as a configuration manager
- Trained models have been saved in .h5 files, to save time
- A CLI has been implemented to enhance the usability

# Results

## Test training (i7 8750H, 6 cores, 16GB RAM)

Dataset size: 999 images
Epochs: 10
Step: 2 (500 images per batch)

![image](https://user-images.githubusercontent.com/11671985/69906008-8cb8c780-139b-11ea-80d1-15fbdd03555a.png)

Time elapsed: ~40m

## Local training (i7 4500U, 4 cores, 16GB RAM)
Dataset size: 20 images
Epochs: 50
Step: 2 (10 images per batch)

![image](https://user-images.githubusercontent.com/26290053/70366268-d2323480-1874-11ea-9b65-a80d5fb88054.png)

Time elapsed: ~10h

## Google Cloud 8 cores, 30GB RAM
Dataset size: 5000 images
Epochs: 1000
Step: 20

![image](https://user-images.githubusercontent.com/26290053/70366326-54baf400-1875-11ea-9271-fb68ce021822.png)

Time elapsed: 50h

## Google Cloud 8 cores, 30GB RAM
Dataset size: 400 images
Epochs: 1000
Step: 20

![image](https://user-images.githubusercontent.com/26290053/70366376-a499bb00-1875-11ea-90e0-79a662c62241.png)

Time elapsed: 48h12min

# Lessons learned
- Deep learning is $$$$$
- General networks are harder to achieve
- Dependencies errors or mismatch
- Difficulty to use GPU to train the model

# Future Works
- Find better parameters from training
- Use GPU for Training
- Use GAN (Generative Adversarial Network) for better results
- Create CI/CD for releases

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.