← Back to blog

How to Train Smart Tool for Precise Cracks Segmentation in Industrial Inspection

Valeria Vorozhko

Step-by-step guide for industrial inspection cracks segmentation on images using custom interactive AI model.

How to Train Smart Tool for Precise Cracks Segmentation in Industrial Inspection

Segmenting cracks on surfaces in industrial inspection is a critical task, influencing safety and preventing potential problems. While it's true that the world of infrastructure and materials demands quick and precise crack identification, not all AI solutions can handle every situation. Using “one-fits-all” AI models like Segment Anything might not cut it for real-world situations.

That's where our guide comes in, showing you how to build your own interactive AI model for cracks segmentation in industrial inspection images.

This blog post is the Part 1 in the series of posts where we share results of our experiments on leveraging synthetic training data to get the accurate and robust semantic segmentation model on very challenging tasks - cracks segmentation:

Straight to the point: what you can get in Supervisely

Segmentation of cracks in images feels like an almost unsolvable challenge for publicly available pre-trained AI models. Standard AI models available in the public domain often struggle to meet the complexity of this task. Luckily, Supervisely allows you to bypass the limitations of out-of-the-box models by training the model on custom dataset. Look what results can be achieved in Supervisely with no coding in less than one hour!

After image
Before image
Segmentation results using custom Smart Tool segmentation model

Crack Segmentation Across Industries: Ensuring Safety and Quality

Crack segmentation holds crucial significance for inspection tasks across a variety of industries beyond construction and infrastructure. Here are the examples:

  1. In the aerospace industry, precise crack detection is vital for ensuring the structural integrity of aircraft components, preventing catastrophic failures during flight.

  2. In the automotive sector, crack segmentation assists in identifying defects in critical parts such as engine components or chassis, guaranteeing the safety of vehicles on the road.

  3. Crack segmentation is essential in the energy sector, helping to detect flaws in pipelines, pressure vessels, and power generation equipment, thereby averting leaks, explosions, or power disruptions.

  4. In manufacturing, crack detection ensures the quality of products like electronic circuits, where even minor cracks can impair functionality.

  5. Furthermore, crack segmentation finds relevance in the medical field, particularly in radiology, as it aids in diagnosing bone fractures and assessing the progression of diseases like osteoporosis.

Across all these diverse sectors, the accurate identification of cracks plays a pivotal role in maintaining safety, functionality, and efficiency.

Video tutorial

Through our comprehensive tutorial, we guide you step by step, demonstrating how to effortlessly build your own custom model for AI-assisted interactive crack segmentation on images.

Try to reproduce this tutorial yourself in our Community Edition for free.

For those who prefer written instructions over video, the text guide is provided below.

Practical Applications of Interactive Image Segmentation

Interactive segmentation is a semi-automated way for solving image segmentation task. The process begins with you selecting the specific area you want to focus on, known as the region of interest (ROI). To segment the object you're interested in, you place a green dot on it. Then, the computer uses these initial clues to automatically segment a dominant object within a chosen area. If the neural network makes mistakes, you can guide it by putting more positive (green 🟢) dots where your object is and negative (red 🔴) dots where there's no part you're interested in. This back-and-forth user-model interaction makes sure the segmentation is right!

Keep in mind that interactive segmentation is a semi-automated labeling technique, thus it can be applied only to a single image during the annotation. It's especially useful for tricky tasks like spotting cracks in complex images.

Data used for the experiment

For our training and testing, we'll be working with a carefully curated dataset that showcases the real-world complexity of cracks images. This dataset comprises a diverse range of surfaces, lighting conditions, and crack patterns, making it a true representation of the challenges we encounter in the field.

The training data consists of 628 of thoroughly annotated crack images, serving as the foundation for teaching our neural network to segment cracks accurately.

Overview of the training datasetOverview of the training dataset

A separate validation dataset containing 70 unseen similar images will be used to assess the performance of our model.

Step 1. Connect your GPU

Easily link your GPU-enabled computer to Supervisely for free model training and evaluation. Just execute a single command in your terminal. See the concise video guide for setup details. The training will be done on your machine. Watch the video guide on how to do that (MacOS, Ubuntu, any Unix OS or Windows).

Step 2. Launch 'Train RITM' app

Our example uses the RITM model, chosen for its ease of training on smaller datasets and precise mask predictions

Launch the Train RITM app from the project’s dashboard to configure and monitor the training process. Click the [⫶] buttonNeural NetworksRITMTrain RITM

Launch train RITMLaunch train RITM

To initiate the training, follow the instructions in the wizard. Configure the essential training settings and hyperparameters. Default values will work, but you can experiment with the training parameters and observe how it impacts the performance of your custom model. For a more comprehensive guide, consult the video tutorial.

The training process generates a range of artifacts, including model weights (checkpoints), logs, charts, as well as visual representations of training batches and predictions. You can access these items through a link in the training dashboard.

Step 3. Launch ‘Serve RITM' app

RITM interactive segmentation SmartTool
Supervisely App

RITM interactive segmentation SmartTool

State-of-the art object segmentation model in Labeling Interface

Within the Supervisely platform, Neural Networks become an integral part through two distinct App types: train and serve. The train App constitutes an interactive dashboard for training, as discussed in the preceding step, whereas the "serve" App empowers users to deploy a trained model. Consequently, predictions from the model are obtained and can be accessible by the user. For more available Apps related to Neural Networks, visit the Neural Networks page.

To evaluate the performance of our trained model using our custom data, we must put it into action. To do so, we need to run serving app by navigating to Neural NetworksImagesInteractive SegmentationServe RITM Supervisely App:

How to run the RITM serving AppHow to run the RITM serving App

We need to choose custom model in the App window and provide the path to the best checkpoint achieved during training. Additionally, in order to distinguish this smart tool from the others which might be deployed, let’s name it cracks. As usual, you need to select a computer for the deployment device and click run. That’s it!

Provide a custom checkpoint you want to runProvide a custom checkpoint you want to run

Results

As evident from the results, the model demonstrates impressive performance on the test data. While some feedback to the model might still be necessary, the outcomes undoubtedly justify the efforts invested!

To enhance the precision of the predictions even further, we can simply add more positive 🟢 and negative 🔴 dots by interacting with the tool.

Conclusion

The custom tool we built for spotting cracks using interactive segmentation is particularly useful for tricky images where accurate automation is needed for each picture. The quality of the training data plays a big role in getting good results. Luckily, training the model in Supervisely is incredibly simple and doesn't require any coding – it can be done in just a few minutes. This approach proves to be effective for achieving high-precision cracks segmentation.

. . .

Supervisely for Computer Vision

Supervisely is online and on-premise platform that helps researchers and companies to build computer vision solutions. We cover the entire development pipeline: from data labeling of images, videos and 3D to model training.

Get Supervisely for free

The big difference from other products is that Supervisely is built like an OS with countless Supervisely Apps — interactive web-tools running in your browser, yet powered by Python. This allows to integrate all those awesome open-source machine learning tools and neural networks, enhance them with user interface and let everyone run them with a single click.

You can order a demo or try it yourself for free on our Community Edition — no credit card needed!

. . .
Valeria Vorozhko
About the author

Business development

Connect on LinkedIn