Skip to content

ldv1/ICA_for_demixing_images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ICA for demixing images

Motivation

This is a very simple example of how to use FastICA of scikit-learn to demix images that were linearly mixed. It shows how good the results can be for structured high-dimensional signals despite the fact that the underlying independence hypotheses of ICA do not respect the two-dimensional structure of the data (each image is stacked into a vector) and the sequential nature of the data (each signal is a random variable and the observed values are i.i.d. samples).

Why do we need a GUI? Well, ICA cannot recover the right magnitudes of the independent components. Hence some images are "inverted". The GUI lets you invert the color map for each image separately.

Dependencies

You will need python 3 with scikit-learn, PyQt5 and Matplotlib.

Code

I borrowed the core code from Blind source separation using FastICA

Usage

python3 main.py --help

will tell you everything about the usage.

It is as simple as that: You provide the pictures and the seed for the mixing matrix:

python3 main.py --seed 1234 --file city.jpg bumper.jpg raisin.jpg flats.jpg

Results

python3 main.py

Defaults will be assumed, and you get

Demo in 2D

The top row depicts the unmixed images (ground truth), the middle row shows the mixed images, and the bottom row gives the results of the demixing with ICA.

The second picture from the left at the bottom is inverted.

Authors

Laurent de Vito

License

All third-party libraries are subject to their own license.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

Releases

No releases published

Packages

No packages published

Languages