/ Модель

Характеристики

Лицензия
MIT
Опубликована
20 окт 2026

recyclenet-mobilenetv3

Классификация изображенийИзображение → label3 профессии
0скачиваний за 30 дней0лайковвеса обновлены21 окт 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Компактные варианты MobileNetV3 в ONNX классифицируют фотографии отходов по шести категориям для сортировки и управления переработкой.

RecycleNet — набор моделей классификации бытовых отходов на базе MobileNetV3-Small и MobileNetV3-Large, подготовленный LeoYan и опубликованный в формате ONNX. Модели относят изображение к одному из шести классов: картон, стекло, металл, бумага, пластик или прочие отходы. Малый вариант рассчитан на устройства с ограниченными ресурсами, включая встраиваемые системы и Raspberry Pi; большой предназначен для серверных сервисов и более высокой точности. В README указана точность большого варианта 83,11% и macro F1 80,51% на тестовой выборке TrashNet.

На вход подаётся пакет RGB-изображений размером 224×224 с нормализацией ImageNet, на выходе — оценки для шести классов. Обе модели используют ONNX opset 18 и поддерживают динамический размер пакета; веса обучены дообучением предобученных на ImageNet-1k MobileNetV3 с классификационной головой для TrashNet. Репозиторий распространяется по лицензии MIT. Качество зависит от соответствия фотографий обучающим данным; модель классифицирует только шесть перечисленных категорий и не выполняет локализацию объектов.

Сценарии применения

  • сортировка картона, стекла, металла, бумаги и пластика по фотографиям
  • распознавание прочих отходов на конвейере переработки
  • классификация мусора на Raspberry Pi и встраиваемых устройствах
  • автоматизация приёма отходов в облачном сервисе
  • предварительная сортировка отходов в клиентском приложении

Ограничения

Модель различает только шесть классов TrashNet и выдаёт оценки классов без указания расположения объектов. Качество на реальных изображениях может отличаться от указанного для тестовой выборки TrashNet.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

♻️ RecycleNet: MobileNetV3 (Small & Large) for Waste Classification (ONNX)

GitHub Repository Hugging Face Model License: MIT ONNX Runtime

RecycleNet provides edge-optimized, production-ready deep learning models designed to classify municipal solid waste into 6 recyclable and non-recyclable streams: Cardboard, Glass, Metal, Paper, Plastic, and Trash.

The complete training pipeline, distributed hyperparameter optimization (Ray Tune), MLflow tracking, and dual-serving (FastAPI & Rust Axum) source code are open-source in the PilotLeoYan/RecycleNet-K8s repository.

This repository hosts two production ONNX variants serialized in opset 18 with dynamic batching:

  1. ⚡ recyclenet-small.onnx (~6.1 MB, 1.52M params): Ultra-compact model engineered for resource-constrained edge hardware, embedded systems, microcontrollers, Raspberry Pi, and client-side WebAssembly.
  2. 🚀 recyclenet-large.onnx (~16.4 MB, 4.21M params): High-capacity model delivering significantly higher classification accuracy (83.11% accuracy, 80.51% macro F1, 0.9790 AUC), engineered for high-throughput cloud microservices (FastAPI, Rust Axum) and edge servers.

📊 Comprehensive Model Comparison

Both models were evaluated on the held-out test split (15% of the TrashNet dataset, 379 samples) with zero data leakage:

Specification / MetricMobileNetV3-Small (recyclenet-small.onnx)MobileNetV3-Large (recyclenet-large.onnx)$\Delta$ (Large vs Small)
Backbone Architecturemobilenet_v3_smallmobilenet_v3_largeHigher capacity
Total Parameters1,524,006 (~1.52M)4,209,718 (~4.21M)+2,685,712 (+176%)
ONNX File Size6.08 MB (6,378,525 B)16.35 MB (17,143,261 B)+10.27 MB
Test Accuracy78.10%83.11%+5.01%
Macro F1-Score74.91%80.51%+5.60%
ROC-AUC (One-vs-Rest)0.94720.9790+0.0318
Test Loss0.65120.4879-0.1633 (lower is better)
Numerical Parity ($\Delta_{\max}$)$2.15 \times 10^{-6}$$5.72 \times 10^{-6}$Both within $< 10^{-5}$ tolerance
Input Shape[batch_size, 3, 224, 224][batch_size, 3, 224, 224]Identical interface
Output Shape[batch_size, 6][batch_size, 6]Identical interface
Target DeploymentEmbedded / IoT / Raspberry PiCloud APIs / Rust / High-AccuracyFlexible trade-off

📈 Per-Class Detailed Performance Breakdown

The table below contrasts the per-class precision, recall, and F1-score across both model architectures on the test split:

