/CST-YOLO

[ICIP'24 Lecture Presentation] Official implementation of "CST-YOLO: A Novel Method for Blood Cell Detection Based on Improved YOLOv7 and CNN-Swin Transformer".

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Official CST-YOLO

This is the source code for the paper titled "CST-YOLO: A Novel Method for Blood Cell Detection Based on Improved YOLOv7 and CNN-Swin Transformer" accepted and presented orally at 2024 IEEE International Conference on Image Processing (ICIP 2024), of which I am the first author. This paper is available to download from IEEE Xplore or arXiv.

Model

The CNN-Swin Transformer You Only Look Once (CST-YOLO) model configuration (i.e., network construction) file is cst-yolo.yaml in the directory ./cfg/training/.

Installation

Install requirements.txt with recommended dependencies Python >= 3.8 environment including Torch <= 1.7.1 and CUDA <= 11.1:

pip install -r requirements.txt

Training

The hyperparameter setting file is hyp.scratch.p5.yaml in the directory ./data/.

Single GPU training
python train.py --workers 8 --device 0 --batch-size 32 --data data/cbc.yaml --img 640 640 --cfg cfg/training/cst-yolo.yaml --weights '' --name cst-yolo --hyp data/hyp.scratch.p5.yaml
Multiple GPU training
python -m torch.distributed.launch --nproc_per_node 4 --master_port 9527 train.py --workers 8 --device 0,1,2,3 --sync-bn --batch-size 128 --data data/cbc.yaml --img 640 640 --cfg cfg/training/cst-yolo.yaml --weights '' --name rcs-yolo --hyp data/hyp.scratch.p5.yaml

Testing

python test.py --data data/cbc.yaml --img 640 --batch 32 --conf 0.001 --iou 0.65 --device 0 --weights runs/train/exp/weights/best.pt --name val

Evaluation

We trained and evaluated CST-YOLO on three blood cell detection datasets Blood Cell Count and Detection (BCCD), Complete Blood Count (CBC), and Blood Cell Detection (BCD). The 60 samples of the validation set duplicate those from the training set in the CBC dataset. Each image includes three types of blood cells: Red Blood Cells (RBCs), White Blood Cells (WBCs), and platelets.

Referencing Guide

Please cite our paper if you use code from this repository. Here is a guide to referencing this work in various styles for formatting your references:

Plain Text

  • IEEE Reference Style
    M. Kang, C.-M. Ting, F. F. Ting, and R. C.-W. Phan, "Cst-yolo: A novel method for blood cell detection based on improved yolov7 and cnn-swin transformer," in Proc. IEEE Int. Conf. Image Process. (ICIP), Abu Dhabi, UAE, Oct. 27–30, 2024, pp. 3024–3029.
    NOTE: City of Conf., Abbrev. State, Country, Month & day(s) are optional.

  • Nature Referencing Style
    Kang, M., Ting, C.-M., Ting, F. F. & Phan, R. C.-W. CST-YOLO: a novel method for blood cell detection based on improved YOLOv7 and CNN-swin transformer. In 2024 IEEE International Conference on Image Processing (ICIP) 3024–3029 (IEEE, 2024).

  • Springer Reference Style
    Kang, M., Ting, C.-M., Ting, F.F., Phan, R.C.-W.: CST-YOLO: a novel method for blood cell detection based on improved YOLOv7 and CNN-swin transformer. In: 2024 IEEE International Conference on Image Processing (ICIP), 3024–3029. IEEE, Piscataway (2024)

  • Elsevier Numbered Style
    M. Kang, C.-M. Ting, F.F. Ting, R.C.-W. Phan, CST-YOLO: A novel method for blood cell detection based on improved YOLOv7 and CNN-swin transformer, in: Proceedings of the IEEE International Conference on Image Processing (ICIP), 27–30 October 2024, Abu Dhabi, UAE, IEEE, Piscataway, New York, USA, 2024, pp. 3024–3029.
    NOTE: Day(s) Month Year, City, Abbrev. State, Country of Conference, Publiser, and Place of Publication are optional.

  • Harvard (Name–Date) Style
    Kang, M., Ting, C.-M., Ting, F.F., Phan, R.C.-W., 2024. CST-YOLO: A novel method for blood cell detection based on improved YOLOv7 and CNN-swin transformer, in: Proceedings of the IEEE International Conference on Image Processing (ICIP), 27–30 October 2024, Abu Dhabi, UAE. IEEE, Piscataway, New York, USA, pp. 3024–3029.
    NOTE: Day(s) Month Year, City, Abbrev. State, Country of Conference, Publiser, and Place of Publication are optional.

BibTeX Format

\begin{thebibliography}{1}
\bibitem{Kang24Cstyolo} M. Kang, C.-M. Ting, F. F. Ting, and R. C.-W. Phan, "Cst-yolo: A novel method for blood cell detection based on improved yolov7 and cnn-swin transformer," in {\emph Proc. IEEE Int. Conf. Image Process. (ICIP)}, Abu Dhabi, UAE, Oct. 27--30, 2024, pp. 3024--3029.
\end{thebibliography}
@inproceedings{Kang24Cstyolo,
  author = "Ming Kang and Chee-Ming Ting and Fung Fung Ting and Rapha{\"e}l C.-W. Phan",
  title = "Rcs-yolo: A fast and high-accuracy object detector for brain tumor detection",
  booktitle = "Proc. IEEE Int. Conf. Image Process. (ICIP)",
  address = "Abu Dhabi, UAE, Oct. 27--30",
  pages = "3024--3029",
  year = "2024",
}
@inproceedings{Kang24Cstyolo,
  author = "Kang, Ming and Ting, Chee-Ming and Ting, Fung Fung and Phan, Rapha{\"e}l C.-W.",
  title = "CST-YOLO: a novel method for blood cell detection based on improved YOLOv7 and CNN-swin transformer",
  editor = "",
  booktitle = "2024 IEEE International Conference on Image Processing (ICIP)",
  series = "",
  volume = "",
  pages = "3024--3029",
  publisher = "IEEE",
  address = "Piscataway",
  year = "2024",
  doi= "10.1109/ICIP51287.2024.10647618",
  url = "https://doi.org/10.1109/ICIP51287.2024.10647618"
}

NOTE: Please remove some optional BibTeX fields, for example, series, volume, address, url and so on, while the LaTeX compiler produces an error. Author names may be manually modified if not automatically abbreviated by the compiler under the control of the .bst file if applicable which defines bibliography/reference style. Kang24Cstyolo could be b1, bib1, or ref1 when references appear in numbered style in which they are cited. The quotation mark pair "" in the field could be replaced by the brace {}.

License

CST-YOLO is released under the GNU General Public License v3.0. Please see the LICENSE file for more information.

Copyright Notice

Many utility codes of our project base on the codes of YOLOv7 and Swin Transformer repositories.