はじめる

脳腫瘍データセット

Open Brain Tumor Dataset In Colab

Ultralytics Brain Tumorデータセットは、脳MRI画像1,115枚(トレーニング用994枚、検証用121枚)と、単一クラスのバウンディングボックス1,180個を含む物体検出データセットです。クラス名はtumorです。各画像には腫瘍のボックスが1~3個含まれています。検証用分割には特定された患者25人の画像が含まれ、特定された患者が両方の分割に含まれることはありません。容量は4.06 MBと小さく、ヘルスケア用途のコンピュータービジョンモデルの学習やプロトタイピングに適していますが、臨床的に検証された診断リソースではありません。



視聴: Ultralytics Platform と Ultralytics YOLO26 による脳腫瘍検出 | 物体検出 🚀

データセットの構成#

Ultralytics Brain Tumorデータセットには、脳MRI画像1,115枚とバウンディングボックス1,180個が含まれており、brain-tumor.yaml構成で定義された2つの分割に分かれています。

分割画像バウンディングボックス患者
学習9941,057ID付き95人、および患者IDのない画像541枚
検証12112325
合計1,1151,180

各画像には、単一クラスtumorのバウンディングボックスが1~3個含まれており、画像サイズは192x256~512x512ピクセルです。構成では個別のテスト分割は定義されていません。

検証セット

検証用分割は患者単位で作成されています。ファイル名が5桁の患者IDで始まるものがあります。たとえば、00097_77.jpgは患者00097に属します。これらの患者のうち25人のIDが付いた画像が検証用分割を構成し、特定された残り95人の患者の画像はトレーニング用分割に含まれるため、特定された患者が両方の分割に含まれることはありません。患者IDがファイル名にない残りの541枚の画像は、すべてトレーニング用分割に含まれています。

データセットは、初回のトレーニング時にUltralytics GitHubアセットから自動でダウンロードされるため、手動でのダウンロードや準備は不要です(4.06 MB)。

古いローカルコピーを更新する

データセットは2026年11月に単一のtumorクラスへ変更されました。ローカルのbrain-tumor/images/trainフォルダーに994枚ではなく893枚の画像がある場合は、データセットディレクトリ内のbrain-tumorフォルダーを削除し(yolo settings内のdatasets_dirを参照)、pip install -U ultralyticsでパッケージを更新してください。次回のトレーニング実行時に、現行バージョンがダウンロードされます。

Ultralytics PlatformのBrain Tumorでは、アノテーションのオーバーレイ付き画像を閲覧したり、Chartsタブでクラス分布やバウンディングボックスのヒートマップを確認したり、データセットをクローンしてクラウドで独自のモデルをトレーニングしたりできます。

用途#

脳腫瘍の検出モデルは、脳MRI画像内の腫瘍を特定します。画像1,115枚を含み、ダウンロードサイズが4.06 MBのUltralytics Brain Tumorデータセットは、次の用途に適しています。

  • ワークフローの学習:小規模なデータセットで医療画像を使用し、トレーニング、検証、予測の一連の流れを実行します。
  • プロトタイピング:より大規模な臨床データセットに移行する前に、腫瘍位置特定のパイプラインを構築してテストします。
  • 特定された患者での評価:検証対象の患者25人に対する検出性能を測定します。患者IDのないトレーニング画像が541枚あるため、これらの患者との重複を否定できません。
  • 研究と教育:医用画像解析や放射線科におけるAIを研究し、検出モデルを比較します。

このデータセットでトレーニングしたモデルは研究と教育を目的としており、臨床診断用として検証されていません。

データセットYAML#

brain-tumor.yaml構成では、データセットのパス、トレーニング画像フォルダーと検証画像フォルダー、単一クラスtumor、ダウンロードURLが定義されています。ラベルにはUltralytics YOLO形式を使用します。

ultralytics/cfg/datasets/brain-tumor.yaml
# 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.zip

使用方法#

以下のコードスニペットを使用すると、脳腫瘍データセットで画像サイズ640、100エポックの条件でYOLO26nモデルをトレーニングできます。

トレーニング例
from ultralytics import YOLO

# モデルを読み込む
model = YOLO("yolo26n.pt")  # 事前トレーニング済みモデルを読み込みます(トレーニングにはこちらを推奨します)

# モデルをトレーニングする
results = model.train(data="brain-tumor.yaml", epochs=100, imgsz=640)
推論例
from ultralytics import YOLO

# モデルを読み込む
model = YOLO("path/to/best.pt")  # 脳腫瘍データセットでファインチューニングしたモデルを読み込む

# モデルを使用した推論
results = model.predict("https://ultralytics.com/assets/brain-tumor-sample.jpg")

サンプル画像とアノテーション#

以下は、Ultralytics Brain Tumorデータセットのサンプル画像とアノテーションです。

Ultralytics Brain Tumorデータセットの腫瘍バウンディングボックス付き脳MRI画像のサンプル

  • アノテーション付き画像:このグリッドには、病変の周囲にtumorのバウンディングボックスが付いたトレーニング画像16枚が表示されています。データセット内で腫瘍のサイズ、形状、位置にばらつきがあるため、検出モデルの汎化に役立ちます。

引用と謝辞#

このデータセットはAGPL-3.0ライセンスの下で利用できます。