Class IDCategorySupportMobileNetV3-Small F1MobileNetV3-Large F1Large PrecisionLarge RecallLarge F1 $\Delta$
0Cardboard5988.29%87.85%97.92%79.66%-0.44%
1Glass7879.78%85.88%79.35%93.59%+6.10%
2Metal6177.31%82.64%83.33%81.97%+5.33%
3Paper9180.92%84.44%85.39%83.52%+3.52%
4Plastic6674.24%81.75%78.87%84.85%+7.51%
5Trash2448.89%60.47%68.42%54.17%+11.58%

[!TIP] Key Architectural Insight: The increased capacity of MobileNetV3-Large yields the most dramatic improvements on complex, ambiguous classes. Trash F1 jumped by +11.58% (precision from 52.4% to 68.4%) and Plastic F1 increased by +7.51% (recall from 74.2% to 84.8%), where subtle texture cues require the richer feature representation of the larger backbone.


🛠️ Input & Output Specification

Both models strictly adhere to the identical tensor contract, allowing seamless drop-in substitution without code modifications.

Input Tensor

  • Name: image
  • Shape: [batch_size, 3, 224, 224] (Dynamic batch dimension, 3 RGB channels, $224 \times 224$ pixels)
  • Data Type: float32
  • Normalization (Standard ImageNet):
    • $\mu = [0.485, 0.456, 0.406]$
    • $\sigma = [0.229, 0.224, 0.225]$

Output Tensor

  • Name: logits
  • Shape: [batch_size, 6] (Raw, unnormalized class logits)
  • Data Type: float32

Class Mapping

{
  "0": "cardboard",
  "1": "glass",
  "2": "metal",
  "3": "paper",
  "4": "plastic",
  "5": "trash"
}

🚀 Quickstart with ONNX Runtime (Python)

Run inference with either variant without installing PyTorch:

import numpy as np
import onnxruntime as ort
from PIL import Image
from huggingface_hub import hf_hub_download

# Choose variant: 'recyclenet-small.onnx' or 'recyclenet-large.onnx'
MODEL_FILENAME = "recyclenet-large.onnx"

# 1. Download model from Hugging Face Hub
model_path = hf_hub_download(
    repo_id="LeoYan/recyclenet-mobilenetv3",
    filename=MODEL_FILENAME,
)

# 2. Preprocess input image (ImageNet normalization)
def preprocess(image_path: str) -> np.ndarray:
    image = Image.open(image_path).convert("RGB").resize((224, 224))
    img_data = np.array(image, dtype=np.float32) / 255.0  # Scale to [0, 1]
    
    mean = np.array([0.485, 0.456, 0.406], dtype=np.float32)
    std = np.array([0.229, 0.224, 0.225], dtype=np.float32)
    normalized = (img_data - mean) / std
    
    # Transform shape: [H, W, C] -> [1, C, H, W]
    return np.expand_dims(np.transpose(normalized, (2, 0, 1)), axis=0)

# 3. Execute Inference
labels = {0: "cardboard", 1: "glass", 2: "metal", 3: "paper", 4: "plastic", 5: "trash"}

session = ort.InferenceSession(model_path)
input_name = session.get_inputs()[0].name
input_tensor = preprocess("sample_bottle.jpg")

logits = session.run(None, {input_name: input_tensor})[0]
probabilities = np.exp(logits) / np.sum(np.exp(logits), axis=-1, keepdims=True)

predicted_class = int(np.argmax(probabilities, axis=1)[0])
confidence = float(probabilities[0][predicted_class])

print(f"Model: {MODEL_FILENAME}")
print(f"Prediction: {labels[predicted_class]} ({confidence * 100:.2f}%)")

🔬 Training Pipeline & Reproducibility

Both models were trained using the MLOps pipeline available in PilotLeoYan/RecycleNet-K8s:

  • Dataset: TrashNet (2,527 images partitioned 70% train, 15% validation, 15% test).
  • Transfer Learning: Backbone pre-trained on ImageNet-1k with custom 6-class classification head and fine-tuning.
  • Hyperparameter Optimization: Distributed search with Ray Tune (ASHA scheduler) sweeping learning rate, weight decay, and batch size.
  • Tracking & Model Registry: Logged with MLflow Tracking (mlflow.db) capturing parameters, per-epoch loss/metrics, and confusion matrices.
  • Parity Verification: Validated with onnx.checker and rigorous PyTorch vs ONNX Runtime output delta tests ($\Delta_{\max} < 10^{-5}$).
  • Serving Backends:
    • FastAPI (src/api): Python REST API with lifespan-managed session cache.
    • Rust Axum (rust_inference): Compiled native microservice using ort and axum achieving sub-millisecond p95 latency.

📜 Citation & License

Shared under the MIT License. If you use these models in your academic research or industry project, please cite:

@misc{recyclenet2026,
  author = {Ortega Rivera, Leonardo F.},
  title = {RecycleNet: Deep Learning & MLOps for Real-Time Waste Classification},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/LeoYan/recyclenet-mobilenetv3}},
  url = {https://github.com/PilotLeoYan/RecycleNet-K8s}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

В репозитории нет весов в формате PyTorch/safetensors.

Ревизия весов
18f647c

0 моделей