Skip to content

Repository files navigation

Image Inpainting using Deep Learning with Curriculum Learning

Live demo

Preview demo

Problem overwiev

Image inpainting is a process of restoring parts of image that are broken. The dataset for this problem is musical albums cover arts from kaggle containing 80k of 512x512 images (in this problem those are resized to 256x256).

Main challenge of this dataset is it's diversity - the cover arts differ in content, styles and compositions. That's why it's safe to assume training perfect model is extremally hard and things like texts may be very difficult (a lot of different fonts and languages). Every image for this task was corrupted with function that replaces 4 32x32 patches with black pixels. The patches can overlap however which allows for a bit more complex shapes than just squares. Since corruptions were done "on the fly" and randomized on each run each image produced a lot of different training samples.

Used loss functions

Since using reconstruction loss (L1/L2) loss is insufficient and produces blurry results other loss functions are needed. Alongside reconstruction loss perceptual loss was introduced. It's based on pretrained VGG16 model and it's goal is to reduce bluriness. After this change the blur problem was significantly decreased.

Full model

Proper model is trained on 20k images (out of 100k in the dataset). It provided balance between high diversity and reasonable time of execution on home PC.

Main problem of trained model

This method produced results that are sharp and consistent when it comes to structure, but failed on very hard areas (like Texts and very object-rich parts of image). In those areas model usually produced either blurred result or checkboard-patterns. The later one is very known problem in image inpainting problem but it was heavilly reduced by using Curriculum Learning.

Example of results

fc9bc252-ffac-46e6-ad91-a8b3b4881144 4dc66d1b-a54f-4d3a-a636-67d423a4e7f4

In order: original vs fixed images

About

University project about inpainting images for Computer Vision classes

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages