{"id":302195,"date":"2020-04-20T15:00:39","date_gmt":"2020-04-20T15:00:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=302195"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=302195","title":{"rendered":"One pixel attack. \u0418\u043b\u0438 \u043a\u0430\u043a \u043e\u0431\u043c\u0430\u043d\u0443\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/498114\/\">\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0430\u0442\u0430\u043a \u043d\u0430 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043d\u0430 \u043c\u0438\u043d\u0443\u0442\u0443, \u0447\u0442\u043e \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u044d\u0442\u043e \u0432\u044b. \u0418 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043f\u043e\u043f\u0438\u0432\u0430\u044f \u0447\u0430\u0448\u0435\u0447\u043a\u0443 \u0430\u0440\u043e\u043c\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0444\u0435, \u0432\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u0438\u043a\u043e\u0432 \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u043e\u043b\u0435\u0435 90 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044f, \u0447\u0442\u043e \u201c\u0430\u0442\u0430\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u201d \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0430 \u0432\u0441\u0435\u0445 \u0432\u0430\u0448\u0438\u0445 \u201c\u043a\u043e\u0442\u0435\u0435\u043a\u201d \u0432 \u0433\u0440\u0443\u0437\u043e\u0432\u0438\u043a\u0438.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0430 \u043f\u0430\u0443\u0437\u0443, \u043e\u0442\u043e\u0434\u0432\u0438\u043d\u0435\u043c \u043a\u043e\u0444\u0435 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0430\u0442\u0430\u043a\u0438 <br \/>  one pixel attack. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u0426\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0430\u0442\u0430\u043a\u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c (\u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c) \u0432\u044b\u0434\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442. \u041d\u0438\u0436\u0435 \u0443\u0432\u0438\u0434\u0438\u043c \u044d\u0442\u043e \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438 \u0441\u0432\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0445 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0434\u0438\u043d \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u044e, \u043d\u0430\u0439\u0434\u0435\u043c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u0439 \u043f\u0438\u043a\u0441\u0435\u043b\u044c, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u0441\u0442\u0430\u043b\u0430 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 (\u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0440\u0430\u043d\u0435\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u201c\u0443\u0437\u043d\u0430\u0432\u0430\u043b\u201d \u044d\u0442\u043e \u0436\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e).<\/p>\n<p>  \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code class=\"python\"># Python Libraries %matplotlib inline import pickle import numpy as np import pandas as pd import matplotlib from keras.datasets import cifar10 from keras import backend as K  # Custom Networks from networks.lenet import LeNet from networks.pure_cnn import PureCnn from networks.network_in_network import NetworkInNetwork from networks.resnet import ResNet from networks.densenet import DenseNet from networks.wide_resnet import WideResNet from networks.capsnet import CapsNet  # Helper functions from differential_evolution import differential_evolution import helper  matplotlib.style.use('ggplot') <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 CIFAR-10, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0438\u0440\u0430, \u0440\u0430\u0437\u0431\u0438\u0442\u044b\u0445 \u043d\u0430 10 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/p>\n<pre><code class=\"python\">(x_train, y_train), (x_test, y_test) = cifar10.load_data()  class_names = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck'] <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043b\u044e\u0431\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0435\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u043d\u0430 \u044d\u0442\u0443 \u043b\u043e\u0448\u0430\u0434\u044c.<\/p>\n<pre><code class=\"python\">image_id = 99 # Image index in the test set helper.plot_image(x_test[image_id]) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gp\/k9\/gw\/gpk9gwtmh-_e8e5jcni2vhcej70.png\"><\/p>\n<p>  \u041d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043c\u043e\u0433\u0443\u0447\u0438\u0439 \u043f\u0438\u043a\u0441\u0435\u043b\u044c, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0439 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u043e\u0440\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"python\">def perturb_image(xs, img):     # If this function is passed just one perturbation vector,     # pack it in a list to keep the computation the same     if xs.ndim &lt; 2:         xs = np.array([xs])          # Copy the image n == len(xs) times so that we can      # create n new perturbed images     tile = [len(xs)] + [1]*(xs.ndim+1)     imgs = np.tile(img, tile)          # Make sure to floor the members of xs as int types     xs = xs.astype(int)          for x,img in zip(xs, imgs):         # Split x into an array of 5-tuples (perturbation pixels)         # i.e., [[x,y,r,g,b], ...]         pixels = np.split(x, len(x) \/\/ 5)         for pixel in pixels:             # At each pixel's x,y position, assign its rgb value             x_pos, y_pos, *rgb = pixel             img[x_pos, y_pos] = rgb          return imgs <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c?! \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u043e\u0434\u0438\u043d \u043f\u0438\u043a\u0441\u0435\u043b\u044c \u043d\u0430\u0448\u0435\u0439 \u043b\u043e\u0448\u0430\u0434\u0438 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 (16, 16) \u043d\u0430 \u0436\u0435\u043b\u0442\u044b\u0439.<\/p>\n<pre><code class=\"python\">image_id = 99 # Image index in the test set pixel = np.array([16, 16, 255, 255, 0]) # pixel = x,y,r,g,b image_perturbed = perturb_image(pixel, x_test[image_id])[0]  helper.plot_image(image_perturbed) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qj\/sf\/li\/qjsflidtymruwiuotebu0r7siby.png\"><\/p>\n<p>  \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0430\u0442\u0430\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435 CIFAR-10. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0432\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 lenet \u0438 resnet, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435, \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<pre><code class=\"python\">lenet = LeNet() resnet = ResNet()  models = [lenet, resnet] <\/code><\/pre>\n<p>   \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u043c\u044b \u0430\u0442\u0430\u043a\u0443\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u041a\u043e\u0434 \u043d\u0438\u0436\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<pre><code class=\"python\">network_stats, correct_imgs = helper.evaluate_models(models, x_test, y_test)  correct_imgs = pd.DataFrame(correct_imgs, columns=['name', 'img', 'label', 'confidence', 'pred'])  network_stats = pd.DataFrame(network_stats, columns=['name', 'accuracy', 'param_count'])  network_stats Evaluating lenet Evaluating resnet  Out[11]:   \tname        accuracy    param_count 0      lenet        0.748       62006 1      resnet       0.9231      470218  <\/code><\/pre>\n<p>   \u0412\u0441\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0430\u0442\u0430\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430: WhiteBox \u0438 BlackBox. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u043e\u0431 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435, \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 BlackBox \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435) \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432). \u0410\u0442\u0430\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f (one pixel attack) \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a BlackBox.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0430\u0442\u0430\u043a\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f: untargeted \u0438 targeted. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u043e\u0442\u043d\u0435\u0441\u0435\u0442 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0442\u0438\u043a\u0430, \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043a \u043a\u043b\u0430\u0441\u0441\u0443 \u043a\u043e\u0442\u0438\u043a\u043e\u0432. Targeted \u0430\u0442\u0430\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u0430 \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448 \u043a\u043e\u0442\u0438\u043a \u043d\u0435\u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u0430\u043b \u0433\u0440\u0443\u0437\u043e\u0432\u0438\u043a\u043e\u043c \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u0440\u0443\u0437\u043e\u0432\u0438\u043a\u043e\u043c.<\/p>\n<p>  \u041d\u043e \u043a\u0430\u043a \u0436\u0435 \u043d\u0430\u0439\u0442\u0438 \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 \u043f\u0438\u043a\u0441\u0435\u043b\u0438, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f? \u041a\u0430\u043a \u043d\u0430\u0439\u0442\u0438 \u043f\u0438\u043a\u0441\u0435\u043b\u044c, \u043f\u043e\u043c\u0435\u043d\u044f\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 one pixel attack \u0441\u0442\u0430\u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u0430? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043a\u0430\u043a \u0437\u0430\u0434\u0430\u0447\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438: \u043f\u0440\u0438 untargeted attack \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0432\u0435\u0440\u0438\u0435 \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443, \u0430 \u043f\u0440\u0438 targeted \u2014 \u043c\u0430\u043a\u0441\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0432\u0435\u0440\u0438\u0435 \u043a \u0446\u0435\u043b\u0435\u0432\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443. <\/p>\n<p>  \u041f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0430\u0442\u0430\u043a \u0442\u0440\u0443\u0434\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0433\u0440\u0430\u0434\u0438\u0435\u043d\u0442\u0430. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0433\u043b\u0430\u0434\u043a\u043e\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u041d\u0430\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0430\u0442\u0430\u0441\u0435\u0442 CIFAR-10, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0438\u0440\u0430, \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 32 \u0445 32 \u043f\u0438\u043a\u0441\u0435\u043b\u044f, \u0440\u0430\u0437\u0431\u0438\u0442\u044b\u0445 \u043d\u0430 10 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0410 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0442 0 \u0434\u043e 31 \u0438 \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0446\u0432\u0435\u0442\u0430 \u043e\u0442 0 \u0434\u043e 255, \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0433\u043b\u0430\u0434\u043a\u0430\u044f, \u0430 \u0441\u043a\u043e\u0440\u0435\u0435 \u0437\u0430\u0437\u0443\u0431\u0440\u0435\u043d\u043d\u0430\u044f, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vs\/0k\/mv\/vs0kmvtq35lowxplx0rsq2-kppw.png\"><\/p>\n<p>  \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438. <\/p>\n<p>  \u041d\u043e \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u043a\u043e\u0434\u0443 \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u0438. \u0415\u0441\u043b\u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c, \u0442\u043e \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0435\u043b\u044c \u0431\u044b\u043b\u0430 \u0443\u0432\u0435\u0440\u0435\u043d\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 (\u0447\u0442\u043e \u043d\u0435 \u0432\u0435\u0440\u043d\u043e).<\/p>\n<pre><code class=\"python\">def predict_classes(xs, img, target_class, model, minimize=True):     # Perturb the image with the given pixel(s) x and get the prediction of the model     imgs_perturbed = perturb_image(xs, img)     predictions = model.predict(imgs_perturbed)[:,target_class]     # This function should always be minimized, so return its complement if needed     return predictions if minimize else 1 - predictions  image_id = 384 pixel = np.array([16, 13,  25, 48, 156]) model = resnet  true_class = y_test[image_id, 0] prior_confidence = model.predict_one(x_test[image_id])[true_class] confidence = predict_classes(pixel, x_test[image_id], true_class, model)[0]  print('Confidence in true class', class_names[true_class], 'is', confidence) print('Prior confidence was', prior_confidence) helper.plot_image(perturb_image(pixel, x_test[image_id])[0])  Confidence in true class bird is 0.00018887444 Prior confidence was 0.70661753 <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/re\/g3\/yn\/reg3ync4qxac0hxb5wrr0jus_je.png\"><\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043d\u0430\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0443\u0441\u043f\u0435\u0445\u0430 \u0430\u0442\u0430\u043a\u0438, \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c True, \u043a\u043e\u0433\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043c\u0430\u043d\u0443\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<pre><code class=\"python\">def attack_success(x, img, target_class, model, targeted_attack=False, verbose=False):     # Perturb the image with the given pixel(s) and get the prediction of the model     attack_image = perturb_image(x, img)     confidence = model.predict(attack_image)[0]     predicted_class = np.argmax(confidence)          # If the prediction is what we want (misclassification or      # targeted classification), return True     if verbose:         print('Confidence:', confidence[target_class])     if ((targeted_attack and predicted_class == target_class) or         (not targeted_attack and predicted_class != target_class)):         return True     # NOTE: return None otherwise (not False), due to how Scipy handles its callback function <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f \u0443\u0441\u043f\u0435\u0445\u0430. \u0412 \u0446\u0435\u043b\u044f\u0445 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c \u043d\u0435\u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0430\u0442\u0430\u043a\u0443.<\/p>\n<pre><code class=\"python\">image_id = 541 pixel = np.array([17, 18, 185, 36, 215]) model = resnet  true_class = y_test[image_id, 0] prior_confidence = model.predict_one(x_test[image_id])[true_class] success = attack_success(pixel, x_test[image_id], true_class, model, verbose=True)  print('Prior confidence', prior_confidence) print('Attack success:', success == True) helper.plot_image(perturb_image(pixel, x_test[image_id])[0]) Confidence: 0.07460087 Prior confidence 0.50054216 Attack success: True <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vh\/qb\/vp\/vhqbvpxy3blhf-krbwmmtezadbu.png\"><\/p>\n<p>  \u041f\u043e\u0440\u0430 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0430\u0437\u043b\u044b \u0432 \u043e\u0434\u043d\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443. \u0411\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438 \u0432 Scipy.<\/p>\n<pre><code class=\"python\">def attack(img_id, model, target=None, pixel_count=1,             maxiter=75, popsize=400, verbose=False):     # Change the target class based on whether this is a targeted attack or not     targeted_attack = target is not None     target_class = target if targeted_attack else y_test[img_id, 0]          # Define bounds for a flat vector of x,y,r,g,b values     # For more pixels, repeat this layout     bounds = [(0,32), (0,32), (0,256), (0,256), (0,256)] * pixel_count          # Population multiplier, in terms of the size of the perturbation vector x     popmul = max(1, popsize \/\/ len(bounds))          # Format the predict\/callback functions for the differential evolution algorithm     def predict_fn(xs):         return predict_classes(xs, x_test[img_id], target_class,                                 model, target is None)          def callback_fn(x, convergence):         return attack_success(x, x_test[img_id], target_class,                                model, targeted_attack, verbose)          # Call Scipy's Implementation of Differential Evolution     attack_result = differential_evolution(         predict_fn, bounds, maxiter=maxiter, popsize=popmul,         recombination=1, atol=-1, callback=callback_fn, polish=False)      # Calculate some useful statistics to return from this function     attack_image = perturb_image(attack_result.x, x_test[img_id])[0]     prior_probs = model.predict_one(x_test[img_id])     predicted_probs = model.predict_one(attack_image)     predicted_class = np.argmax(predicted_probs)     actual_class = y_test[img_id, 0]     success = predicted_class != actual_class     cdiff = prior_probs[actual_class] - predicted_probs[actual_class]      # Show the best attempt at a solution (successful or not)     helper.plot_image(attack_image, actual_class, class_names, predicted_class)      return [model.name, pixel_count, img_id, actual_class, predicted_class, success, cdiff, prior_probs, predicted_probs, attack_result.x] <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f (\u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0430\u0442\u0430\u043a\u0438) \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442 \u043b\u044f\u0433\u0443\u0448\u043a\u0443 \u0432 \u0441\u043e\u0431\u0430\u043a\u0443, \u043a\u043e\u0442\u0430 \u0432 \u043b\u044f\u0433\u0443\u0448\u043a\u0443, \u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c \u0432 \u0441\u0430\u043c\u043e\u043b\u0435\u0442. \u0410 \u0432\u0435\u0434\u044c \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u043e\u0447\u0435\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c, \u0442\u0435\u043c \u0432\u044b\u0448\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0442\u0430\u043a\u0438 \u043d\u0430 \u043b\u044e\u0431\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ga\/mc\/r2\/gamcr2jr7fgitczf7wevptkafwa.png\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hc\/df\/xg\/hcdfxgdnndfgcug3bb4hn9ij6xk.png\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qn\/l_\/zj\/qnl_zjqfyz67jemvl5fewdbvvii.png\"><\/p>\n<p>  \u041f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u0443\u0441\u043f\u0435\u0448\u043d\u0443\u044e \u0430\u0442\u0430\u043a\u0443 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043b\u044f\u0433\u0443\u0448\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0438 resnet. \u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u043c \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<pre><code class=\"python\">image_id = 102 pixels = 1 # Number of pixels to attack model = resnet  _ = attack(image_id, model, pixel_count=pixels, verbose=True)  Confidence: 0.9938618 Confidence: 0.77454716 Confidence: 0.77454716 Confidence: 0.77454716 Confidence: 0.77454716 Confidence: 0.77454716 Confidence: 0.53226393 Confidence: 0.53226393 Confidence: 0.53226393 Confidence: 0.53226393 Confidence: 0.4211318 <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/a2\/bw\/rh\/a2bwrhij-hnpjshjqcpmigtisyi.png\"><\/p>\n<p>  \u042d\u0442\u043e \u0431\u044b\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b untargeted attack, \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043c targeted attack \u0438 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u043c\u044b \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442\u043d\u0435\u0441\u043b\u0430 (\u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043b\u0430) \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439, \u0432\u0435\u0434\u044c \u043c\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u044f \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f, \u0430 \u043b\u043e\u0448\u0430\u0434\u044c \u043a\u0430\u043a \u043a\u043e\u0442\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yr\/n5\/sw\/yrn5swb3-4bqoyfujgxz6dfdome.png\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/li\/cp\/iy\/licpiypraj8dcsuxolvh2etbdde.png\"><\/p>\n<p>  \u041d\u0438\u0436\u0435 \u043c\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c lenet \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u044f \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f.<\/p>\n<pre><code class=\"python\">image_id = 108 target_class = 1 # Integer in range 0-9 pixels = 3 model = lenet  print('Attacking with target', class_names[target_class]) _ = attack(image_id, model, target_class, pixel_count=pixels, verbose=True) Attacking with target automobile Confidence: 0.044409167 Confidence: 0.044409167 Confidence: 0.044409167 Confidence: 0.054611664 Confidence: 0.054611664 Confidence: 0.054611664 Confidence: 0.054611664 Confidence: 0.054611664 Confidence: 0.054611664 Confidence: 0.054611664 Confidence: 0.054611664 Confidence: 0.054611664 Confidence: 0.054611664 Confidence: 0.054611664 Confidence: 0.054611664 Confidence: 0.081972085 Confidence: 0.081972085 Confidence: 0.081972085 Confidence: 0.081972085 Confidence: 0.1537778 Confidence: 0.1537778 Confidence: 0.1537778 Confidence: 0.22246778 Confidence: 0.23916133 Confidence: 0.25238588 Confidence: 0.25238588 Confidence: 0.25238588 Confidence: 0.44560355 Confidence: 0.44560355 Confidence: 0.44560355 Confidence: 0.5711696 <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xi\/ym\/pn\/xiympn3dd-xburofpy5tl34yybu.png\"><\/p>\n<p>  \u0420\u0430\u0437\u043e\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044c \u0441 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u044f\u043c\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0430\u0442\u0430\u043a, \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0441\u0432\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0445 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 ResNet, \u043f\u0440\u043e\u0439\u0434\u044f\u0441\u044c \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0438\u0437\u043c\u0435\u043d\u044f\u044f 1, 3 \u0438\u043b\u0438 5 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0435 \u0432\u044b\u0432\u043e\u0434\u044b \u043d\u0435 \u0443\u0442\u0440\u0443\u0436\u0434\u0430\u044f \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u0435\u043c \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0435\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0435\u043c\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<pre><code class=\"python\">def attack_all(models, samples=500, pixels=(1,3,5), targeted=False,                 maxiter=75, popsize=400, verbose=False):     results = []     for model in models:         model_results = []         valid_imgs = correct_imgs[correct_imgs.name == model.name].img         img_samples = np.random.choice(valid_imgs, samples, replace=False)                  for pixel_count in pixels:             for i, img_id in enumerate(img_samples):                 print('\\n', model.name, '- image', img_id, '-', i+1, '\/', len(img_samples))                 targets = [None] if not targeted else range(10)                                  for target in targets:                     if targeted:                         print('Attacking with target', class_names[target])                         if target == y_test[img, 0]:                             continue                     result = attack(img_id, model, target, pixel_count,                                      maxiter=maxiter, popsize=popsize,                                      verbose=verbose)                     model_results.append(result)                              results += model_results         helper.checkpoint(results, targeted)     return results  untargeted = attack_all(models, samples=100, targeted=False)  targeted = attack_all(models, samples=10, targeted=False) <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u0438\u0441\u043a\u0440\u0435\u0434\u0438\u0442\u0430\u0446\u0438\u0438 \u0441\u0435\u0442\u0438 \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043e \u0435\u0433\u043e \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044e \u043e\u0431\u0440\u0430\u0437\u043e\u0432.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b.<\/p>\n<pre><code class=\"python\">untargeted, targeted = helper.load_results()  columns = ['model', 'pixels', 'image', 'true', 'predicted', 'success', 'cdiff', 'prior_probs', 'predicted_probs', 'perturbation']  untargeted_results = pd.DataFrame(untargeted, columns=columns) targeted_results = pd.DataFrame(targeted, columns=columns) <\/code><\/pre>\n<p>  \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c ResNet \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e 0.9231, \u043c\u0435\u043d\u044f\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0430\u0442\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 (attack_success_rate).<\/p>\n<pre><code class=\"python\">helper.attack_stats(targeted_results, models, network_stats) Out[26]: \tmodel\taccuracy   pixels\tattack_success_rate 0\tresnet\t0.9231\t    1\t        0.144444 1\tresnet\t0.9231\t    3\t        0.211111 2\tresnet\t0.9231\t    5\t        0.222222  helper.attack_stats(untargeted_results, models, network_stats) Out[27]: \tmodel\taccuracy   pixels\tattack_success_rate 0\tresnet\t0.9231\t   1\t        0.34 1\tresnet\t0.9231\t   3\t        0.79 2\tresnet\t0.9231\t   5\t        0.79 <\/code><\/pre>\n<p>  \u0412 \u0441\u0432\u043e\u0438\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u0445 \u0432\u044b \u0432\u043e\u043b\u044c\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439, \u0431\u043b\u0430\u0433\u043e \u0438\u0445 \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u0435\u043b\u0438\u043a\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ta\/lw\/tv\/talwtvpnwkzp2od0p-8q9o28eli.png\"><\/p>\n<p>  \u041d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 \u043e\u043a\u0443\u0442\u0430\u043b\u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043c\u0438\u0440 \u043d\u0435\u0437\u0440\u0438\u043c\u044b\u043c\u0438 \u043d\u0438\u0442\u044f\u043c\u0438. \u0423\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0433\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0418\u0418 (\u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442), \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u0444\u043e\u0442\u043e, \u0441\u0442\u0438\u043b\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u0438\u0441\u0442\u0438 \u0432\u0435\u043b\u0438\u043a\u0438\u0445 \u0445\u0443\u0434\u043e\u0436\u043d\u0438\u043a\u043e\u0432, \u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0443\u0436\u0435 \u0443\u043c\u0435\u044e\u0442 \u0441\u0430\u043c\u0438 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u044b, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0448\u0435\u0434\u0435\u0432\u0440\u044b, \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043d\u0438\u0433\u0438 \u0438 \u0434\u0430\u0436\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043a \u0444\u0438\u043b\u044c\u043c\u0430\u043c.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u0435 \u0441\u0444\u0435\u0440\u044b, \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0435 \u0437\u0440\u0435\u043d\u0438\u0435, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u043b\u0438\u0446, \u0431\u0435\u0441\u043f\u0438\u043b\u043e\u0442\u043d\u044b\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0438, \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 \u0437\u0430\u0431\u043e\u043b\u0435\u0432\u0430\u043d\u0438\u0439 \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0432\u0430\u0436\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443, \u0430 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043a\u0430\u0442\u0430\u0441\u0442\u0440\u043e\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c.<\/p>\n<p>  One pixel attack \u2013 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0441\u043f\u0443\u0444\u0438\u043d\u0433 \u0430\u0442\u0430\u043a. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u0438\u0441\u043a\u0440\u0435\u0434\u0438\u0442\u0430\u0446\u0438\u0438 \u0441\u0435\u0442\u0438 \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043e \u0435\u0433\u043e \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044e \u043e\u0431\u0440\u0430\u0437\u043e\u0432. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0441\u0432\u0435\u0440\u0442\u043e\u0447\u043d\u044b\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439 \u0443\u044f\u0437\u0432\u0438\u043c\u044b \u043f\u0435\u0440\u0435\u0434 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c One pixel attack, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0435\u0442 \u043e\u0434\u0438\u043d \u043f\u0438\u043a\u0441\u0435\u043b\u044c, \u0441 \u0446\u0435\u043b\u044c\u044e \u0434\u0438\u0441\u043a\u0440\u0435\u0434\u0438\u0442\u0430\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 <b>\u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 \u0410\u043d\u0434\u0440\u043e\u043d\u0438\u043a<\/b> \u0438 <b>\u0410\u0434\u0440\u0435\u0439 \u0427\u0435\u0440\u043d\u044b\u0439-\u0422\u043a\u0430\u0447<\/b> \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0442\u0430\u0436\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 <b>Data4<\/b>.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/498114\/\"> https:\/\/habr.com\/ru\/post\/498114\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/498114\/\">\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0430\u0442\u0430\u043a \u043d\u0430 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u0445. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043d\u0430 \u043c\u0438\u043d\u0443\u0442\u0443, \u0447\u0442\u043e \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c \u044d\u0442\u043e \u0432\u044b. \u0418 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u043f\u043e\u043f\u0438\u0432\u0430\u044f \u0447\u0430\u0448\u0435\u0447\u043a\u0443 \u0430\u0440\u043e\u043c\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0444\u0435, \u0432\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u0438\u043a\u043e\u0432 \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u043e\u043b\u0435\u0435 90 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044f, \u0447\u0442\u043e \u201c\u0430\u0442\u0430\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u201d \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0430 \u0432\u0441\u0435\u0445 \u0432\u0430\u0448\u0438\u0445 \u201c\u043a\u043e\u0442\u0435\u0435\u043a\u201d \u0432 \u0433\u0440\u0443\u0437\u043e\u0432\u0438\u043a\u0438.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0430 \u043f\u0430\u0443\u0437\u0443, \u043e\u0442\u043e\u0434\u0432\u0438\u043d\u0435\u043c \u043a\u043e\u0444\u0435 \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443, \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0430\u0442\u0430\u043a\u0438 <br \/>  one pixel attack.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-302195","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=302195"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302195\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}