This project demonstrates the segmentation of grayscale and color images using a Gaussian Mixture Model (GMM) and the Expectation-Maximization (EM) algorithm. The project applies these advanced machine learning techniques to segment images effectively, providing a comprehensive approach to image segmentation.
- Grayscale and Color Image Segmentation: Uses GMM and EM algorithms to segment grayscale and color images.
- Machine Learning Application: Demonstrates the application of machine learning techniques in image processing.
- Log-Likelihood Plotting: Visualizes the log-likelihood and negative log-likelihood curves to show the convergence of the EM algorithm.
This section provides a detailed explanation of the core functions and algorithms used in the project.
To get started with the Image Segmentation project, follow these steps to clone the repository and install the required dependencies.
Ensure you have Python installed on your machine. You can download it from python.org.
-
Clone the Repository
git clone https://github.com/JayKareliya-code/GMM-EM-model.git
-
Create a Virtual Environment
It's a good practice to use a virtual environment to manage dependencies. You can create a virtual environment using the following command:
python -m venv venv
-
Activate the Virtual Environment
-
On Windows:
venv\Scripts\activate
-
On macOS/Linux:
source venv/bin/activate
-
-
Install Dependencies
Install the required dependencies using the
requirements.txt
file:pip install -r requirements.txt
-
Run the Script
Once the dependencies are installed, you can run the script to perform image segmentation:
python ImageSegmentation.py
Ensure the following libraries are included in your requirements.txt
file: