# ๐Ÿ–ผ๏ธ Example Images for Testing This directory contains sample images for testing the ViT Auditing Toolkit across different analysis types. ## ๐Ÿ“ Directory Structure ``` examples/ โ”œโ”€โ”€ basic_explainability/ # Images for testing prediction and explanation โ”œโ”€โ”€ counterfactual/ # Images for robustness testing โ”œโ”€โ”€ calibration/ # Images for confidence calibration โ”œโ”€โ”€ bias_detection/ # Images for bias analysis โ””โ”€โ”€ general/ # General test images ``` ## ๐ŸŽฏ Recommended Test Images by Tab ### Tab 1: Basic Explainability (๐Ÿ”) **Purpose**: Test prediction accuracy and explanation quality **Recommended Images**: - **Clear single objects**: Cat, dog, car, bird (high confidence predictions) - **Complex scenes**: Multiple objects, cluttered backgrounds - **Ambiguous images**: Similar classes (husky vs wolf, muffin vs chihuahua) - **Different angles**: Top view, side view, close-up **Examples to add**: ``` basic_explainability/ โ”œโ”€โ”€ cat_portrait.jpg # Clear cat face โ”œโ”€โ”€ dog_playing.jpg # Dog in action โ”œโ”€โ”€ bird_flying.jpg # Bird in flight โ”œโ”€โ”€ car_sports.jpg # Sports car โ”œโ”€โ”€ multiple_objects.jpg # Complex scene โ”œโ”€โ”€ ambiguous_animal.jpg # Hard to classify โ””โ”€โ”€ unusual_angle.jpg # Non-standard viewpoint ``` ### Tab 2: Counterfactual Analysis (๐Ÿ”„) **Purpose**: Test prediction robustness and identify critical regions **Recommended Images**: - **Simple backgrounds**: Easy to see perturbation effects - **Centered objects**: Better for patch analysis - **Distinct features**: Eyes, wheels, wings (test if they're critical) - **Varying complexity**: Simple to complex objects **Examples to add**: ``` counterfactual/ โ”œโ”€โ”€ face_centered.jpg # Test facial feature importance โ”œโ”€โ”€ car_side_view.jpg # Test wheel/door importance โ”œโ”€โ”€ building_architecture.jpg # Test structural elements โ”œโ”€โ”€ simple_object.jpg # Baseline robustness test โ””โ”€โ”€ textured_object.jpg # Test texture vs shape ``` ### Tab 3: Confidence Calibration (๐Ÿ“Š) **Purpose**: Test if model confidence matches accuracy **Recommended Images**: - **High quality**: Should have high confidence - **Low quality**: Blurry, dark, pixelated - **Edge cases**: Partial objects, occluded views - **Various difficulties**: Easy to hard classifications **Examples to add**: ``` calibration/ โ”œโ”€โ”€ clear_high_quality.jpg # Should be high confidence โ”œโ”€โ”€ slightly_blurry.jpg # Medium confidence expected โ”œโ”€โ”€ very_blurry.jpg # Low confidence expected โ”œโ”€โ”€ dark_lighting.jpg # Test lighting robustness โ”œโ”€โ”€ partial_object.jpg # Occluded/cropped โ””โ”€โ”€ mixed_quality_set/ # Batch of varied quality ``` ### Tab 4: Bias Detection (โš–๏ธ) **Purpose**: Detect performance variations across subgroups **Recommended Images**: - **Same subject, different conditions**: Lighting, weather, seasons - **Demographic variations**: Different breeds, ages, sizes - **Environmental context**: Indoor vs outdoor, urban vs rural - **Quality variations**: Professional vs amateur photos **Examples to add**: ``` bias_detection/ โ”œโ”€โ”€ day_lighting.jpg # Same scene in daylight โ”œโ”€โ”€ night_lighting.jpg # Same scene at night โ”œโ”€โ”€ sunny_weather.jpg # Clear conditions โ”œโ”€โ”€ rainy_weather.jpg # Poor conditions โ”œโ”€โ”€ indoor_scene.jpg # Controlled environment โ”œโ”€โ”€ outdoor_scene.jpg # Natural environment โ””โ”€โ”€ subgroup_sets/ # Organized by demographic โ”œโ”€โ”€ lighting/ โ”œโ”€โ”€ weather/ โ”œโ”€โ”€ quality/ โ””โ”€โ”€ environment/ ``` ## ๐ŸŒ Where to Get Test Images ### Free Image Sources (Royalty-Free) 1. **Unsplash** (https://unsplash.com) - High quality, free to use - Good for professional-looking tests ```bash # Example downloads curl -L "https://unsplash.com/photos/[photo-id]/download" -o image.jpg ``` 2. **Pexels** (https://www.pexels.com) - Free stock photos and videos - Good variety of subjects 3. **Pixabay** (https://pixabay.com) - Free images and videos - Commercial use allowed 4. **ImageNet Sample** (https://image-net.org) - Validation set samples - Directly relevant to ViT training ### Quick Download Scripts #### Download Sample Images ```bash # Create directories mkdir -p examples/{basic_explainability,counterfactual,calibration,bias_detection,general} # Download sample cat image curl -L "https://images.unsplash.com/photo-1574158622682-e40e69881006?w=800" \ -o examples/basic_explainability/cat_portrait.jpg # Download sample dog image curl -L "https://images.unsplash.com/photo-1543466835-00a7907e9de1?w=800" \ -o examples/basic_explainability/dog_portrait.jpg # Download sample bird image curl -L "https://images.unsplash.com/photo-1444464666168-49d633b86797?w=800" \ -o examples/basic_explainability/bird_flying.jpg # Download sample car image curl -L "https://images.unsplash.com/photo-1583121274602-3e2820c69888?w=800" \ -o examples/basic_explainability/sports_car.jpg ``` #### Use Your Own Images ```bash # Simply copy your images to the appropriate directory cp /path/to/your/image.jpg examples/basic_explainability/ ``` ## ๐Ÿ“‹ Image Requirements ### Technical Specifications - **Format**: JPG, PNG, WebP - **Size**: Any size (will be resized to 224ร—224) - **Color**: RGB (grayscale will be converted) - **Quality**: Higher quality = better analysis ### Recommended Guidelines - **Resolution**: At least 224ร—224 pixels (higher is fine) - **Aspect Ratio**: Any (will be center-cropped) - **File Size**: < 10MB for faster upload - **Content**: Clear, well-lit subjects work best ## ๐Ÿงช Testing Checklist ### Basic Testing - [ ] Upload works for all image formats (JPG, PNG) - [ ] Predictions are reasonable - [ ] Visualizations render correctly - [ ] Interface is responsive ### Tab-Specific Testing #### Basic Explainability - [ ] Attention maps show relevant regions - [ ] GradCAM highlights correctly - [ ] SHAP values make sense - [ ] All layers/heads accessible #### Counterfactual Analysis - [ ] Perturbations are visible - [ ] Sensitivity maps are informative - [ ] All perturbation types work - [ ] Metrics are calculated #### Confidence Calibration - [ ] Calibration curves render - [ ] Metrics are reasonable - [ ] Bin settings work correctly #### Bias Detection - [ ] Subgroups are compared - [ ] Variations are generated - [ ] Metrics show differences ## ๐Ÿ’ก Tips for Good Test Images ### Do's โœ… - Use clear, well-lit images - Test with ImageNet classes the model knows - Try edge cases and challenging examples - Test with images from different sources - Use consistent naming conventions ### Don'ts โŒ - Don't use copyrighted images (use free sources) - Don't use extremely large files (> 50MB) - Don't use corrupted or invalid image files - Don't rely on a single image type ## ๐ŸŽฏ Creating Your Own Test Set ```bash #!/bin/bash # Script to organize your test images # Create structure mkdir -p examples/{basic_explainability,counterfactual,calibration,bias_detection} # Organize by category echo "Organizing images..." # Move or copy your images to appropriate folders # Rename for consistency mv unclear_image.jpg examples/basic_explainability/01_cat.jpg mv another_image.jpg examples/basic_explainability/02_dog.jpg echo "โœ… Test image set ready!" ``` ## ๐Ÿ“Š ImageNet Classes Reference Common classes the ViT models can recognize (examples): - **Animals**: cat, dog, bird, fish, horse, elephant, bear, tiger, etc. - **Vehicles**: car, truck, bus, motorcycle, bicycle, airplane, boat, etc. - **Objects**: chair, table, bottle, cup, keyboard, phone, book, etc. - **Nature**: tree, flower, mountain, beach, forest, etc. - **Food**: pizza, burger, cake, fruit, vegetables, etc. See full list: https://github.com/anishathalye/imagenet-simple-labels ## ๐Ÿ”— Quick Links - **Unsplash API**: https://unsplash.com/developers - **Pexels API**: https://www.pexels.com/api/ - **ImageNet**: https://image-net.org/ - **COCO Dataset**: https://cocodataset.org/ --- **Ready to test?** Add your images to the appropriate directories and start analyzing! ๐Ÿš€