Git Product home page Git Product logo

mkang315 / bgf-yolo Goto Github PK

View Code? Open in Web Editor NEW
52.0 1.0 9.0 20.36 MB

Official implementation of "BGF-YOLO: Enhanced YOLOv8 with Multiscale Attentional Feature Fusion for Brain Tumor Detection".

License: GNU Affero General Public License v3.0

Python 99.47% Shell 0.53%
afpn bi-level-routing-attention biformer bifpn br35h-brain-tumor-detection-2020 cbam ciou-loss computer-vision-algorithms deep-learning-framework deep-neural-networks gfpn giou-loss lesion-detection medical-image-analysis medical-image-computing medical-image-detection medical-image-processing object-detection yolo wiou-loss

bgf-yolo's Introduction

Official BGF-YOLO

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.

Model

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

Installation

Install requirements.txt in a Python>=3.8.0 environment, including PyTorch>=1.8.

pip install -r requirements.txt  # install
Training CLI
python yolo/bgf/detect/train.py

Testing CLI

python yolo/bgf/detect/predict.py

Evaluation

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
BGF-YOLO (Ours) 0.919 0.926 0.974 0.653

Generalizability in External Validation

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

License

BGF-YOLO is released under the GNU Affero General Public License v3.0 (AGPL-3.0). Please see the LICENSE file for more information.

Copyright Notice

Many utility codes of our project base on the codes of Ultralytics YOLOv8, GiraffeDet, DAMO-YOLO, and BiFormer repositories.

bgf-yolo's People

Contributors

mkang315 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bgf-yolo's Issues

Training report error

1.root@7s26acs0ob5sl-0:/E22201117/clk/code/BGF-YOLO-main# python yolo/bgf/detect/train.py
Traceback (most recent call last):
File "yolo/bgf/detect/train.py", line 7, in
from ...nn.tasks import DetectionModel
ValueError: attempted relative import beyond top-level package
2.BGF-YOLO/yolo/init.py
from . import bfg
all = 'bfg', # tuple or list

May I ask if it should be bgf?
from . import bgf
all = 'bgf', # tuple or list

parameters of model

Hi,
I've looked at this perfect model for detecting the brain tumors and the results was very intresting for me. To be honest, I'm looking for the number parameters of this model. Can you please help me and make it clear for me that how many parameters does your model consist?

dataset

Is it possible to release segmented datasets, similar to what RCS-YOLO has disclosed?

Request for pretrained weight

Good morning,

Would you mind sharing the pretrained weight of Br35h of YOLO-V8 and BGF-YOLO, please?
Thank you very much in advanced.

problem with relative imports and missing files

I try to run the train script:

❯ python yolo/bgf/detect/train.py       

And get this error:

Traceback (most recent call last):
  File "/ssdpool/projects//BGF-YOLO/yolo/bgf/detect/train.py", line 7, in <module>
    from ...nn.tasks import DetectionModel
ImportError: attempted relative import with no known parent package

I tried replacing all relative imports with absolute imports and also setting the PYTHONPATH to the project dir or running the script as a module. However I run into more and more problems. E.g. this one:

❯ python -m yolo.bgf.detect.train                                                                                                                                                                                                                                           
Traceback (most recent call last): 
File "/home/thomas/conda/envs/timm/lib/python3.10/runpy.py", line 187, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/home/thomas/conda/envs/timm/lib/python3.10/runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "/ssdpool/projects/BGF-YOLO/yolo/__init__.py", line 8, in <module>
  from yolo.engine.model import YOLO                                                                                                                                                                                                                                              File "/ssdpool/projects/BGF-YOLO/yolo/engine/model.py", line 21, in <module>
    ClassificationModel, yolo.v8.classify.ClassificationTrainer, yolo.v8.classify.ClassificationValidator,
    AttributeError: partially initialized module 'yolo' has no attribute 'v8' (most likely due to a circular import)                                                                                                                                                                  

If I search the source for ClassificationTrainer it's nowhere to be found. I think you may have missed some parts of the source.
They would likely be available in the original yolov8 source, however since this is probably on a different version I was hesitant to grab it from there.

Asking about wiou

Hi @mkang315

I would like to inquire about the wIoU loss function. If I want to implement wIoU based on your code, would any settings need to be changed?

I already follow your notes. But I just wonder how to running it.

In yolov5 to use other loss function, we need to change CIOU=False.

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.