ImageNet 데이터셋
Ultralytics ImageNet 데이터셋(data="imagenet")은 이미지 분류 모델을 학습하고 벤치마킹하는 데 사용되는 ImageNet-1k / ILSVRC-2012 하위 집합입니다. 객체 클래스 1,000개, 학습 이미지 1,281,167개, 검증 이미지 50,000개로 구성되고, 일반적으로 이미지 크기 224x224로 학습하며, 다운로드 데이터의 크기는 약 144 GB입니다. 더 광범위한 ImageNet 데이터베이스에는 20,000개가 넘는 카테고리에 걸쳐 WordNet 시셋으로 주석이 달린 고해상도 이미지가 1,400만 개 이상 포함되어 있습니다. 그러나 Ultralytics는 컴퓨터 비전 분야의 딥러닝에서 사실상의 벤치마크가 된 표준화된 ILSVRC 하위 집합(1,000개 클래스)을 사용해 학습합니다.
ImageNet 사전 학습 모델#
| 모델 | 크기 (픽셀) | acc top1 | acc top5 | 속도 CPU ONNX (ms) | 속도 T4 TensorRT10 (ms) | 파라미터 (M) | FLOPs (B), 224 기준 |
|---|---|---|---|---|---|---|---|
| YOLO26n-cls | 224 | 71.4 | 90.1 | 5.0 ± 0.3 | 1.1 ± 0.0 | 2.8 | 0.4 |
| YOLO26s-cls | 224 | 76.0 | 92.9 | 7.9 ± 0.2 | 1.3 ± 0.0 | 6.7 | 1.5 |
| YOLO26m-cls | 224 | 78.1 | 94.2 | 17.2 ± 0.4 | 2.0 ± 0.0 | 11.6 | 4.8 |
| YOLO26l-cls | 224 | 79.0 | 94.6 | 23.2 ± 0.3 | 2.8 ± 0.0 | 14.1 | 6.0 |
| YOLO26x-cls | 224 | 79.9 | 95.0 | 41.4 ± 0.9 | 3.8 ± 0.0 | 29.6 | 13.5 |
주요 기능#
- Ultralytics
imagenet데이터셋은 이미지 분류의 표준 사전 학습 벤치마크인 1,000개 클래스의 이미지 1,281,167개(학습)와 50,000개(검증)(ILSVRC-2012)를 제공합니다. - 클래스는 WordNet 계층 구조에 따라 구성되며, 각 클래스는 시셋(synset, 동의어 집합)에 해당합니다.
- 모델은 일반적으로 224x224 크기로 학습되며, 전체 데이터셋은 약 144 GB를 다운로드해야 합니다.
- 매년 개최되는 ImageNet 대규모 시각 인식 챌린지(ILSVRC)는 컴퓨터 비전 연구의 발전에 중요한 역할을 해 왔습니다.
데이터셋 구조#
Ultralytics ImageNet 데이터셋은 ILSVRC-2012 분할을 사용합니다:
| 분할 | 이미지 | 클래스 |
|---|---|---|
| 학습 | 1,281,167 | 1,000 |
| 검증 | 50,000 | 1,000 |
이미지는 WordNet 시셋 ID를 이름으로 사용하는 클래스별 폴더(예: n01440764)에 저장되며, 이는 Ultralytics 분류 학습에서 요구하는 디렉터리 구조입니다. 1,000개 클래스는 각각 WordNet 시셋에 대응하며 별도의 테스트 분할은 없으므로, 검증 이미지 50,000개를 사용해 정확도를 측정합니다.
ImageNet-1k의 다운로드 용량은 약 ~144 GB이므로 학습 전에 디스크 공간이 충분한지 확인하세요. 빠른 실험에는 동일한 폴더 형식을 사용하고 훨씬 짧은 시간에 학습할 수 있는 소규모 ImageNette 및 ImageNet10 하위 집합을 사용하세요.
ImageNet 대규모 시각 인식 챌린지(ILSVRC)#
매년 개최되는 ImageNet 대규모 시각 인식 챌린지(ILSVRC)는 연구자들이 일관된 평가 지표를 갖춘 대규모 표준 데이터셋에서 알고리즘을 벤치마킹할 수 있게 했습니다. 이 대회는 이미지 분류, 객체 탐지 및 기타 비전 작업을 위한 딥러닝의 주요 발전을 이끌었습니다. 특히 AlexNet이 2012년 우승하면서 현대 딥러닝 시대의 시작에 기여했습니다.
응용 분야#
ImageNet 데이터셋은 이미지 분류, 객체 감지, 객체 위치 파악을 위한 딥러닝 모델의 학습과 평가에 널리 사용됩니다. AlexNet, VGG, ResNet과 같은 대표적인 아키텍처는 모두 ImageNet에서 개발되고 벤치마크되었으며, ImageNet 사전 학습 가중치는 다양한 비전 작업에서 전이 학습을 위한 일반적인 시작점으로 사용됩니다.
사용법#
ImageNet에서 YOLO 분류 모델을 이미지 크기 224x224로 설정하고 100 에폭 동안 학습하려면 아래 코드 스니펫을 사용하세요.
from ultralytics import YOLO
# 모델 로드
model = YOLO("yolo26n-cls.pt") # 사전 학습된 모델을 불러옵니다(학습에 권장).
# 모델 학습
results = model.train(data="imagenet", epochs=100, imgsz=224)Ultralytics Platform을 사용해 분류 데이터셋을 관리하고 클라우드에서 학습을 실행할 수도 있습니다.
샘플 이미지 및 어노테이션#
ImageNet 데이터셋은 ILSVRC-2012 클래스 1,000개를 포함하며, 컴퓨터 비전 모델을 학습하고 평가하는 데 다양하고 광범위한 자료를 제공합니다. 다음은 데이터셋의 이미지 예시입니다:

