Professional IT services from accompio for companies in Germany.
Blog

Testing artificial intelligence

18.01.2024

The use of AI is on everyone's lips. Tom has changed his perspective – from application to testing – and takes you on a journey through the world of AI testing.

Two men on an AI test trip, focusing on technology and innovation.

Artificial intelligence (AI) is on everyone's lips these days and is often mentioned in the context of more efficient and faster working. Nevertheless, systems like ChatGPT are often criticised. Answers are said to be false, questions are not answered due to restrictive filters, or facts are invented – the AI creates its own reality.

In the software industry, ensuring quality and functionality plays an important role. Errors should be found and rectified quickly, ideally before the product even reaches the end customer. This requires thorough software testing. But does this also work with AI? Can AI systems be tested and if so, how? In this blog series, I'll be exploring these questions and reporting on my findings on the subject of „Testing AI“.

Every beginning is… surprisingly intuitive?

Getting started in the world of AI wasn't exactly easy due to the variety of systems and focuses. I hadn't had much exposure to the topic until now. My experience has so far been limited to generating images with „Midjourney“, simple chatbot interactions with „ChatGPT“ and the use of „Google Translate“ for translating texts. So, where's the best place to start and where do you set your own boundaries? The danger is great of quickly getting lost in topics that sound very interesting but take a lot of time to reach the goal.

First, it was necessary to build a basic understanding of how AI systems work and to deepen this knowledge step by step. The first port of call for this was the „Teachable Machine“, with which you can create your own AI for image classification. It even worked surprisingly easily and very intuitively, even without in-depth mathematical knowledge. All it took was holding an object up to the camera of a smartphone or laptop and taking various pictures of the objects at the press of a button on the web interface. With a separate training set for pens, a coffee cup, and headphones respectively, the AI could then distinguish between the objects in real-time, which I just had to hold up to the camera.

The aim of machine learning is to recognise meaningful relationships within input data and derive rules from them. With these rules, a system can then recognise trends, classify data or make predictions when new, unknown data is input. For example, in the Teachable Machine, an upside-down coffee cup is still classified correctly, even though it no longer matches the data with which the system was originally trained.

Classification in Machine Learning
Classification in Machine Learning (Image: accompio PrimeTec GmbH)

After the initial experiments with the image classification AI already delivered promising and, above all, very clear results, The next item on the agenda is to implement a similar system on our own machine.. Fortunately, the developers of Teachable Machine had an older version of the system open-source on GitHub published. Even though it's the archived original version and the functions are quite basic, a look into the program code was quite insightful. For example, the images are trained locally on the machine using Tensorflow. There is no communication with other services. 

Workflow of input, learning and output in image recognition and assignment using artificial intelligence.
The first version of ”Teachable Machine” reliably recognises the blue pen, which is labelled as the ”purple” class.

Image Classification – What needs to be considered? 

The system is up and running and is already delivering initial results. In tests, the AI is up to 95 percent certain that the recognised object is indeed the one shown. However, in other cases, the objects are misclassified. A coffee cup suddenly becomes a pen, and in another instance, the AI can no longer distinguish between the items. How can this happen? 
 
During the creation of the training data, some important characteristics have emerged: 

  • The background in the image should remain as consistent as possible. A pen lying on the desk and visible in the image is not a problem, provided it is also visible in all other images and later in the live webcam in the same position.   
  • The object is recognised with a higher probability if it is captured from different perspectives. For example, it helps to rotate the coffee cup so that in addition to the front and back, the bottom of the cup, the inside, as well as several side and rotated views are captured. The more training data, the better the result. 
  • Another important factor was disturbances. In this case, it was sufficient if body parts such as arms, face, or torso were visible in the image during the recording. The classification then worked less reliably. 
  • The shape and colour of the objects should also be taken into account. While the system can differentiate very well between a green cup and a blue pen, the recognition of a green ballpoint pen is poorer than that of a blue one. 

AI self-study 

After gathering initial impressions from interacting with AI, I wanted to delve deeper into the subject. How exactly does AI work from a technical perspective? How are AIs created? What needs to be considered? And above all: How can AI be tested? 

