Primary central nervous system lymphoma detection and classification method and system based on YOLOv8

Through the YOLOv8-based object detection model, the problem of high misdiagnosis rate in PCNS-DLBCL diagnosis is solved, and tumor detection and classification with high accuracy and robustness are achieved.

CN119006916BActive Publication Date: 2025-04-11JIANGSU PROVINCE HOSPITAL (THE FIRST AFFILIATED HOSPITAL OF NANJING MEDICAL UNIVERSITY) +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411124405.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2024-05-14
Filing Date
2024-08-16
Publication Date
2025-04-11
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

The prior art has a high misdiagnosis rate in the diagnosis of primary central nervous system diffuse large B-cell lymphoma (PCNS-DLBCL), which is difficult to distinguish from glioblastoma (GBM) and brain metastases (BM), resulting in wrong treatment decisions.

Method used

Using the YOLOv8-based object detection model, the YOLOv8 model was trained to detect and classify PCNS-DLBCL tumors and identify them from GBM and BM.

Benefits of technology

High accuracy detection and classification of PCNS-DLBCL tumors can be effectively distinguished from GBM and BM, and improved the accuracy and robustness of diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006916B_ABST
    Figure CN119006916B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of medical image processing technology, and specifically relates to a primary central nervous system lymphoma detection and classification method and system based on YOLOv8, including: collecting MRI image data of patients with primary central nervous system diffuse large B-cell lymphoma, intracranial metastasis, and glioblastoma; processing the MRI image data, screening out images containing tumors in the MRI images, and forming a data set with randomly selected patient images without tumors, and dividing the data set into a training set, a validation set, and a test set; annotating the images in the training set and the validation set; training a YOLOv8 target detection model; using classification loss to update the weight of the model; and evaluating the target detection and classification performance of the target detection model. The present invention can successfully detect PCNS-DLBCL tumors, and can be distinguished from GBM and BM at the same time, with high accuracy and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical image processing, and in particular to a primary central nervous system lymphoma detection and classification method based on YOLOv8. Background Art

[0002] Primary central nervous system-diffuse large B cell lymphoid (PCNS-DLBCL) is a special type of extranodal non-Hodgkin lymphoma (NHL). Plain and enhanced cranial MRI examinations are widely used in the examination of PCNS-DLBCL, but they are often misdiagnosed as brain metastases (BM) or glioblastoma (GBM), misleading clinicians' treatment plans.

[0003] Since PCNS-DLBCL progresses rapidly and has a poor prognosis, timely preoperative diagnosis and treatment are the key to improving the clinical prognosis of PCNS-DLBCL. Therefore, how to accurately identify PCNS-DLBCL through imaging examinations early before surgery is of great significance for the formulation of subsequent treatment plans and avoiding misdiagnosis as GBM and BM. The diagnosis of traditional PCNS-DLBCL MRI relies on experienced neurosurgeons and neuroradiologists to interpret MRI (magnetic resonance imaging) images based on different sequences, and it also needs to be differentiated from GBM and BM. The work is time-consuming, and the subjectivity and fatigue of the diagnostic physicians and the diversity of the disease itself can easily lead to misdiagnosis, which causes clinicians to make wrong treatment decisions.

[0004] In recent years, deep learning has made remarkable achievements in tumor segmentation and diagnosis. In order to reduce the labor intensity of clinicians in the clinical management of PCNS-DLBCL and improve the accuracy of tumor detection, this paper proposes an automatic detection and classification method for tumor targets in MRI based on a real-time diagnostic model based on YOLOv8. Summary of the invention

[0005] Purpose of the invention: The purpose of the present invention is to address the deficiencies of the prior art and provide a primary central nervous system lymphoma detection and classification method based on YOLOv8, which can successfully detect PCNS-DLBCL tumors and can be distinguished from GBM and BM with high accuracy and robustness.

[0006] Technical solution: The primary central nervous system lymphoma detection and classification method based on YOLOv8 of the present invention comprises the following steps:

[0007] S1: Acquire MRI image data of patients with primary central nervous system diffuse large B-cell lymphoma, intracranial metastases, and glioblastoma;

[0008] S2: Process the MRI image data, screen out the images containing tumors from the MRI images, and form a data set with randomly selected patient images without tumors. The data set is divided into a training set, a validation set, and a test set.

[0009] S3: Annotate the images in the training set and validation set, including: creating a rectangular box to select the corresponding target area, determining the position and classification, for images with tumors, the rectangular box only covers the tumor area, for images without tumors, the rectangular box covers the largest area of ​​the brain as much as possible, and saving the annotated images;

[0010] S4: Train the YOLOv8 target detection model. Set the initial anchor box before training. Use the training set to train the model. Train the predicted bounding box based on the initial anchor box. Calculate the difference between the predicted bounding box and the true bounding box. Perform reverse update based on the difference and iteratively adjust the model parameters.

[0011] S5: Evaluate the YOLOv8 target detection model. Input the images of the validation set into the YOLOv8 target detection model trained in S4 for feature extraction and output the detection results, including the coordinates of the bounding box, the confidence of the bounding box, and the predicted probability of each category. Accuracy, recall, precision, and the harmonic mean of precision and recall are used as indicators to evaluate the target detection and classification performance of the YOLOv8 target detection model.

[0012] To further improve the above technical solution, we manually screened out the images containing tumors in the MRI images of patients with primary central nervous system diffuse large B-cell lymphoma, intracranial metastases, and glioblastoma, and randomly selected tumor-free images of each patient, which were equivalent to approximately 1 / 3 of the number of images containing tumors, as the normal image group.

[0013] Furthermore, the network structure of the YOLOv8 target detection model includes an Input module, a Backbone module, a Neck module and a Head module;

[0014] The Input module is used for Mosaic data enhancement, image size processing, and adaptive anchor frame calculation; the Mosaic data enhancement refers to enhancing the data set in a Mosaic manner, including selecting four images each time, randomly scaling, randomly cropping, and randomly arranging the four images, and then splicing the four images into a new large image; the image size processing is used to transform the size of the image after the Mosaic data enhancement processing into a fixed size; the adaptive anchor frame calculation is used to set the initial anchor frame before training, and the initial anchor frame is a combination of aspect ratios of different scales;

[0015] The Backbone module includes Focus and CSPNet. The Focus transforms the original image into a feature map through slicing and convolution operations. The CSPNet implements local cross-layer fusion and uses feature information from different layers to obtain a richer feature map.

[0016] The Neck includes FPN and PAN. The FPN transmits information through upsampling and fuses feature maps of different scales to obtain a predicted feature map. The PAN is a bottom-up feature pyramid for further fusing feature information.

[0017] The Head module is used to convert the feature map provided by the Neck network into the final detection result, including the coordinates of the bounding box, the confidence of the bounding box, and the predicted probability of each category.

[0018] Furthermore, during the training process of the YOLOv8 target detection model, classification loss is used to update the weight of the model. The classification loss includes VFL and DEL. For positive samples containing targets, VFL introduces an asymmetric weighting operation to reduce the loss of negative samples and keep the weight of positive samples larger; DFL adjusts the weights of positive and negative samples so that the model focuses on the position distribution near the target more quickly.

[0019] Furthermore, the VFL calculation formula is as follows:

[0020]

[0021] Among them, p is the predicted classification score, q is the target score, is a balancing factor used to adjust the weights between positive and negative samples. Used to adjust the weight of p;

[0022] The DFL calculation formula is as follows:

[0023] ;

[0024] in: , Defines the true label value The boundaries of the forecast distribution interval; is the true label value; is the boundary value corresponding to the predicted distribution The cumulative probability value of Represents the boundary value corresponding to the predicted distribution The cumulative probability of .

[0025] Furthermore, the precision rate refers to the total number of correctly predicted positive samples in the validation set / the total number of all samples predicted as positive, and the calculation formula is as follows:

[0026]

[0027] Among them, TP represents the number of correct classes predicted as correct classes, and FP represents the number of negative classes predicted as correct classes;

