A leukocyte sorting and disease diagnosis instrument and method based on deep learning
The leukocyte sorting and disease diagnostic instrument, which integrates microfluidic chips and deep learning algorithms, solves the problems of low sorting purity, cell viability destruction and duplicate counting in existing technologies. It achieves high-throughput, label-free, rapid and accurate detection and integrated diagnosis of leukocytes, and is suitable for intelligent diagnosis in primary healthcare scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING NORMAL UNIVERSITY
- Filing Date
- 2026-03-16
- Publication Date
- 2026-06-30
Smart Images

Figure CN122307077A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical device and artificial intelligence interdisciplinary technology, specifically to a deep learning-based instrument and method for white blood cell sorting and disease diagnosis. Background Technology
[0002] The "Healthy China 2030" strategy establishes the core principle of "prevention first, combined with treatment," and prioritizes early screening and treatment of major diseases. Nephritis is a common kidney disease, and my country has a high prevalence of chronic kidney disease. If nephritis is not diagnosed and treated promptly, it can develop into serious conditions such as kidney failure and uremia, placing a heavy burden on patients' families and society. Clinical studies have shown that changes in the number and activity of white blood cells can directly reflect the degree of kidney inflammation and are important biomarkers for the early diagnosis of nephritis.
[0003] Current methods for detecting white blood cells mainly rely on routine blood tests, biochemical analysis, and imaging examinations, but these methods have significant drawbacks: traditional blood tests are slow and have low sensitivity, making real-time dynamic monitoring impossible; biochemical tests indirectly reflect inflammatory states and are easily affected by interference; and imaging examinations are costly and complex, making them unsuitable for primary care screening. Furthermore, existing cell sorting techniques often employ density gradient centrifugation or filtration, which suffer from low sorting purity and cell viability loss, while biochemical labeling methods such as fluorescent labeling can negatively impact subsequent cell detection and research.
[0004] With the development of micro-nano manufacturing and artificial intelligence technologies, microfluidic sorting and deep learning image recognition technologies have provided new approaches for the accurate detection of white blood cells. However, existing technologies still suffer from problems such as low integration, cumbersome detection processes, high instrument costs, and difficulty in large-scale application.
[0005] The patent with publication number "CN113435493A" mainly realizes the classification and detection of unlabeled white blood cells, but it does not involve the capture and integrated diagnosis of sorted cells. Furthermore, the white blood cells still need to be fluorescently stained during the training phase, which does not completely eliminate the labeling operation, and the classification is singular.
[0006] The patent with publication number "CN113435493A" uses the ResNet-50 transfer learning network combined with image preprocessing to achieve white blood cell classification. It only extracts basic image features and does not solve the problem of repeated counting caused by cell overlap and slight movement. Moreover, the network is only suitable for basic classification, has limited feature extraction capabilities, and only adopts basic networks.
[0007] The patent with publication number "CN113435493A" uses a combination of algorithms and modules for white blood cell classification. It adopts a distributed module approach but does not have a dedicated integrated instrument design and requires the use of external equipment.
[0008] Therefore, developing a label-free, high-throughput deep learning-based leukocyte sorting and disease diagnosis instrument that integrates sorting, detection, and analysis is an urgent problem to be solved in this invention. Summary of the Invention
[0009] The purpose of this invention is to propose a deep learning-based instrument and method for leukocyte sorting and disease diagnosis, thereby automating the entire process of sorting, detection and analysis, so as to enable timely early diagnosis and prognosis assessment of inflammation.
[0010] To achieve the above objectives, the technical solution adopted by the present invention is as follows: The present invention provides a deep learning-based white blood cell sorting and disease diagnostic instrument, which includes: a sample processing system for label-free high-throughput sorting of white blood cells in whole blood samples, a visual detection system for white blood cell identification and parameter detection, and a control and analysis system for overall control and data analysis, so that the three major systems including the sample processing system, the visual detection system and the control and analysis system are integrated into an integrated shell made of 3D printing;
[0011] The sample processing system includes a microfluidic chip assembly, an injection pump assembly, an inlet / outlet assembly, a detection liquid tube, a first reservoir, a second reservoir, a third reservoir, and a small door. The microfluidic chip assembly includes a microfluidic cell sorting chip and a microfluidic cell capture chip connected to each other. The microfluidic cell sorting chip has a trapezoidal spiral flow channel structure. The trapezoidal spiral flow channel structure is used to integrate sample pretreatment and hydrodynamic focusing functions. The microfluidic cell sorting chip and the microfluidic cell capture chip are connected to achieve high-throughput and precise cell sorting and capture. The trapezoidal spiral flow channel structure is based on the principle of cell inertial focusing, which can achieve efficient separation of white blood cells and red blood cells without labeling.
[0012] The visual inspection system includes a microscopic imaging module, an image acquisition card, and a Res2Net-YOLO-based recognition algorithm module. The microscopic imaging module is used to meet the requirements for cell morphology feature extraction, and the Res2Net-YOLO-based recognition algorithm module achieves accurate differentiation between white blood cells and red blood cells by extracting multi-dimensional features including cell area, roundness, and texture.
[0013] The control and analysis system includes a circuit board bracket for embedding the development board, a display screen, an embedded control unit, host computer software, and a human-computer interaction interface. The embedded control unit is communicatively connected to the injection pump assembly and the image acquisition card to achieve synchronous flow rate control and image acquisition. The host computer software integrates model inference, data statistics, and deduplication algorithms to output detection results including cell number, type, and size.
[0014] As a further improvement, the microscopic imaging module mainly includes an electron microscope and a camera. By capturing images of the microfluidic cell capture chip, images of the white blood cell capture results are obtained, and then transmitted to the host computer software via an image acquisition card for visual detection and analysis using the improved algorithm.
[0015] As a further improvement, the development board is equipped with a fluid drive module. The injection pump assembly works together with the fluid drive module. Through the coordinated action of the host computer software and the development board, the injection pump assembly is driven to accurately control the injection and effluent rates, throughput and mode switching, thereby achieving high-throughput sorting.
[0016] As a further improvement, the trapezoidal spiral flow channel structure includes an inlet, a leukocyte outlet, and a erythrocyte outlet; the integrated sample pretreatment and hydrodynamic focusing functional chip and liquid drive system are sealed together through a quick-connect interface, enabling high-throughput label-free sorting of erythrocytes and leukocytes; the microfluidic cell sorting chip is made of biocompatible materials.
[0017] As a further improvement, the microfluidic cell capture chip includes an inlet, an outlet, multiple sets of parallel arrayed micro-trap units, and a planar substrate at the bottom of the microcavities. The microfluidic cell capture chip is the core component for achieving precise observation: this structure is integrated into the rear section of the microfluidic sorting chip and consists of multiple sets of parallel arrayed micro-trap units. The micro-trap unit is designed with a combination of a gradually contracting flow channel and a microcavity of matching size. After the sample is separated into white blood cells through the spiral sorting channel, it enters the gradually contracting flow channel. The fluid resistance guides the individual white blood cells to embed into the circular microcavity that matches the typical size of the white blood cells, ensuring that the individual cells are completely embedded and maintain their extended shape. The multiple sets of micro-trap units are arranged in parallel, which can capture multiple white blood cells simultaneously. Combined with a high-speed camera, it can realize synchronous imaging observation of multiple cells, greatly improving the detection efficiency and laying a good foundation for subsequent visual detection.
[0018] As a further improvement, a gradually contracting structure is provided at the inlet, so that the leukocyte solution initially sorted at the inlet flows into the inlet through the leukocyte outflow outlet, and then the leukocytes are captured by the parallel array micro-trap unit. Each set of the parallel array micro-trap unit consists of several circular microcavities with diameters matching the size of the leukocytes and connecting channels, so as to facilitate subsequent visual analysis and detection of the multi-dimensional features of the cells by a visual inspection system.
[0019] As a further improvement, the visual inspection system observes and photographs the microfluidic cell capture chip through a microscopic imaging module. The acquired photos are processed by an image acquisition card to achieve real-time, high-speed, and uncompressed imaging of white blood cells. The obtained images of white blood cells are analyzed by a Res2Net-YOLO-based recognition algorithm module on a host computer to complete the identification and counting of white blood cells.
[0020] The visual detection system's Res2Net-YOLO-based recognition algorithm module uses YOLOv12 as its basic framework, replaces the CSPBlock in the backbone with Res2Block to expand the receptive field, uses KNN and DIOU algorithms to solve the problem of repeated counting, and supplements the training dataset with abnormal white blood cell images of nephritis patients based on the BCCD dataset to improve the accuracy of cell recognition.
[0021] The core advantage of the Res2Net neural network is its multi-scale, fine-grained feature extraction. Through deep and stable training, it is suitable for cell detection and localization of small targets. The KNN and DIOU algorithms determine repeated detection by feature space distance, which is suitable for densely overlapping, differently sized, and blurred cell scenes. By introducing adaptive algorithms, it is possible to quickly distinguish and count different types of white blood cells.
[0022] The Res2Net-YOLOv12 recognition algorithm module is based on the YOLOv12 framework. It improves the network by replacing the CSPBlock module of the backbone layer with Res2Block, and combines it with the Feature Pyramid Network (FPN) to complete multi-scale feature extraction. It innovatively introduces the KNN and DIOU fusion algorithm to solve the problem of duplicate counting caused by cell overlap. At the same time, it supplements the abnormal white blood cell images of nephritis patients with the BCCD public dataset to construct a customized training dataset, which improves the model's generalization ability to clinical samples. The Res2Net-YOLOv12 recognition algorithm module achieves accurate classification and recognition of white blood cells by extracting multi-dimensional morphological features such as cell area, roundness, and texture, meeting the real-time requirements of high-throughput detection.
[0023] As a further improvement, the embedded control unit of the control and analysis system includes an STM32 microcontroller and a ZYNQ heterogeneous platform. It connects the injection pump assembly, display screen, and collection device via a circuit board bracket. Code is written and burned into the STM32 microcontroller using host computer software to achieve collaborative control of multiple modules. The host computer software, developed using Python and Qt, supports parameter threshold settings, real-time data display, and abnormal alarm functions. It also exports test reports and cell characteristic databases. This enables collaborative operation of multiple modules, including flow rate control of the injection pump assembly, mode switching between the detection and collection tubes, sorting mechanism drive, and display screen control, enhancing the instrument's intelligent control level. The human-machine interface provides intuitive data display and can export test reports and cell characteristic databases, providing data support for clinical diagnosis and medical research.
[0024] The sample processing system also includes a collection tube, a base plate, a storage tank frame, and a coarse centrifuge tube. The display screen is equipped with detection parameters including injection flow rate, imaging frame rate, and detection threshold. The display screen is also equipped with mode switching between the detection tube and the collection tube. The coarse centrifuge tube can switch between different liquids extracted from the first storage tank for storing physiological saline cleaning solution, the second storage tank for storing alcohol cleaning solution, and the third storage tank for storing waste liquid.
[0025] On the other hand, the present invention also provides a disease diagnosis method for a deep learning-based leukocyte sorting and disease diagnosis instrument, implemented in the deep learning-based leukocyte sorting and disease diagnosis instrument according to any one of claims 1-7, specifically including the following steps:
[0026] S1. Sample pretreatment: Inject the whole blood sample into the test tube, and set the detection parameters, including the injection flow rate, imaging frame rate and detection threshold, through the touch interface on the display screen;
[0027] S2. System initialization: The control and analysis system drives the injection pump assembly to inject physiological saline cleaning solution into the first reservoir to pre-treat the channels of the microfluidic cell sorting chip and remove air bubbles from the tubing;
[0028] S3. Leukocyte sorting and capture: The injection pump assembly pumps the whole blood sample into the microfluidic sorting chip. Through the hydrodynamic focusing unit, the cells pass through the trapezoidal spiral flow channel structure in an orderly single row. Based on the principle of inertial focusing, the unlabeled separation of leukocytes and red blood cells is achieved. Then, the sorted leukocytes are captured by the microfluidic cell capture chip.
[0029] S4. Image Acquisition and Recognition: The microfluidic cell capture chip is observed and photographed through the microscopic imaging module. The microscopic imaging module simultaneously acquires images of the sorted and captured cells and transmits them to the host computer software through the image acquisition card. The Res2Net-YOLO recognition algorithm module extracts cell features, distinguishes the types of white blood cells, and combines a deduplication algorithm to remove duplicate counts.
[0030] S5. Data Analysis and Output: The control and analysis system statistically analyzes parameters including white blood cell count, size, and type, compares them with clinical standard data, generates diagnostic reference results, displays and stores test reports through the display screen interface;
[0031] S6. System Cleaning: After detection, cleaning solution is injected into the second storage tank to clean the chip and tubing, preventing sample contamination residue. Residual waste liquid is injected into the third storage tank. This method requires no fluorescent labeling or chemical reagents, the sorting process is gentle, cell viability is higher than 95%, the detection speed is fast, and the identification results are accurate, enabling rapid detection of whole blood samples.
[0032] This invention achieves label-free high-throughput sorting of leukocytes, precise capture of leukocytes by array-type micro-trap units, and integrated deep learning-based recognition and disease diagnosis. The entire process does not require biochemical labeling, avoiding the damage to cell morphology and activity caused by staining. Furthermore, it achieves the integration of sorting and detection, significantly improving diagnostic efficiency and practicality.
[0033] This invention innovatively proposes the Res2Net-YOLOv12 recognition algorithm, which is based on the YOLOv12 framework. It replaces CSPBlock with Res2Block to achieve fine-grained multi-scale feature extraction. At the same time, it innovatively introduces the KNN and DIOU fusion algorithm to accurately solve the problem of repeated counting caused by cell overlap and flow, and specifically improves the generalization ability of diagnosing diseases such as nephritis. The recognition accuracy, anti-interference ability and clinical adaptability of the algorithm are significantly improved.
[0034] This invention integrates a sample processing system, a visual inspection system, and a control and analysis system into a three-dimensional printed instrument. It is equipped with an embedded control unit (STM32 and ZYNQ) and a touch screen, supporting independent parameter setting, real-time data display, anomaly alarms, and export of test reports. The instrument has a compact structure, small size, and low cost, realizing the miniaturization and integration of the instrument, which is conducive to promoting the intelligent localization of diagnostic testing equipment.
[0035] Compared with the prior art, the beneficial effects of the present invention are:
[0036] 1. This invention employs label-free sorting and detection technology, which achieves leukocyte sorting based on the principle of microfluidic inertial focusing and combines it with visual recognition technology for detection. This avoids the damage to cell viability caused by biochemical markers. The sorted cells can be used for subsequent gene sequencing, drug screening and other research, while reducing detection costs.
[0037] 2. The innovation deeply integrates deep learning algorithms, microfluidic technology and 3D printing technology to achieve an integrated design of sorting-detection-analysis. The instrument has a compact structure, small size and low cost, which is easy to promote and apply in primary medical scenarios. The detection process is highly automated, which greatly improves diagnostic efficiency.
[0038] 3. Using the improved Res2Net-YOLO algorithm, combined with the Feature Pyramid Network (FPN) to complete multi-scale feature extraction, and innovatively introducing the KNN and DIOU fusion algorithm to solve the problem of repeated counting caused by cell overlap, the detection accuracy is high and the anti-interference ability is strong, providing a reliable detection basis for the early diagnosis of diseases such as nephritis;
[0039] 4. The core components of the instrument are fabricated using 3D printing technology, and the chip is made using a low-cost thin-film processing technology, which enables it to be used only once, avoiding cross-contamination, while reducing R&D and production costs and facilitating large-scale production. Attached Figure Description
[0040] Figure 1 This is a schematic diagram of the overall structure of the deep learning-based white blood cell sorting and disease diagnostic instrument of the present invention.
[0041] Figure 2 This is a front view of the internal structure of the deep learning-based white blood cell sorting and disease diagnostic instrument of the present invention.
[0042] Figure 3 This is a schematic diagram of the back structure of the deep learning-based white blood cell sorting and disease diagnostic instrument of the present invention.
[0043] Figure 4 This is a schematic diagram of visual inspection of chip components in this invention;
[0044] Figure 5 This is a schematic diagram of the structure of the microfluidic cell sorting chip of the present invention;
[0045] Figure 6 This is a schematic diagram of the microfluidic cell capture chip in this invention;
[0046] Figure 7 This is a schematic diagram of the overall principle of the visual inspection system in this invention;
[0047] Figure 8 This is the instrument control flowchart of the deep learning-based white blood cell sorting and disease diagnosis instrument of this invention;
[0048] In the figure: 1-Microfluidic chip assembly, 1-1-Microfluidic cell sorting chip, 1-1-1-White blood cell effluent outlet, 1-1-2-Red blood cell effluent outlet, 1-1-3-Inlet, 1-1-4-Trapezoidal spiral flow channel structure, 1-2-Microfluidic cell capture chip, 1-2-1-Inlet, 1-2-2-Outlet, 1-2-3-Parallel array microtrap unit, 1-2-4-Planar substrate, 2-Display screen, 3-Sample inlet / outlet assembly, 4-Detection liquid tube, 5-Collection liquid tube, 6-Base plate, 7-Small door, 8-Injection pump assembly, 9-Reservoir frame, 10-Circuit board support, 11-Crude centrifuge tube, 12-First reservoir, 13-Second reservoir, 14-Third reservoir. Detailed Implementation
[0049] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0050] like Figure 1 As shown, the deep learning-based white blood cell sorting and disease diagnostic instrument provided by the present invention mainly includes a microfluidic chip assembly 1, a display screen 2, a sample inlet / outlet assembly 3, a detection liquid tube 4, a collection liquid tube 5, a base plate 6, and a small door 7.
[0051] The microfluidic chip assembly 1 includes a microfluidic cell sorting chip 1-1 and a microfluidic cell capture chip 1-2, which realize the preliminary sorting of cell fluid and capture of white blood cells; the display screen 2 is used to set instrument parameters and display results; the sample inlet assembly 3 includes a detection liquid tube 4 and a collection liquid tube 5. The detection liquid tube 4 is used to store the cell sample fluid to be tested, and the collection liquid tube 5 is used to collect the sorted white blood cell suspension; the base plate 6 serves as the support for the entire instrument; the small door 7 serves as the door of the outer frame of the coarse centrifuge tube 11, which facilitates opening, closing and replacing the coarse centrifuge tube.
[0052] As shown in Figure 2, Figure 3 As shown, the deep learning-based white blood cell sorting and disease diagnosis instrument provided by the present invention mainly includes an injection pump assembly 8, a liquid storage tank frame 9, a circuit board support 10, a coarse centrifuge tube 11, a first liquid storage tank 12, a second liquid storage tank 13, and a third liquid storage tank 14.
[0053] The function of the injection pump assembly 8 is to precisely and stably deliver cell fluid to various locations at a set speed; the circuit board support 10 is used to embed the development board and connect various control structures through circuitry; the coarse centrifuge tube 11 is used to extract liquid from the storage tank; the first storage tank 12, the second storage tank 13, and the third storage tank 14 are used to store alcohol cleaning solution, physiological saline cleaning solution, and waste liquid, respectively.
[0054] The instrument employs a layered design. The bottom layer houses the fluid drive module, including the injection pump assembly 8, switching valves, and tubing system. The middle layer contains the microfluidic cell sorting chip 1-1 and the microfluidic cell capture chip 1-2, ensuring precise alignment between the cell capture module and the chip channels. The top layer houses the control unit and the host computer module, enabling coordinated control of all systems. Each layer is secured by support pillars, and the entire instrument is encapsulated in a 3D-printed shell, resulting in a compact and low-cost structure. Through the coordinated action of its modules, it achieves high-throughput, label-free sorting, and precise classification and counting of leukocytes.
[0055] like Figure 4 As shown, the detection process of this instrument system includes sorting white blood cells unlabeled by a microfluidic sorting chip, then connecting a microfluidic cell capture chip so that the white blood cells can unfold and embed into the capture structure in the form of single cells, taking pictures by an electron microscope, and transmitting the obtained cell images to the host computer through an image acquisition card. The white blood cells are then classified and counted using the visual recognition algorithm of Res2Net-YOLOv12.
[0056] like Figure 5As shown, the microfluidic cell sorting chip 1-1 adopts a trapezoidal spiral flow channel structure 1-1-4, including a liquid inlet 1-1-3, a white blood cell outlet 1-1-1, and a red blood cell outlet 1-1-2. It can achieve label-free, high-throughput sorting of white blood cells and red blood cells of different sizes and masses through the trapezoidal spiral flow channel by utilizing the principle of inertial focusing difference.
[0057] like Figure 6 As shown, the microfluidic cell trapping chip 1-2 is the core component for achieving precise observation. It includes a multi-channel parallel array microtrap unit 1-2-3, an inlet 1-2-1, an outlet 1-2-2, and a planar substrate 1-2-4 at the bottom of the microcavity.
[0058] The microfluidic cell capture chip 1-2 is integrated into the post-sorting section of the microfluidic cell sorting chip 1-1, located after the exit of the helical sorting channel. It consists of multiple sets of parallel array microtrap units 1-2-3. The core of the microtrap unit is a gradient contraction channel combined with a matching-sized microcavity design: after the sample is separated into leukocytes through the helical sorting channel, it enters the gradient contraction channel through the inlet 1-2-1, using fluid resistance to guide individual leukocytes into the circular microcavity; the size of the microcavity matches the typical size of leukocytes, ensuring that individual cells are completely embedded and maintain their extended shape. At the same time, a planar substrate 1-2-4 is provided at the bottom of the microcavity, which is precisely aligned with the focusing plane of the microscopic imaging module; multiple sets of parallel array microtrap units 1-2-3 are arranged in parallel, which can capture multiple leukocytes simultaneously. Combined with a high-speed camera, it can achieve synchronous imaging observation of multiple cells, greatly improving detection efficiency.
[0059] As cells flow through the sorting chip, large and small cells experience different forces within the spiral flow channel, achieving precise sorting at the chip's end and allowing them to enter the cell capture chip. The cell capture chip utilizes a gradually contracting flow channel and micro-trap units matched to the size of white blood cells to capture individual white blood cells and maintain their extended shape, facilitating subsequent image capture and observation. The unit chip is made of biocompatible resin material, 3D printed, with a hydrophilic inner surface treatment to reduce cell adsorption. The sorting channel dimensions are optimized using COMSOL simulation to ensure orderly, single-row passage of cells, achieving efficient separation of white blood cells and red blood cells and improving sorting purity.
[0060] like Figure 7 The diagram shows the algorithm framework of the visual detection system. This system is built on the PyTorch deep learning framework, using Python as the development language and OpenCV as the image preprocessing tool. The overall configuration consists of five stages: environment setup, network framework construction, dataset construction and preprocessing, model training and optimization, and engineering deployment. Targeting the detection scenario of white blood cells—characterized by their microscale size, small inter-class differences, and high overlap—it collaborates with a microscopic imaging hardware module to achieve real-time acquisition, processing, recognition, and counting of cell images. Specific implementation details are as follows:
[0061] (a) Algorithm Development Environment Configuration
[0062] The algorithm was developed based on the Linux operating system. The core dependent libraries and their corresponding versions are: Python 3.8, PyTorch 1.13.1, CUDA 11.7, cuDNN 8.5, and OpenCV 4.7.0. CUDA and cuDNN are used to accelerate the algorithm with GPU computing power, which solves the computing power requirements for real-time cell image detection and ensures that the algorithm has a short single-image inference time.
[0063] (II) Building a YOLOv12 Basic Network
[0064] 1. Input layer configuration: The network uses a 416×416 pixel single-channel grayscale image as input, replacing the official RGB three-channel input to reduce computational cost; a Mosaic data augmentation module is added to randomly rotate the cell image by ±15 degrees, scale it by 0.8 to 1.2 times, and randomly crop and stitch it to improve the model's generalization level.
[0065] 2. Backbone layer basic configuration: It consists of Conv convolutional layers, CSPBlock module, and SPPF spatial pyramid pooling layer. The Conv convolutional layer uses 3×3 convolutional kernels and adds batch normalization (BN) and SiLU activation function. If the stride is 2, feature map downsampling can be achieved. The SPPF layer uses multi-scale pooling kernels with specifications of 1×1, 5×5, and 9×9 to achieve the convergence of multi-scale features.
[0066] 3. Neck layer configuration: The feature fusion structure of FPN and PAN is adopted to upsample, downsample and cross-scale fusion the feature maps of the three scales (80×80, 40×40 and 20×20) output by the Backbone layer to adapt to the detection needs of white blood cells of different sizes.
[0067] 4. Head layer configuration: The YOLOv12 (Anchor-Free) detection head is used to directly regress the center coordinates, width, height and confidence of the cell detection box, and output the binary classification probability of white blood cells / red blood cells. The loss function uses CIoU-Loss for detection box regression, BCEWithLogitsLoss for class classification and Focal Loss to solve the problem of positive and negative sample imbalance.
[0068] (III) Integration of Res2Net and YOLOv12
[0069] 1. Core improvement method: Replace the three key CSPBlock modules in the YOLOv12 Backbone layer with the core Res2Block module of Res2Net. The replacement positions correspond to the downsampled 80×80, 40×40 and 20×20 feature maps, respectively, to achieve the extraction of fine-grained features of cells at different scales.
[0070] 2. Res2Block core parameters: The number of feature mapping groups is set to 4, the sequence of dilated convolutional expansion rate is set to 1, the number of input and output channels is exactly the same as the original CSPBlock, and 1×1 convolution is used to reduce the dimensionality of branch channels, thus controlling the amount of computation while maintaining the feature extraction capability.
[0071] 3. Fusion Principle: The multi-branch residual fine-grained feature learning mechanism of Res2Block is integrated into YOLOv12. The single-path feature mapping is split into four branches. Multi-scale features are extracted through dilated convolutions with different dilation rates, and then feature fusion is achieved through branch concatenation and residual connections. This improves the network's ability to capture fine-grained morphological features such as white blood cell edges and textures. The core implementation formula of Res2Block is:
[0072] Let the input feature map of Res2Block be X∈R, and the number of feature map groups be s. Then X is split into s branch features X1, X2, ..., X s Perform a 3×3 dilated convolution operation on the i-th branch (i≥2), with an expansion rate of d(i-1), as shown in the formula: Finally, the output features of all branches are concatenated and the number of channels is adjusted by a 1×1 convolution to obtain the final output: .
[0073] (iv) Dataset Construction and Preprocessing
[0074] 1. Dataset composition: Based on the BCCD public blood cell dataset, 50 abnormal white blood cell microscopic images from nephritis patients were added to construct a customized dataset of 12,000 images, which were divided into training set, validation set and test set in an 8:1:1 ratio.
[0075] 2. Annotation method: White blood cells and red blood cells are manually annotated using the LabelImg annotation tool to generate a YOLO format txt annotation file. The annotation content includes the target category, the center coordinates of the detection box, and the normalized values of the width and height.
[0076] 3. Image preprocessing steps: Perform grayscale conversion, Gaussian noise reduction, contrast enhancement, 416×416 size normalization, and pixel value normalization in the 0-1 range in sequence. The preprocessed data is directly input into the network for training.
[0077] (v) Model Training
[0078] The model was trained using the stochastic gradient descent (SGD) optimizer with momentum set to 0.937, batch size set to 16, initial learning rate set to 0.001, and learning rate decay strategy using Cosine AnnealingLR. The training epochs were 200, weight decay was set to 0.0005, and gradient clipping was set to 1.0. During training, the model metrics were monitored using a validation set. If the metrics did not improve for 10 consecutive epochs, the optimal model weights were saved to prevent overfitting.
[0079] (vi) KNN and DIOU deduplication algorithms
[0080] 1. Deduplication logic: First, redundant detection boxes of the same cell are removed by non-maximum suppression (NMS, threshold 0.5). Then, the duplicate counts caused by slight cell movement or overlap are removed by the KNN and DIOU fusion algorithm. The number of K nearest neighbors is set to 3, and the DIOU judgment threshold is set to 0.5. When the DIOU of two detection boxes is greater than or equal to 0.5, they are judged as the same cell and the counts are merged.
[0081] 2. DIOU Calculation Method: Based on the overlapping area of the detection boxes, the Euclidean distance between the centers, and the length of the diagonal of the circumscribed rectangle, the formula includes two core indicators: the ratio of overlapping areas of the detection boxes and the proportion of the center distance. Compared with the traditional IoU, it can better reflect the positional relationship of the detection boxes.
[0082] 3. KNN Implementation: Using the center coordinates of the cell detection box as the feature point, a KDTree is constructed to quickly find the K nearest neighbor detection boxes. Only the nearest neighbor boxes are calculated, which improves the algorithm efficiency while ensuring the deduplication effect.
[0083] (vii) Implementation code of the core algorithm module
[0084] S1.Res2Block module core parameter definitions and explanations:
[0085] in_channels: The number of channels in the input feature map, matching the number of channels in the original Backbone CSPBlock.
[0086] out_channels: The number of channels in the output feature map, matching the number of channels in the original Backbone CSPBlock.
[0087] s: Number of feature mapping groups, fixed at 4, splitting single-path features into branches to achieve fine-grained multi-scale extraction.
[0088] dilation: a dilation rate sequence of dilated convolutions, covering different receptive fields to capture leukocyte edge and texture features.
[0089] stride: Convolution stride, 1 = Preserve feature map size, 2 = Downsampling
[0090] mid_channels: The number of channels in a single branch, evenly distributing the input channels.
[0091] residual: The residual term preserves the original input features and addresses the gradient vanishing problem caused by increasing network depth.
[0092] S2.Res2Block module core code and explanation:
[0093] `self.conv1=nn.Conv2d(in_channels,out_channels,1,stride=stride,padding=0,bias=False)`: A 1×1 convolutional core that adjusts the number of input channels, compresses the feature dimension, reduces the computational cost of subsequent dilated convolutions, and has no bias term to improve training stability.
[0094] `x_split=torch.chunk(x,self.s,dim=1)`: This is the core of feature splitting. It splits the feature map into 4 branches along the channel dimension (dim=1), with each branch having the number of channels equal to `mid_channels`, preparing for multi-branch feature extraction.
[0095] x_branch=self.branch_convs[i-1](x_split[i]+x_out[i-1]): The core of branch fusion. The feature of the subsequent branch = the feature of the current branch + the output of the previous branch. The information of multiple branches is fused through residual connections, and then multi-scale features are extracted by dilated convolution.
[0096] x=torch.cat(x_out,dim=1): This is the core feature concatenation function. It concatenates the outputs of the four branches along the channel dimension to restore the total number of channels and fuse multi-scale features.
[0097] x = self.bn2(self.conv2(x)) + residual: This is the core of residual fusion. It uses a 1×1 convolution to fuse the concatenated features, then adds them to the residual term to achieve ResNet's residual learning, preserving the original features while incorporating new ones.
[0098] S3. KNN+DIOU Deduplication Algorithm Core Parameter Definition and Explanation
[0099] box1 / box2: Coordinates of the detection box, describing the location range of white blood cells and red blood cells.
[0100] k: K-nearest neighbors, fixed at 3, only the 3 nearest detection boxes are searched, balancing deduplication effect and computational efficiency.
[0101] diou_thresh: DIOU threshold, determines the merged count of duplicate detection boxes for the same cell (adapted to scenarios with overlapping white blood cells).
[0102] detections: raw detection results, box = detection box, score = confidence level (0-1), cls = category (0 = white blood cells, 1 = red blood cells)
[0103] centers: Coordinates of the center of the detection box, used for KNN nearest neighbor lookup to quickly locate adjacent detection boxes.
[0104] `keep`: Preserve the array of markers. `True` means keep the bounding box, `False` means mark it as a duplicate (remove).
[0105] S4. KNN+DIOU deduplication algorithm core code and explanation
[0106] `inter_area=max(0,inter_x2-inter_x1)*max(0,inter_y2-inter_y1)`: This is the core of the overlap area calculation, calculating the intersection area of two bounding boxes. If there is no overlap, the value is 0. It is the basis for IoU / DIOU calculations.
[0107] iou = inter_area / union_area if union_area > 0 else 0: IoU calculation core, intersection-union ratio, reflects the degree of overlap between two boxes, but does not consider positional relationships (only overlap).
[0108] diou_val=iou-(c_dist**2) / (en_dist**2+1e-6): The core of DIOU calculation, adding a center distance penalty term to the IoU, more accurately reflects the positional relationship of the detection boxes, and 1e-6 avoids division by zero errors.
[0109] `kd_tree=KDTree(centers)`: The core of KDTree construction, it builds a fast search tree based on the center coordinates of the detection boxes, improving the efficiency of nearest neighbor search by more than 10 times compared to brute-force traversal.
[0110] `sorted_idx=np.argsort(-scores)`: This is the core of the confidence-based sorting function. It sorts the bounding boxes from highest to lowest confidence, prioritizing the retention of high-confidence bounding boxes (to avoid removing high-confidence bounding boxes from low-confidence bounding boxes).
[0111] keep[j]=False: This is the core of the duplicate marking mechanism. When the condition "same category + DIOU ≥ threshold" is met, the bounding box is marked as a duplicate, and only non-duplicate bounding boxes are ultimately retained.
[0112] (ix) Specific workflow of the visual inspection system
[0113] Combination Figure 7 A schematic diagram of the overall principle of the visual inspection system. The collaborative workflow between the algorithm module and the microscopic imaging hardware is as follows:
[0114] 1. Image acquisition: The microscopic imaging module uses an electron microscope objective paired with a high-speed industrial camera to image white blood cells in the cell capture structure of the microfluidic chip. The image acquisition card converts the analog image into a digital image and transmits it to the host computer. The acquisition frame rate is synchronized with the flow rate of the syringe pump to ensure that no images are missed when cells pass through in a single row.
[0115] 2. Image preprocessing: The host computer uses OpenCV to perform grayscale conversion, Gaussian noise reduction, contrast enhancement, 416×416 size normalization, and pixel value normalization on the acquired raw image, converting it into an input format that the algorithm can recognize.
[0116] 3. Feature extraction and detection: The preprocessed image is input into the trained Res2Net-YOLOv12 model. Fine-grained multi-scale features of cells are extracted through the Res2Block backbone network. After feature fusion through FPN and PANNeck layers, the Head layer outputs cell detection boxes, confidence scores and class labels.
[0117] 4. Deduplication and optimization: First, redundant detection boxes are removed using NMS, and then duplicate counts are removed using KNN and DIOU algorithms to obtain accurate cell detection results;
[0118] 5. Feature Statistics and Output: The algorithm module automatically extracts multi-dimensional morphological features of detected white blood cells, such as area, roundness, and texture. It transmits parameters such as white blood cell count, average size, and type distribution to the control and analysis system. The host computer software compares these parameters with built-in clinical standard data to generate a reference result for nephritis risk assessment, which is then displayed through a human-computer interaction interface. The system also supports the storage and export of test reports.
[0119] like Figure 8 The instrument control flowchart shown illustrates that after the instrument starts, it first performs system initialization and hardware self-test. Users can set parameters such as sample injection flow rate and imaging frame rate via the touch screen. The host computer encapsulates the parameters into control commands and sends them to the slave computer. After parsing the commands, the slave computer drives the syringe pump to draw physiological saline from the storage tank for tubing pre-rinsing and defoaming. Then, it switches to the sample solution pathway, controlling the syringe pump to push the sample through the microfluidic chip at the set flow rate. Simultaneously, it triggers the high-speed camera to acquire cell images, and the image data is uploaded to the host computer in real time. The Res2Net-YOLO algorithm is used to complete white blood cell identification and counting. After the detection is completed, the system automatically switches to the waste liquid pathway for tubing cleaning. Finally, all components are reset and a diagnostic report is generated.
[0120] The detection method steps of this invention are as follows: Figure 4 As shown, the specific implementation process is as follows:
[0121] S1. Sample pretreatment: Collect whole blood samples from patients and inject them into sample tubes to ensure that the samples are free of coagulation and large amounts of impurities; set the injection flow rate, imaging frame rate and white blood cell count threshold via the touch screen.
[0122] S2. System initialization: The control and analysis system drives the injection pump assembly 8 to draw an appropriate amount of cleaning fluid from the first reservoir 12 (physiological saline), inject it into the microfluidic chip tubing, remove air bubbles, and ensure that the tubing is unobstructed.
[0123] S3. Leukocyte Sorting: The syringe pump assembly 8 pumps the whole blood sample into the microfluidic sorting chip 1-1 at a set flow rate. After being focused by the hydrodynamic focusing unit, the sample enters the trapezoidal spiral flow channel structure 1-1-4. Based on the principle of cell inertial focusing, leukocytes and red blood cells form different motion trajectories within the channel due to their size difference, and are finally separated at the outlet unit, with leukocytes entering the collection channel. The collection channel connects to the microfluidic cell capture chip 1-2, which uses circular microcavities that fit the size of leukocytes to completely embed the leukocytes and maintain their extended shape.
[0124] S4. Image Acquisition and Recognition: Cell images are acquired and sorted simultaneously using an electron microscope and transmitted to the host computer via an image acquisition card; the Res2Net-YOLO algorithm processes the images, extracts cell features, distinguishes between white blood cells and red blood cells, and removes duplicate counts using the KNN and DIOU algorithms.
[0125] S5. Data Analysis and Output: The control and analysis system statistically analyzes parameters such as white blood cell count, average size, and type distribution, compares them with built-in clinical standard data, and generates reference results for nephritis risk assessment; the test results are displayed on the touch screen 2, and the data is stored locally, supporting the export of test reports via USB interface.
[0126] S6. System Cleaning: After the test is completed, the system automatically switches to cleaning mode, draws cleaning solution from the second cleaning solution tube 13 (alcohol cleaning solution), rinses the chip tubing, removes sample residue, and avoids cross-contamination.
[0127] The instrument of this invention is used to test clinical whole blood samples. The testing procedure is as follows: Figure 8 As shown, the white blood cell recognition accuracy reached 93.44%, the sorting purity reached 95%, and the detection time was less than 5 minutes. Compared with the clinical gold standard, the error was within an acceptable range, which can meet the needs of early diagnosis of nephritis.
[0128] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any modifications or equivalent changes made based on the technical essence of the present invention shall still fall within the scope of protection claimed by the present invention.
Claims
1. A deep learning-based white blood cell sorting and disease diagnosis instrument, characterized in that, The deep learning-based white blood cell sorting and disease diagnostic instrument includes: a sample processing system for label-free high-throughput sorting of white blood cells in whole blood samples, a visual detection system for white blood cell identification and parameter detection, and a control and analysis system for overall control and data analysis. The sample processing system includes a microfluidic chip assembly (1), an injection pump assembly (8), an inlet / outlet assembly (3), a detection liquid tube (4), a first liquid reservoir (12), a second liquid reservoir (13), a third liquid reservoir (14), and a small door (7). The microfluidic chip assembly (1) includes a microfluidic cell sorting chip (1-1) and a microfluidic cell capture chip (1-2) that are connected to each other. The microfluidic cell sorting chip (1-1) has a trapezoidal spiral flow channel structure (1-1-4). The visual inspection system includes a microscopic imaging module, an image acquisition card, and a Res2Net-YOLO-based recognition algorithm module. The microscopic imaging module is used to meet the requirements for cell morphology feature extraction, and the Res2Net-YOLO-based recognition algorithm module achieves accurate differentiation between white blood cells and red blood cells by extracting multi-dimensional features including cell area, roundness, and texture. The control and analysis system includes a circuit board bracket (10) for embedding the development board, a display screen (2), an embedded control unit, host computer software and a human-computer interaction interface. The embedded control unit is connected to the injection pump assembly (8) and the image acquisition card to realize the synchronization of flow rate control and image acquisition. The host computer software integrates model inference, data statistics and deduplication algorithms to output detection results including cell number, type and size.
2. The deep learning-based leukocyte sorting and disease diagnostic instrument according to claim 1, characterized in that: The trapezoidal spiral flow channel structure (1-1-4) includes an inlet (1-1-3), a white blood cell outlet (1-1-1), and a red blood cell outlet (1-1-2).
3. The deep learning-based leukocyte sorting and disease diagnostic instrument according to claim 1, characterized in that: The microfluidic cell trapping chip (1-2) includes an inlet (1-2-1), an outlet (1-2-2), multiple sets of parallel array microtrap units (1-2-3), and a planar substrate (1-2-4). The inlet (1-2-1) is provided with a gradually contracting structure, so that the leukocyte solution initially sorted by the inlet (1-2-1) flows into the inlet (1-2-1) through the leukocyte outflow outlet (1-1-1), and then passes through the parallel array micro-trap unit (1-2-3) to capture the leukocytes. Each set of the parallel array micro-trap unit (1-2-3) consists of several circular microcavities with diameters matching the size of leukocytes and connecting channels, so as to facilitate subsequent visual analysis and detection of the multi-dimensional characteristics of the cells through a visual detection system.
4. The deep learning-based leukocyte sorting and disease diagnosis instrument according to claim 1, characterized in that: The visual detection system observes and photographs the microfluidic cell capture chip (1-2) through the microscopic imaging module. The acquired photos are processed by the image acquisition card to achieve real-time, high-speed, and uncompressed imaging of white blood cells. The obtained white blood cell images are analyzed by the upper computer software through the Res2Net-YOLO-based recognition algorithm module to complete the recognition and counting of white blood cells. The visual detection system's Res2Net-YOLO-based recognition algorithm module uses YOLOv12 as its basic framework, replaces the CSPBlock in the backbone with Res2Block to expand the receptive field, and uses KNN and DIOU algorithms to solve the problem of repeated counting. Based on the BCCD dataset, it supplements the training dataset with abnormal white blood cell images of nephritis patients to improve the accuracy of cell recognition.
5. The deep learning-based leukocyte sorting and disease diagnosis instrument according to claim 1, characterized in that: The embedded control unit of the control and analysis system includes an STM32 microcontroller and a ZYNQ heterogeneous platform. It is connected to the injection pump assembly (8), the display screen (2) and the collection device through a circuit board bracket (10). The upper computer software is used to write code and burn it into the STM32 microcontroller to realize the collaborative control of multiple modules. The upper computer software is developed using Python and Qt, supports parameter threshold setting, real-time data display and abnormal alarm functions, and exports detection reports and cell characteristic databases. The sample processing system also includes a collection tube (5), a base plate (6), a storage tank frame (9), and a coarse centrifuge tube (11). The display screen (2) is equipped with detection parameters including sample injection flow rate, imaging frame rate, and detection threshold. The display screen (2) is equipped with mode switching between the detection tube (4) and the collection tube (5). The coarse centrifuge tube (11) switches between different liquids extracted from the first storage tank (12) for storing physiological saline cleaning solution, the second storage tank (13) for storing alcohol cleaning solution, and the third storage tank (14) for storing waste liquid.
6. A disease diagnosis method based on deep learning for leukocyte sorting and disease diagnostic instruments, characterized in that, The implementation in the deep learning-based leukocyte sorting and disease diagnostic instrument according to any one of claims 1-7 specifically includes the following steps: S1. Sample pretreatment: Inject the whole blood sample into the detection tube (4), and set the detection parameters including the injection flow rate, imaging frame rate and detection threshold through the touch interface of the display screen (2); S2. System initialization: The control and analysis system drives the injection pump assembly (8) to inject physiological saline cleaning solution through the first reservoir (12) to pre-treat the channels of the microfluidic cell sorting chip (1-1) and remove air bubbles from the pipeline; S3. Leukocyte sorting and capture: The injection pump assembly (8) pumps the whole blood sample into the microfluidic sorting chip (1-1). Through the hydrodynamic focusing unit, the cells pass through the trapezoidal spiral channel structure (1-1-4) in an orderly manner in a single row. Based on the inertial focusing principle, the unlabeled separation of leukocytes and red blood cells is achieved. Then, the sorted leukocytes are captured by the microfluidic cell capture chip (1-2). S4. Image Acquisition and Recognition: The microfluidic cell capture chip (1-2) is observed and photographed through the microscopic imaging module. The microscopic imaging module simultaneously acquires images of the cells after sorting and capture, and transmits them to the host computer software through the image acquisition card. The Res2Net-YOLO recognition algorithm module extracts cell features, distinguishes the types of white blood cells, and combines the deduplication algorithm to remove duplicate counts. S5. Data Analysis and Output: The control analysis system statistically analyzes parameters including white blood cell count, size, and type, compares them with clinical standard data, generates diagnostic reference results, and displays and stores the test report through the display interface of the display screen (2); S6. System cleaning: After the test is completed, cleaning solution is injected through the second storage tank (13) to clean the chip and pipeline to avoid sample contamination residue. The remaining waste liquid is injected into the third storage tank (14).