RepositoryPython
ufoym

ufoym/imbalanced-dataset-sampler

A (PyTorch) imbalanced dataset sampler for oversampling low frequent classes and undersampling high frequent ones.

2.3ksao
262fork
27issue
2lượt xem

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: data-sampling

#1 Repository của tuần

1
TINIX TRENDING·Chủ đề: imbalanced-data

#1 Repository của tuần

1
TINIX TRENDING·Chủ đề: data-sampling

#1 Repository của tuần

🎯 Cân bằng lớp dữ liệu bất thường trong PyTorch

Sampler tự động điều chỉnh trọng số lớp khi huấn luyện mô hình trên tập dữ liệu có phân phối lớp không cân bằng.

Dự án imbalanced-dataset-sampler cung cấp sampler ImbalancedDatasetSampler cho PyTorch, giải quyết vấn đề mô hình bị thiên lệch về lớp có nhiều mẫu (ví dụ: chẩn đoán bệnh hiếm). Thay vì tạo lại tập dữ liệu mới, sampler này tính toán trọng số mẫu dựa trên xác suất xuất hiện lớp và áp dụng trong mỗi epoch.

✨ Điểm nổi bật

  • Tự động tính trọng số: Ước lượng trọng số lấy nghịch đảo tần suất lớp.
  • Cân bằng phân phối lớp: Oversampling lớp thiểu số, undersampling lớp đa số trong quá trình lấy mẫu.
  • Không tạo tập dữ liệu mới: Trực tiếp áp dụng vào DataLoader.
  • Giảm overfitting: Kết hợp tốt với kỹ thuật tăng cường dữ liệu.
  • Dễ tích hợp: Chỉ cần truyền sampler vào tham số sampler của DataLoader.

💡 Vì sao đáng chú ý

Không giống kỹ thuật resampling thủ công (trùng lặp mẫu hoặc xóa ngẫu nhiên), ImbalancedDatasetSampler tích hợp sẵn trong pipeline huấn luyện PyTorch, giảm thiểu công sức xử lý dữ liệu. Kết quả trên MNIST bất thường cho thấy cải thiện đáng kể độ chính xác lớp thiểu số (như 2, 6, 9) mà không làm giảm hiệu suất lớp còn lại.


#PyTorch #ImbalancedData #MachineLearning #DataSampling #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
157.6M
Jun 1, 2026
RepositoryPython
ultralytics/ultralytics

Ultralytics YOLO27, YOLO26, YOLO11, YOLOv8 — object detection, instance segmentation, semantic segmentation, image classification, pose estimation, object tracking

63.9k
Dec 1, 2026
RepositoryPython
huggingface/transformers

🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

169.5k
Dec 1, 2026
RepositoryPython
Comfy-Org/ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

149.6k
Dec 2, 2026
Modelimage-classification
google/vit-base-patch16-224

Vision Transformer (base-sized model) Vision Transformer (ViT) model pre-trained on ImageNet-21k (14 million images, 21,843 classes) at resolution 224x224, and fine-tuned on ImageNet 2012 (1 million images, 1,000 classes) at resolution 224x224. It w...

♥0
11.8M
Sep 5, 2023
Modelimage-classification
Falconsai/nsfw_image_detection

Model Card: Fine-Tuned Vision Transformer (ViT) for NSFW Image Classification Model Description The Fine-Tuned Vision Transformer (ViT) is a variant of the transformer encoder architecture, similar to BERT, that has been adapted for image classifica...

♥0
1.4M
Sep 7, 2026
Modelimage-classification
timm/mobilenetv3_small_100.lamb_in1k

Model card for mobilenetv3small100.lambin1k A MobileNet-v3 image classification model. Trained on ImageNet-1k in timm using recipe template described below. Recipe details: A LAMB optimizer based recipe that is similar to ResNet Strikes Back(https:/...

♥0
4.0M
Oct 30, 2026
Modelimage-classification
timm/tf_efficientnetv2_s.in21k_ft_in1k

Model card for tfefficientnetv2s.in21kftin1k A EfficientNet-v2 image classification model. Trained on ImageNet-21k and fine-tuned on ImageNet-1k in Tensorflow by paper authors, ported to PyTorch by Ross Wightman. Model Details - Model Type: Image cl...

♥0
2.8M
Jan 21, 2025
Modelimage-classification
microsoft/resnet-50

ResNet-50 v1.5 ResNet model pre-trained on ImageNet-1k at resolution 224x224. It was introduced in the paper Deep Residual Learning for Image Recognition(https://arxiv.org/abs/1512.03385) by He et al. Disclaimer: The team releasing ResNet did not wr...

♥0
95.5k
Feb 13, 2024