SMART POTHOLE DETECTION

by angasailakshmi in Living > Travel

20 Views, 0 Favorites, 0 Comments

SMART POTHOLE DETECTION

ChatGPT Image Sep 22, 2026, 09_23_00 AM.png

Introduction

Potholes are a common road problem that can cause accidents, vehicle damage, and inconvenience to drivers and pedestrians. Detecting potholes manually can be difficult and time-consuming.

In this project, we use Artificial Intelligence (AI) and PictoBlox to build a Smart Pothole Detection system. The AI model is trained using images of potholes and normal roads. After training, the system can analyze a new road image and identify whether a pothole is present.

When a pothole is detected, the system displays a warning message to alert the user. This project demonstrates how AI and machine learning can be used to solve a real-world problem and contribute to safer roads.

Supplies

Screenshot 2026-05-10 024852.png
  1. Pictoblox Software: Download PictoBlox | Windows, MacOS, Linux, Chromebook, Android & iOS
  2. Laptop/PC
  3. Inbuilt or External Camera Setup
  4. Speaker or Headphones


AI Model Training

Screenshot 2026-09-18 204552.png
Screenshot 2026-09-18 204545.png
Screenshot 2026-09-18 204530.png

Step 1: Open PictoBlox

  1. Open PictoBlox.
  2. Create a new project.
  3. Switch to the Machine Learning Environment.
  4. Select Image Classification.

Step 2: Create Classes

Create two classes:

  1. Class 1 – Pothole
  2. Class 2 – Normal Road

Step 3: Add Training Images

For Pothole:

  1. Collect images showing different potholes.
  2. Use images from different angles and distances.
  3. Include small, medium, and large potholes.
  4. Try to collect around 30–50 images.

For Normal Road:

  1. Collect images of roads without potholes.
  2. Include different road surfaces and viewpoints.
  3. Try to collect around 30–50 images.

Step 4: Train the Model

  1. Add the images to their respective classes.
  2. Check that the images are correctly categorized.
  3. Click Train Model.
  4. Wait for the training process to finish.
  5. Test the model with new road images that were not used during training.

Step 5: Test

Show a new image/video to the AI model.

Expected results:

Pothole image → Pothole detected

Normal road image → Normal road

Step by Step Block Code

Screenshot 2026-09-18 201400.png

Step 1: Start the Program

First, add the Events block:

when 🚩 clicked

This block starts the Smart Pothole Detection program when the green flag is clicked.

Step 2: Create a Continuous Loop

From Control, add:

forever

Place it below the green flag block.

This makes the AI continuously analyze images and check for potholes.

Blocks:

when 🚩 clicked
forever

Step 3: Select a Road Image

Inside the forever loop, add:

switch backdrop to [random backdrop]

This changes the stage backdrop to a road image.

For your project, you can have different backdrops containing pothole and normal road images.

Blocks:

forever
switch backdrop to [random backdrop]

Step 4: Analyze the Image Using AI

From the Machine Learning/AI blocks, add:

analyse image from [backdrop]

This tells the trained AI model to analyze the current backdrop image.

Blocks:

forever
switch backdrop to [random backdrop]
analyse image from [backdrop]

The AI will compare the image with the classes you trained.

Step 5: Display the Identified Class

Add the say block:

say [identified class] for (2) seconds

The identified class reporter shows what the AI has identified.

For example:

Normal

or

Pothole

Complete section:

analyse image from [backdrop]

say [identified class] for (2) seconds

Step 6: Check Whether the Road Is Normal

From Control, add:

if < > then

Inside the condition, use:

is identified class [Normal] ?

So the block becomes:

if <is identified class [Normal] ?> then

This checks whether the AI has classified the image as a normal road.

Step 7: Display “Road is Clear”

Inside the Normal condition, add:

say [Road is clear] for (2) seconds

So this section becomes:

if <is identified class [Normal] ?> then
say [Road is clear] for (2) seconds

When the AI detects a normal road, the system displays:

✅ Road is clear

Step 8: Check for a Pothole

Add another:

if < > then

Use:

is identified class [Pothole] ?

The complete condition is:

if <is identified class [Pothole] ?> then

Step 9: Play an Alert Sound

Inside the Pothole condition, add:

play sound [Alert] until done

When a pothole is detected, the system plays an alert sound.

Step 10: Display the Warning

Below the sound block, add:

say [Pothole] for (2) seconds

You can make the message more informative:

say [⚠ Pothole detected! Please slow down.] for (2) seconds

If your PictoBlox version doesn't allow the warning symbol, simply use:

say [Pothole detected! Please slow down.]


Test the Project

Smart pothale detection

Click the green flag.

The program selects a road backdrop.

AI analyzes the image.

The identified class is displayed.

If the class is Normal, it says “Road is clear.”

If the class is Pothole, the Alert sound plays.

The system displays “Pothole detected! Please slow down.”

Because the code is inside forever, the process repeats continuously.

Applications

Road Safety – Detect potholes and alert drivers to slow down or take caution.

Smart City Management – Help smart-city systems identify roads that require maintenance.

Road Maintenance – Assist municipal authorities in finding potholes that need repair.

Vehicle Safety – Help reduce vehicle damage caused by unexpected potholes.

Pothole Mapping – Detected potholes can be recorded and mapped to identify problem areas.

Conclusion

The Smart Pothole Detection project demonstrates how Artificial Intelligence and Machine Learning can be used to address a real-world road safety problem. By training an image classification model with pothole and normal-road images, the system can identify road conditions and provide a warning when a pothole is detected.

Through this project, students learn about AI, machine learning, image classification, datasets, and block-based programming while developing a practical solution. The project can be further improved by adding GPS tracking, automatic reporting, pothole severity detection, and a road-condition mapping system.