[0028] The recall rate refers to the probability that the correct category in the validation set is predicted correctly, and the calculation formula is as follows:

[0029]

[0030] Among them, TP represents the number of correct classes predicted as correct classes, and FN represents the number of correct classes predicted as negative classes.

[0031] The harmonic mean of the precision and recall is F1, and the calculation formula is as follows:

[0032]

[0033] Among them, P is the precision and R is the recall.

[0034] Furthermore, the S5 uses the visualization tool TensorBoardj to perform visualization model training. Different model parameters are set during the training process, and the model parameters are adjusted through the network diagram, tensor index changes, and tensor distribution displayed by TensorBoard.

[0035] A system for executing the above-mentioned primary central nervous system lymphoma detection and classification method based on YOLOv8, comprising:

[0036] An image acquisition module, used to acquire an MRI image of a target site;

[0037] The tumor detection and classification module inputs the MRI image into the YOLOv8 target detection model and outputs the detection results, including the coordinates of the tumor bounding box, the confidence of the tumor bounding box, and the predicted probability of the tumor category.

[0038] Beneficial effect: Compared with the prior art, the advantages of the present invention are: the present invention establishes a network model based on YOLOv8, which successfully detects PCNS-DLBCL tumors on MRI images, and can be distinguished from GBM and BM at the same time, and the model has high accuracy and robustness.

[0039] The present invention first processes image data, including image size standardization and adaptive anchor frame calculation, to facilitate model training; then uses the YOLOv8 algorithm to perform target detection on the image, which can transform the input image into a fixed size and improve the accuracy of model training by designing initial anchor frame parameters; YOLOv8 uses asymmetric VFLLoss and CIOU Loss+DFL, and these loss functions help the model focus on the target position faster and improve the accuracy of classification; TensorBoard is used to visualize the model training to help select the best network parameters, thereby optimizing model performance.

[0040] The present invention achieves high-precision tumor recognition and classification through precise data processing, advanced detection algorithms and effective loss functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 Schematic diagram of image annotation for training set and validation set images.

[0042] Figure 2 This is the structure diagram of the YOLOv8 model in the present invention.

[0043] Figure 3 This is a structural diagram of the Backbone part in the YOLOv8 model in the present invention.

[0044] Figure 4 This is the structural diagram of the Neck part of the YOLOv8 model in the present invention.

[0045] Figure 5 Graph of the YOLOv8 model DF in the present invention.

[0046] Figure 6 The present invention provides an overall implementation roadmap for the method.

[0047] Figure 7 This is the training curve of YOLOv8 detecting PCNS-DLBCL in the present invention.

[0048] Figure 8 This is a visualization diagram of the model after deployment of the present invention. DETAILED DESCRIPTION

[0049] The technical solution of the present invention is described in detail below with reference to the accompanying drawings, but the protection scope of the present invention is not limited to the embodiments.

[0050] Example 1: The present invention proposes a detection and classification method based on the YOLOv8 detection algorithm for primary central nervous system lymphoma detection, which includes data collection, data processing and data division, image annotation, YOLOv8 target detection algorithm, YOLOv8 algorithm classification loss and classification algorithm evaluation index. Specifically, the implementation process of the primary central nervous system lymphoma detection and classification method based on YOLOv8 is as follows:

[0051] Step 1. Data collection: First, data from patients with primary central nervous system diffuse large B-cell lymphoma, intracranial metastases, and glioblastoma admitted to the Department of Neurosurgery of Jiangsu Provincial People's Hospital from 2014 to 2022 were collected. The data collection was approved by the Institutional Review Board, and all experiments followed the Declaration of Helsinki. Because this study was a retrospective study, the informed consent form was waived, and a total of 388 patients were included, including 81 PCNS-DLBCL, 149 GBM, and 158 BM; aged 28-79 (median 62) years, including 216 males and 172 females.

[0052] Step 2, data processing and data partitioning: All MRI (magnetic resonance imaging) images were scanned using a Siemens scanner, and then a radiologist and a neurosurgeon jointly determined and screened out the images containing tumors in the patient's MRI images, and divided the images into training, validation and test sets using Python random code, with a data distribution ratio of 7:2:1.

