Within the area of medical diagnostics, the correct identification and counting of blood cells are essential for assessing a affected person’s well being. The paper “Automatic Identification and Counting of Blood Cells” proposes a machine studying strategy to automate this course of, leveraging superior object detection algorithms to streamline and enhance the accuracy of blood cell evaluation. On this assessment, I doc my expertise implementing the strategies described within the paper, utilizing a repository accessible on GitHub, and supply insights into the method and outcomes.
There are two methods to go for the implementation one is to obtain the dataset and practice the mannequin and the opposite is to obtain the weights (educated mannequin), dataset and place within the folder. The folder ought to look one thing like this
On this article, I’ll focus extra on utilizing already educated mannequin and see the inference outcomes. However if you happen to want to practice the mannequin, you possibly can simply comply with directions on the GitHub repo and it’ll work wonderful.
Step one within the implementation was establishing the suitable surroundings. The code offered within the repository required Python 3.7, so I created a digital surroundings utilizing the next instructions:
sudo apt-get set up python3.7-venv
python3.7 -m venv blood_cell_detection_env
supply blood_cell_detection_env/bin/activate
After that I put in all of the required libraries utilizing pip as follows
pip set up Cython tensorflow-gpu==2.2.0 tf-slim==1.1.0 opencv-python protobuf==3.20
This setup ensured that each one dependencies and packages had been managed inside an remoted surroundings, stopping conflicts with different tasks.
Run the next command to construct cython extension
python setup.py build_ext --inplace
To run the code, enter the next code in terminal
python detect.py
The problems I confronted throughout implementation was the paths talked about within the code, within the following information cy_yolo2_findboxes.pyx, cy_yolo_findboxes.pyx
Substitute the next traces from each information
from nms cimport NMS
TO
from .nms cimport NMS
That is the primary subject which I confronted, relaxation many of the points had been as a result of surroundings setup, however if you happen to comply with the steps I discussed above, it is going to work wonderful. Nonetheless, if you happen to face any points, you possibly can at all times contact me.
The implementation produced promising outcomes, with the mannequin precisely figuring out and counting the various kinds of blood cells. The efficiency of the mannequin was in step with the expectations set by the paper, demonstrating the effectiveness of the YOLO framework for this software.
The next determine represents the output of the code.
The picture offered exhibits the output from the implementation of the Automated Identification and Counting of Blood Cells algorithm. Right here’s a breakdown of what the picture represents:
Complete Counts: The highest bar of the output shows the whole depend of various kinds of blood cells recognized by the algorithm:
- RBCs (Purple Blood Cells): 17
- WBC (White Blood Cells): 1
- Platelets: 1
Detection Visualization:
- RBCs (Purple Blood Cells): These are circled in blue, and every recognized RBC is labeled with “RBC.” The algorithm has efficiently detected and counted a complete of 17 RBCs on this explicit picture.
- WBC (White Blood Cells): The one WBC within the picture is highlighted with a inexperienced circle and labeled “WBC.” WBCs are sometimes bigger and have a extra advanced inner construction in comparison with RBCs, which is clear within the picture.
- Platelets: The one platelet is highlighted with a purple circle and labeled “Platelets.” Platelets are normally a lot smaller than each RBCs and WBCs.
By way of accuracy, the mannequin achieved excessive precision in detecting RBCs, WBCs, and platelets, with minimal false positives or negatives. The pace of detection was additionally spectacular, making this strategy appropriate for real-time purposes in scientific settings.
Within the file detect.py, you possibly can change the enter image from this Line 109:
Implementing the strategies described in “Automated Identification and Counting of Blood Cells” offered beneficial insights into the applying of machine studying in medical diagnostics. The method highlighted the significance of cautious dataset preparation, hyper-parameter tuning, and the potential of the YOLO framework in automating advanced duties similar to blood cell evaluation.
This assessment serves as a testomony to the progress being made within the area of medical picture processing and underscores the potential for additional developments by the combination of machine studying strategies.