diff --git a/docs/en/datasets/detect/brain-tumor.md b/docs/en/datasets/detect/brain-tumor.md new file mode 100644 index 00000000000..1507e74785d --- /dev/null +++ b/docs/en/datasets/detect/brain-tumor.md @@ -0,0 +1,91 @@ +--- +comments: true +description: Brain tumor detection, a leading dataset for medical imaging, integrates with Ultralytics. Discover ways to use it for training YOLO models. +keywords: Ultralytics, Brain Tumor dataset, object detection, YOLO, YOLO model training, object tracking, computer vision, deep learning models +--- + +# Brain Tumor Dataset + +A brain tumor detection dataset consists of medical images from MRI or CT scans, containing information about brain tumor presence, location, and characteristics. This dataset is essential for training computer vision algorithms to automate brain tumor identification, aiding in early diagnosis and treatment planning. + +## Dataset Structure + +The brain tumor dataset is divided into two subsets: + +- **Training set**: Consisting of 893 images, each accompanied by corresponding annotations. +- **Testing set**: Comprising 223 images, with annotations paired for each one. + +## Applications + +The application of brain tumor detection using computer vision enables early diagnosis, treatment planning, and monitoring of tumor progression. By analyzing medical imaging data like MRI or CT scans, computer vision systems assist in accurately identifying brain tumors, aiding in timely medical intervention and personalized treatment strategies. + +## Dataset YAML + +A YAML (Yet Another Markup Language) file is used to define the dataset configuration. It contains information about the dataset's paths, classes, and other relevant information. In the case of the brain tumor dataset, the `brain-tumor.yaml` file is maintained at [https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/brain-tumor.yaml](https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/brain-tumor.yaml). + +!!! Example "ultralytics/cfg/datasets/brain-tumor.yaml" + + ```yaml + --8<-- "ultralytics/cfg/datasets/brain-tumor.yaml" + ``` + +## Usage + +To train a YOLOv8n model on the brain tumor dataset for 100 epochs with an image size of 640, utilize the provided code snippets. For a detailed list of available arguments, consult the model's [Training](../../modes/train.md) page. + +!!! Example "Train Example" + + === "Python" + + ```python + from ultralytics import YOLO + + # Load a model + model = YOLO('yolov8n.pt') # load a pretrained model (recommended for training) + + # Train the model + results = model.train(data='brain-tumor.yaml', epochs=100, imgsz=640) + ``` + + === "CLI" + + ```bash + # Start training from a pretrained *.pt model + yolo detect train data=brain-tumor.yaml model=yolov8n.pt epochs=100 imgsz=640 + ``` + +!!! Example "Inference Example" + + === "Python" + + ```python + from ultralytics import YOLO + + # Load a model + model = YOLO('path/to/best.pt') # load a brain-tumor fine-tuned model + + # Inference using the model + results = model.predict("https://ultralytics.com/assets/brain-tumor-sample.jpg") + ``` + + === "CLI" + + ```bash + # Start prediction with a finetuned *.pt model + yolo detect predict model='path/to/best.pt' imgsz=640 source="https://ultralytics.com/assets/brain-tumor-sample.jpg" + ``` + + +## Sample Images and Annotations + +The brain tumor dataset encompasses a wide array of images featuring diverse object categories and intricate scenes. Presented below are examples of images from the dataset, accompanied by their respective annotations + +![Brain tumor dataset sample image](https://github.com/RizwanMunawar/RizwanMunawar/assets/62513924/1741cbf5-2462-4e9a-b0b9-4a07d76cf7ef) + +- **Mosaiced Image**: Displayed here is a training batch comprising mosaiced dataset images. Mosaicing, a training technique, consolidates multiple images into one, enhancing batch diversity. This approach aids in improving the model's capacity to generalize across various object sizes, aspect ratios, and contexts. + +This example highlights the diversity and intricacy of images within the brain tumor dataset, underscoring the advantages of incorporating mosaicing during the training phase. + +## Citations and Acknowledgments + +The dataset has been released available under the [AGPL-3.0 License](https://github.com/ultralytics/ultralytics/blob/main/LICENSE). \ No newline at end of file diff --git a/docs/mkdocs_github_authors.yaml b/docs/mkdocs_github_authors.yaml index de18a7fdd3a..5734987c237 100644 --- a/docs/mkdocs_github_authors.yaml +++ b/docs/mkdocs_github_authors.yaml @@ -14,7 +14,7 @@ 79740115+0xSynapse@users.noreply.github.com: 0xSynapse abirami.vina@gmail.com: abirami-vina ayush.chaurarsia@gmail.com: AyushExel -chr043416@gmail.com: null +chr043416@gmail.com: RizwanMunawar glenn.jocher@ultralytics.com: glenn-jocher muhammadrizwanmunawar123@gmail.com: RizwanMunawar not.committed.yet: null diff --git a/mkdocs.yml b/mkdocs.yml index 903aa8d81b1..e66b6a54783 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -249,6 +249,7 @@ nav: - VOC: datasets/detect/voc.md - xView: datasets/detect/xview.md - Roboflow 100: datasets/detect/roboflow-100.md + - Brain-tumor: datasets/detect/brain-tumor.md - Segmentation: - datasets/segment/index.md - COCO: datasets/segment/coco.md diff --git a/ultralytics/cfg/datasets/brain-tumor.yaml b/ultralytics/cfg/datasets/brain-tumor.yaml new file mode 100644 index 00000000000..be6109820b5 --- /dev/null +++ b/ultralytics/cfg/datasets/brain-tumor.yaml @@ -0,0 +1,22 @@ +# Ultralytics YOLO 🚀, AGPL-3.0 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.05 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: ../datasets/brain-tumor # dataset root dir +train: train/images # train images (relative to 'path') 893 images +val: valid/images # val images (relative to 'path') 223 images +test: # test images (relative to 'path') + +# Classes +names: + 0: negative + 1: positive + +# Download script/URL (optional) +download: https://ultralytics.com/assets/brain-tumor.zip