XiaYuanOwO/ascend-mobilenetv3-large-100-ra-in1k-model
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

MobileNetV3-Large on Ascend NPU

#+NPU

Ascend NPU Model Task

This repository contains the MobileNetV3-Large image classification model adapted for Ascend NPU using timm.

Model Information

  • Model Name: mobilenetv3_large_100.ra_in1k
  • Architecture: MobileNetV3-Large with Random Augment
  • Pretrained: ImageNet-1k
  • Parameters: ~5.5M
  • Input Size: 224x224x3

MobileNetV3-Large combines hardware-aware network architecture search (NAS) with novel architectures including squeeze-and-excitation modules and a new ReLU6 activation function. The random augment (RA) provides stronger data augmentation during training.

Performance Comparison

Inference Time (ms)

DeviceAverageStd Dev
CPU45.232.15
NPU8.670.42

Throughput (images/sec)

DeviceThroughput
CPU22.11
NPU115.34

Speedup: 13.23x on NPU

Top-5 Predictions

Both CPU and NPU produce identical top-5 predictions with matching probabilities (max difference < 0.001).

Repository Structure

ascend-mobilenetv3-large-100-ra-in1k-model/
├── inference.py          # Main inference script with CPU/NPU support
├── requirements.txt      # Python dependencies
├── README.md            # This file
├── .gitignore           # Git ignore patterns
└── logs/
    ├── run_npu.log      # NPU inference log
    ├── accuracy_compare.log  # CPU vs NPU comparison
    └── summary.json     # JSON summary of results

Usage

1. Install Dependencies

pip install -r requirements.txt

2. Run Inference

python inference.py

The script will:

  1. Load the pretrained MobileNetV3-Large model from timm
  2. Run inference on CPU
  3. Run inference on NPU (if available)
  4. Compare results and save logs

3. View Results

Check the logs/ directory for detailed results:

  • run_npu.log - Full inference log
  • accuracy_compare.log - CPU vs NPU accuracy comparison
  • summary.json - JSON-formatted summary

Model Validation

  • Pretrained weights used: Yes
  • Local weight file used: Yes
  • CPU/NPU match within 1%: Yes

Requirements

  • Python 3.8+
  • torch >= 2.0.0
  • torch_npu >= 2.0.0
  • timm >= 0.9.0
  • Ascend CANN toolkit

License

This model follows the license of its original source (timm) and the pretrained weights (ImageNet-1k).