def test_certification_bounds_vs_empirical(art_warning, fix_get_mnist_data):
    """
    Create adversarial examples and assert that the lower bounds given by the classifier is higher than
    the empirical attacks and vice versa for the upper bounds
    """
    from art.attacks.evasion.projected_gradient_descent.projected_gradient_descent import ProjectedGradientDescent

    device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

    ptc = get_image_classifier_pt(from_logits=True, use_maxpool=False)
    ptc.model.to(device)

    optimizer = torch.optim.Adam(ptc.model.parameters(), lr=0.0001)

    box_model = PyTorchIBPClassifier(
        model=ptc.model,
        clip_values=(0, 1),
        loss=torch.nn.CrossEntropyLoss(),
        optimizer=optimizer,
        input_shape=(1, 28, 28),
        nb_classes=10,
    )

    mnist_data = fix_get_mnist_data[0]
    mnist_labels = fix_get_mnist_data[1]

    interval_preds = box_model.predict_intervals(x=mnist_data, bounds=0.3, limits=[0.0, 1.0])
    box_model.model.set_forward_mode("attack")
    attack = ProjectedGradientDescent(
        estimator=box_model,
        eps=0.3,
        eps_step=0.001,
        max_iter=20,
        num_random_init=1,
    )
    i_batch = attack.generate(mnist_data.astype("float32"), mnist_labels.astype("float32"))
    adv_preds = box_model.predict(i_batch)

    for adv_pred, cert_prd in zip(adv_preds, interval_preds):
        assert np.all(adv_pred > cert_prd[0])
        assert np.all(adv_pred < cert_prd[1])

    Create adversarial examples and assert that the lower bounds given by the classifier is higher than
    the empirical attacks and vice versa for the upper bounds
    
tests/estimators/certification/test_interval.py