This is the source code for the paper, "BGF-YOLO: Enhanced YOLOv8 with Multiscale Attentional Feature Fusion for Brain Tumor Detection", of which I am the first author.
The model configuration (i.e., network construction) file is bgf-yolo.yaml in the directory ./models/bgf.
The hyperparameter setting file is default.yaml in the directory ./yolo/cfg/.
Install requirements.txt in a Python>=3.8.0 environment, including PyTorch>=1.8.
pip install -r requirements.txt # install
python yolo/bgf/detect/train.py
python yolo/bgf/detect/predict.py
We trained and evaluated BGF-YOLO on the dataset Br35H :: Brain Tumor Detection 2020. The .txt format annotations in the file dataset-Br35H.zip are coverted from original json format.
Model | Precision | Recall | mAP50 | mAP50:95 |
---|---|---|---|---|
RT-DETR-X | 0.825 | 0.770 | 0.870 | 0.597 |
Co-DETR with Swin L (36 Epochs, DETR Augmentation) | – | – | 0.941 | 0.609 |
YOLOv9-E | 0.927 | 0.869 | 0.919 | 0.630 |
YOLOv10-X | 0.916 | 0.808 | 0.880 | 0.603 |
BGF-YOLO (Ours) | 0.919 | 0.926 | 0.974 | 0.653 |
We conducted additional experimental validation on a different domain using the COVID-19 facemask detection dataset. The table below consistently shows the superior detection performance of our method compared to YOLOv8x. This indicates the generalizability of our method to other domains of object detection.
Model | Precision | Recall | mAP50 | mAP50:95 |
---|---|---|---|---|
YOLOv8x | 0.866 | 0.773 | 0.802 | 0.494 |
BGF-YOLO (Ours) | 0.847 | 0.764 | 0.820 | 0.504 |
BGF-YOLO is released under the GNU Affero General Public License v3.0 (AGPL-3.0). Please see the LICENSE file for more information.
Many utility codes of our project base on the codes of Ultralytics YOLOv8, GiraffeDet, DAMO-YOLO, and BiFormer repositories.