class_docstr: Implementation of Hidden Trigger Backdoor Attack by Saha et al 2019.
  "Hidden Trigger Backdoor Attacks
  
  | Paper link: https://arxiv.org/abs/1910.00033
class_docstr_tok: ["Implementation","of","Hidden","Trigger","Backdoor","Attack","by","Saha","et","al","2019",".","``","Hidden","Trigger","Backdoor","Attacks","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1910.00033"]
docstr: Helper function to preprocess the input for use with computing the loss gradient.
  :param x: The input to preprocess
  :return: Preprocessed input
docstr_tok: ["Helper","function","to","preprocess","the","input","for","use","with","computing","the","loss","gradient",".",":","param","x",":","The","input","to","preprocess",":","return",":","Preprocessed","input"]
code: def _apply_preprocessing(self, x: np.ndarray) -> np.ndarray:
      """
      Helper function to preprocess the input for use with computing the loss gradient.
      :param x: The input to preprocess
      :return: Preprocessed input
      """
      if x.shape == self.estimator.input_shape:
          x_expanded = np.expand_dims(x, 0)
      else:
          x_expanded = x
  
      # Apply preprocessing
      (
          x_preprocessed,
          _,
      ) = self.estimator._apply_preprocessing(  # pylint: disable=W0212
          x=x_expanded, y=None, fit=False
      )
      return x_preprocessed
  
file_path: adversarial-robustness-toolbox/art/attacks/poisoning/hidden_trigger_backdoor/hidden_trigger_backdoor_keras.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import List, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  import six
  from tqdm.auto import trange
  from art.attacks.attack import PoisoningAttackWhiteBox
  from art.attacks.poisoning.backdoor_attack import PoisoningAttackBackdoor
  from art.estimators import BaseEstimator, NeuralNetworkMixin
  from art.estimators.classification.classifier import ClassifierMixin
  from art.estimators.classification.keras import KerasClassifier
  from art.attacks.poisoning.hidden_trigger_backdoor.loss_meter import LossMeter
  from art.utils import check_and_transform_label_format
label_desc: Use image node_id 4 for calling the HiddenTriggerBackdoorKeras obj's underlying member method code with example usage: obj._apply_preprocessing(x) and returns: x_preprocessed