YOLOv11-based inflammation edema score table automatic identification method and system
Through the YOLOv11 object detection method, the inefficiency and accuracy of converting SPARCC scoring table data into Excel is solved, and efficient and accurate automatic scoring table recognition and data set generation are achieved.
Patent Information
- Application Number
- CN202510652075.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-08-22
AI Technical Summary
In the prior art, the process of converting data from the SPARCC score table into Excel is time-consuming and labor-intensive and error-prone, and large language models are difficult to accurately identify the scores in the SPARCC score table, and there is a lack of an effective data set.
The YOLOv11-based object detection method is adopted to correct image tilt and color histogram cropping and optimize the YOLOv11 network structure through Fourier transform, and combine the checksum position sorting of sub-region detection to realize automatic identification and accurate conversion of the SPARCC score table.
It improves the success rate and accuracy of the SPARCC score table identification, ensures the correctness and completeness of the data, and greatly facilitates the data processing of scientific researchers.
Smart Images

Figure CN120526445A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and in particular to a method and system for automatically recognizing an inflammation edema scoring table based on YOLOv11. Background Art
[0002] The SPARCC (Spondyloarthritis Research Consortium of Canada) scoring system is an MRI scoring system for assessing sacroiliac joint inflammation. It assesses inflammatory status and activity by semiquantitatively analyzing the degree of edema and has been widely used in clinical research. The SPARCC scoring system has significant application value in clinical research, and can be used for early diagnosis of ankylosing spondylitis, evaluation of anti-inflammatory drug efficacy, and assessment of disease activity. The SPARCC scoring system has high inter-rater reliability and is relatively sensitive to disease progression. OMERACT (Outcome Measures in Rheumatology) advocates that the SPARCC sacroiliac joint scoring system be the preferred choice. In recent years, the SPARCC sacroiliac joint scoring system has garnered widespread research attention in the medical community. For example, the Spondyloarthritis Research Consortium of Canada, the Task Force on Endpoint Measurement in Rheumatology Clinical Trials, the People's Liberation Army General Hospital, Sichuan Orthopedic Hospital, the EuroSpA Imaging Project, and the International Spondyloarthritis Evaluation Group are all using the system. However, it has not received significant attention in the academic and industrial fields of artificial intelligence, primarily due to the lack of available SPARCC scoring datasets. However, there is currently no systematic method for converting SPARCC rating sheets into Excel, making it difficult to obtain relevant data sets. Previous methods often used manual annotation, which involved a large amount of manpower writing the ratings from the SPARCC rating sheets into Excel. This was very time-consuming and labor-intensive, and due to inevitable manual fatigue, errors were prone to occur when writing data. Although thanks to the rapid development of large language models, large language models are processing image problems faster, more convenient, and more accurately, it is still difficult for large language models to correctly identify the ratings in the SPARCC rating sheets and fill them into Excel. Therefore, it is crucial to obtain a systematic method for writing SPARCC rating sheets into Excel.
[0003] Benefiting from the powerful detection capabilities of deep neural networks, tasks such as image recognition and image retrieval have achieved widespread success, with significant progress in object detection tasks using visual features. YOLOv11 is the latest version of the Ultralytics YOLO series, combining cutting-edge accuracy, speed, and efficiency for object detection, segmentation, classification, oriented bounding boxes, and pose estimation. Compared to other object detection models, it has fewer parameters and better results, which means that YOLOv11 is more efficient, faster, and lighter on edge devices, and will be frequently used in future medical tests. Due to the visual similarity of the scoring boxes in the SPARCC scoring table, correct identification is often only possible with the help of small local differences, which YOLO can achieve. Therefore, object detection learning based on YOLOv11 plays a key role in the task of writing the SPARCC system scoring table to Excel. Summary of the Invention
[0004] The purpose of the present invention is to propose an automatic recognition method and system for inflammation and edema score sheets based on YOLOv11, which can accurately and effectively convert inflammation and edema score sheets into Excel.
[0005] To achieve the above object, the technical solution of the present invention is as follows:
[0006] The present invention proposes an automatic recognition method for an inflammation edema score sheet based on YOLOv11, which is characterized by comprising the following steps:
[0007] Step S1: Obtain a scan of the inflammation and edema score sheet, obtain a Fourier transform image of the inflammation and edema score sheet from the scan, calculate the tilt angle through binarization and Hough line detection, and then rotate and correct the inflammation and edema score sheet;
[0008] Step S2: Perform color histogram analysis on the inflammation and edema score sheet, crop the inflammation and edema score sheet according to the color histogram, and then manually annotate a portion of the inflammation and edema score sheet and save it in YOLO format as a training set for the target detection task;
[0009] Step S3: Optimize the YOLOv11 network structure, then use the manually labeled dataset in step S2 to train the target detection task, and finally save the trained YOLOv11 target detection model;
[0010] Step S4: Use the trained YOLOv11 target detection model to identify the inflammation and edema score table and obtain the detection results in YOLO format. If the detection results do not match the specified number, identify the correct number through regional detection verification; then sort the target position detection results, and finally fill the sorted results in Excel in order.
[0011] Preferably, step S1 specifically includes the following steps:
[0012] Step S11: obtaining a scan of the inflammation and edema scoring form;
[0013] Step S12: Obtaining the Fourier transform of the inflammation and edema score sheet. First, read the scanned copy of the inflammation and edema score sheet and convert it into a grayscale image and perform image expansion. Then, perform Fourier transform on the expanded image. The Fourier transform uses the following formula:
[0014]
[0015] Where (freq u ,freq v ) are the row and column indices in the frequency domain, F is the frequency domain value, F(freq u ,freq v ) indicates that the image is at frequency (freq u ,freq v )’s amplitude and phase; img M Represents the width of the image, img N Represents the height of the image; (img m ,img n ) represent the horizontal and vertical coordinates of the image, f is the spatial domain value, f(img m ,img n ) represents the image at position (img m ,img n )’s pixel value;
[0016] Step S13: Calculate the tilt angle by binarization and Hough line detection. Binarization is the process of converting the Fourier transform image of the inflammation and edema score table into black and white. The calculation formula for binarization is as follows:
[0017]
[0018] Among them, pixel(img m ,img n ) indicates the position (img m ,img n ) The pixel value after binarization, max_val is the maximum value after binarization, usually 255; gray_img(img m ,img n ) is the original grayscale image at position (img m ,img n )’s pixel value, threshold is the set threshold;
[0019] The edge points in the binary image are converted to parameter space through Hough line detection. Then, the peak point in the parameter space is found through a voting mechanism. The parameters corresponding to the peak point are the parameters of the line. The tilt angle of the image is thus obtained, which facilitates image correction.
[0020] Step S14: Based on the tilt angle obtained in step S13, the center point of the binarized image is first calculated to generate a rotation matrix, and then an affine transformation is applied to perform rotation correction on the scanned copy of the inflammation and edema score sheet obtained initially.
[0021] Preferably, step S2 specifically includes the following steps:
[0022] Step S21: performing color histogram analysis on the rotation-corrected inflammation and edema score sheet, first reading the inflammation and edema score sheet and converting it into the BGR color space, and then calculating the histograms of the three color channels B, G, and R respectively;
[0023] Step S22: Select the first two areas with the highest pixel frequency in the color histogram, crop the area between them to obtain the scoring area of the inflammation and edema scoring table, save the image and replace the original image;
[0024] Step S23: Manually label part of the inflammation and edema score table, that is, use RectBox to select all the score rectangles in turn, then enter the score value as the label, save it in YOLO format, and use it as the target detection task training set.
[0025] Preferably, step S3 specifically includes the following steps:
[0026] Step S31: Optimize the YOLOv11 network structure; the optimized YOLOv11 total loss function L YOLOv11 for:
[0027] L YOLOv11 =L cls +L box +L dfl +L MPDIoU
[0028] Where, L cls , L box , L MPDIoU , L MPDIoU They represent classification loss, bounding box regression loss, distribution focus loss, and MPDIoU loss respectively;
[0029] The MPDIoU loss takes into account the shape and size of the bounding box to provide a more accurate metric. The specific formula is as follows:
[0030]
[0031] Among them, L MPDIoU is the MPDIoU loss value, IoU is the traditional intersection-over-union ratio, d1 and d2 are the Euclidean distances between the upper left corner and the lower right corner of the predicted box and the true box, respectively, that is, the square root of the sum of the squares of the width and height of the predicted box or the true box; the calculation formula of IoU is as follows:
[0032]
[0033] Among them, (Box A ,Box B ) represent two recognition boxes, IoU(Box A ,Box B ) represents the intersection-over-union ratio of two recognition boxes, Area(Box A ∩Box B ) represents the intersection area of two recognition boxes, Area(Box A ∪Box B ) represents the union area of two recognition boxes;
[0034] Step S32: Use the manually labeled dataset to train YOLOv11 for the target detection task;
[0035] Step S33: Save the trained YOLOv11 target detection model.
[0036] Preferably, the classification loss is used to calculate the difference between the predicted category probability distribution and the true label in each grid cell. The specific formula is as follows:
[0037]
[0038] Among them, L cls Represents the classification loss value, grid i Indicates the grid number, GRID is the total number of grids, Represents a grid i Is there a target in class? c Indicates the category of the detected target, CLASS indicates the total number of target detection categories, Indicates whether the target in the grid belongs to the class class c , The predicted category is class c probability.
[0039] Preferably, the bounding box regression loss is used to optimize the difference between the predicted bounding box and the true bounding box, and the specific formula is as follows:
[0040]
[0041] Among them, L boxrepresents the bounding box regression loss, λ box It is a hyperparameter used to balance the weights of different losses, Box x 、Box y 、Box w 、Box h Represents the horizontal coordinate, vertical coordinate, width and height of the center point of the real bounding box, pred x 、pred y 、pred w 、pred h Represents the horizontal coordinate, vertical coordinate, width and height of the center point of the predicted bounding box respectively.
[0042] Preferably, the distribution focus loss is used to deal with the class imbalance problem, and the specific formula is as follows:
[0043]
[0044] Among them, L dfl represents the distribution focal loss, λ dfl is a hyperparameter, BOX num is the total number of bounding boxes, box i is the number of the bounding box, α is the category balance factor, and γ is the parameter that adjusts the weight of hard examples.
[0045] Preferably, in step S4, if the scan result does not match the specified number, the correct number is identified through regional detection and verification, as follows:
[0046] The inflammatory edema score sheet was cropped according to the preset cropping region size. Each cropped region was again sent to the YOLOv11 target detection model for detection, and the number of identified regions was recorded. The number of identified regions was summarized. If the summary number still did not match the specified number, the cropping region size was halved and the above steps were repeated until it matched the specified number.
[0047] Preferably, the target position detection results are sorted, and the sorted results are finally filled into Excel in order; specifically as follows:
[0048] Sort the YOLO-formatted detection results based on the detected target locations. First, define a point class to store the label of each detection result, as well as the x-coordinate, y-coordinate, width, and height of the bounding box. Then, traverse the inflammation and edema score table detection results and record the maximum and minimum y-coordinate values and the number of points in all detection results. Adjust the y-coordinate of each detection result to a similar maximum or minimum value. Then, sort the detection results by x-coordinate and then by y-coordinate to obtain the final sorted result. Finally, fill the sorted results in Excel in order.
[0049] The present invention also proposes an automatic recognition system for an inflammation and edema score sheet based on YOLOv11, comprising a processor, a memory, and a computer program stored on the memory. When the processor executes the computer program, it specifically performs any step in the above-mentioned automatic recognition method for an inflammation and edema score sheet.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] 1. The present invention ensures the level of the scanned image through image correction based on Fourier transform, effectively preventing the problem of not being able to identify the scoring area due to the tilt of the scanned image. After testing, this method can greatly improve the recognition success rate and accuracy.
[0052] 2. The present invention effectively reduces the input image size through image cropping based on color histogram, while ensuring that the scoring area is not lost, which can significantly reduce the area that needs to be detected, thereby improving the speed and accuracy of target detection.
[0053] 3. This paper optimizes the YOLOv11 object detection model and adds an additional MPDIoU loss to the loss. This loss takes into account the shape and size of the bounding box and can provide a more accurate measurement.
[0054] 4. This invention analyzes YOLO-formatted data and uses region-based detection and verification to detect a specified number of scoring regions to ensure data accuracy. It also uses a position-based sorting method to accurately write the scores from the SPARCC scoring table into Excel, greatly avoiding the possibility of data disorder and errors.
[0055] 5. The YOLOv11-based automatic recognition method for inflammatory edema scoring constructed in the present invention can accurately and effectively locate the scoring area, achieve a high target detection accuracy, and thus write the score more accurately into Excel and can be directly used as a valid data set, which greatly facilitates scientific researchers. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0057] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings.
[0058] like Figure 1 As shown, this embodiment provides an automatic recognition method for an inflammation edema score table based on YOLOv11, which specifically includes the following steps:
[0059] Step S1: Obtain a scan of the inflammation and edema score sheet, obtain a Fourier transform image of the inflammation and edema score sheet from the scan, calculate the tilt angle through binarization and Hough line detection, and then rotate and correct the inflammation and edema score sheet;
[0060] Step S2: Perform color histogram analysis on the inflammation and edema score sheet, crop the inflammation and edema score sheet according to the color histogram, and then manually annotate a portion of the inflammation and edema score sheet and save it in YOLO format as a training set for the target detection task;
[0061] Step S3: Optimize the YOLOv11 network structure, then use the manually labeled dataset in step S2 to train the target detection task, and finally save the trained YOLOv11 target detection model;
[0062] Step S4: Use the trained YOLOv11 target detection model to identify the inflammation and edema score table and obtain the detection results in YOLO format. If the detection results do not match the specified number, identify the correct number through regional detection verification; then sort the target position detection results, and finally fill the sorted results in Excel in order.
[0063] In this embodiment, step S1 specifically includes the following steps:
[0064] Step S11: obtaining a scan of the inflammation and edema score sheet, mainly by scanning the inflammation and edema score sheet with a scanner;
[0065] Step S12: Obtaining the Fourier transform of the inflammation and edema score sheet. First, read the scanned copy of the inflammation and edema score sheet and convert it into a grayscale image. To improve the efficiency of the Fourier transform, the image is expanded to the optimal size, and then the expanded image is subjected to the Fourier transform. The Fourier transform uses the following formula:
[0066]
[0067] Where (freq u ,freq v ) are the row and column indices in the frequency domain, F is the frequency domain value, F(frequ ,freq v ) indicates that the image is at frequency (freq u ,freq v )’s amplitude and phase; img M Represents the width of the image, img N Represents the height of the image; (img m ,img n ) represent the horizontal and vertical coordinates of the image, f is the spatial domain value, f(img m ,img n ) represents the image at position (img m ,img n )’s pixel value;
[0068] Step S13: Calculate the tilt angle through binarization and Hough line detection. Binarization is the process of converting the Fourier transform image of the inflammation and edema score table into black and white. It is usually used for image preprocessing to facilitate subsequent edge detection and feature extraction. The calculation formula for binarization is as follows:
[0069]
[0070] Among them, pixel(img m ,img n ) indicates the position (img m ,img n ) The pixel value after binarization, max_val is the maximum value after binarization, usually 255; gray_img(img m ,img n ) is the original grayscale image at position (img m ,img n ), threshold is the set threshold.
[0071] Hough line detection is an algorithm used to detect straight lines in an image. It converts edge points in a binary image into a parameter space, then uses a voting mechanism to find peak points in the parameter space. The parameters corresponding to these peak points are the parameters of the line. This allows the image's tilt angle to be determined, facilitating image correction.
[0072] Step S14: Based on the tilt angle obtained in step S13, the center point of the binarized image is first calculated to generate a rotation matrix, and then an affine transformation is applied to perform rotation correction on the scanned copy of the inflammation and edema score sheet obtained initially.
[0073] In this embodiment, step S2 specifically includes the following steps:
[0074] Step S21: performing color histogram analysis on the rotation-corrected inflammation and edema score sheet, first reading the inflammation and edema score sheet and converting it into the BGR color space, and then calculating the histograms of the three color channels B, G, and R respectively;
[0075] Step S22: Select the first two areas with the highest pixel frequency in the color histogram, crop the area between them, and obtain the scoring area of the inflammation and edema scoring table. Save the image and replace the original image.
[0076] Step S23: Manually label part of the inflammation and edema score table, that is, use RectBox to select all the score rectangles in turn, then enter the score value as the label, save it in YOLO format, and use it as the target detection task training set. The size of the training set is determined based on personal experience.
[0077] In this embodiment, step S3 specifically includes the following steps:
[0078] Step S31: Optimize the YOLOv11 network structure. YOLOv11's object detection loss function combines classification loss, bounding box regression loss, and distribution focus loss. Classification loss is used to calculate the difference between the predicted class probability distribution and the true label in each grid cell. The specific formula is as follows:
[0079]
[0080] Among them, L cls Represents the classification loss value, grid i Indicates the grid number, GRID is the total number of grids, Indicates whether there is a target in the grid, class c Indicates the category of the detected target, CLASS indicates the total number of target detection categories, Indicates whether the target in the grid belongs to the class class c ,and The predicted category is class c probability.
[0081] The bounding box regression loss is used to optimize the difference between the predicted bounding box and the true bounding box. The specific formula is as follows:
[0082]
[0083] Among them, L box represents the bounding box regression loss, λ box It is a hyperparameter used to balance the weights of different losses. Box x 、Box y 、Box w 、Box hRepresents the horizontal coordinate, vertical coordinate, width and height of the center point of the real bounding box, pred x 、pred y 、pred w 、pred h Represents the horizontal coordinate, vertical coordinate, width and height of the center point of the predicted bounding box respectively.
[0084] Distribution focus loss is used to deal with category imbalance problems and effectively handle unbalanced data sets. The specific formula is as follows:
[0085]
[0086] Among them, λ dfl represents the distribution focal loss, λ dfl is a hyperparameter, BOX num is the total number of bounding boxes, box i is the number of the bounding box, α is the category balance factor, and γ is the parameter that adjusts the weight of hard examples.
[0087] The original YOLOv11 total loss function is a weighted sum of the three components mentioned above. This paper builds on this by additionally using the MPDIoU loss, which takes into account the shape and size of the bounding box to provide a more accurate metric. The specific formula is as follows:
[0088]
[0089] Among them, L MPDIoU is the MPDIoU loss value, IoU is the traditional intersection-over-union ratio, d1 and d2 are the Euclidean distances between the upper left corner and the lower right corner of the predicted box and the true box, respectively, that is, the square root of the sum of the squares of the width and height of the predicted box or the true box. Specifically, the IoU calculation formula is as follows:
[0090]
[0091] Among them, (Box A ,Box B ) represent two recognition boxes, IoU(Box A ,Box B ) represents the intersection of two recognition boxes, Area(Box A ∩Box B ) represents the intersection area of two recognition boxes, Area(Box A ∪Box B ) represents the union area of two recognition boxes.
[0092] The improved YOLOv11 total loss function is:
[0093] L YOLOv11=L cls +L box +L dfl +L MPDIoU
[0094] Step S32: Use the manually labeled dataset to train YOLOv11 for the target detection task;
[0095] Step S33: Save the trained YOLOv11 target detection model.
[0096] In this embodiment, step S4 specifically includes the following steps:
[0097] Step S41: Identify the inflammation edema score table using the trained YOLOv11 target detection model to obtain a detection result in YOLO format;
[0098] Step S42: If the scan result does not match the specified number, the correct number is identified through regional detection and verification.
[0099] The inflammatory edema score sheet is cropped according to the preset cropping region size. Each cropped region is then sent to the YOLOv11 object detection model for detection again, and the number of identified regions is recorded. The number of identified regions is summarized. If the summarized number still does not match the specified number, the cropping region size is halved and the above steps are repeated until the specified number is matched.
[0100] Step S43: Sort the detection results in YOLO format based on the detected target position. First, define a point class to store the label of each detection result, as well as the x-coordinate, y-coordinate, width, and height of the bounding box; then traverse the inflammation and edema score table detection results, record the maximum and minimum y-coordinates and the number of points in all detection results; adjust the y-coordinate of each detection result to a similar maximum or minimum value recorded; then sort the detection results by x-coordinate first, and then by y-coordinate to obtain the final sorting result; finally, fill the sorted results in Excel in order.
[0101] This embodiment also provides an automatic recognition system for an inflammation and edema score table based on YOLOv11, comprising a processor, a memory, and a computer program stored on the memory. When the processor executes the computer program, it specifically performs the steps in any of the above-mentioned automatic recognition methods for an inflammation and edema score table.
[0102] The above are preferred embodiments of the present invention. Any changes made according to the technical solution of the present invention, as long as the resulting functions and effects do not exceed the scope of the technical solution of the present invention, shall fall within the scope of protection of the present invention.
Claims
1. A method for automatically identifying inflammation and edema score tables based on YOLOv11, characterized by: The following steps are involved: Step S1: Obtain a scan of the inflammation and edema score sheet, obtain a Fourier transform image of the inflammation and edema score sheet from the scan, calculate the tilt angle through binarization and Hough line detection, and then rotate and correct the inflammation and edema score sheet; Step S2: Perform color histogram analysis on the inflammation and edema score sheet, crop the inflammation and edema score sheet according to the color histogram, and then manually annotate a portion of the inflammation and edema score sheet and save it in YOLO format as a training set for the target detection task; Step S3: Optimize the YOLOv11 network structure, then use the manually labeled dataset in step S2 to train the target detection task, and finally save the trained YOLOv11 target detection model; Step S4: Use the trained YOLOv11 target detection model to identify the inflammation and edema score table and obtain the detection results in YOLO format. If the detection results do not match the specified number, identify the correct number through regional detection verification; then sort the target position detection results, and finally fill the sorted results in Excel in order.
2. A method for automatically identifying inflammation and edema score tables based on YOLOv11, characterized by: Step S1 specifically includes the following steps: Step S11: obtaining a scan of the inflammation and edema scoring form; Step S12: Obtaining the Fourier transform of the inflammation and edema score sheet. First, read the scanned copy of the inflammation and edema score sheet and convert it into a grayscale image and perform image expansion. Then, perform Fourier transform on the expanded image. The Fourier transform uses the following formula: Where (freq u ,freq v ) are the row and column indices in the frequency domain, F is the frequency domain value, F(freq u ,freq v ) indicates that the image is at frequency (freq u ,freq v )’s amplitude and phase; img M Represents the width of the image, img N Represents the height of the image; (img m ,img n ) represent the horizontal and vertical coordinates of the image, f is the spatial domain value, f(img m ,img n ) represents the image at position (img m ,img n )’s pixel value; Step S13: Calculate the tilt angle by binarization and Hough line detection. Binarization is the process of converting the Fourier transform image of the inflammation and edema score table into black and white. The calculation formula for binarization is as follows: Among them, pixel(img m ,img n ) indicates the position (img m ,img n ) The pixel value after binarization, max_val is the maximum value after binarization, usually 255; gray_img(img m ,img n ) is the original grayscale image at position (img m ,img n )’s pixel value, threshold is the set threshold; The edge points in the binary image are converted to parameter space through Hough line detection. Then, the peak point in the parameter space is found through a voting mechanism. The parameters corresponding to the peak point are the parameters of the line. The tilt angle of the image is thus obtained, which facilitates image correction. Step S14: Based on the tilt angle obtained in step S13, the center point of the binarized image is first calculated to generate a rotation matrix, and then an affine transformation is applied to perform rotation correction on the scanned copy of the inflammation and edema score sheet obtained initially.
3. The method for automatically identifying an inflammation edema score based on YOLOv11 according to claim 1, characterized in that: Step S2 specifically includes the following steps: Step S21: performing color histogram analysis on the rotation-corrected inflammation and edema score sheet, first reading the inflammation and edema score sheet and converting it into the BGR color space, and then calculating the histograms of the three color channels B, G, and R respectively; Step S22: Select the first two areas with the highest pixel frequency in the color histogram, crop the area between them to obtain the scoring area of the inflammation and edema scoring table, save the image and replace the original image; Step S23: Manually label part of the inflammation and edema score table, that is, use RectBox to select all the score rectangles in turn, then enter the score value as the label, save it in YOLO format, and use it as the target detection task training set.
4. The method for automatically identifying an inflammation edema score based on YOLOv11 according to claim 1, characterized in that: Step S3 specifically includes the following steps: Step S31: Optimize the YOLOv11 network structure; the optimized YOLOv11 total loss function L YOLOv11 for: L YOLOv11 =L cls +L box +L dfl +L MPDIoU Where, L cls , L box , L MPDIoU , L MPDIoU They represent classification loss, bounding box regression loss, distribution focus loss, and MPDIoU loss respectively; The MPDIoU loss takes into account the shape and size of the bounding box to provide a more accurate metric. The specific formula is as follows: Among them, L MPDIoU is the MPDIoU loss value, IoU is the traditional intersection-over-union ratio, d1 and d2 are the Euclidean distances between the upper left corner and the lower right corner of the predicted box and the true box, respectively, that is, the square root of the sum of the squares of the width and height of the predicted box or the true box; the calculation formula of IoU is as follows: Among them, (Box A ,Box B ) represent two recognition boxes, IoU(Box A ,Box B ) represents the intersection of two recognition boxes, Area(Box A ∩Box B ) represents the intersection area of two recognition boxes, Area(Box A ∪Box B ) represents the union area of two recognition boxes; Step S32: Use the manually labeled dataset to train YOLOv11 for the target detection task; Step S33: Save the trained YOLOv11 target detection model.
5. The method for automatically identifying an inflammation edema score based on YOLOv11 according to claim 4, characterized in that: The classification loss is used to calculate the difference between the predicted category probability distribution and the true label in each grid cell. The specific formula is as follows: Among them, L cls Represents the classification loss value, grid i Indicates the grid number, GRID is the total number of grids, Represents a grid i Is there a target in class? c Indicates the category of the detected target, CLASS indicates the total number of target detection categories, Indicates whether the target in the grid belongs to the class class c , The predicted category is class c probability.
6. The method for automatically identifying an inflammation edema score based on YOLOv11 according to claim 5, characterized in that: The bounding box regression loss is used to optimize the difference between the predicted bounding box and the true bounding box. The specific formula is as follows: Among them, L box represents the bounding box regression loss, λ box It is a hyperparameter used to balance the weights of different losses, Box x 、Box y 、Box w 、Box h Represents the horizontal coordinate, vertical coordinate, width and height of the center point of the real bounding box, pred x 、pred y 、pred w 、pred h Represents the horizontal coordinate, vertical coordinate, width and height of the center point of the predicted bounding box respectively.
7. The method for automatically identifying an inflammation edema score based on YOLOv11 according to claim 6, characterized in that: The distribution focus loss is used to deal with the problem of class imbalance. The specific formula is as follows: Among them, L dfl represents the distribution focal loss, λ dfl is a hyperparameter, BOX num is the total number of bounding boxes, box i is the number of the bounding box, α is the category balance factor, and γ is the parameter that adjusts the weight of hard examples.
8. The method for automatically identifying an inflammation edema score based on YOLOv11 according to claim 1, characterized in that: In step S4, if the scan result does not match the specified number, the correct number is identified through regional detection and verification, as follows: The inflammatory edema score sheet was cropped according to the preset cropping region size. Each cropped region was again sent to the YOLOv11 target detection model for detection, and the number of identified regions was recorded. The number of identified regions was summarized. If the summary number still did not match the specified number, the cropping region size was halved and the above steps were repeated until it matched the specified number.
9. The method for automatically identifying an inflammation edema score based on YOLOv11 according to claim 1, characterized in that: The target position detection results are sorted, and the sorted results are finally filled into Excel in order; the details are as follows: Sort the YOLO format detection results based on the detected target location. First, define a point class to store the label of each detection result, as well as the x-coordinate, y-coordinate, width, and height of the bounding box. Then, the inflammation and edema score table test results were traversed, and the maximum, minimum, and number of points of the y-coordinates in all the test results were recorded; the y-coordinates of each test result were adjusted to the closest recorded maximum or minimum value; the test results were then sorted by x-coordinate first, and then by y-coordinate to obtain the final sorting results; finally, the sorted results were filled in Excel in order.
10. An automatic recognition system for inflammation and edema score based on YOLOv11, characterized by: The method comprises a processor, a memory and a computer program stored in the memory. When the processor executes the computer program, the method specifically performs the steps of the method for automatically identifying an inflammation edema scoring table according to any one of claims 1 to 9.