研究または開発で脳腫瘍データセットを使用する場合は、次のように引用してください。

引用
@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}
}

よくある質問#

  • Ultralytics Brain Tumorデータセットには、脳MRI画像1,115枚と1クラスtumorが含まれています。トレーニング画像994枚にはバウンディングボックスが1,057個、検証画像121枚にはバウンディングボックスが123個あります。各画像にはボックスが1~3個含まれており、個別のテスト分割はありません。分割の詳細については、データセットの構造を参照してください。

  • Ultralytics Brain Tumorデータセットには脳MRI画像が含まれており、CTスキャンはありません。画像サイズは192x256~512x512ピクセルで、各画像にはtumorのバウンディングボックスが1~3個、Ultralytics YOLO形式でラベル付けされています。

  • いいえ。Ultralytics Brain Tumorデータセットには腫瘍のない画像も陰性クラスも含まれていません。1,115枚すべての画像にtumorのバウンディングボックスが1~3個付いているため、このデータセットでトレーニングしたモデルは、スキャンが正常かどうかではなく、腫瘍の位置を学習します。このデータセットでトレーニングしたモデルは研究と教育を目的としており、臨床診断用ではありません。

  • Ultralytics Brain Tumorデータセットは患者単位で分割されています。検証画像121枚には患者25人のIDが付いており、特定された患者が両方の分割に含まれることはありません。患者はファイル名の5桁のプレフィックスで識別されます(例:00097_77.jpg)。トレーニングセットには、特定された残り95人の患者と、ファイル名に患者IDがない画像541枚が含まれています。

  • Ultralytics Brain Tumorデータセット(4.06 MB)は、data="brain-tumor.yaml"を使用した初回のトレーニング時にUltralytics GitHubアセットから自動でダウンロードされるため、手動でのダウンロードは不要です。トレーニング画像893枚の古いコピーがすでにディスクにある場合は、そのbrain-tumorフォルダーを削除し、先にultralyticsパッケージを更新すると、現行の単一クラス版がダウンロードされます。別の小規模な医用画像データセットについては、Medical Pills検出データセットを参照してください。

  • YOLO26をUltralytics Brain Tumorデータセットでトレーニングするには、トレーニングコマンドにdata="brain-tumor.yaml"を渡します。データセットは自動でダウンロードされます。以下の例では、YOLO26nを画像サイズ640、100エポックでトレーニングします。

    トレーニング例
    from ultralytics import YOLO
    
    # モデルを読み込む
    model = YOLO("yolo26n.pt")  # 事前トレーニング済みモデルを読み込みます(トレーニングにはこちらを推奨します)
    
    # モデルをトレーニングする
    results = model.train(data="brain-tumor.yaml", epochs=100, imgsz=640)

    使用可能な引数の詳細な一覧については、トレーニングページを参照してください。

  • Ultralytics Brain TumorデータセットでファインチューニングしたYOLO26モデルで推論を実行するには、best.ptの重みを読み込み、脳MRI画像に対してpredictを呼び出します。各結果には、信頼度スコア付きのtumorバウンディングボックスが含まれます。

    推論例
    from ultralytics import YOLO
    
    # モデルを読み込む
    model = YOLO("path/to/best.pt")  # 脳腫瘍データセットでファインチューニングしたモデルを読み込む
    
    # モデルを使用した推論
    results = model.predict("https://ultralytics.com/assets/brain-tumor-sample.jpg")
  • Ultralytics Brain TumorデータセットはUltralyticsが作成し、AGPL-3.0ライセンスの下で公開されています。

コメント11

質問したり、結果を共有したり、ほかの人をサポートしたりできます。

    1. Paula DerrengerUltralytics(編集済み)

      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/destination

      Replace path/to/destination with 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! 🚀

  1. G-qingqianGitHub

    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: @.***>

    1. Glenn JocherUltralytics

      The packaged brain-tumor zip 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 generate train.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).

  2. G-qingqianGitHub

    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.

    1. Glenn JocherUltralytics

      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
  3. pizzas17GitHub

    How could I download this dataset on COCO format or how could I convert it? (Since I wish to have an EDA on it

  4. xySun17GitHub

    How can i train the yoloV8 using this dataset without loading the pre-trained weights?

    1. Paula DerrengerUltralytics(編集済み)

      @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=640

      This 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! 🚀

      1
    2. xySun17GitHub

      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'"

    3. Paula DerrengerUltralytics(編集済み)

      Hello @xySun17,

      Thank you for reaching out! It looks like the issue might be related to the dataset path configuration in your brain-tumor.yaml file. Here are a few steps to troubleshoot and resolve this:

      1. Verify Dataset Path: Ensure that the paths specified in your brain-tumor.yaml file correctly point to the locations of your dataset images. For example:

        path: /home/ros/datasets/brain-tumor
        train: images/train
        val: images/val
      2. Check Directory Structure: Confirm that the directory structure matches what is specified in the YAML file. The images/train and images/val directories should exist within /home/ros/datasets/brain-tumor.

      3. Update Configuration: If the dataset is located in a different directory, update the path in the YAML file accordingly. For instance, if your dataset is in /home/ros/my-datasets/brain-tumor, update the path to:

        path: /home/ros/my-datasets/brain-tumor
      4. 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.

      5. 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.yaml should 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.zip

      If 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! 🚀