{"id":2615,"date":"2017-08-27T21:04:05","date_gmt":"2017-08-27T19:04:05","guid":{"rendered":"https:\/\/blog.mi.hdm-stuttgart.de\/?p=2615"},"modified":"2023-08-06T21:50:31","modified_gmt":"2023-08-06T19:50:31","slug":"fooling-the-intelligence","status":"publish","type":"post","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2017\/08\/27\/fooling-the-intelligence\/","title":{"rendered":"FOOLING THE INTELLIGENCE"},"content":{"rendered":"<h2>Adversarial machine learning and its dangers<\/h2>\n<p><em>The world is led by machines, humans are subjected to the robot\u2019s rule. Omniscient computer systems hold the control of the world. The newest technology has outpaced human knowledge, while the mankind is powerless in the face of the stronger, faster, better and almighty cyborgs.<\/em><\/p>\n<p>Such dystopian visions of the future often come to mind when reading or hearing the latest news about current advances in the field of artificial intelligence. A lot of Sci-Fi movies and literature take up this issue and show what might happen if the systems become more intelligent than humans and develop their own mind. Even the CEO of SpaceX, Tesla and Neuralink, Elon Musk, who is known for his innovative mindset, has a critical opinion towards future progress in artificial intelligence:<\/p>\n<blockquote><p>If I were to guess what our biggest existential threat is, it\u2019s probably that. So we need to be very careful with the artificial intelligence. [&#8230;] With artificial intelligence we are summoning the demon.<\/p>\n<p>Elon Musk<\/p><\/blockquote>\n<p><!--more--><br \/>\nFor this reason he started the non-profit organization <a href=\"http:\/\/openai.com\/\"><i>OpenAI<\/i><\/a> in 2015 aiming at researching and developing <i>friendly artificial intelligence.<\/i> But also other famous scientists and researchers have doubts that the current hype regarding AI and Deep Learning yields only benefits for the people. Stephen Hawking claims, for example, that<\/p>\n<blockquote><p>the rise of powerful AI will either be the best or the worst thing ever to happen to humanity. We do not yet know which. The research done by this centre is crucial to the future of our civilisation and of our species.<\/p>\n<p>Stephen Hawking<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>While these doomsday scenarios are targeted at a potential evolution of artificial intelligence in decades, if not centuries, there are already posing serious dangers and risks from such systems these days. In times of increasingly self-driving vehicles, personal assistants, recommender systems etc., where more and more task are taken over by computers, people rely on them and trust them. Consumers use artificial intelligence because it simplifies their daily lives, it offers convenience and helps them in certain situations. Companies use and develop intelligent systems because they provide multiple benefits compared to human labour: They are cheaper, have more capacity and are more efficient. But above all, we think that these algorithms are free of human errors: They don\u2019t make errors due to fatigue or inattentiveness. They don\u2019t make errors due to miscalculations or misjudgement. They behave like they are told to behave. And this is exactly the reason why the so-called <b>adversarial machine learning<\/b> is such a powerful opportunity that enables attackers to specifically manipulate these systems.<\/p>\n<p>&nbsp;<\/p>\n<h3>What is adversarial machine learning?<\/h3>\n<p>First of all, what is machine learning? Machine learning is a subfield of artificial intelligence, although the terms are often used interchangeably. It can be used to learn from input data in order to make predictions. The heart of each ML application is its underlying model, that defines the architecture of the algorithm and all of its parameters. It is important to mention that machine learning is not tied to a specific algorithm, for example not all ML applications make use of deep neural networks, although this type of algorithm is becoming more and more popular.<\/p>\n<p>There are two ways of machine learning that you can use, based on the characteristics of the input data and on what you want to learn: With supervised learning classification (deciding between two or more classes, e.g. \u201cIs the object in the image a bus, a car or a pedestrian?\u201d) and regression (learning a function, e.g. \u201cHow long will my journey take?\u201d) tasks can be solved, but they require labeled training data. This means that for each data instance, for example some image, the required target output has to be specified, e.g. \u201cthe image contains a car and pedestrian, but no bus\u201d. Unsupervised learning on the other hand does not require labeled data, which can save a lot of time during data preparation, but the tasks are limited to cluster analysis like finding similarities, which is heavily used in recommender systems.<\/p>\n<p>In order to get high-quality predictions from the algorithm, one has to train the model first. During the training phase, you feed lots of data into the algorithm, which computes an output based on the current model. In the case of supervised learning, the computed output is compared with the given target output. Based on the deviation, the model parameters are updated (this is basically the \u201clearning\u201d) in order to minimize the error. If the performance of the model is satisfying, it can be leveraged in production in order to predict, classify, cluster or whatever you want to do with your data.<\/p>\n<p>&nbsp;<\/p>\n<p>Now that we have a principal understanding of how machine learning is working, we can get a better understanding of how adversarial machine learning is working. Generally speaking, inputs of machine learning systems are manipulated in a way that the output of the model becomes any desired result with high confidence. By applying smallest perturbation to the inputs, the model can be completely tricked. As a result, attackers can enforce the machine learning application to output any result they want under certain circumstances.<\/p>\n<p>This opens the door for various types of attacks that are not limited to a specific type of application, technology, or algorithm. But how does it look like in practice?<\/p>\n<p>&nbsp;<\/p>\n<h3>Adversarial machine learning in practice<\/h3>\n<p>To give an example of what adversarial machine learning is capable of, we can take a closer look at fooling image recognition.<\/p>\n<p>Some years ago, image recognition was done by applying traditional techniques, which includes choosing the suitable filters, applying edge and keypoint detection and clustering the visual words. Although this method worked well for years, it had some drawbacks: First of all, it depends on the specific application; you had to choose the correct setup, filters and other components tailored towards the individual application. Furthermore, the accuracy was acceptable, but not extraordinary. But from the 2010s on, a new technique was developed, strongly outpacing former traditional methods: Image recognition based on deep learning. They simplified and generalized the whole process while setting new benchmarks in the field of image recognition.<\/p>\n<p>Although their accuracy is above any doubt, they are prone to adversarial machine learning attacks. In this context, the attacker manipulates an image in such a manner that the classification algorithm misclassifies the content of the image in favor of the attacker\u2019s desired output.<\/p>\n<p>Researchers presented two types of attacks, both fooling the algorithm:<\/p>\n<p>The first approach is based on a \u201cnormal\u201d image, meaning that the image contains a human-recognizable object or scene. Now the attacker adds a tiny perturbation to the image, which is hardly perceptible by humans, if at all. However, the perturbation is not some random white-noise signal, but results from a targeted calculation. In the figure below, you can see an example:<\/p>\n<figure id=\"attachment_2616\" aria-describedby=\"caption-attachment-2616\" style=\"width: 593px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-26-23.35.12.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2616\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2017\/08\/27\/fooling-the-intelligence\/screenshot-2017-08-26-23-35-12\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-26-23.35.12.png\" data-orig-size=\"593,241\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Example for an adversarial example\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;On the left the original image is depicted. To its right you can see the perturbation. These two combined result in the third image. Notice that the manipulation is not perceptible&lt;\/p&gt;\n\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-26-23.35.12.png\" class=\"wp-image-2616 size-full\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-26-23.35.12.png\" alt=\"\" width=\"593\" height=\"241\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-26-23.35.12.png 593w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-26-23.35.12-300x122.png 300w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/a><figcaption id=\"caption-attachment-2616\" class=\"wp-caption-text\">On the left the original image is depicted. To its right you can see the perturbation. These two combined result in the third image. Notice that the manipulation is not perceptible<\/figcaption><\/figure>\n<p>On the left side, the original image containing a panda is depicted. If you would feed this image in the machine learning algorithm used for this example, it would classify the content with a confidence of 57.7% to be a panda. But instead of classifying the output of that picture, the attacker adds a perturbation to it, pictured in the center. Note that this noisy image is multiplied with a factor of 0.007, so it is actually not visible for human eyes. The combination of the original image and the perturbation is visible on the right: It looks exactly like the original panda image, even if you know that it contains the perturbation, you cannot recognize it. For humans, the object in the manipulated image is still clearly a panda, but the algorithm is almost completely convinced (99.3% confidence) that it contains a gibbon. But this is no coincidence: You can basically take any picture, add the correct perturbation to it and get the desired output classification.<\/p>\n<p>&nbsp;<\/p>\n<figure style=\"width: 777px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/08\/szegedy.jpg\" alt=\"\" width=\"777\" height=\"407\"><figcaption class=\"wp-caption-text\">Original images are shown on the left side, the distortions in the center are added. Each of those images is recognized as ostrich.<\/figcaption><\/figure>\n<p>As you can see in the figure above, the algorithm classifies each of these six different images as <i>ostrich<\/i>, although they are containing something completely different.<\/p>\n<p>&nbsp;<\/p>\n<p>The second approach starts from scratch, without depending on an existing image. A completely random-looking image is generated, looking like a white-noise signal, but is actually recognized with high confidence by the algorithm. How does this look like?<\/p>\n<figure id=\"attachment_2622\" aria-describedby=\"caption-attachment-2622\" style=\"width: 402px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-27-20.05.14.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2622\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2017\/08\/27\/fooling-the-intelligence\/screenshot-2017-08-27-20-05-14\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-27-20.05.14.png\" data-orig-size=\"402,226\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Adversarial images crafted by an genetic algorithm\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;The images are recognized to be digits between 0-9 with 99.99% confidence.&lt;\/p&gt;\n\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-27-20.05.14.png\" class=\"wp-image-2622 size-full\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-27-20.05.14.png\" alt=\"\" width=\"402\" height=\"226\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-27-20.05.14.png 402w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/Screenshot-2017-08-27-20.05.14-300x169.png 300w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/a><figcaption id=\"caption-attachment-2622\" class=\"wp-caption-text\">The images are recognized to be digits between 0-9 with 99.99% confidence.<\/figcaption><\/figure>\n<p>In this example, you can see several newly generated images. For humans, it looks more like some kind of &nbsp;QR code or something, but the algorithm can recognize digits in these images. For example, the images in the first column are classified to contain the digit \u201c0\u201d. &nbsp;For us it\u2019s impossible to see, but the algorithm yields a confidence score of 99.99%.<\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"how_does_it_work\">How does it work?<\/h3>\n<p>As described in the <a href=\"#what_else_is_possible\">next section,<\/a> adversarial machine learning is not limited to a specific application, e.g. image recognition, but is universally practicable in the field of machine learning. For that reason, it is not possible to explain how all of these attacks exactly work, because it depends on what you want to achieve. Therefore, a short summary is given of how the scientists managed it to produce and manipulate images like in the examples above in order to fool the image classification algorithm:<\/p>\n<p>&nbsp;<\/p>\n<p>In general, the image generation and manipulation process is based on a local search algorithm, known as <i>genetic algorithm.<\/i> It is derived from the biological theory of evolution by Charles Darwin, transferring the concept of \u201csurvival of the fittest\u201d to optimization problems.<\/p>\n<p>Let\u2019s call the the digit-generation example from above to mind: How can we produce such an image, that looks like white noise, but will be classified by a trained machine learning algorithm to contain any desired digit between 0 to 9 with a confidence of over 99%?<\/p>\n<p>Imagine we want to craft an image which is classified as the digit \u201c6\u201d. At first, we have to produce an initial <i>population<\/i>. The population is the set of all relevant states, referred to as <i>individuals<\/i>. This means in practice that we have to generate a set of independent, random images. Each image is an individual, all images together form the population.<\/p>\n<p>The whole process consists of four steps:<\/p>\n<ol>\n<li><strong>Evaluation<\/strong>: Each individual is evaluated with a fitness function. The fitness function indicates how good the respective individual is with regard to subjective. In concrete terms, each previously randomly generated image is classified with the machine learning algorithm. The fitness value would be the confidence score of the algorithm for the digit \u201c6\u201d. Since the images are white-noise signals, the fitness evaluation value should be quite low initially for each individual.<\/li>\n<li><strong>Selection<\/strong>: We select a subset from the complete population for the next step. However, these individuals are not randomly chosen. Since we want to build a better generation, we state that fitter individuals are more likely to be chosen. This means that we select those images, that are recognized to be a \u201c6\u201d with higher confidence, with higher likelihood.<\/li>\n<li><strong>Crossover<\/strong>: We can only produce a new population, if we modify the selected individuals. Therefore we choose pairs of <i>parent individuals<\/i> which produce a <i>child individual <\/i>by crossover. Regarding our example crossover means that we choose a random crossover point (selecting a random pixel) and then taking all the pixel values before that crossover point from the first <i>parent individual<\/i> and taking all the pixel values after that crossover point from the second individual, combining them into the new <i>child individual<\/i>. By this means we hope to chose the best values from the parents and therefore produce an even stronger child.<\/li>\n<li><strong>Mutation<\/strong>: With low probability, we modify individual pixel values in the child instance.<\/li>\n<\/ol>\n<p>The child individuals replace the weakest individuals from the current population. Now we can evaluate the population again in order to determine the fitness values of all individuals. If the fitness value of one or more individuals is high enough, which means that the ML algorithm is confident enough to recognize a \u201c6\u201d, we can terminate the genetic algorithm. Otherwise, we start the next iteration, constituting the next generation.<\/p>\n<p>For the example above, the researchers needed less than 50 generations to produce images with a confidence score of \u2265 99.99% and only 200 iterations to achieve a median confidence of 99%.<\/p>\n<p>Using this approach, we don\u2019t need access to the underlying model of the classification algorithm, we just need the output with the confidence score.<\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"what_else_is_possible\">What else is possible?<\/h3>\n<p>Adversarial machine learning is not limited to image recognition tasks. There are many more applications that are vulnerable to these attacks:<\/p>\n<p>Researchers showed how to easily fool Google\u2019s new <a href=\"https:\/\/cloud.google.com\/video-intelligence\/\">Cloud Video Intelligence API.<\/a> This API offers the functionality to analyse videos and make them searchable like textual content. The main purpose of the Cloud Video Intelligence API is to recognize the the content of videos and provide the associated labels.<\/p>\n<p>How could we adversarially use this API? Remember that the principle of adversarial machine learning consists of manipulating inputs of machine learning systems in a way that the output of the model becomes any desired result with high confidence.<\/p>\n<p><a href=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/image2.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2624\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2017\/08\/27\/fooling-the-intelligence\/image2\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/image2.png\" data-orig-size=\"1339,592\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/image2-1024x453.png\" class=\"alignnone wp-image-2624 size-full\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/image2.png\" alt=\"The Google Cloud Video Intelligence API\" width=\"1339\" height=\"592\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/image2.png 1339w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/image2-300x133.png 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/image2-768x340.png 768w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/image2-1024x453.png 1024w\" sizes=\"auto, (max-width: 1339px) 100vw, 1339px\" \/><\/a><\/p>\n<p>Researchers took an image different from the actual video content and inserted it periodically and at a very low rate into the video. The original video contained for example animals like in the figure above. Now they inserted an image of a car, a building, a food plate or a laptop every two seconds for one frame. Although this is a very low rate (one frame every two seconds for a video of 25 fps corresponds to a insertion rate of 2%), the API is deceived into returning only the video labels which are related to the inserted image, but did not return any labels related to the original video.<\/p>\n<p>&nbsp;<\/p>\n<p>Another team showed how to attack voice recognition systems. Personal assistants are widely and extensively used nowadays, but they are also prone to adversarial attacks. Similar to the image generation example above, they generated voice commands in order to fool systems like the Google Assistant or Apple\u2019s Siri. For their whitebox approach they had complete knowledge of the model, its parameters and architecture. Hence the attack worked out very well: The voice commands were not recognizable by humans, but completely understandable by the system. This way an attacker could attack any voice recognition system without being noticed by the user. However, in reality it\u2019s not common to have complete knowledge about the system\u2019s internals. Therefore they performed another experiment, this time treating the machine learning model as blackbox. Even though the voice commands generated now were easier understandable for humans, they were also harder to process by the voice recognition systems.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube-nocookie.com\/embed\/HvZAZFztlO0\" allowfullscreen=\"allowfullscreen\" width=\"560\" height=\"315\" frameborder=\"0\"><\/iframe><\/p>\n<p>A third team of researchers also showed how to attack malware classification systems. First, they created an artificial neural network that acts as a malware classifier and trained it with 120.000 android applications, 5.000 of them being malware. Now they tried to attack their own network, treating it like a blackbox (they pretended not to know about the details of the model, making it more realistic). For this they modified the malware examples in such a manner that they are classified by the neural network to be non-malicious by adding features like permissions or API calls to the Android application. The results showed that they were successfully fooling the classifier, which did not recognize the modified malware in 60% &#8211; &nbsp;80% of all cases.<\/p>\n<p>This shows that adversarial machine learning can be a huge threat in terms of machine learning driven systems, especially for security-critical domains.<\/p>\n<h3><\/h3>\n<h3>Why does it work?<\/h3>\n<p>Why are these algorithms vulnerable to adversarial machine learning? These attacks can not only be targeted towards deep neural networks, but also other, completely different algorithms. That means the attack is universal and therefore practicable for many applications. But what is the reason for that?<\/p>\n<p>If we approach the topic from a higher level, we find the cause for this in the similar, but not completely equal ways of learning that exist between humans and machines. Machine learning is, like many other techniques in artificial intelligence (for example neural networks and evolutionary algorithms), strongly inspired by nature: As explained previously, machine learning works by training the model with large amounts of data, while it\u2019s constantly improving. Humans learn in the same way: There is a supervisor, most likely the parents or teachers, who tells the child what to do and what not to do. A child learns to write by repeating to write words over and over again. With every iteration, there are minor improvements and in the long term the child is \u201ctrained\u201d. However, there are differences: When a human classifies an image, there are multiple areas in the brain involved, processing the information, gathering information from the long term memory, linking several impulses, forming connections, \u2026 This mechanism is incredibly complex, even scientists are not yet completely aware of what exactly is going on.<\/p>\n<p>On the other hand, models for machine learning algorithms consist of mathematical formulas which basically map the high dimensional input data onto low dimensional output data. We know what the algorithm is doing, so we know how it\u2019s working internally.<\/p>\n<p>While humans make use of their abstract representation of knowledge, machines rely on parameterized functions. If you can control the functions and know exactly what they are doing, it\u2019s a lot easier to modify their input in order to receive the desired output.<\/p>\n<p>But referring back to the panda-image example from above, why exactly does such completely random-looking noise completely fool the neural network, while there is no difference recognizable by humans?<\/p>\n<p>The answer is that we actually don\u2019t add <b>random <\/b>noise to the picture. The perturbation is calculated subject to the desired output. Explaining the details of this method would go beyond the scope of this post, but a short summary is provided:<\/p>\n<p>The aim of the training phase is to improve the model. For neural networks this means that we adapt the weights between the nodes in order to get better results. The weights are adapted in dependency of the loss function, measuring the deviation between actual output and target output. By calculating the gradient we know how to adjust the weights (gradient descent algorithm). In order to calculate the perfect perturbation to fool the classifier, we turn the tables: Instead of adapting the weights depending on the output, we adapt the input depending on the output. To put it simply, we calculate the perturbation that increases the neuron\u2019s activation for the desired output. For example the perturbation that is added to the panda image above focuses on the activation of the nodes that are triggered when recognizing a gibbon. So all we have to do is to calculate the gradient ascent instead of the gradient descent based on the desired output.<\/p>\n<p>Now you may ask why we would have to run algorithms over several iterations in order to generate adversarial instances like in the genetic algorithm example that we used to produce machine-recognizable digits, when all we have to do is to simply calculate the gradient ascent. The answer is that calculating the gradient ascent is the faster, easier and more precise solution, but it has one major drawback: You need access to and knowledge about the underlying model (its weights) which is not given in most cases. To sum it up, if you want to generate adversarial examples with an whitebox attack, you may want to choose the gradient ascent method, while on blackbox attacks you have to go with other techniques like local search or even bruteforce attacks.<\/p>\n<p>&nbsp;<\/p>\n<h3>What can happen?<\/h3>\n<p>The bandwidth of targets and impacts is very manyfold. For some applications there is no big impact, for example fooling recommender systems, weather forecasts or artificial intelligence in computer games may lead to confusing results for the end user, but there is no major damage. But then again, considering applications in security- or safety-critical domains, adversarial machine learning can result in serious damages. Imagine your self-driving car recognizes a right-of-way sign instead a stop-sign, because somebody manipulated it. The driver has no opportunity to react to this misinterpretation because the perturbation is not visible to him. Or think of AI systems that are trained to write news and reports for newspapers <a href=\"https:\/\/www.theguardian.com\/technology\/2017\/jul\/06\/press-association-wins-google-grant-to-run-news-service-written-by-computers\">like Google is testing currently<\/a>. If you can fool this system, it is open for propaganda and fake news. Furthermore, military drones can use image recognition to identify enemy targets. It is frightening to think of scenarios in which it\u2019s possible for attackers to mislead them into attacking uninvolved targets. Or your phone reacts to a hidden voice command, incomprehensible for humans, that tricks your personal assistant into posting your private data to Twitter.<\/p>\n<p>&nbsp;<\/p>\n<h3>Countermeasures<\/h3>\n<p>It is hard to protect machine learning systems against adversarial attacks, because there is no known solution to reliably detect perturbations or adversarial manipulations. However, some approaches exist in order to defend against these attacks:<\/p>\n<ul>\n<li><strong>Request user feedback:<\/strong> Before any actions is taken by the system, the user approval is required. This way, the user acts as an instance to control the results of the algorithm and can deny them if he detects any mistake. But this approach has two main drawbacks: First of all, asking the user for feedback contradicts the idea of AI, which should support the user as much as possible with as little effort as possible. This limits the usability. Secondly, the user is not always able to give the correct feedback, for example the invisible perturbation in the panda image. Therefore, requiring user feedback is not a suitable solution against AML.<\/li>\n<li><strong>Adversarial learning:<\/strong> Machine learning models can only recognize something they\u2019ve already seen before. An image recognition system only knows how a car looks like if a number of cars were present in the learning dataset. The same also applies for AML: The model can\u2019t recognize adversarial instances as such if it has not learned what adversarial instances are. Therefore you can deliberately add adversarial data to the training set in order to recognize them in the production phase. This is a good start for protection against AML, but attacks can still be successful because of the diversity of possible attacks.<\/li>\n<li><strong>Choose another model:<\/strong> The previously presented approaches are a way of minimizing the effects of adversarial machine learning, but do not fight their cause. Researchers showed that AML is possible due to the linearity of the models. Only with linear components in the model it is possible to fool it. Therefore the ultimate solution against AML is to use a model that is nonlinear, for example random forests or radial basis functions. The problem is that these models may not always be as good as models like neural networks. In that case the developer has to decide between high performance and high security. Unfortunately, performance sells better than security. Machine learning models <em>\u201cwere designed and trained to have good average performance, but not necessarily worst-case performance\u201d<\/em>, as Nicolas Papernot, Google PhD fellow in security, put it into words.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>Conclusion<\/h3>\n<p>Machine learning applications are already widely spread and are involved in an increasing part of our daily lives. They can be extremely helpful, but they can also be exploited by attackers, feeding them with adversarial instances. While the impacts are not always harmful, they can cause great damage in some cases. The problem is that currently most of the deployed models are vulnerable to those attacks due to their linearity. Almost every model based on the popular neural networks is affected. Furthermore, there is no existing countermeasure against AML, but it\u2019s even getting worse: Attackers find more and more ways to fool the models. So does this mean that Elon Musk is right and we should fear artificial intelligence, because it\u2019s our biggest threat? At least it seems that AI will be more important than ever and new progress will be made in the next years. Then we will know whether adversarial attacks have grown to become normal dangerous side effects or we discover a reliable way of defending against them.<\/p>\n<p>There is only one fact that shows us that adversarial machine learning has its limitations, too: To attack an existing model in an optimal way, we need internal information about it. However, most companies use proprietary models, keeping the architecture and parameters secret. In this manner they are still assailable, e.g. with search algorithms, but not as targeted. What a consolation!<\/p>\n<p>Maybe we should listen to the warning voices. Who wants to live in a world in that our lives are depending on the unreliable decisions of machines? Sounds a lot like dystopia and Science-Fiction, huh?<\/p>\n<p>&nbsp;<\/p>\n<h4>Sources:<\/h4>\n<ul>\n<li>Deceiving Google\u2019s Cloud Video Intelligence API Built for Summarizing Videos (<a href=\"https:\/\/arxiv.org\/pdf\/1703.09793.pdf\">https:\/\/arxiv.org\/pdf\/1703.09793.pdf<\/a>)<\/li>\n<li>Adversarial Perturbations Against Deep Neural Networks<br \/>\nfor Malware Classification (<a href=\"https:\/\/arxiv.org\/pdf\/1606.04435.pdf\">https:\/\/arxiv.org\/pdf\/1606.04435.pdf<\/a>)<\/li>\n<li>Explaining and harnessing adversarial examples, J. Goodfellow et al. (<a href=\"https:\/\/arxiv.org\/pdf\/1412.6572.pdf\">https:\/\/arxiv.org\/pdf\/1412.6572.pdf<\/a>)<\/li>\n<li>Intriguing properties of neural networks, C. Szegedy et al. (<a href=\"https:\/\/arxiv.org\/pdf\/1312.6199.pdf\">https:\/\/arxiv.org\/pdf\/1312.6199.pdf<\/a>)<\/li>\n<li>Deceiving Google\u2019s Cloud Video Intelligence API Built for Summarizing Videos, H. Hosseini et al. (<a href=\"https:\/\/arxiv.org\/pdf\/1703.09793.pdf\">https:\/\/arxiv.org\/pdf\/1703.09793.pdf<\/a>)<\/li>\n<li>Deep Neural Networks are Easily Fooled: High Confidence Predictions for Unrecognizable Images , A. Nguyen et al. (<a href=\"https:\/\/arxiv.org\/pdf\/1412.1897.pdf\">https:\/\/arxiv.org\/pdf\/1412.1897.pdf<\/a>, <a href=\"http:\/\/www.evolvingai.org\/fooling\">http:\/\/www.evolvingai.org\/fooling<\/a>)<\/li>\n<li>Hidden Voice Commands, N. Carlini et al. (<a href=\"https:\/\/www.usenix.org\/system\/files\/conference\/usenixsecurity16\/sec16_paper_carlini.pdf\">https:\/\/www.usenix.org\/system\/files\/conference\/usenixsecurity16\/sec16_paper_carlini.pdf<\/a>, <a href=\"http:\/\/www.hiddenvoicecommands.com\/\">http:\/\/www.hiddenvoicecommands.com\/<\/a>)<\/li>\n<li>Adversarial Perturbations Against Deep Neural Networks for Malware Classification, K. Grosse et al. (<a href=\"https:\/\/arxiv.org\/pdf\/1606.04435.pdf\">https:\/\/arxiv.org\/pdf\/1606.04435.pdf<\/a>)<\/li>\n<li>The Limitations of Deep Learning in Adversarial Settings , N. Papernot et al. (<a href=\"https:\/\/arxiv.org\/pdf\/1511.07528.pdf\">https:\/\/arxiv.org\/pdf\/1511.07528.pdf<\/a>)<\/li>\n<li>Fooling The Machine, D. Gershgorn (<a href=\"http:\/\/www.popsci.com\/byzantine-science-deceiving-artificial-intelligence\">http:\/\/www.popsci.com\/byzantine-science-deceiving-artificial-intelligence<\/a>) (Image)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Adversarial machine learning and its dangers The world is led by machines, humans are subjected to the robot\u2019s rule. Omniscient computer systems hold the control of the world. The newest technology has outpaced human knowledge, while the mankind is powerless in the face of the stronger, faster, better and almighty cyborgs. Such dystopian visions of [&hellip;]<\/p>\n","protected":false},"author":578,"featured_media":2625,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1,26,651],"tags":[118,106,119,57],"ppma_author":[729],"class_list":["post-2615","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-allgemein","category-secure-systems","category-system-designs","tag-adversarial-machine-learning","tag-artificial-intelligence","tag-deep-learning","tag-machine-learning"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/08\/AAEAAQAAAAAAAAxmAAAAJDcyNzkyZjkzLTUzZTEtNGU1ZS04OWYxLWU4NDU5Y2QxOTRjYQ.png","jetpack-related-posts":[{"id":10442,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2020\/08\/19\/adversarial-attacks\/","url_meta":{"origin":2615,"position":0},"title":"The Dark Side of AI &#8211; Part 2: Adversarial Attacks","author":"Florian Wintel","date":"19. August 2020","format":false,"excerpt":"Find out how AI may become an attack vector! Could an attacker use your models against your? Also, what\u2019s the worst that could happen? Welcome to the domain of adversarial AI!","rel":"","context":"In &quot;Allgemein&quot;","block_context":{"text":"Allgemein","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/allgemein\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/08\/fgsm_panda_image_preds_1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/08\/fgsm_panda_image_preds_1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/08\/fgsm_panda_image_preds_1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/08\/fgsm_panda_image_preds_1.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/08\/fgsm_panda_image_preds_1.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/08\/fgsm_panda_image_preds_1.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":7327,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/30\/about-the-robustness-of-machine-learning\/","url_meta":{"origin":2615,"position":1},"title":"About the Robustness of Machine Learning","author":"Marcel Heisler","date":"30. August 2019","format":false,"excerpt":"In the past couple of years research in the field of machine learning (ML) has made huge progress which resulted in applications like automated translation, practical speech recognition for smart assistants, useful robots, self-driving cars and lots of others. But so far we only have reached the point where ML\u2026","rel":"","context":"In &quot;Secure Systems&quot;","block_context":{"text":"Secure Systems","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/system-designs\/secure-systems\/"},"img":{"alt_text":"Glitch","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/glitch-2463363_1920.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/glitch-2463363_1920.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/glitch-2463363_1920.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/glitch-2463363_1920.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/glitch-2463363_1920.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/glitch-2463363_1920.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1017,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2016\/07\/25\/machine-learning-in-secure-systems\/","url_meta":{"origin":2615,"position":2},"title":"Machine Learning in secure systems","author":"Claudius Messerschmidt","date":"25. July 2016","format":false,"excerpt":"Sadly today's security systems often be hacked and sensitive informations get stolen. To protect a company against cyber-attacks security experts define a \"rule set\" to detect and prevent any attack. This \u201canalyst-driven solutions\u201d are build up from human experts with their domain knowledge. This knowledge is based on experiences and\u2026","rel":"","context":"In &quot;Allgemein&quot;","block_context":{"text":"Allgemein","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/allgemein\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2016\/07\/Machine_learning_SeSy_robot_landscape.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2016\/07\/Machine_learning_SeSy_robot_landscape.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2016\/07\/Machine_learning_SeSy_robot_landscape.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2016\/07\/Machine_learning_SeSy_robot_landscape.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":25062,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2023\/07\/27\/machine-learning-fluch-oder-segen-fur-die-it-security\/","url_meta":{"origin":2615,"position":3},"title":"Machine Learning: Fluch oder Segen f\u00fcr die IT Security?","author":"Sabrina Berg","date":"27. July 2023","format":false,"excerpt":"Im heutigen digitalen Zeitalter ist die Sicherheit von IT-Systemen ein allgegenw\u00e4rtiges Thema von enormer Wichtigkeit. Rund um die Uhr m\u00fcssen riesige Mengen an sensible Daten sicher gespeichert und \u00fcbertragen werden k\u00f6nnen und die Funktionalit\u00e4t von unz\u00e4hligen Systemen muss zuverl\u00e4ssig aufrecht gehalten werden. Industrie 4.0, unz\u00e4hlige Onlinediensten und das Internet of\u2026","rel":"","context":"In &quot;Allgemein&quot;","block_context":{"text":"Allgemein","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/allgemein\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/07\/Machine-learning-1024x587-1-e1690452250291.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/07\/Machine-learning-1024x587-1-e1690452250291.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/07\/Machine-learning-1024x587-1-e1690452250291.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/07\/Machine-learning-1024x587-1-e1690452250291.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":25006,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2023\/07\/24\/sicherheitscheck-wie-sicher-sind-deep-learning-systeme\/","url_meta":{"origin":2615,"position":4},"title":"Sicherheitscheck \u2013 Wie sicher sind Deep Learning Systeme?","author":"Silas Blumenstock","date":"24. July 2023","format":false,"excerpt":"Was ist Deep Learning?Angriffe auf Deep Learning Systeme\u00dcbersicht von AngriffenVor\/W\u00e4hrend des TrainingsPoisoning AttacksModel Extraction AttacksModel Inversion AttacksNach dem Training (Inferenzphase)Adversarial AttacksGegenma\u00dfnahmenAusblickLiteratur In einer immer st\u00e4rker digitalisierten Welt haben Neuronale Netze und Deep Learning eine immer wichtigere Rolle eingenommen und viele Bereiche unseres Alltags in vielerlei Hinsicht bereichert. Von Sprachmodellen \u00fcber\u2026","rel":"","context":"In &quot;Allgemein&quot;","block_context":{"text":"Allgemein","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/allgemein\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/07\/ga_banner_EA15O715KD.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/07\/ga_banner_EA15O715KD.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/07\/ga_banner_EA15O715KD.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/07\/ga_banner_EA15O715KD.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/07\/ga_banner_EA15O715KD.jpg?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":10415,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2020\/08\/19\/ai-cyberattacks-deepfakes\/","url_meta":{"origin":2615,"position":5},"title":"The Dark Side of AI &#8211; Part 1: Cyberattacks and Deepfakes","author":"Micha Christ","date":"19. August 2020","format":false,"excerpt":"Introduction Who hasn't seen a cinema production in which an AI-based robot threatens individual people or the entire human race? It is in the stars when or if such a technology can really be developed. With this series of blog entries we want to point out that AI does not\u2026","rel":"","context":"In &quot;Allgemein&quot;","block_context":{"text":"Allgemein","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/allgemein\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/08\/screen-shot-2018-08-03-at-10-34-32-1.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/08\/screen-shot-2018-08-03-at-10-34-32-1.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/08\/screen-shot-2018-08-03-at-10-34-32-1.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"jetpack_sharing_enabled":true,"authors":[{"term_id":729,"user_id":578,"is_guest":0,"slug":"jm104","display_name":"Jonas Miederer","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/d15a29d9ba35a0201372a85a016ec53287c26a881f138bf69cc30869bd27d25a?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts\/2615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/users\/578"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/comments?post=2615"}],"version-history":[{"count":8,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts\/2615\/revisions"}],"predecessor-version":[{"id":25491,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts\/2615\/revisions\/25491"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/media\/2625"}],"wp:attachment":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/media?parent=2615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/categories?post=2615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/tags?post=2615"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/ppma_author?post=2615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}