[0053] MRI images were scanned using a Siemens scanner with a magnetic field strength of 3.0 t and a 16-channel phased array head coil, including T1W, T2W, FLAIR, and T1W+C axial two-dimensional spin echo images. The pixel matrix size of the MRI images was 230×230, and the following settings were used for acquisition: slice thickness 5 mm, encoding direction left and right, repetition time (TR) T1W, T2W, FLAIR, and T1W-C were 154, 4600, 7000, and 204 ms, respectively, echo time (TE) T1W, T2W, FLAIR, and T1W-C were 3, 114, 100, and 4 ms, respectively, and flip time (TI) FLAIR was 130 ms.

[0054] The DICOM-formatted patient MRI image data was converted into jpg format images (resolution 448*448, 24-bit color depth) through MicroDicom. A radiologist and a neurosurgeon jointly determined and screened out the images containing tumors in the MRI images of PCNS-DLBCL, GBM, and BM patients. At the same time, images without tumors, which were equivalent to about one-third of the number of images containing tumors, were randomly selected as the normal image group for each patient. In the end, a total of 12,937 brain MRI images were collected, including 2,168 images in the PCNS-DLBCL group, 3,798 images in the GBM group, 3,361 images in the BM group, and 3,610 images in the NC group. The images in the data set were numbered in sequence. The training set contained 9,044 images, the validation set contained 2,588 images, and the test set contained 1,305 images.

[0055] The images are divided into training set, validation set and test set by Python random code, and their ratios in the enhanced dataset are 7:2:1 respectively. The number of different lesion categories in the training set, validation set and test set is shown in Table 1.

[0056] Table 1 Distribution of various types of lesion images in the dataset

[0057] Dataset total PCNS-DLBCL GBM BM NC Training set 9044 1512 2660 2345 2527 Validation set 2588 436 758 673 721 Test Set 1305 220 380 343 362

[0058] Step 3: Image annotation: A senior diagnostic radiologist and a neurosurgeon jointly annotated the training set and validation set images using LabelImg software, and reached a consensus after careful discussion on any disagreements. Figure 1 A senior radiologist and a neurosurgeon used LabelImg software to annotate the training set and validation set images. After careful discussion, they reached a consensus on the differences. The rectangular box only covers the entire tumor area (including the enhanced area and the necrotic area), and the standard for normal images covers the largest area of ​​the brain as much as possible. Create a rectangular box to select the corresponding target area, and determine the location and classification as shown in the figure. Multiple tumors should be annotated separately, regardless of the size of the tumor. After processing, select the VOC dataset annotation format to save, and the annotation file type is XML file.

[0059] Step 4, YOLOv8 target detection algorithm: The YOLOv8 algorithm needs to transform the size of the input image into a fixed size and then send it to the detection model for training. The YOLOv8 algorithm is the latest version of the YOLO algorithm. The YOLO algorithm is a neural network for classification and positioning of target detection. It has been widely used in the field of target detection and has developed from V1 to V8. YOLOv8 has the characteristics of small size, fast speed, and high precision. It is implemented in the mature PyTorch ecosystem and is easy to deploy. YOLOv8 includes 5 models: YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l, and YOLOv8x. The YOLOv8n used this time is the network with the smallest depth, the smallest feature map width, and the fastest processing speed in the YOLOv8 series. Its network model structure is as follows Figure 2 As shown in the figure, the network structure of the target recognition model is divided into four parts: Input, Backbone, Neck, and Head.

