File size: 3,424 Bytes
3f2d6ef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---

language: en
tags:
- image-classification
- nameplate-detection
- industrial
- pytorch
- computer-vision
license: mit
datasets:
- kahua-ml/nameplate-classification
base_model: mobilenet_v2
pipeline_tag: image-classification
---


# Nameplate Classifier

## Model Description

This is a lightweight binary image classifier that determines whether an image contains a readable nameplate or not. The model is based on MobileNetV2 architecture and is optimized for industrial equipment nameplate detection.

## Model Details

- **Model Type**: Image Classification (Binary)
- **Architecture**: MobileNetV2 backbone with custom classifier
- **Framework**: PyTorch
- **Model Size**: ~9.4MB
- **Input Size**: 224x224 RGB images
- **Classes**: 
  - `no_nameplate` (0): Image does not contain a readable nameplate
  - `has_nameplate` (1): Image contains a readable nameplate

## Training Data

The model was trained on the `kahua-ml/nameplate-classification` dataset, which contains:
- **Positive examples**: 3,456 images with nameplates from industrial equipment
- **Negative examples**: 826 images without nameplates from construction safety and industry datasets
- **Total**: 4,282 images

## Performance

- **Expected Accuracy**: 85-95%
- **Training Time**: ~10-15 minutes
- **Inference Speed**: Very fast (optimized for real-time applications)

## Usage

```python

import torch

import torchvision.transforms as transforms

from PIL import Image



# Load model

model = torch.load("model.pth", map_location='cpu')

model.eval()



# Prepare image

transform = transforms.Compose([

    transforms.Resize((224, 224)),

    transforms.ToTensor(),

    transforms.Normalize(mean=[0.485, 0.456, 0.406], 

                        std=[0.229, 0.224, 0.225])

])



# Predict

image = Image.open("your_image.jpg")

input_tensor = transform(image).unsqueeze(0)



with torch.no_grad():

    outputs = model(input_tensor)

    probabilities = torch.nn.functional.softmax(outputs, dim=1)

    predicted = torch.max(outputs, 1)[1].item()

    confidence = probabilities[0][predicted].item()



result = "has_nameplate" if predicted == 1 else "no_nameplate"

print(f"Prediction: {result} (Confidence: {confidence:.3f})")

```

## Applications

- Industrial equipment documentation
- Asset management systems
- Quality control in manufacturing
- Automated inventory systems

## Limitations

- Optimized for industrial nameplates
- May not work well on severely damaged or obscured nameplates
- Requires clear, readable text on nameplates

## Training Details

- **Optimizer**: Adam
- **Loss Function**: CrossEntropyLoss
- **Epochs**: 5
- **Batch Size**: 32
- **Learning Rate**: 0.001
- **Data Augmentation**: Random horizontal flip, rotation, color jitter

## Model Architecture

```

LightweightNameplateClassifier(

  (backbone): MobileNetV2(

    (classifier): Sequential(

      (0): Dropout(p=0.2)

      (1): Linear(in_features=1280, out_features=128)

      (2): ReLU()

      (3): Dropout(p=0.3)

      (4): Linear(in_features=128, out_features=2)

    )

  )

)

```

## Citation

If you use this model in your research, please cite:

```

@misc{kahua-nameplate-classifier,

  title={Lightweight Nameplate Classifier},

  author={Kahua ML Team},

  year={2024},

  howpublished={\url{https://huggingface.co/kahua-ml/nameplate-classifier}}

}

```