Skip to content

feat: add segment 3 dataset images submission for cataluna84#10

Open
cataluna84 wants to merge 1 commit intomainfrom
submission/cataluna84-segment-3
Open

feat: add segment 3 dataset images submission for cataluna84#10
cataluna84 wants to merge 1 commit intomainfrom
submission/cataluna84-segment-3

Conversation

@cataluna84
Copy link
Contributor

Summary

This PR submits the solution for Segment 3: Dataset Images, focusing on interpreting the mixed4a layer of InceptionV1. It implements a pipeline to correlate dataset examples with feature visualizations to understand neuron behavior.

Technical Details

Notebook: segments/segment_3_dataset_images/submissions/cataluna84__segment_3_dataset_images.ipynb

ML Pipeline & Workflow

  1. Model: Pre-trained InceptionV1 (GoogLeNet) via lucent.modelzoo. Target Layer: mixed4a.
  2. Dataset Streaming: Efficiently streams ImageNet-1k from HuggingFace, processing ~1.2M images without full disk download.
  3. Activation Tracking:
    • Approach: Scans the dataset to find images that maximally (and minimally) activate specific neurons.
    • Spectrum Tracker: Uses ActivationSpectrumTrackerV2 to track 4 categories per neuron: Max Activating, Slightly Positive, Slightly Negative, and Min Activating (Inhibitory).
    • Optimization: Memory-efficient min-heap implementation (SampleRecord) to track top-k samples on the fly.
  4. Feature Visualization (Optimization):
    • Uses Lucent (lucent.optvis) to perform gradient ascent on the input space.
    • Generates Positive (Dream) and Negative (Avoidance) synthetic images to compare with real data.
  5. Visualization:
    • Outputs a Distill.pub-style Activation Spectrum, arranging synthetic and real images side-by-side to reveal the "ideal" feature vs. real-world triggers.
  6. Experiment Monitoring: Integrated with Weights & Biases to log throughput (img/sec) and progress.

Verification

  • Confirmed streaming pipeline throughput.
  • Verified interaction between ActivationExtractor hooks and the main loop.
  • Validated generation of both optimized images and dataset activation tracking.

@cataluna84
Copy link
Contributor Author

It took 31 hours 33 minutes to go through the whole ImageNet dataset with a batch size of 128 and sample_record_limit as 2000 taking about 20 GB of RAM.

https://wandb.ai/cataluna84/vision-interpretability/runs/ybjw2oe7?nw=nwusercataluna84

Let me know if you are getting the same results with the hyperparameters I am using, and any other questions that you may have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant