def test_backdoor_pattern(self):
        """
        Test the backdoor attack with a pattern-based perturbation can be trained on classifier
        """

        krc = get_image_classifier_kr()
        (is_poison_train, x_poisoned_raw, y_poisoned_raw) = self.poison_dataset(
            self.x_train_mnist, self.y_train_mnist, self.poison_func_1
        )
        # Shuffle training data
        n_train = np.shape(y_poisoned_raw)[0]
        shuffled_indices = np.arange(n_train)
        np.random.shuffle(shuffled_indices)
        x_train = x_poisoned_raw[shuffled_indices]
        y_train = y_poisoned_raw[shuffled_indices]

        krc.fit(x_train, y_train, nb_epochs=NB_EPOCHS, batch_size=32)

        Test the backdoor attack with a pattern-based perturbation can be trained on classifier
        
tests/attacks/test_backdoor_attack.py