AlexNet_IN1k

AlexNet_IN1k is an EIDORA image-embedding adaptation of TorchVision's pretrained AlexNet checkpoint AlexNet_Weights.IMAGENET1K_V1.

Instead of returning the original 1000-class classification output, this package exposes the 4096-dimensional activation after the second fully connected layer and applies L2 normalization. The resulting embeddings are intended to be compared with cosine similarity.

Recommended Use

This model is suitable when a classic convolutional neural-network representation is useful as a reference or comparison point.

  • General-purpose visual feature extraction and image-similarity or retrieval experiments.
  • Comparing a classic CNN representation with other image encoders on the same collection.
  • Exploratory analysis of image collections, including art and cultural-image collections, when the representation is evaluated against the needs of the specific collection.

AlexNet features have been used in prior work as generic image descriptors and in computational studies of visual art. The cultural-art studies cited below used different AlexNet layers or task-specific fine-tuning, so they should be understood as evidence for the broader use of AlexNet representations rather than validation of this exact EIDORA embedding.

Limitations

  • The upstream checkpoint is distributed by TorchVision as IMAGENET1K_V1 for ImageNet-1K classification; it was not developed specifically for cultural-heritage analysis, art similarity, or collection-specific semantics.
  • The embedding has 4096 dimensions, which is relatively large compared with many newer image encoders and increases storage requirements for large collections.
  • AlexNet is an older CNN architecture. Its representation should be compared with alternative encoders on the target collection rather than assumed to be the most appropriate representation for every task.
  • This package provides image embeddings only; it is not a text-image or other cross-modal model.

Input

  • Modality: image
  • Color space: RGB
  • Model input size: 224 x 224
  • Runtime input name: pixel_values
  • Tensor layout: NCHW

Output

The model returns:

embedding: float32 [batch, 4096]

The representation is taken from the activation after the second 4096-unit fully connected layer of the TorchVision AlexNet classifier. The package returns this representation L2-normalized so that cosine similarity can be used directly.

The original 1000-class AlexNet classification output is not exposed by this package.

Preprocessing

The image preprocessing follows the transform associated with TorchVision AlexNet_Weights.IMAGENET1K_V1.

Before the ONNX model:

  1. Convert the image to RGB.
  2. Resize the shorter image side to 256 pixels using bilinear interpolation.
  3. Center crop to 224 x 224.
  4. Rescale pixel values to [0, 1].

The following channel normalization is included inside the ONNX graph:

  • Mean: [0.485, 0.456, 0.406]
  • Standard deviation: [0.229, 0.224, 0.225]

This division is important for reproducing the EIDORA embedding: decoding, RGB conversion, resizing, cropping and rescaling happen before the model, while mean/std normalization is part of the ONNX graph.

Model Source and Architecture

Exact converted checkpoint

This package was converted from:

torchvision.models.alexnet(
    weights=AlexNet_Weights.IMAGENET1K_V1
)

TorchVision weight identifier:

AlexNet_Weights.IMAGENET1K_V1

TorchVision weight artifact:

alexnet-owt-7be5be79.pth

Official TorchVision documentation:

https://docs.pytorch.org/vision/stable/models/generated/torchvision.models.alexnet.html

TorchVision source:

https://github.com/pytorch/vision/blob/main/torchvision/models/alexnet.py

Architecture provenance

AlexNet was introduced by Alex Krizhevsky, Ilya Sutskever and Geoffrey E. Hinton in ImageNet Classification with Deep Convolutional Neural Networks (2012).

https://proceedings.neurips.cc/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html

The TorchVision architecture contains five convolutional layers followed by a classifier with two 4096-unit hidden fully connected layers and a final 1000-class output layer. EIDORA exposes the activation after the second 4096-unit layer rather than the final classifier.

Training Data and Checkpoint Provenance

TorchVision identifies this checkpoint as AlexNet_Weights.IMAGENET1K_V1. Its metadata reports ImageNet-1K classification results and states that the weights closely reproduce the results of the AlexNet paper using a simplified training recipe.

TorchVision training recipe:

https://github.com/pytorch/vision/tree/main/references/classification#alexnet-and-vgg

For background on the ImageNet Large Scale Visual Recognition Challenge and the ImageNet classification benchmark, see:

Olga Russakovsky et al. (2015), ImageNet Large Scale Visual Recognition Challenge, International Journal of Computer Vision.

https://doi.org/10.1007/s11263-015-0816-y

For dataset provenance, this card follows TorchVision's checkpoint naming and cites the ImageNet/ILSVRC literature. It does not claim that a third-party ImageNet mirror or Hugging Face dataset repository was the direct source used to train these weights.

Research Context

AlexNet representations as image descriptors

The original AlexNet work examined similarity using the network's 4096-dimensional hidden representation. Later computer-vision literature also established the use of AlexNet fully connected activations, including FC7-type activations, as generic image descriptors and for image retrieval.

Suraj Srinivas et al. (2016), A Taxonomy of Deep Convolutional Neural Nets for Computer Vision.

https://doi.org/10.3389/frobt.2015.00036

Use in visual-art research

Brachmann, Barth and Redies (2017) used AlexNet features to study visual properties of Western, Islamic and Chinese artworks. Their analysis focused on convolutional feature responses rather than the exact 4096-dimensional EIDORA representation used here.

Anselm Brachmann, Erhardt Barth and Christoph Redies (2017), Using CNN Features to Better Understand What Makes Visual Artworks Special.

https://doi.org/10.3389/fpsyg.2017.00830

Elgammal et al. (2018) compared AlexNet, VGGNet and ResNet variants for art-style classification and representation analysis on large painting collections. Their AlexNet experiments included task-specific training/fine-tuning and reduced-dimensional layers, so their model is also not identical to this unchanged TorchVision embedding.

Ahmed Elgammal et al. (2018), The Shape of Art History in the Eyes of the Machine.

https://doi.org/10.1609/aaai.v32i1.11894

These studies motivate including AlexNet as an established representation for comparison in cultural-image analysis, but they do not imply that this exact checkpoint or embedding is optimal for every cultural collection.

Attribution and Licensing

Original architecture authors: Alex Krizhevsky, Ilya Sutskever and Geoffrey E. Hinton.

The converted checkpoint is distributed upstream through TorchVision. TorchVision source code is licensed under BSD-3-Clause. Terms associated with pretrained weights and the original training data should also be considered when using or redistributing the model.

EIDORA provides the ONNX conversion and embedding adaptation and does not claim authorship of the original AlexNet architecture, TorchVision implementation, pretrained checkpoint, or ImageNet training data.

References

  1. Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). ImageNet Classification with Deep Convolutional Neural Networks. NeurIPS 25.
  2. Krizhevsky, A. (2014). One weird trick for parallelizing convolutional neural networks. arXiv:1404.5997.
  3. Russakovsky, O. et al. (2015). ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision, 115, 211-252.
  4. Srinivas, S. et al. (2016). A Taxonomy of Deep Convolutional Neural Nets for Computer Vision. Frontiers in Robotics and AI, 2:36.
  5. Elgammal, A., Liu, B., Kim, D., Elhoseiny, M., & Mazzone, M. (2018). The Shape of Art History in the Eyes of the Machine. AAAI-18.

Package Information

  • Package version: 0.1.0
  • ONNX opset: 17
Downloads last month
823
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including EIDORA/AlexNet_IN1k

Paper for EIDORA/AlexNet_IN1k