[0060] Input: This is the stage where the model receives the original image. H x W x C represents the height, width, and number of channels of the original image data. The unprocessed image will be fed into the model for target detection. The input part includes three parts: Mosaic data enhancement, image size processing, and adaptive anchor box calculation. The recognition model uses the Mosaic method to enhance the data, which is ideal for small target detection and meets the needs of small target detection such as tumors. Mosaic data enhancement is performed on the annotated image. Four images are used each time, and the four images are randomly scaled, randomly cropped, and randomly arranged. Then, the four images are spliced ​​into a new image to increase the diversity of the data. In the recognition algorithm, the size of the input image needs to be transformed into a fixed size and then sent to the detection model for training. Before network training, it is necessary to set the initial anchor box. The initial anchor boxes set for the target recognition model are [116, 90, 156, 198, 373, 326], [30, 61, 62, 45, 59, 119], [10, 13, 16, 30, 33, 23]. The network model is trained based on the initial anchor box to obtain the predicted box, which is compared with the true bounding box. The network model parameters are adjusted iteratively based on the reverse update of the difference.

[0061] Backbone: This is the core part of the model, responsible for extracting image features. The Backbone part includes the Focus structure and the CrossStage Partial Networks (CSPNet). The Focus structure includes 4 slice operations and 1 convolution operation with 32 convolution kernels to convert the original 640×640×3 image into a 320×320×32 feature map. CSPNet imitates the idea of ​​dense cross-layer skip-layer connection of Densenet, performs local cross-layer fusion, and uses the feature information of different layers to obtain richer feature maps, such as Figure 3 shown.

[0062] Neck (Neck Network): It is used to further process and refine the features extracted by the backbone network. The Neck part adopts the FPN+PAN structure. FPN is top-down and uses upsampling to transfer and fuse information to obtain the predicted feature map. PAN uses a bottom-up feature pyramid. Figure 4 shown.

[0063] Head network: The head network is responsible for converting the feature map provided by the neck network into the final detection result, including the coordinates of the bounding box, the confidence of the bounding box, and the predicted probability of each category.

[0064] The classification loss of YOLOv8 is an asymmetric VFL (VariFocal) Loss, and its regression loss is in the form of CIOU (Complete-IOU) Loss + DFL (Distribution Focal Loss).

[0065] The main improvement of VFL is the asymmetric weighted operation, the formula of which is as follows:

[0066]

[0067] Where p is the predicted IACS (an IOU-aware classification score), q is the target score, is a balancing factor used to adjust the weight between positive and negative samples. In tasks such as object detection, negative samples (background) are usually much more than positive samples (target objects). It is used to adjust this imbalance so that the model pays more attention to positive or negative samples.

[0068] when When , the model will pay more attention to the positive sample (i.e., the target object). When , the model will pay more attention to negative samples (i.e., background). For foreground points, its ground truth class q is set to the IoU between the generated bounding box and the true bounding box, otherwise it is 0, while for background points, the target q of all classes is 0. Using the formula Factoring the scaling loss, varifocal loss only reduces the loss contribution of negative examples (q=0) without reducing the weight of positive examples (q>0) in the same way.

[0069] DFL (Distribution Focal Loss) such as Figure 5 As shown in the figure, the main purpose is to model the position of the box as a general distribution, so that the network can quickly focus on the distribution of positions close to the target position, allowing the network to focus on the target more quickly. Nearby values ​​increase their probability. The specific calculation formula is as follows:

[0070]

[0071] DFL is mainly used in the bounding box regression process in the target detection task, by learning the difference between the predicted bounding box and the true bounding box. Where:

[0072] and : These two values ​​define the true label value The boundaries of the forecast distribution interval;

[0073] : The true label value (ground truth), that is, the true value of a certain dimension of the target bounding box;

[0074] : corresponding to the boundary value in the predicted distribution The cumulative probability value of

[0075] : They represent the boundary values ​​in the predicted distribution The cumulative probability of .

[0076] Step 5: Classification algorithm evaluation indicators: The diagnostic performance of the YOLOv8 target detection model was evaluated in a variety of ways. Precision, recall, and F1 score were used as indicators for target detection evaluation and classification performance. In order to quantitatively visualize the classification ability of YOLO, a confusion matrix was designed and statistical analysis was performed using Python 3.7.

[0077] Precision refers to the total number of correctly predicted positive samples in the validation data set / the total number of all predicted positive samples, as shown in the following formula, where FP represents the number of negative classes predicted as correct classes.

[0078]