인용 및 감사의 글#
연구 또는 개발 작업에서 ImageNet 데이터셋을 사용하는 경우 다음 논문을 인용해 주세요:
@article{ILSVRC15,
author = {Olga Russakovsky and Jia Deng and Hao Su and Jonathan Krause and Sanjeev Satheesh and Sean Ma and Zhiheng Huang and Andrej Karpathy and Aditya Khosla and Michael Bernstein and Alexander C. Berg and Li Fei-Fei},
title={ImageNet Large Scale Visual Recognition Challenge},
year={2015},
journal={International Journal of Computer Vision (IJCV)},
volume={115},
number={3},
pages={211-252}
}머신 러닝 및 컴퓨터 비전 연구 커뮤니티에 귀중한 자료인 ImageNet 데이터셋을 만들고 관리해 온 Olga Russakovsky, Jia Deng, Li Fei-Fei가 이끈 ImageNet 팀에 감사드립니다. ImageNet 데이터셋과 제작자에 관한 자세한 내용은 ImageNet 웹사이트를 방문하세요.
자주 묻는 질문#
ImageNet 데이터셋은 WordNet 시셋으로 주석이 달린 고해상도 이미지 1,400만 개 이상을 포함하는 대규모 이미지 데이터베이스입니다. Ultralytics의
data="imagenet"은 이미지 분류 사전 학습의 사실상 벤치마크인 표준화된 ILSVRC-2012 하위 집합(1,000개 클래스)을 사용해 학습합니다. AlexNet, VGG, ResNet과 같은 주요 모델이 ImageNet으로 학습되고 벤치마킹되었으며, 이는 컴퓨터 비전 발전에서 ImageNet이 수행한 역할을 보여 줍니다.Ultralytics
imagenet데이터셋은 ILSVRC-2012 하위 집합을 사용하며, 여기에는 클래스 1,000개, 학습 이미지 1,281,167개, 검증 이미지 50,000개가 포함됩니다. 일반적으로 이미지 크기 224x224로 학습하며 다운로드 용량은 약 144 GB입니다. 전체 ImageNet 데이터베이스는 20,000개가 넘는 WordNet 시셋의 이미지 1,400만 개 이상으로 훨씬 규모가 크지만, 분류 학습과 벤치마킹에는 1,000개 클래스의 하위 집합이 사용됩니다.ImageNet에서 Ultralytics YOLO 모델을 학습하려면 사전 학습된 분류 모델을 불러오고
data을imagenet로 지정하세요:학습 예제from ultralytics import YOLO # 모델 로드 model = YOLO("yolo26n-cls.pt") # 사전 학습된 모델을 불러옵니다(학습에 권장). # 모델 학습 results = model.train(data="imagenet", epochs=100, imgsz=224)보다 자세한 학습 지침은 학습 페이지를 참조하세요.
Ultralytics YOLO26 사전 학습 분류 모델은 속도와 정확도 사이에서 뛰어난 균형을 제공합니다. 예를 들어 top-1 정확도 71.4%, top-5 정확도 90.1%를 달성하는 YOLO26n-cls 모델은 실시간 애플리케이션에 최적화되어 있습니다. 사전 학습 모델은 처음부터 학습하는 데 필요한 컴퓨팅 리소스를 줄이고 개발 주기를 단축합니다.
매년 개최되는 ImageNet 대규모 시각 인식 챌린지(ILSVRC)는 대규모 표준 데이터셋에서 알고리즘을 평가하는 경쟁의 장을 제공해 컴퓨터 비전의 발전을 이끌었습니다. 일관된 평가 지표는 이미지 분류, 객체 탐지, 이미지 분할의 혁신을 촉진하며 딥러닝과 컴퓨터 비전의 한계를 지속적으로 확장했습니다.
댓글8
질문을 하거나 결과를 공유하거나 다른 사람을 도와주세요.
Jie Liuhow to reproduce the result of Pretrained Models? Please give me the command
Paula DerrengerUltralytics(수정됨)@keeper-jie hi there!
To reproduce the pretrained classification results on ImageNet, train from the model YAML (not the
.ptweights) so the model starts from random initialization:Using Python:
from ultralytics import YOLO # Build a model from its YAML configuration (replace 'yolo26n-cls.yaml' with other sizes like 'yolo26s-cls.yaml') model = YOLO("yolo26n-cls.yaml") # Train the model on ImageNet results = model.train(data="imagenet", epochs=100, imgsz=224)Using CLI:
yolo train data=imagenet model=yolo26n-cls.yaml epochs=100 imgsz=224These commands train on the ImageNet dataset for 100 epochs at 224x224. You can adjust the
epochsandimgszparameters as needed. For more details, refer to the Ultralytics documentation on ImageNet.If you encounter any issues, please ensure you are using the latest version of the Ultralytics package, and provide a minimum reproducible example. Happy training! 🚀
Jie Liuplease show me the command to use yolov8 yaml file to reproduce the table result like below without pretrain model:
Model size(pixels) acc-top1 acc-top5 Speed-CPU ONNX(ms) Speed-A100 TensorRT(ms) params(M) FLOPs(B) at 640 YOLOv8n-cls 224 69.0 88.3 12.9 0.31 2.7 4.3
Paula DerrengerUltralytics(수정됨)Hi @keeper-jie,
To reproduce the results of the YOLO26 classification models on the ImageNet dataset without using pretrained weights, you can follow the steps below. This will allow you to train the models from scratch and evaluate their performance.
Using Python:
from ultralytics import YOLO # Load a model configuration without pretrained weights model = YOLO("yolo26n-cls.yaml") # You can replace 'yolo26n-cls.yaml' with other model variants like 'yolo26s-cls.yaml', 'yolo26m-cls.yaml', etc. # Train the model on ImageNet results = model.train(data="imagenet", epochs=100, imgsz=224)Using CLI:
# Start training from scratch using a *.yaml model configuration yolo train data=imagenet model=yolo26n-cls.yaml epochs=100 imgsz=224These commands will initiate training on the ImageNet dataset for 100 epochs with an image size of 224x224 pixels. You can adjust the
epochsandimgszparameters as needed.Important Notes:
- Ensure you have the latest version of the Ultralytics package installed.
- Providing a minimum reproducible example can be very helpful if you encounter any issues. You can find more information on how to create one here.
For more detailed information and additional arguments you can use, please refer to the Ultralytics documentation on ImageNet.
If you have any further questions or run into any issues, feel free to ask. Happy training! 🚀
Jie LiuI train the model with
!yolo train data=/dataset/imagenet model=yolov8x-cls.yaml epochs=100 imgsz=224 batch=476*8 device=0,1,2,3,4,5,6,7, but the result is only 0.631 on top1 acc, please help me check it. Log:100 epochs completed in 7.923 hours. Optimizer stripped from /usr/src/ultralytics/runs/classify/train4/weights/last.pt, 115.1MB Optimizer stripped from /usr/src/ultralytics/runs/classify/train4/weights/best.pt, 115.1MB Validating /usr/src/ultralytics/runs/classify/train4/weights/best.pt... Ultralytics YOLOv8.1.8 🚀 Python-3.10.13 torch-2.1.0 CUDA:0 (NVIDIA L20, 45596MiB) YOLOv8x-cls summary (fused): 133 layers, 57404200 parameters, 0 gradients, 154.8 GFLOPs [34m[1mtrain:[0m /dataset/imagenet/train... found 1281167 images in 1000 classes ✅ [34m[1mval:[0m /dataset/imagenet/val... found 50000 images in 1000 classes ✅ [34m[1mtest:[0m None... classes top1_acc top5_acc: 100%|██████████| 53/53 [00:31<00:0 all 0.631 0.858
Paula DerrengerUltralytics(수정됨)Hi @keeper-jie,
Thank you for sharing the details of your training process and results. To better assist you, it would be helpful to have a minimum reproducible example. This will allow us to diagnose the issue more effectively. You can find guidelines on how to create one here: Minimum Reproducible Example.
In the meantime, here are a few suggestions to help troubleshoot and potentially improve your model's performance:
-
Verify Dataset Integrity: Ensure that the ImageNet dataset is correctly formatted and all images are accessible. Sometimes, missing or corrupted images can affect training results.
-
Hyperparameter Tuning: Experiment with different hyperparameters such as learning rate, batch size, and optimizer settings. The default settings might not always yield the best results for every dataset.
-
Data Augmentation: Implementing data augmentation techniques can help improve model generalization. Techniques like random cropping, flipping, and color jittering can be beneficial.
-
Learning Rate Scheduler: Using a learning rate scheduler can help in adjusting the learning rate during training, which might improve convergence.
-
Regularization Techniques: Techniques such as dropout and weight decay can help in preventing overfitting and improving model performance.
-
Latest Version: Ensure you are using the latest version of the Ultralytics package. Sometimes, updates include performance improvements and bug fixes.
Here is an example command to train the model from scratch using the YOLO26 YAML configuration:
Using Python:
from ultralytics import YOLO # Load a model configuration without pretrained weights model = YOLO("yolo26x-cls.yaml") # Train the model on ImageNet results = model.train(data="imagenet", epochs=100, imgsz=224)Using CLI:
# Start training from scratch using a *.yaml model configuration yolo train data=imagenet model=yolo26x-cls.yaml epochs=100 imgsz=224If the issue persists, please provide more details or a reproducible example, and we will be happy to assist you further. Thank you for your patience and cooperation!
-
Jie LiuBug description:
use 8 L20 GPU can not reproduce yolov8x-cls top1 acc.MRE:
yolo train data=imagenet model=yolov8x-cls.yaml epochs=100 imgsz=224 batch=476*8 device=0,1,2,3,4,5,6,7Result :
100 epochs completed in 7.923 hours. Optimizer stripped from /usr/src/ultralytics/runs/classify/train4/weights/last.pt, 115.1MB Optimizer stripped from /usr/src/ultralytics/runs/classify/train4/weights/best.pt, 115.1MB Validating /usr/src/ultralytics/runs/classify/train4/weights/best.pt... Ultralytics YOLOv8.1.8 🚀 Python-3.10.13 torch-2.1.0 CUDA:0 (NVIDIA L20, 45596MiB) YOLOv8x-cls summary (fused): 133 layers, 57404200 parameters, 0 gradients, 154.8 GFLOPs [34m[1mtrain:[0m /dataset/imagenet/train... found 1281167 images in 1000 classes ✅ [34m[1mval:[0m /dataset/imagenet/val... found 50000 images in 1000 classes ✅ [34m[1mtest:[0m None... classes top1_acc top5_acc: 100%|██████████| 53/53 [00:31<00:0 all 0.631 0.858Dependencies(yolo checks):
Ultralytics YOLOv8.1.8 🚀 Python-3.10.13 torch-2.1.0 CUDA:0 (NVIDIA L20, 45596MiB) Setup complete ✅ (128 CPUs, 503.5 GB RAM, 860.1/7096.0 GB disk) OS Linux-5.15.0-94-generic-x86_64-with-glibc2.31 Environment Linux Python 3.10.13 Install git RAM 503.52 GB CPU Intel Xeon Gold 6458Q CUDA 12.1 matplotlib ✅ 3.8.2>=3.3.0 numpy ✅ 1.23.5>=1.22.2 opencv-python ✅ 4.9.0.80>=4.6.0 pillow ✅ 10.0.1>=7.1.2 pyyaml ✅ 6.0>=5.3.1 requests ✅ 2.31.0>=2.23.0 scipy ✅ 1.12.0>=1.4.1 torch ✅ 2.1.0>=1.8.0 torchvision ✅ 0.16.0>=0.9.0 tqdm ✅ 4.65.0>=4.64.0 psutil ✅ 5.9.0 py-cpuinfo ✅ 9.0.0 thop ✅ 0.1.1-2209072238>=0.1.1 pandas ✅ 2.2.0>=1.1.4 seaborn ✅ 0.13.2>=0.11.0Addition train config:
task: classify mode: train model: yolov8x-cls.yaml data: /dataset/imagenet epochs: 100 time: null patience: 50 batch: 3808 imgsz: 224 save: true save_period: -1 cache: false device: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 workers: 8 project: null name: train4 exist_ok: false pretrained: true optimizer: auto verbose: true seed: 0 deterministic: true single_cls: false rect: false cos_lr: false close_mosaic: 10 resume: false amp: true fraction: 1.0 profile: false freeze: null multi_scale: false overlap_mask: true mask_ratio: 4 dropout: 0.0 val: true split: val save_json: false save_hybrid: false conf: null iou: 0.7 max_det: 300 half: false dnn: false plots: true source: null vid_stride: 1 stream_buffer: false visualize: false augment: false agnostic_nms: false classes: null retina_masks: false embed: null show: false save_frames: false save_txt: false save_conf: false save_crop: false show_labels: true show_conf: true show_boxes: true line_width: null format: torchscript keras: false optimize: false int8: false dynamic: false simplify: false opset: null workspace: 4 nms: false lr0: 0.01 lrf: 0.01 momentum: 0.937 weight_decay: 0.0005 warmup_epochs: 3.0 warmup_momentum: 0.8 warmup_bias_lr: 0.1 box: 7.5 cls: 0.5 dfl: 1.5 pose: 12.0 kobj: 1.0 label_smoothing: 0.0 nbs: 64 hsv_h: 0.015 hsv_s: 0.7 hsv_v: 0.4 degrees: 0.0 translate: 0.1 scale: 0.5 shear: 0.0 perspective: 0.0 flipud: 0.0 fliplr: 0.5 mosaic: 1.0 mixup: 0.0 copy_paste: 0.0 auto_augment: randaugment erasing: 0.4 crop_fraction: 1.0 cfg: null tracker: botsort.yaml save_dir: /usr/src/ultralytics/runs/classify/train4I use yolov8 docker with command
docker pull ultralytics/ultralytics:8.1.8
Paula DerrengerUltralytics(수정됨)Hi @keeper-jie,
Thank you for providing detailed information about your training process and results. It's great to see that you're using the YOLOv8 classification model on the ImageNet dataset. Let's work together to troubleshoot and improve your model's performance.
Steps to Troubleshoot and Improve Performance:
-
Verify Dataset Integrity: Ensure that the ImageNet dataset is correctly formatted and all images are accessible. Sometimes, missing or corrupted images can affect training results.
-
Hyperparameter Tuning: Experiment with different hyperparameters such as learning rate, batch size, and optimizer settings. The default settings might not always yield the best results for every dataset.
-
Data Augmentation: Implementing data augmentation techniques can help improve model generalization. Techniques like random cropping, flipping, and color jittering can be beneficial.
-
Learning Rate Scheduler: Using a learning rate scheduler can help in adjusting the learning rate during training, which might improve convergence.
-
Regularization Techniques: Techniques such as dropout and weight decay can help in preventing overfitting and improving model performance.
-
Latest Version: Ensure you are using the latest version of the Ultralytics package. Sometimes, updates include performance improvements and bug fixes.
Example Command to Train from Scratch:
Here is an example command to train the model from scratch using the YOLO26 YAML configuration:
Using Python:
from ultralytics import YOLO # Load a model configuration without pretrained weights model = YOLO("yolo26x-cls.yaml") # Train the model on ImageNet results = model.train(data="imagenet", epochs=100, imgsz=224)Using CLI:
# Start training from scratch using a *.yaml model configuration yolo train data=imagenet model=yolo26x-cls.yaml epochs=100 imgsz=224Additional Tips:
- Check for Overfitting: Monitor the training and validation loss. If the training loss is significantly lower than the validation loss, your model might be overfitting.
- Use Mixed Precision Training: Enabling Automatic Mixed Precision (AMP) can speed up training and reduce memory usage.
Minimum Reproducible Example:
If the issue persists, please provide a minimum reproducible example. This will help us diagnose the issue more effectively. You can find guidelines on how to create one here: Minimum Reproducible Example.
If you have any further questions or run into any issues, feel free to ask. Happy training! 🚀
-