Heritage Headdress Classification Using Teachable Machine

Bashayr Alabdullah
4 min readMar 22, 2024

Let’s play

This post explores a classification project that identifies four traditional heritage headdresses in Saudi Arabia: the Flower Men’s headdresses from the Southern Region, the Ghutra, and the Shemagh. Using Google’s Teachable Machine, I developed a system that recognizes these important cultural items.

Dataset Description

The dataset includes 186 images, divided into three categories: Flower Men’s headdresses from the Southern Region, Ghutra, and Shemagh, with 62 images for each type. I sourced these images from online platforms like Google and Pinterest.

Data Preparation

After downloading, I converted all images to JPEG format to ensure uniformity. I also resized and cropped the images to emphasize the headdresses, reducing background distractions. For example, this process resulted in 46 quality images for the Ghutra category suitable for training.

Dataset Organization and Model Training

I organized the images by category using Google’s Teachable Machine, which helped in setting up the dataset for training and testing. It’s allocated 85% of the images for training and the remaining 15% for testing.

I then uploaded these images to Teachable Machine. The training phase allowed the model to learn the distinctive features of each headdress, essential for accurate classification during testing.

Platform and Model Description

The platform is user-friendly and helps people without deep technical knowledge to build machine learning models quickly. It has several features that make the process easier:

  • Ease of Use: The platform is designed to be straightforward, allowing users to create models without getting bogged down in complexity.
  • Training and Testing Integration: Teachable Machine divides the data into training and testing sets, making it easy to evaluate the model’s performance.
  • Deployment Readiness: Once the model is ready, it can be exported for use in different applications.

In Teachable Machine, data is split as follows:

  • Training Samples (85%): These are used to teach the model about the different classes of headdresses.
  • Test Samples (15%): These help evaluate how well the model can identify new, unseen images.

There are also some important terms to understand:

  • Underfitting: This happens if the model can’t identify the patterns well.
  • Overfitting: This occurs if the model learns the training data too well and can’t generalize to new data.
  • Epochs: This term refers to how many times the model sees the entire dataset during training. I set the model to run through the data 100 times (100 epochs).

The model development followed these steps:

1. Upload the dataset

I uploaded images of the three headdress types to Teachable Machine.

2. Train the model

I adjusted settings like the number of times the model would learn from the data (epochs) and the learning rate to ensure the model learns effectively.

3. Preview the model

After training, I checked how well the model was performing by testing it with new images.

4. Export the model

Once I was happy with the model’s performance, I exported it to use in other applications.

Accuracy Measurement

The platform conducted an automated evaluation of the headdress classification model using a validation set that constituted 15% of the total dataset, which the model had not encountered during training. This method offered an impartial assessment of the model’s performance across different classes:

  • Flower Men: The platform reported an 80% accuracy rate for the Flower Men’s headdresses, with the model correctly identifying 8 out of 10 images.
  • Ghutra: For Ghutra headdresses, the model achieved a 71% accuracy rate, correctly classifying 5 out of 7 images.
  • Shemagh: The model demonstrated its highest accuracy with the Shemagh, reaching a 90% rate by accurately classifying 9 out of 10 images.

The platform also provided graphical representations to further elucidate the model’s performance.

I hope this inspires others to use technology in similar ways.

--

--

Bashayr Alabdullah

Salam, I'm Tech Engineer 🚀. I blend technology insights, inspiration, and fun in my feed. #innovation #discovery 🥑🎶🎯🌻