Bộ dữ liệu khối u não
Dataset Khối u não Ultralytics là một dataset phát hiện đối tượng gồm 1.115 ảnh MRI não (994 ảnh huấn luyện và 121 ảnh xác thực), với 1.180 bounding box thuộc một class duy nhất, tumor. Mỗi ảnh chứa từ 1 đến 3 bounding box khối u. Tập xác thực chứa ảnh của 25 bệnh nhân đã xác định danh tính, và không có bệnh nhân nào đã xác định danh tính xuất hiện trong cả hai tập. Với dung lượng 4,06 MB, đây là một dataset nhỏ gọn để học tập và tạo nguyên mẫu các model thị giác máy tính cho ứng dụng chăm sóc sức khỏe, nhưng không phải là tài nguyên chẩn đoán đã được xác nhận lâm sàng.
Xem: Phát hiện khối u não bằng Ultralytics Platform với Ultralytics YOLO26 | Phát hiện đối tượng 🚀
Cấu trúc dataset#
Dataset Khối u não Ultralytics gồm 1.115 ảnh MRI não và 1.180 bounding box, được chia thành hai tập theo cấu hình brain-tumor.yaml:
| Tập dữ liệu | Hình ảnh | Bounding box | Bệnh nhân |
|---|---|---|---|
| Huấn luyện | 994 | 1,057 | 95 bệnh nhân có ID, cùng 541 ảnh không có ID bệnh nhân |
| Validation | 121 | 123 | 25 |
| Tổng | 1,115 | 1,180 |
Mỗi ảnh chứa từ 1 đến 3 bounding box thuộc class duy nhất tumor; kích thước ảnh nằm trong khoảng từ 192x256 đến 512x512 pixel. Cấu hình không định nghĩa tập kiểm tra riêng.
Tập xác thực được tạo theo bệnh nhân. Một số tên tệp bắt đầu bằng ID bệnh nhân gồm năm chữ số: ví dụ, 00097_77.jpg thuộc về bệnh nhân 00097. Ảnh mang ID của 25 bệnh nhân này tạo thành tập xác thực; ảnh của 95 bệnh nhân còn lại đã xác định danh tính thuộc tập huấn luyện, do đó không có bệnh nhân nào đã xác định danh tính xuất hiện trong cả hai tập. 541 ảnh còn lại không có ID bệnh nhân trong tên tệp và đều thuộc tập huấn luyện.
Dataset được tự động tải xuống (4,06 MB) từ tài nguyên trên GitHub của Ultralytics khi bạn huấn luyện lần đầu, vì vậy không cần tải xuống hoặc chuẩn bị thủ công.
Dataset đã chuyển sang class tumor duy nhất vào tháng 11 năm 2026. Nếu thư mục cục bộ brain-tumor/images/train của bạn chứa 893 ảnh thay vì 994 ảnh, hãy xóa thư mục brain-tumor trong thư mục dataset (xem datasets_dir trong yolo settings) và cập nhật package bằng pip install -U ultralytics. Phiên bản hiện tại sẽ được tải xuống trong lần huấn luyện tiếp theo.
Khám phá Brain Tumor trên Ultralytics Platform để duyệt hình ảnh cùng các lớp phủ annotation, xem phân bố lớp và heatmap BBox trong tab Charts, cũng như sao chép bộ dữ liệu để huấn luyện model của riêng bạn trên cloud.
Ứng dụng#
Các model phát hiện khối u não xác định vị trí khối u trong ảnh MRI não. Với 1.115 ảnh và dung lượng tải xuống 4,06 MB, dataset Khối u não Ultralytics phù hợp cho:
- Học quy trình: chạy toàn bộ chu trình huấn luyện, xác thực và dự đoán trên ảnh y tế bằng một dataset nhỏ.
- Tạo nguyên mẫu: xây dựng và kiểm thử pipeline định vị khối u trước khi chuyển sang dataset lâm sàng lớn hơn.
- Đánh giá trên các bệnh nhân đã xác định danh tính: đo lường khả năng phát hiện trên 25 bệnh nhân thuộc tập xác thực. Do 541 ảnh huấn luyện không có ID bệnh nhân, không thể loại trừ khả năng trùng lặp với các bệnh nhân này.
- Nghiên cứu và giáo dục: so sánh các model phát hiện và tìm hiểu phân tích ảnh y tế cũng như AI trong X-quang.
Các model được huấn luyện trên dataset này dành cho nghiên cứu và giáo dục, chưa được xác nhận để chẩn đoán lâm sàng.
YAML của dataset#
Cấu hình brain-tumor.yaml xác định đường dẫn dataset, thư mục ảnh huấn luyện và xác thực, class duy nhất tumor cùng URL tải xuống. Nhãn sử dụng định dạng Ultralytics YOLO.
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# Brain-tumor dataset by Ultralytics
# Documentation: https://docs.ultralytics.com/datasets/detect/brain-tumor
# Example usage: yolo train data=brain-tumor.yaml
# parent
# ├── ultralytics
# └── datasets
# └── brain-tumor ← downloads here (4.06 MB)
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: brain-tumor # dataset root dir
train: images/train # train images (relative to 'path') 994 images
val: images/val # val images (relative to 'path') 121 images
# Classes
names:
0: tumor
# Download script/URL (optional)
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/brain-tumor.zipCách sử dụng#
Để huấn luyện model YOLO26n trên dataset khối u não trong 100 epoch với kích thước ảnh 640, hãy dùng các đoạn code bên dưới.
from ultralytics import YOLO
# Tải model
model = YOLO("yolo26n.pt") # tải model đã huấn luyện trước (được khuyến nghị khi huấn luyện)
# Huấn luyện model
results = model.train(data="brain-tumor.yaml", epochs=100, imgsz=640)from ultralytics import YOLO
# Tải model
model = YOLO("path/to/best.pt") # tải model đã tinh chỉnh trên brain-tumor
# Suy luận bằng model
results = model.predict("https://ultralytics.com/assets/brain-tumor-sample.jpg")Hình ảnh mẫu và annotation#
Dưới đây là một số ảnh mẫu từ dataset Khối u não Ultralytics cùng với chú giải:

