AI in the hands of your grandma: things that could go kaboom and how to prevent them

Adam Czapski
Jit Team
Published in
6 min readApr 1, 2022

TL;DR

Newly AI-empowered users are more than susceptible to making mistakes when they create their own AI models. Big mistakes happen even to the frontrunners of Artificial Intelligence that cause outrage in the fabric of society. However, there are some tips and guidelines that may stave off your model from underperforming or solving a completely different problem than you intended it for.

Intro

In the previous blog post, I briefly touched on the topic of democratized AI and its tools that allowed non-AI experts to get their hands dirty with creating their own models. In this post, I will explain how tricky training a model can get.

Google’s racist blunder

You may have heard of Google’s Photo app classifying two Afro-Americans as gorillas. If you haven’t, here’s the story. In 2015, an engineer embarrassed Google on Twitter by pointing out that the Photo app labeled two unfortunate young people as gorillas.

Three years later, Wired performed a series of tests to examine if the problem still existed. Well, it was still there. Google blocked the image categories such as “gorilla”, “chimp”, “chimpanzee”, and “monkey”. That was the quick and dirty fix that solved the problem.

In the community of data scientists, there’s a running urban legend about training tanks. The story recounts a person building a tank classifier for the military that was trained on images of tanks only in forests. When the model saw a picture of an empty forest, it would still classify it as a tank. In other words, the classifier learned to classify a forest, not a tank. The story serves as a precautionary tale for young data scientists.

Machines learn from humans

Most of the time humans are the source of knowledge for computers meaning we provide annotated datasets from which machines learn. Our biases become part of the technology and it is of paramount importance to educate newly empowered individuals with the ability to create AI solutions.

What newbies with no AI knowledge should know

AI in the hands of inexperienced newcomers that democratized AI made easy to use should beware of a couple of basics while preparing their dataset, a collection of data for a machine to learn from. For example, in the context of computer vision, a dataset is a set of images/videos while text and speech belong to the realm of natural language processing. I will focus on a case of building a dataset for computer vision since the tools I listed in the previous blog post are computer vision-oriented.

The first question that most people ask about is the number of images/videos they need to annotate. The official answer to that question is “nobody knows”. That’s an honest answer. It all depends on the problem you’re trying to solve. Although, there are some rules of thumb and considerations to make.

On one hand, leveraging transfer learning may decrease the number of images/videos you need to annotate in your dataset. If you’re wondering why it’s because of the fact that transfer learning is a method of retraining pre-trained neural networks (trained on very large amounts of data) with your dataset so that you do not have to start training a neural network from scratch.

On the other hand, annotating very similar objects in images may increase the number of images/videos you need to annotate in your dataset. The more overlap (i.e. similar features) between objects, the more data you will need e.g. if you would like to classify cat breeds, you will need a bigger dataset than in the case of classifying cats and dogs.

These aspects concern only the size of your dataset, however, the quality of your dataset also plays a pivotal role in the equation of building a good dataset. In computer science, there is a famous saying “garbage in, garbage out”. What it means is that poor inputs produce bad results. If you feed your model with inaccurate samples, no matter how good your AI development platform, your AI team, or your data scientists are, the results will be far from desirable.

First off, make sure your dataset contains relevant samples. If you want to build a model discriminating between several cat breeds, make sure you collect images and videos of cats and not dogs. Subsequently, ensure you collect a diverse dataset with unique representations. you need to gather enough unique representations of cat breeds you would like to discriminate. When you think of a cat, you may be thinking about your own cat or a neighbor’s cat. However, cats (Felidae) are diverse in terms of their size, fur color, and species. Lions are different from cheetahs, not to mention breeds of domestic cats.

When you build your dataset, you also need to think about the background against which the objects of interest are presented e.g. you need to have images of cats in various settings for instance in a garden, in a building, on a sofa, in the grass, etc. Lighting and angles at which the images are taken also play an important role. So, you need to provide images of cats in broad daylight, at night, at dusk, and at dawn from various perspectives. In general, the dataset should reflect the image quality and content that you will encounter when applying the model in practice.

The camera from which the photos were taken is also substantive in building a dataset. The image saturation, temperature, resolution, and other properties of images have an influence on the predictive capability of a model. It is recommended to use the same quality of images in your dataset against which the model will make predictions. If you record a video with your smartphone and train your model with the images from your smartphone, the model may manifest some unexpected behavior when you run predictions on images from a professional studio camera.

That’s about it in broad strokes for the things to take into consideration while collecting your dataset. As a newcomer in the realm of democratized AI, the way you can positively influence your model is to make sure to double-check the annotations you or your colleagues created. If you accidentally misannotated a whole bunch of oranges and labeled them as tangerine, the model would produce erroneous predictions.

When you work with others on annotating the same dataset, you should establish general guidelines for annotating objects. Without these guidelines, annotators will interpret the task on their own and may use suboptimal annotation methods or completely misunderstand the task.

What is also worth bearing in mind when labeling is to efficiently split the annotation workload among annotators. Some datasets require specialized knowledge to annotate them, and you can divide the dataset based on the level of expertise required to annotate the media item within the dataset.

Conclusion

As a fledgling adept of democratized AI, I came a long way from my naïve assumptions about the tools of democratized AI to a more mature understanding of how complex creating a scalable AI solution is. The popularization of no-code AI tools is really blissful. However, just like a smartphone camera with some Instagram filters enabled in your pocket will not automatically make you a great photographer so will not the democratized AI tools turn you into a data scientist.

--

--