[0079] Recall refers to the probability that the correct category in the validation dataset is predicted correctly, as shown in the following formula, where TP represents the number of correct categories predicted as correct categories, and FN represents the number of correct categories predicted as negative categories.

[0080]

[0081] F1 is the harmonic mean of precision (P) and recall (R), which combines precision and recall to prevent possible deviations caused by using only recall or precision, and facilitates the evaluation of network performance. The specific formula is as follows:

[0082]

[0083] Select different training parameters for different physical machine hardware devices to ensure the efficiency and stability of deep learning training. For high-performance hardware, choose a larger learning rate and batch size to increase the training speed; for low-performance hardware, choose a smaller learning rate and batch size to avoid training instability. Adjust the training parameters according to the actual situation to optimize the training effect.

[0084] In this embodiment, the above method is performed on a server configured with an Intel(R) Xeon(R) Platinum 8163@2.50GHz×12-core CPU processor and an NVIDIA Tesla V100 GPU. During the training process, the batch size is set to 16 and the epochs is set to 400. Figure 6 The figure shows the overall implementation route of the system. Information extraction includes: preprocessing a large number of tumor training data sets, transforming the size of the input image into a fixed size, and then sending it to the detection model for training. The model introduces an initial anchor box in the target recognition process. The initial anchor box is a set of initial areas with fixed size and aspect ratio. In model training, the closer the initial anchor box parameters are to the real bounding box, the easier the model will be to train, and its predicted bounding box will be more consistent with the real bounding box. Therefore, the quality of the initial candidate box parameter design directly affects the accuracy of the target box position. The best prediction model is obtained by continuously adjusting the parameters according to the map indicators of each training. The training application process includes four modules: model training, real-time monitoring, tumor recognition, and information transmission and interaction of the taping machine.

[0085] The present invention uses the visualization tool TensorBoard for visualization model training. TensorBoard is a visualization tool that can be used to display network diagrams, changes in tensor indicators, distribution of tensors, etc., especially when training the network, setting different parameters (such as weight W, bias B, number of convolutional layers, number of fully connected layers, etc.), using TensorBoard can intuitively select parameters, such as Figure 7 shown.

[0086] The present invention also conducts comparative experiments of different YOLOv8 algorithms to demonstrate the real-time detection and classification performance of YOLO. The experimental results are shown in Table 2. YOLOv8m has the highest accuracy and recall rate.

[0087] Table 2. Comparative experimental results of different YOLOv8 algorithms

[0088] Model disease True Label Detection Label False positive label Recall Accuracy Accuracy F1 score YOLOv8n PCNS-DLBCL 436 355 79 0.81(0.795,0.825) 0.94(0.929,0.947) 0.82(0.805,0.835) 0.81(0.785,0.835) GBM 758 681 49 0.90(0.888,0.912) 0.95(0.943,0.959) 0.93(0.920,0.940) 0.92(0.887,0.953) BM 673 595 30 0.88(0.867,0.893) 0.96(0.950,0.966) 0.95(0.942,0.958) 0.91(0.878,0.942) NM 721 703 216 0.98(0.975,0.985) 0.91(0.899,0.921) 0.77(0.754,0.786) 0.86(0.831,0.889) YOLOv8s PCNS-DLBCL 436 362 62 0.83(0.815,0.845) 0.95(0.938,0.956) 0.85(0.836,0.864) 0.84(0.813,0.867) GBM 758 704 50 0.93(0.920,0.940) 0.96(0.952,0.968) 0.93(0.920,0.940) 0.93(0.897,0.963) BM 673 604 31 0.90(0.888,0.912) 0.96(0.954,0.968) 0.95(0.942,0.958) 0.92(0.887,0.953) NM 721 704 127 0.98(0.975,0.985) 0.94(0.935,0.953) 0.85(0.836,0.864) 0.91(0.878,0.942) YOLOv8m PCNS-DLBCL 436 375 53 0.86(0.847,0.873) 0.96(0.948,0.964) 0.88(0.867,0.893) 0.87(0.841,0.899) GBM 758 711 44 0.94(0.931,0.949) 0.97(0.958,0.972) 0.94(0.931,0.949) 0.94(0.906,0.974) BM 673 626 30 0.93(0.920,0.940) 0.97(0.963,0.977) 0.95(0.942,0.958) 0.94(0.906,0.974) NM 721 711 139 0.99(0.986,0.994) 0.94(0.933,0.951) 0.84(0.826,0.854) 0.91(0.878,0.942)

