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 arXiv.
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/.
Install requirements.txt with recommended dependencies Python >= 3.8 environment including Torch <= 1.7.1 and CUDA <= 11.1:
pip install -r requirements.txt
The hyperparameter setting file is hyp.scratch.p5.yaml in the directory ./data/.
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
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
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
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.
Please cite our paper if you use code from this repository:
Plain Text
-
IEEE 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, in press (pp. 000–000).
NOTE: City of Conf., Abbrev. State, Country, Month & day(s) are optional. -
Nature 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) in press (000–000) (IEEE, 2024). -
Springer 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), in press (000–000). 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, NY, USA, 2024, in press (pp. 000–000).
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, NY, USA, in press (pp. 000–000).
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 {\it Proc. IEEE Int. Conf. Image Process. (ICIP)}, Abu Dhabi, UAE, Oct. 27--30, 2024, in press.
\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 = "000--000",
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 = "000--000",
publisher = "IEEE",
address = "Piscataway",
year = "2024",
doi= "10.1109/ICIP49359.2024.00000000",
url = "https://doi.org/10.1109/ICIP49359.2024.00000000"
}
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 {}
.
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.