图 1 中毒前后confidence score
一、后门攻击包括两个步骤:1)图像投毒;2)标签投毒。
# -*- coding:utf-8 -*-
import cv2
import os
import sys
import re
import xml.etree.ElementTree as ET
from PIL import Image
import numpy as np
import random
import argparse
import shutil
from PIL import Image
from matplotlib import pyplot as plt
#
def trigger_mask_generation(xmlname, imgreadpath, poisoned_xmlpath, poisoned_imgpath):
tree = ET.parse(xmlname)
root = tree.getroot()
size = root.findall('size')
print(size)
size