> ## Documentation Index
> Fetch the complete documentation index at: https://aegean.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Backbone Networks

> Neural network architectures used for feature extraction

## ResNet-50

<Note>
  Since we are dealing with grayscale images we replicate the single channel to three channels to match the input size of the ResNet-50v2 model and avoid redesigning backbones.
</Note>

<img src="https://mintcdn.com/aegeanaiinc/-u553YOuO9vAksef/products/applications/anomaly-detection/manufacturing/images/resnet50.png?fit=max&auto=format&n=-u553YOuO9vAksef&q=85&s=edde3eb19c0e203818661c2db603a109" alt="ResNet-50v2 Architecture" width="363" height="15195" data-path="products/applications/anomaly-detection/manufacturing/images/resnet50.png" />

The [timm](https://github.com/huggingface/pytorch-image-models) (PyTorch Image Models) library is used to load the pretrained ResNet-50 model. The model summary shows:

* **Input**: $3 \times 224 \times 224$ images (grayscale replicated to 3 channels)
* **Output**: 2048-dimensional feature vector (before classification head)
* **Architecture**: 50 layers with residual connections
* **Pretrained on**: ImageNet (1000 classes)

### Why ResNet-50?

ResNet-50 was chosen for several reasons:

1. **Proven effectiveness**: Widely used in transfer learning applications
2. **Appropriate depth**: Deep enough to learn hierarchical features without being overly complex
3. **Efficient inference**: Reasonable computational requirements for edge deployment
4. **Available pretrained weights**: Extensive pretraining on ImageNet provides strong general visual features

### Feature Extraction

For anomaly detection, we use the ResNet-50 model as a feature extractor:

1. Remove the final classification layer
2. Extract features from the global average pooling layer
3. Obtain a 2048-dimensional embedding for each input image

These embeddings are then used with UMAP for dimensionality reduction and kNN for anomaly scoring.

***

<Callout icon="pen-to-square" iconType="regular">
  [Edit this page on GitHub](https://github.com/aegean-ai/eaia/edit/main/src/products/applications/anomaly-detection/manufacturing/appendix/backbone-networks.mdx) or [file an issue](https://github.com/aegean-ai/eaia/issues/new/choose).
</Callout>