- Ảnh đã chú giải: Lưới hiển thị 16 ảnh huấn luyện, mỗi ảnh có một bounding box
tumorbao quanh tổn thương. Kích thước, hình dạng và vị trí khối u khác nhau trong dataset, giúp model phát hiện khái quát hóa tốt hơn.
Trích dẫn và lời cảm ơn#
Dataset được cung cấp theo Giấy phép AGPL-3.0.
Nếu sử dụng dataset khối u não trong nghiên cứu hoặc công việc phát triển, vui lòng trích dẫn:
@dataset{Ultralytics_Brain_Tumor_Dataset_2023,
author = {Ultralytics},
title = {Brain Tumor Detection Dataset},
year = {2023},
publisher = {Ultralytics},
url = {https://docs.ultralytics.com/datasets/detect/brain-tumor}
}Câu hỏi thường gặp#
Dataset Khối u não Ultralytics có 1.115 ảnh MRI não và 1 class,
tumor: 994 ảnh huấn luyện với 1.057 bounding box và 121 ảnh xác thực với 123 bounding box. Mỗi ảnh có từ 1 đến 3 bounding box và không có tập kiểm tra riêng. Xem Cấu trúc Dataset để biết chi tiết về cách chia tập.Dataset Khối u não Ultralytics chứa ảnh MRI não, không có ảnh CT. Kích thước ảnh nằm trong khoảng từ 192x256 đến 512x512 pixel; mỗi ảnh được gán nhãn bằng 1 đến 3 bounding box
tumortheo định dạng Ultralytics YOLO.Không, dataset Khối u não Ultralytics không chứa ảnh không có khối u và cũng không có class âm tính. Cả 1.115 ảnh đều có từ 1 đến 3 bounding box
tumor, vì vậy model được huấn luyện trên dataset này sẽ học cách xác định vị trí khối u, chứ không phải xác định ảnh chụp có khỏe mạnh hay không. Các model được huấn luyện trên dataset này dành cho nghiên cứu và giáo dục, không dùng để chẩn đoán lâm sàng.Dataset Khối u não Ultralytics được chia theo bệnh nhân: 121 ảnh xác thực mang ID của 25 bệnh nhân và không có bệnh nhân nào đã xác định danh tính xuất hiện trong cả hai tập. Bệnh nhân được xác định bằng tiền tố gồm năm chữ số trong tên tệp, chẳng hạn
00097_77.jpg. Tập huấn luyện chứa 95 bệnh nhân đã xác định danh tính còn lại cùng 541 ảnh không có ID bệnh nhân trong tên tệp.Dataset Khối u não Ultralytics (4,06 MB) được tự động tải xuống từ tài nguyên trên GitHub của Ultralytics trong lần đầu huấn luyện bằng
data="brain-tumor.yaml", vì vậy không cần tải xuống thủ công. Nếu ổ đĩa đã có bản cũ với 893 ảnh huấn luyện, hãy xóa thư mụcbrain-tumorcủa bản đó và cập nhật packageultralyticstrước để tải xuống phiên bản hiện tại chỉ có một class. Để tìm một dataset chẩn đoán hình ảnh y tế nhỏ khác, hãy xem dataset phát hiện Viên thuốc y tế.Để huấn luyện YOLO26 trên dataset Khối u não Ultralytics, hãy truyền
data="brain-tumor.yaml"vào lệnh huấn luyện; dataset sẽ được tự động tải xuống. Các ví dụ dưới đây huấn luyện YOLO26n trong 100 epoch với kích thước ảnh 640:Ví dụ huấn luyệnfrom ultralytics import YOLO # Tải model model = YOLO("yolo26n.pt") # tải model đã huấn luyện trước (được khuyến nghị khi huấn luyện) # Huấn luyện model results = model.train(data="brain-tumor.yaml", epochs=100, imgsz=640)Để xem danh sách chi tiết các đối số hiện có, tham khảo trang Huấn luyện.
Để chạy suy luận bằng model YOLO26 được fine-tune trên dataset Khối u não Ultralytics, hãy tải trọng số
best.ptcủa bạn và gọi predict trên ảnh MRI não. Mỗi kết quả chứa các bounding boxtumorcùng điểm tin cậy:Ví dụ suy luậnfrom ultralytics import YOLO # Tải model model = YOLO("path/to/best.pt") # tải model đã tinh chỉnh trên brain-tumor # Suy luận bằng model results = model.predict("https://ultralytics.com/assets/brain-tumor-sample.jpg")Dataset Khối u não Ultralytics do Ultralytics tạo và phát hành theo Giấy phép AGPL-3.0.
Bình luận11
Đặt câu hỏi, chia sẻ kết quả hoặc giúp đỡ người khác.
ZoltinZyc
how can i download this datasett??
1
Paula DerrengerUltralytics(đã chỉnh sửa)Hey there! 😊 The easiest way is to train with
data=brain-tumor.yaml, which downloads the dataset automatically the first time. To download it manually, use:wget https://github.com/ultralytics/assets/releases/download/v0.0.0/brain-tumor.zip unzip brain-tumor.zip -d path/to/destinationReplace
path/to/destinationwith the directory where you'd like the dataset stored. Once you have the dataset, you're all set to start training or inferencing with YOLO models on brain tumor images!Should you need further guidance, feel free to ask. Happy coding! 🚀
G-qingqian
Thank you for your reply. I noticed that in the original dataset, the images in the train folder do have ID prefixes, but the images in the val folder are all prefixed with val1_, making it impossible to distinguish which patient the data belongs to. Therefore, I cannot redivide the dataset. Could you please provide data with complete identifiers? ---- Replied Message ---- FromGlenn @.>Date1/18/2026 @.>@.>, @.>SubjectRe: [ultralytics/ultralytics] zh/datasets/detect/brain-tumor/ (Discussion #9988) The packaged brain-tumor dataset split is provided at the image-folder level and doesn’t ship patient IDs/metadata, so we can’t guarantee a patient-disjoint (no same patient in both train/val) split; if you need patient-wise separation, you’ll need to rebuild the split from patient identifiers and point a custom YAML to *.txt image lists (supported by Ultralytics YOLO), e.g. see the provided config in the Brain Tumor dataset docs and the brain-tumor.yaml in the repo.
my-brain-tumor.yaml path: /data/brain-tumor train: splits/train.txt # one image path per line (ideally grouped by patient ID when you create it) val: splits/val.txt names: 0: negative 1: positive
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
Glenn JocherUltralyticsThe packaged
brain-tumorzip only includes image-level labels with anonymized filenames (no patient IDs/metadata), so we can’t provide “complete identifiers” or guarantee a patient-disjoint re-split; for patient-wise splitting you’ll need to rebuild from a source that includes patient IDs (e.g., your DICOM/NIfTI originals) and then generatetrain.txt/val.txt, and if you just need stronger evaluation without IDs you can use our K-Fold Cross Validation guide—please keep follow-ups here in the GitHub discussion (we can’t provide support over email/DM).
G-qingqian
Can your dataset ensure that the data are independently and identically distributed by patient? That is, there will be no data from the same patient in both the training set and the validation set.
Glenn JocherUltralyticsThe packaged
brain-tumordataset split is provided at the image-folder level and doesn’t ship patient IDs/metadata, so we can’t guarantee a patient-disjoint (no same patient in both train/val) split; if you need patient-wise separation, you’ll need to rebuild the split from patient identifiers and point a custom YAML to*.txtimage lists (supported by Ultralytics YOLO), e.g. see the provided config in the Brain Tumor dataset docs and the brain-tumor.yaml in the repo.# my-brain-tumor.yaml path: /data/brain-tumor train: splits/train.txt # one image path per line (ideally grouped by patient ID when you create it) val: splits/val.txt names: 0: negative 1: positive
pizzas17
How could I download this dataset on COCO format or how could I convert it? (Since I wish to have an EDA on it
xySun17
How can i train the yoloV8 using this dataset without loading the pre-trained weights?
Paula DerrengerUltralytics(đã chỉnh sửa)@xySun17 hello!
To train YOLO26 without loading the pre-trained weights, you can initialize the model from scratch by specifying the model architecture file (e.g.,
yolo26n.yaml) instead of the pre-trained weights file. Here’s how you can do it:Python
from ultralytics import YOLO # Load a model architecture without pre-trained weights model = YOLO("yolo26n.yaml") # build a new model from YAML # Train the model results = model.train(data="brain-tumor.yaml", epochs=100, imgsz=640)CLI
# Train from scratch using the model architecture file yolo detect train data=brain-tumor.yaml model=yolo26n.yaml epochs=100 imgsz=640This approach ensures that the model starts training with random weights rather than pre-trained ones. If you encounter any issues, please ensure you are using the latest version of the Ultralytics package and provide a minimum reproducible example if the problem persists. You can find more details on creating a reproducible example here.
Feel free to reach out if you have any further questions. Happy training! 🚀
1xySun17
Thank you!! However, there is another problem, that is, why it says the path of dataset is not found? I already downloaded the dataset files and changed the path in "brain-tumor.yaml" file.
The threw error was follows: "Dataset 'brain-tumor.yaml' images not found ⚠️, missing path '/valid/images' Note dataset download directory is '/home/ros/datasets'. You can update this in '/home/ros/.config/Ultralytics/settings.yaml'"
Paula DerrengerUltralytics(đã chỉnh sửa)Hello @xySun17,
Thank you for reaching out! It looks like the issue might be related to the dataset path configuration in your
brain-tumor.yamlfile. Here are a few steps to troubleshoot and resolve this:-
Verify Dataset Path: Ensure that the paths specified in your
brain-tumor.yamlfile correctly point to the locations of your dataset images. For example:path: /home/ros/datasets/brain-tumor train: images/train val: images/val -
Check Directory Structure: Confirm that the directory structure matches what is specified in the YAML file. The
images/trainandimages/valdirectories should exist within/home/ros/datasets/brain-tumor. -
Update Configuration: If the dataset is located in a different directory, update the
pathin the YAML file accordingly. For instance, if your dataset is in/home/ros/my-datasets/brain-tumor, update thepathto:path: /home/ros/my-datasets/brain-tumor -
Reproducible Example: If the issue persists, providing a minimum reproducible example can greatly help in diagnosing the problem. You can find guidance on creating a reproducible example here.
-
Latest Version: Ensure you are using the latest version of the Ultralytics package. You can update it using:
pip install --upgrade ultralytics
Here’s an example of how your
brain-tumor.yamlshould look:# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license # Brain-tumor dataset by Ultralytics # Documentation: https://docs.ultralytics.com/datasets/detect/brain-tumor/ # Example usage: yolo train data=brain-tumor.yaml path: /home/ros/datasets/brain-tumor # dataset root dir train: images/train # train images (relative to 'path') val: images/val # val images (relative to 'path') # Classes names: 0: negative 1: positive # Download script/URL (optional) download: https://github.com/ultralytics/assets/releases/download/v0.0.0/brain-tumor.zipIf you follow these steps and still encounter issues, please share more details or any error messages you receive. This will help us assist you better.
Best regards and happy coding! 🚀
-



