Abstract
We present an interactive system enabling users to manipulate images to explore the robustness and sensitivity of deep learning image classifiers. Using modern web technologies to run in-browser inference, users can remove image features using inpainting algorithms and obtain new classifications in real time, which allows them to ask a variety of "what if" questions by experimentally modifying images and seeing how the model reacts. Our system allows users to compare and contrast what image regions humans and machine learning models use for classification, revealing a wide range of surprising results ranging from spectacular failures (e.g., a "water bottle" image becomes a "concert" when removing a person) to impressive resilience (e.g., a "baseball player" image remains correctly classified even without a glove or base).
Probing the Black Box: Interactive Inpainting for Model Interpretability
How do you trust a machine that can’t explain itself? As deep learning models become more pervasive, the "black box" problem—our inability to see exactly why a model makes a specific decision—becomes a major hurdle for deployment and public trust. While static heatmaps (like saliency maps) offer a glimpse into the machine's mind, they don't allow for the kind of "what if" experimentation that humans use to learn.
Researchers from Georgia Tech have developed an interactive system that lets users poke, prod, and edit images in real-time to see how a classifier reacts. By erasing specific objects and filling them in with realistic backgrounds, users can uncover the hidden biases and surprising resiliencies of modern computer vision. This open-source, web-based tool uses in-painting algorithms to let users remove image features and observe real-time changes in deep learning classifications. This interactive "what-if" approach reveals whether a model is relying on core objects or incidental background context to make its predictions.
Methods and System Architecture
Most interpretability tools are passive. They might show you a "heatmap" of pixels that influenced a decision, but they don't let you test hypotheses. For example, if a model identifies a "doctor," is it looking at the person’s face, or just the stethoscope? Existing methods for probing models often involve "occlusion"—placing gray squares over parts of an image. However, these gray squares create harsh edges and artifacts that can confuse a neural network in ways that don't reflect real-world scenarios. This system addresses the need for semantic manipulation: the ability to remove a meaningful object (like a baseball glove) and replace it with a plausible background (like dirt) to see if the model’s logic holds up.
The system combines several modern web and CV technologies:
- In-Browser Inference: Using TensorFlow.js, the system runs models like SqueezeNet and MobileNet directly in the user's browser. This enables near-instant feedback without the latency of a round-trip to a GPU server.
- Interactive Inpainting: To remove objects naturally, the tool provides two algorithms: Telea (a fast, heuristic-based method for immediate results) and PatchMatch (a more sophisticated algorithm for higher-quality textures).
- Class Activation Maps (CAMs): On-demand visualizations that highlight which regions of the image the model is currently prioritizing.
Key Insights: Fragility and Resilience
The tool reveals two fascinating extremes in model behavior:
- Contextual Fragility: The authors highlight "spectacular failures" where removing a single person from a "water bottle" image caused the model to reclassify it as a "concert." This suggests the model was over-relying on the human presence rather than the bottle itself.
- Unexpected Resilience: Conversely, some models are surprisingly robust. In one example, a "baseball player" remained correctly classified even after the ball, glove, and base were erased. This implies the model learned to recognize the specific pose or uniform of the player as sufficient evidence.
By allowing humans to choose what to erase, the tool focuses on "semantically meaningful" regions. Moving from static explanations to an "interactive dialogue" allows users to develop a more intuitive, qualitative sense of a model’s "personality" and limitations.
Key Results
The primary result is the functional system itself, which was demonstrated live at CVPR 2018. A notable misclassification case involved a photo of a dock. By removing the masts of boats and replacing them with sky, the model flipped its prediction from "dock" to "ocean liner," even though the cars and water remained unchanged. This demonstrates how the model's classification can be tethered to specific, sometimes non-essential, vertical features.
By leveraging TensorFlow.js and the Telea algorithm, the authors achieved a "real-time" loop where users can paint over an object and see the probability bars shift instantly.
Limitations and Future Work
Because it runs in the browser, the system is currently limited to smaller, mobile-optimized models like SqueezeNet. Testing massive state-of-the-art models would require a different architecture. Additionally, while inpainting is better than gray boxes, it isn't perfect; if the inpainting is "blurry," the model might react to the blurriness rather than the absence of the object. Future work could involve combinatorial search to automatically find the most "sensitive" regions of an image, though human-in-the-loop exploration remains vital for true understanding.
Summary updated