Coming soon! Tartan identifier!

Help me celebrate Scottish History and Culture!

Follow the project:
If you love kilts as much as I do, you may, also like me, want to know everything about them! If you're new to the idea of kilts and tartan, don't worry, I won't leave you hanging!

Tartan is the term used to describe a given specific pattern of plaid. Over time, these various tartans began to be associated closely with various clans. Eventually, this was standardized. More information can be found at the amazing Scottish Register of Tartans. Go check out the great work they're doing and get lost in the rabbit hole of tartans.

Another good resource is USA Kilts. They also have a great YouTube Channel where they discuss everything kilts and celtic! They are honestly a great source of anything kilt-adjacent, from fashion ideas to interesting history and culture lessons. When I was early in my kilt journey, they were there for me! Join us!

Currently, there are many websites that will help you find your Clan tartan, but currently they all require you to either know what clan the tartan is associated with or search through similar colors. Often, it can be difficult to understand some of the terms involved (sett, warp, weft, and twill, oh my!).

What I intend to create here will not replace the above. In fact, my final model will link to all of the above where applicable (I want you to use the registry, and I think you should buy from USA kilts). My silly little tool will hopefully be a helpful addition to the kilt-iverse and find its place in the kilt tradition of the future. Hey, a person can dream! XD

Current State of the Project

I was able to safely and ethically scrape somewhere around 11,000 photos of around 5,500 tartans. Currently, I don't have any pictures of tartan "in the wild," which I'll eventually need in order to identify tartan hiding slyly in the backgrounds of pictures; I have closeup photos of the pertinent section of each tartan. I have begun planning the neural network and have started experimenting with transformation of the images to make imperfect examples. I currently have a pipeline that will make 100 iterations of each image (toying with orientation and brightness).

While I build the model, I'm also building this site (as you can see!)

I have started to build a model to see how it goes (knowing full well that there will be some things to iron out). I've been playing with image data generation, which takes the perfect tartan image square and flips it and turns it and changes the brightness to make a bunch of variations of the picture. This makes it so the machine learning model can learn on imperfect data and not just get used to seeing a tartan in that exact orientation. This is a start, but as you can see in this Jupyter Notebook, it's not quite enough. My model is currently vastly overfitting (doing great at the small amount of training data and then doing terribly when trying to classify the data it hasn't seen yet).

When I originally played around with image data generation, I was using the tensorflow/keras image preprocessing ImageDataGenerator. But when I was reading about it, I read about the above tactic of adding it directly into the sequential neural network model. Because it wasn't going well, I decided to try with ImageDataGenerator. As you can see, this doesn't solve the problem of overfitting.

Next step is to create a python program that takes each tartan image I have and pieces it together to make larger tartan images, more like a bolt of plaid. Then I'll write another program that takes the new images and changes the lighting, shadows, saturation, etc. In short, in the absence of the images I need, I am going to see about creating them myself.

Contribute to the Project

If you'd like to send me (preferably labeled) pictures of tartan, I would be greatly appreciative: AnEyeForTartan@gmail.com