[0089] The present invention also compares the performance of YOLOv8n and YOLOv8s, and the experimental results are listed in Table 3. In Table 3, the mAP of YOLOv8m is 90.08%, and the lowest missing value is 0.0043. It can be found that the average accuracy of the model based on YOLOv8m is significantly better than other algorithms. YOLOv8m can provide better detection capabilities. The diagnostic accuracy of YOLOv8n and YOLOv8s is slightly lower, at 0.94 and 0.95 respectively, with YOLOv8m having the highest accuracy. The F1 value of YOLOv8m is 0.92, followed by YOLOv8s (0.91); YOLOv8n (0.88). The present invention also visualizes the monitoring effect diagram after deploying the model, as shown in Figure 8 shown.

[0090] Table 3. Performance comparison results of YOLOv8m, YOLOv8n, and YOLOv8s

[0091] Model Training time Missing Values Recall Accuracy Accuracy F1 score mAP@0.5 YOLOv8n 5h52m24s 0.0048 0.90(0.888,0.912) 0.94(0.930,0.948) 0.86(0.847,0.873) 0.88(0.850,0.910) 0.854 YOLOv8s 6h22m56s 0.0044 0.92(0.910,0.930) 0.95(0.945,0.961) 0.90(0.888,0.912) 0.91(0.878,0.942) 0.893 YOLOv8m 9h46m26s 0.0043 0.94(0.931,0.949) 0.96(0.950,0.966) 0.90(0.888,0.912) 0.92(0.887,0.953) 0.901

[0092] mAP: Mean Average Precision

[0093] The present invention establishes a network model based on the YOLOv8 algorithm to successfully detect PCNS-DLBCL tumors on MRI images of four sequences (T1W, T2W, FLAIR and T1W+C), and can also distinguish them from GBM and BM. The model has high accuracy and robustness. Figure 8As shown, a computer system of the model is also implemented to realize the visual operation of the above method, and the system includes: an image acquisition module, which is used to acquire an MRI image of the target part; a tumor detection and classification module, which inputs the MRI image into the YOLOv8 target detection model and outputs the detection results, including the coordinates of the tumor bounding box, the confidence of the tumor bounding box, and the predicted probability of the tumor category.

[0094] As described above, although the present invention has been shown and described with reference to specific preferred embodiments, it should not be construed as limiting the present invention itself. Various changes in form and details may be made without departing from the spirit and scope of the present invention as defined in the appended claims.

Claims

1. A primary central nervous system lymphoma detection and classification method based on YOLOv8, characterized in that: The steps include: S1: Acquire MRI image data of patients with primary central nervous system diffuse large B-cell lymphoma, intracranial metastases, and glioblastoma; S2: Process the MRI image data, screen out the images containing tumors from the MRI images, and form a data set with randomly selected patient images without tumors. The data set is divided into a training set, a validation set, and a test set. S3: Annotate the images in the training set and validation set, including: creating a rectangular box to select the corresponding target area, determining the position and classification, for images with tumors, the rectangular box only covers the tumor area, for images without tumors, the rectangular box covers the largest area of ​​the brain as much as possible, and saving the annotated images; S4: Train the YOLOv8 target detection model. Set the initial anchor box before training. Use the training set to train the model. Train the predicted bounding box based on the initial anchor box. Calculate the difference between the predicted bounding box and the true bounding box. Perform reverse update based on the difference and iteratively adjust the model parameters. S5: Evaluate the YOLOv8 object detection model. Input the images of the validation set into the YOLOv8 object detection model trained in S4 for feature extraction. Output the detection results, including the coordinates of the bounding box, the confidence of the bounding box, and the predicted probability of each category. The precision, recall and the harmonic mean of precision and recall are used as indicators to evaluate the target detection and classification performance of the YOLOv8 target detection model.

