RepositoryPython
mkang315

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

76stars
19forks
8issues
1views

Official CST-YOLO

Build Build

Description

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 by and presented orally at the 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 the paper if using 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.

  • IEEE Full Name Reference Style
    Ming Kang, Chee-Ming Ting, Fung Fung Ting, and Raphaël C.-W. Phan. Cst-yolo: A novel method for blood cell detection based on improved yolov7 and cnn-swin transformer. In ICIP, pages 3024–3029, 2024.
    NOTE: This is a modification to the standard IEEE Reference Style and used by most IEEE/CVF conferences, including CVPR, ICCV, and WACV, to render first names in the bibliography as "Firstname Lastname" rather than "F. Lastname" or "Lastname, F.".
     - IJCAI Full Name-Year Variation
    [Kang et al., 2024] Ming Kang, Chee-Ming Ting, Fung Fung Ting, and Raphaël C.-W. Phan. Cst-yolo: A novel method for blood cell detection based on improved yolov7 and cnn-swin transformer. In Proceedings of the 2024 IEEE International Conference on Image Processing, pages 3024–3029, Piscataway, NJ, October 2024. IEEE.
     - ACL Full Name-Year Variation
    Ming Kang, Chee-Ming Ting, Fung Fung Ting, and Raphaël C.-W. Phan. 2024. Cst-yolo: A novel method for blood cell detection based on improved yolov7 and cnn-swin transformer. In Proceedings of the 2024 IEEE International Conference on Image Processing, pages 3024–3029, Piscataway, NJ. IEEE.

  • 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), pp. 3024–3029. IEEE, Piscataway (2024)
    NOTE: ECCV and MICCAI conference proceedings are part of the book series LNCS in which Springer's format for bibliographical references is strictly enforced. LNCS stands for Lecture Notes in Computer Science.

  • 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), 2024, pp. 3024–3029.
    NOTE: Day(s) Month Year, City, Abbrev. State, Country of Conference, Publiser, and Place of Publication are optional and omitted.

  • Elsevier Name–Date (Harvard) 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.

  • Elsevier Vancouver Style
    Kang M, Ting C-M, Ting FF, Phan RC-W. 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); 2024 Oct 27–30; Abu Dhabi, UAE. Piscataway: IEEE; 2024. p. 3024–9.

  • Elsevier Embellished Vancouver Style
    Kang M, Ting C-M, Ting FF, Phan RC-W. 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); 2024 Oct 27–30; Abu Dhabi, UAE. Piscataway: IEEE; 2024. p. 3024–9.

  • APA7 (Author–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 2024 IEEE International Conference on Image Processing (ICIP) (pp. 3024–3029). IEEE. https://doi.org/10.1109/ICIP51287.2024.10647618
     - AAAI (Author–Year) Variation
    Kang, M.; Ting, C.-M.; Ting, F. F.; and 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 2024 IEEE International Conference on Image Processing (ICIP), 3024–3029. Piscataway, NJ: IEEE.
     - ICML (Author–Year) Variation
    Kang, M., Ting, C.-M., Ting, F. F., and Phan, R. C.-W. CST-YOLO: A novel method for blood cell detection based on improved YOLOv7 and CNN-swin Transformer. In Proceedings of the 2024 IEEE International Conference on Image Processing (ICIP), pp. 3024–3029, Piscataway, NJ, 2024. IEEE.
    NOTE: For NeurIPS and ICLR, any reference/citation style is acceptable as long as it is used consistently. The sample of references in Formatting Instructions For NeurIPS almost follows APA7 (author–date) style and that in Formatting Instructions For ICLR Conference Submissions is similar to IJCAI full name-year variation.

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 = "Cst-yolo: A novel method for blood cell detection based on improved yolov7 and cnn-swin transformer",
  booktitle = "Proc. IEEE Int. Conf. Image Process. (ICIP)",
  % booktitle = ICIP, %% IEEE Full Name Reference Style
  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 {YOLO}v7 and {CNN}-{S}win {T}ransformer",
  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/tags such as series, volume, address, url, and so on if the LaTeX compiler produces an error. Author names may be manually modified if not automatically abbreviated by the compiler under the control of the bibliography/reference style (i.e., .bst) file. The BibTex citation key may be bib1, b1, 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 {}, whereas the brace {} in the BibTeX field/tag title plays a role of keeping letters/characters/text original lower/uppercases or sentence/capitalized cases unchanged while using Springer Nature bibliography style files, for example, sn-nature.bst.

License

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

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

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
tensorflow/tensorflow

An Open Source Machine Learning Framework for Everyone

201.9k
Dec 1, 2026
RepositoryPython
TorchIO-project/torchio

Medical imaging processing for AI applications.

2.5k
Nov 13, 2026
RepositoryPython
d2l-ai/d2l-zh

《动手学深度学习》:面向中文读者、能运行、可讨论。中英文版被70多个国家的500多所大学用于教学。

82.9k
Jul 30, 2024
RepositoryPython
rohitg00/ai-engineering-from-scratch

Learn AI Engineering! Learn it. Build it. Ship it for others.

81.4k
Nov 30, 2026
RepositoryC++
opencv/opencv

Open Source Computer Vision Library

91.8k
Nov 30, 2026
RepositoryPython
ultralytics/yolov5

Ultralytics YOLOv5 in PyTorch for object detection, instance segmentation, classification, training, and export.

58.3k
Nov 23, 2026
RepositoryPython
deepfakes/faceswap

Deepfakes Software For All

57.6k
Aug 5, 2026
RepositoryPython
Project-MONAI/MONAI

AI Toolkit for Healthcare Imaging

8.9k
Nov 27, 2026
RepositoryPython
JoHof/lungmask

Automated lung segmentation in CT

796
Oct 26, 2026