class_docstr: Implementation of the ShapeShifter attack. This is a robust physical adversarial attack on Faster R-CNN object
  detector and is developed in TensorFlow.
  
  | Paper link: https://arxiv.org/abs/1804.05810
class_docstr_tok: ["Implementation","of","the","ShapeShifter","attack",".","This","is","a","robust","physical","adversarial","attack","on","Faster","R-CNN","object","detector","and","is","developed","in","TensorFlow",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1804.05810"]
docstr: Create the loss tensor of this attack.
  
  :param initial_input: Initial input.
  :param current_value: Current image/texture.
  :param custom_loss: Custom loss function from users.
  :return: Attack loss tensor.
docstr_tok: ["Create","the","loss","tensor","of","this","attack",".",":","param","initial_input",":","Initial","input",".",":","param","current_value",":","Current","image\/texture",".",":","param","custom_loss",":","Custom","loss","function","from","users",".",":","return",":","Attack","loss","tensor","."]
code: def _create_attack_loss(
      self,
      initial_input: "Tensor",
      current_value: "Tensor",
      custom_loss: Optional["Tensor"] = None,
  ) -> "Tensor":
      """
      Create the loss tensor of this attack.
  
      :param initial_input: Initial input.
      :param current_value: Current image/texture.
      :param custom_loss: Custom loss function from users.
      :return: Attack loss tensor.
      """
      import tensorflow as tf
  
      # Compute faster rcnn loss
      partial_faster_rcnn_loss = self._create_faster_rcnn_loss()
  
      # Compute box loss
      partial_box_loss = self._create_box_loss()
  
      # Compute RPN loss
      partial_rpn_loss = self._create_rpn_loss()
  
      # Compute similarity loss
      weight_similarity_loss = self._create_similarity_loss(
          initial_input=initial_input, current_value=current_value
      )
  
      # Compute total loss
      if custom_loss is not None:
          total_loss = tf.add_n(  # pragma: no cover
              [
                  partial_faster_rcnn_loss,
                  partial_box_loss,
                  partial_rpn_loss,
                  weight_similarity_loss,
                  custom_loss,
              ],
              name="total_loss",
          )
  
      else:
          total_loss = tf.add_n(
              [
                  partial_faster_rcnn_loss,
                  partial_box_loss,
                  partial_rpn_loss,
                  weight_similarity_loss,
              ],
              name="total_loss",
          )
  
      return total_loss
  
file_path: adversarial-robustness-toolbox/art/attacks/evasion/shapeshifter.py
imports: import logging
  from typing import List, Dict, Optional, Tuple, TYPE_CHECKING
  import numpy
  from art.attacks.attack import EvasionAttack
  from art.estimators.object_detection.tensorflow_faster_rcnn import TensorFlowFasterRCNN
label_desc: Use image node_id 6 for calling the ShapeShifter obj's underlying member method code with example usage: obj._create_attack_loss(initial_input, current_value, custom_loss) and returns: total_loss