Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: [email protected]
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Take our 85+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

Publication

Image Segmentation Made Easy: A Guide to Ilastik and EasIlastik for Non-Experts
Computer Vision   Data Science   Latest   Machine Learning

Image Segmentation Made Easy: A Guide to Ilastik and EasIlastik for Non-Experts

Author(s): Titouan Le Gourrierec

Originally published on Towards AI.

Example of the results obtainable after this tutorial (by author)

Introduction

Image segmentation plays a key role in various fields, from identifying cells in biological research to analyzing regions in satellite imagery. However, traditional segmentation methods often require advanced programming skills or machine learning expertise β€” making them inaccessible to many.

Fortunately, tools like Ilastik and EasIlastik are changing the game. These open-source applications empower users to perform sophisticated image segmentation without writing a single line of code. With intuitive interfaces and interactive workflows, they allow even non-experts to achieve high-quality results quickly.

In this article, we’ll explore what makes Ilastik and EasIlastik so powerful, walk through how to use them, and show you how they can simplify your image segmentation tasks, no matter your level of experience.

Ilastik: A powerful tool to segment images

Ilastik is a powerful, open-source tool designed to make complex image analysis tasks like segmentation and object classification accessible to non-experts. With no prior experience in machine learning required, it empowers users to create customized models by simply annotating images, making it perfect for anyone who needs to process visual data.

It uses interactive machine learning, allowing users to annotate images directly, train models in real-time, and apply them without needing programming skills. From biological microscopy to industrial inspection, Ilastik is versatile and ideal for a wide range of applications.

To download Ilastik, please visit Ilastik website and follow the installation instructions for your operating system.

How to use it?

Once you’ve downloaded Ilastik, launch the software and select β€˜Pixel Classification’ under the β€˜Segmentation Workflows’ section to get started.

Ilastik’s interface at launch (by author)

1. Loading Images for Model Training

To begin, add the images needed for training the model:

  • Click on the β€˜Add New’ button.
  • Select β€˜Add separate images’ to upload your image files.
How to load images for model training (by author)

2. Feature Selection

Next, click on the β€˜2. Feature Selection’ button in the left-hand menu. A popup will appear with a set of feature checkboxes.

  • Select all the boxes. These features represent different image properties like edges, textures, and intensity patterns. Don’t worry β€” Ilastik will automatically determine which ones are most relevant based on the images you provide.
  • Click β€˜OK’, then proceed to β€˜3. Training’.
Feature selection menu (by author)

3. Annotating Images

Now comes the interactive part:

  • Add the labels you need for each class in your dataset.
  • Use the pen tool to annotate regions on your images, assigning them to the appropriate labels.
Examples of image annotations (by author)

4. Refining the Model with Incremental Learning

Once you’ve made your initial annotations, click on the β€˜Suggest Features’ button. This allows Ilastik to select the most relevant features for your specific dataset.

Here’s where Ilastik shines: you can incrementally improve the model’s predictions.

  • Review the segmentation results produced by your model.
  • Annotate more areas or correct any inaccuracies to refine the predictions further.

This iterative approach ensures that your model adapts to the complexity of your data.

Incremental annotations to improve predictions (by author)

5. Exporting Predictions and Saving the Model

Once you’re satisfied with the results:

  1. Click on β€˜4. Prediction Export’ in the left menu.
  2. Open β€˜Choose Export Image Settings’ and adjust the β€˜Renormalize [min, max]’ parameter to reflect the number of classes in your dataset (e.g., 0 to the number of labels you created).
  3. Save the model as an .ilp file for future use.
Settings for prediction export and model saving (by author)

Using Your Trained Model with Python and EasIlastik

Once you’ve trained and saved your Ilastik model as a .ilp file, you can seamlessly integrate it into your Python workflow using the EasIlastik package. EasIlastik simplifies running your Ilastik model on large datasets without needing to open the Ilastik interface, making it ideal for batch processing and automation.

1. Installing EasIlastik

Before using EasIlastik, you’ll need to install it. You can do this easily via pip:

pip install EasIlastik

2. Running Your Model with EasIlastik

Once you’ve installed the package, you can use it to apply your trained Ilastik model to new images. The process is simple and involves just a few lines of code:

import EasIlastik

EasIlastik.run_ilastik(
input_path="path/to/input/folder",
model_path="path/to/your/model.ilp",
result_base_path="path/to/your/output/folder/"
)
Example of segmentation results with EasIlastik (by author)

Explanation of Parameters:

  • input_path: This is the path to the image or folder containing the images you want to process. EasIlastik can handle a single image or multiple images in a folder.
  • model_path: This is the path to your saved Ilastik model file (.ilp). It’s the model you trained using the Ilastik interface, and now you’re ready to apply it to new data.
  • result_base_path: Specify the path where you want the processed results to be saved. EasIlastik will store the output files here.

Why Use EasIlastik?

  • Batch Processing: Easily process hundreds or thousands of images at once. This is especially useful for large datasets where manually running predictions in Ilastik’s GUI would be too time-consuming.
  • Automation: Integrating EasIlastik into your Python scripts allows you to automate your image segmentation pipeline, enabling seamless workflows for repeated tasks.
  • Simplicity: Despite its power, EasIlastik is simple to use, requiring minimal code. This makes it accessible even to those with little to no programming experience.
  • Flexibility: EasIlastik provides the flexibility to incorporate Ilastik’s powerful segmentation capabilities into larger data processing pipelines, whether for research, industrial applications, or other fields.

With just a few lines of code, you can easily process large batches of images using the model you trained in Ilastik, making EasIlastik a powerful tool for automating and scaling image segmentation tasks.

Conclusion

Ilastik and EasIlastik offer a powerful, accessible solution for image segmentation, ideal for users with no prior AI knowledge. Their intuitive interfaces and interactive workflows allow users to easily tackle complex segmentation tasks. By eliminating the need for specialized coding or deep machine learning knowledge, these tools accelerate research, reduce human error, and enable efficient, high-quality image analysis.

Whether for biological research, industrial applications, or other fields, Ilastik makes image segmentation easy. EasIlastik further simplifies the process by allowing seamless integration with Python for batch processing.

Give Ilastik a try and unlock the full potential of your image data!

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming aΒ sponsor.

Published via Towards AI

Feedback ↓