A very helpful and important companion on the path to being able to test AI was the c't special issue „AI Practice“ (2023/24). This allowed me to better understand the basic content on the topic of AI and directly link it with my practical experience with image classification AI. But what happens next? 

The ISTQB „Certified Tester Foundation Level“ is an international standard and a recognised basis in the field of software testing. Although the terms and concepts it contains are generally applicable to all software projects, the ISTQB goes one step further. The syllabus for „Certified Tester AI Testing“ aims to broaden one's horizons with regard to artificial intelligence, particularly concerning the testing of AI systems – exactly what I need. Thus, through the learning content, I was able to build a basic understanding of the various testing methods, quality characteristics, and risk aspects that are particularly important for testing AI systems. 

The next major goal was set, and the plan was to develop an acceptance test for an AI system focusing on AI features. The next steps were to apply what had been learned and compare several AI systems with pre-trained models. However, this is exactly where the first problem arose. Acceptance of the system is only possible if a pre-trained model is available. However, the „Teachable Machine“ that was set up did not have a function with which recorded images and trained models could be saved and recalled. Therefore, it was not possible to reset the system to a starting state from which future tests could be repeated under the same conditions. On the other hand, I could not find a similarly functioning AI system with which a meaningful comparison would have been possible. A change of scene was therefore necessary. 

The path to your own AI translator 

With rapid technological advancements, machine translation has reached a significant milestone. Ten years ago, I was rather sceptical of machine translation. The translation quality of Google Translate was not convincing, and the system's applications were limited to a simple web interface. Today, the translations are reportedly sometimes so good that they are indistinguishable from human translation. But is that really true? 

For further analysis, I initially focused on two different translation systems: DeepL and Libre Translate. Both are fundamentally machine translation systems. While Libre Translate relies on OpenNMT as an open-source system, DeepL keeps its doors closed – the company reveals very little about how the system works in the background. This is reason enough to take a closer look at the two systems and put them through their paces. 

The translation quality of Libre Translate is funny, but disappointing.

After swiftly setting up one's own instance of Libre Translate, the question of how best to test the system soon arose. An intuitive approach would certainly be to have a given text translated into another language and then translate that translation back into the original language – a round-trip translation, so to speak. This way, one could check how large the differences are between the original text and the twice-translated text, right? Unfortunately not. Because instead of evaluating a single system, you would be evaluating two systems that work independently of each other – the translation from language A to language B and the back-translation from language B to language A. Therefore, this approach is not suitable for evaluating translation quality.  

Another option would be to assess the translation quality by human translators, experts with many years of experience in this field. The texts could then be examined by experts for various features. 

  • How good is the translation quality? 
  • How much of the original text's meaning is retained in the translation? 
  • How understandable is the translation? 
  • Are there any missing words or incorrect word orders in the translation? 

The main problem in answering these questions, however, is that they are partly subject to a subjective assessment – standardised metrics must first be developed with experts. Even then, the assessment is mostly subjective and a costly affair.  

A less costly and considerably more reliable method is the use of machine-evaluated metrics. One of the first metrics for this was the „Bilingual Evaluation Understudy“, brief BLEU. This metric considers the agreement between machine and human results, provided a sufficiently large amount of human-generated data is available. The closer the machine translation is to professional human translation, the higher the quality rating.

 

A brief outlook

Following this introduction to the world of AI testing, the following chapters will take a closer look at the systems presented, in particular within the Regarding the AI-specific ISTQB features. In addition to the metrics mentioned above, I will examine further test methods and quality features in more detail. A comprehensive risk analysis will also present potential system risks and problems, along with their solutions from a testing perspective – all with the ultimate goal of designing a general acceptance test for AI-assisted translators. 

Woman with a headset in customer service at Accompio IT Services.

Get in touch with us

We at accompio will be happy to help you.

Arrange an initial consultation

This field is for validation purposes and should be left unchanged.
This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form

From time to time we would like to inform you about our products and services as well as other content that may be of interest to you. You can unsubscribe from these communications at any time. If you agree to us contacting you for this purpose, please tick the following box. You can revoke your consent at any time with effect for the future - via the unsubscribe link at the end of each e-mail or by e-mail to info@accompio.com.

We process and store your data. You can find further information at Privacy Policy.