Open In App

ML | Independent Component Analysis

Independent Component Analysis is a technique used to separate mixed signals into their independent sources. The application of ICA ranges from audio and image processing to biomedical signal analysis. The article discusses about the fundamentals of ICA.

What is Independent Component Analysis?

Independent Component Analysis (ICA) is a statistical and computational technique used in machine learning to separate a multivariate signal into its independent non-Gaussian components. The goal of ICA is to find a linear transformation of the data such that the transformed data is as close to being statistically independent as possible.



The heart of ICA lies in the principle of statistical independence. ICA identify components within mixed signals that are statistically independent of each other.

Statistical Independence Concept:

It is a probability theory that if two random variables X and Y are statistically independent. The joint probability distribution of the pair is equal to the product of their individual probability distributions, which means that knowing the outcome of one variable does not change the probability of the other outcome.



or

Assumptions in ICA

  1. The first assumption asserts that the source signals (original signals) are statistically independent of each other.
  2. The second assumption is that each source signal exhibits non-Gaussian distributions.

Mathematical Representation of Independent Component Analysis

The observed random vector is , representing the observed data with m components. The hidden components are represented by the random vector , where n is the number of hidden sources.

Linear Static Transformation

The observed data X is transformed into hidden components S using a linear static transformation representation by the matrix W.

Here, W = transformation matrix.

The goal is to transform the observed data x in a way that the resulting hidden components are independent. The independence is measured by some function . The task is to find the optimal transformation matrix W that maximizes the independence of the hidden components.

Advantages of Independent Component Analysis (ICA):

Disadvantages of Independent Component Analysis (ICA):

Cocktail Party Problem

Consider Cocktail Party Problem or Blind Source Separation problem to understand the problem which is solved by independent component analysis.

Problem: To extract independent sources’ signals from a mixed signal composed of the signals from those sources.

Given: Mixed signal from five different independent sources. 

Aim: To decompose the mixed signal into independent sources:

Solution: Independent Component Analysis

Here, there is a party going into a room full of people. There is ‘n’ number of speakers in that room, and they are speaking simultaneously at the party. In the same room, there are also ‘n’ microphones placed at different distances from the speakers, which are recording ‘n’ speakers’ voice signals. Hence, the number of speakers is equal to the number of microphones in the room.

Now, using these microphones’ recordings, we want to separate all the ‘n’ speakers’ voice signals in the room, given that each microphone recorded the voice signals coming from each speaker of different intensity due to the difference in distances between them.

Decomposing the mixed signal of each microphone’s recording into an independent source’s speech signal can be done by using the machine learning technique, independent component analysis.

where, X1, X2, …, Xn are the original signals present in the mixed signal and Y1, Y2, …, Yn are the new features and are independent components that are independent of each other.

Implementing ICA in Python

FastICA is a specific implementation of the Independent Component Analysis (ICA) algorithm that is designed for efficiency and speed.

Step 1: Import necessary libraries

The implementation requires to import numpy, sklearn, FastICA and matplotlib.

import numpy as np
from sklearn.decomposition import FastICA
import matplotlib.pyplot as plt

                    

Step 2: Generate Random Data and Mix the Signals

In the following code snippet,

# Generate synthetic mixed signals
np.random.seed(42)
samples = 200
time = np.linspace(0, 8, samples)
 
signal_1 = np.sin(2 * time) 
signal_2 = np.sign(np.sin(3 * time)) 
signal_3 = np.random.laplace(size= samples) 
 
S = np.c_[signal_1, signal_2, signal_3]
S += 0.2 * np.random.normal(size=S.shape)  # Add noise
 
# Mix the signals
A = np.array([[1, 1, 1], [0.5, 2, 1], [1.5, 1, 2]])  # Mixing matrix
X = S.dot(A.T)  # Observed mixed signals

                    

Step 3: Apply ICA to unmix the signals

In the following code snippet,

ica = FastICA(n_components=3)
S_ = ica.fit_transform(X)  # Estimated sources

                    
[/sourcecode]


Step 4: Visualize the signals

# Plot the results
plt.figure(figsize=(8, 6))
 
plt.subplot(3, 1, 1)
plt.title('Original Sources')
plt.plot(S)
 
plt.subplot(3, 1, 2)
plt.title('Observed Signals')
plt.plot(X)
 
plt.subplot(3, 1, 3)
plt.title('Estimated Sources (FastICA)')
plt.plot(S_)
 
plt.tight_layout()
plt.show()

                    

Output:

Difference between PCA and ICA

Both the techniques are used in signal processing and dimensionality reduction, but they have different goals.

Principal Component Analysis Independent Component Analysis
It reduces the dimensions to avoid the problem of overfitting. It decomposes the mixed signal into its independent sources’ signals.
It deals with the Principal Components. It deals with the Independent Components.
It focuses on maximizing the variance. It doesn’t focus on the issue of variance among the data points.
It focuses on the mutual orthogonality property of the principal components. It doesn’t focus on the mutual orthogonality of the components.
It doesn’t focus on the mutual independence of the components. It focuses on the mutual independence of the components.

Also Check:

Frequently Asked Questions (FAQs)

Q. What is the difference between PCA and ICA?

PCA emphasize to capture maximum variance and provide uncorrelated components, while ICA focuses onextracting statistically independent components, even if they are correlated, hence, ICA is suitable forblind source separation and signal extraction tasks.

Q. What is the application of ICA?

ICA demonstrate it’s application in diverse field such as signal processing, neuroscience, and finance. It is employed for blind source separation, extracting independent components from mixed signals, leading to advancements in fields like biomedical signal processing, communication systems, and environmental monitoring.

Q. Is ICA for dimensionality reduction?

ICA is a linear dimensionality reduction method, converting a dataset into sets of independent components. The number of independent components extracted by ICA corresponds to the dimensions or features present in the original dataset.


Article Tags :