Instructions to use oliversinn/waferguard-cnn with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use oliversinn/waferguard-cnn with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://oliversinn/waferguard-cnn") - Notebooks
- Google Colab
- Kaggle
waferguard-cnn
Description
Custom CNN for wafer defect classification
Model Details
- Framework: Keras (TensorFlow backend)
- Input: (52, 52, 3) normalized wafer map images
- Output: 38-class probability distribution
- Task: Multi-class wafer defect pattern classification
Metrics
- Macro F1: 0.9736
Usage
from tensorflow import keras
from huggingface_hub import hf_hub_download
import numpy as np
# Download model
model_path = hf_hub_download("username/waferguard-cnn", filename="model.keras")
model = keras.models.load_model(model_path)
# Predict on wafer map (52, 52, 3)
wafer_map = np.random.randint(0, 3, (1, 52, 52, 3)).astype(np.float32)
predictions = model.predict(wafer_map)
predicted_class = np.argmax(predictions[0])
confidence = predictions[0, predicted_class]
print(f"Class: {predicted_class}, Confidence: {confidence:.2%}")
Dataset
Trained on WaferMap dataset from Kaggle:
License
MIT License
- Downloads last month
- 5