2. The primary central nervous system lymphoma detection and classification method based on YOLOv8 according to claim 1, characterized in that: The images containing tumors in MRI images of patients with primary central nervous system diffuse large B-cell lymphoma, intracranial metastases, and glioblastoma were manually screened out, and the images without tumors, which were equivalent to about 1 / 3 of the images containing tumors, were randomly selected from each patient as the normal image group.

3. The primary central nervous system lymphoma detection and classification method based on YOLOv8 according to claim 1, characterized in that: The network structure of the YOLOv8 target detection model includes an Input module, a Backbone module, a Neck module and a Head module; The Input module is used for Mosaic data enhancement, image size processing, and adaptive anchor frame calculation; the Mosaic data enhancement refers to enhancing the data set in a Mosaic manner, including selecting four images each time, randomly scaling, randomly cropping, and randomly arranging the four images, and then splicing the four images into a new large image; the image size processing is used to transform the size of the image after the Mosaic data enhancement processing into a fixed size; the adaptive anchor frame calculation is used to set the initial anchor frame before training, and the initial anchor frame is the initial area of ​​different scales and aspect ratios; The Backbone module includes Focus and CSPNet. The Focus transforms the original image into a feature map through slicing and convolution operations. The CSPNet implements local cross-layer fusion and uses feature information from different layers to obtain a richer feature map. The Neck includes FPN and PAN. The FPN transmits information through upsampling and fuses feature maps of different scales to obtain a predicted feature map. The PAN is a bottom-up feature pyramid for further fusing feature information. The Head module is used to convert the feature map provided by the Neck network into the final detection result, including the coordinates of the bounding box, the confidence of the bounding box, and the predicted probability of each category.

4. The primary central nervous system lymphoma detection and classification method based on YOLOv8 according to claim 1, characterized in that: The YOLOv8 target detection model uses classification loss to update the model weight during training. The classification loss includes VFL and DEL. For positive samples containing targets, VFL introduces an asymmetric weighting operation to reduce the loss of negative samples and keep the weight of positive samples larger. DFL adjusts the weights of positive and negative samples so that the model focuses on the position distribution near the target more quickly.

5. The primary central nervous system lymphoma detection and classification method based on YOLOv8 according to claim 4, characterized in that: The VFL calculation formula is as follows: Among them, p is the predicted classification score, q is the target score, is a balancing factor used to adjust the weights between positive and negative samples. Used to adjust the weight of p; The DFL calculation formula is as follows: in: y i , y i+1 Defines the true label value y The boundaries of the forecast distribution interval; y is the true label value; S i is the boundary value corresponding to the predicted distribution y i The cumulative probability value of S i+1 Represents the boundary value corresponding to the predicted distribution y i+1 The cumulative probability of .

6. The primary central nervous system lymphoma detection and classification method based on YOLOv8 according to claim 1, characterized in that: The precision rate refers to the total number of correctly predicted positive samples in the validation set / the total number of samples predicted as positive. The calculation formula is as follows: ; Among them, TP represents the number of correct classes predicted as correct classes, and FP represents the number of negative classes predicted as correct classes; The recall rate refers to the probability that the correct category in the validation set is predicted correctly, and the calculation formula is as follows: ; Among them, TP represents the number of correct categories predicted as correct categories, and FN represents the number of correct categories predicted as negative categories; The harmonic mean of the precision and recall is F1, and the calculation formula is as follows: ; Among them, P is the precision and R is the recall.

7. The primary central nervous system lymphoma detection and classification method based on YOLOv8 according to claim 1, characterized in that: The S5 uses the visualization tool TensorBoardj to perform visualization model training. Different model parameters are set during the training process. The model parameters are adjusted through the network diagram, tensor index changes, and tensor distribution displayed by TensorBoard.

Citation Information

Patent Citations

  • Cancer cell detection method and system based on deep learning, and medium

    CN112802010A

  • Cervical cancer diagnosis report generation method, device and equipment based on deep learning

    CN117457140A