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.
You will need python 3 with scikit-learn, PyQt5 and Matplotlib.
I borrowed the core code from Blind source separation using FastICA
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
python3 main.py
Defaults will be assumed, and you get
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.
Laurent de Vito
All third-party libraries are subject to their own license.
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.