Method and device for evaluating quality of cell image
By identifying and evaluating cells in cell images, using the grayscale values and length uniformity of multi-directional boundary points, as well as the internal noise distribution, the quality evaluation parameters of cell images are calculated, and the problem of inaccurate cell image quality evaluation in the prior art is solved, achieving higher accuracy and targeting.
Patent Information
- Application Number
- CN202311837722.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2025-06-27
AI Technical Summary
The existing cell image quality evaluation methods in cell image applications have low accuracy and targeting of the quality evaluation results, especially when the cell distribution is uneven and the individual cell structure is unclear.
By identifying cells in the cell image, the evaluation parameters of each cell are obtained, including evaluation parameters determined based on the uniform grayscale values of boundary points in multiple directions and the uniform length, as well as the internal noise distribution. Then, based on these evaluation parameters and their proportion in the image, the quality evaluation parameters of the entire cell image are calculated.
It improves the accuracy and pertinence of cell image quality evaluation, and can more accurately reflect the quality of individual cells, thereby improving the accuracy of the evaluation results of the entire cell image quality.
Smart Images

Figure CN120219277A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of medical image processing technology, and in particular, to a method and device for evaluating the quality of cell images. Background Art
[0002] Image technology is increasingly widely used in the medical field. Cell images are a type of medical image. If the collected cell images are directly subjected to various analysis and processing without evaluation, the results of the analysis and processing of low-quality images have low credibility and will interfere with medical diagnosis. For example, for cell quantification analysis of cell images, operations such as cell segmentation and counting are performed, and various parameters of the cells, such as density and spacing, are further calculated. Only high-quality images can obtain true and accurate analysis results to assist doctors in diagnosis. Therefore, the quality evaluation of cell images has high application value in the medical field and helps to increase the credibility of subsequent cell image analysis and processing results. Currently, the general method for evaluating the quality of images, when applied to cell images, the accuracy of the obtained quality evaluation results needs to be improved. Summary of the Invention
[0003] This application provides a method and device for obtaining the quality score of cell images, as well as related equipment, aiming to solve the problem of how to improve the accuracy of the quality score of cell images.
[0004] To achieve the above objective, this application provides the following technical solutions:
[0005] The first aspect of this application provides a method for evaluating the quality of cell images, including:
[0006] Identifying the cells in the cell image;
[0007] Obtaining the evaluation parameters of all identified cells, where the evaluation parameter of the first cell is determined based on the uniformity of the gray values of the boundary points of the first cell in multiple directions, and the first cell is any one of the cells;
[0008] Obtaining the proportion of cells with various evaluation parameters in the image;
[0009] Evaluating the quality of the entire cell image according to the evaluation parameters of all identified cells and the proportion.
[0010] Further, the determination of the evaluation parameter of the first cell based on the uniformity of the gray values of the boundary points of the first cell in multiple directions includes:
[0011] Obtaining the gray values of the boundary points of the first cell in multiple directions;
[0012] Determining the gray reference value based on the gray values of the boundary points of the first cell in the selected direction;
[0013] Obtain the number of directions in which the gray values of the boundary points meet the first preset condition, where the first preset condition is set based on the gray reference value;
[0014] Determine the evaluation parameter of the first cell according to the number.
[0015] Furthermore, obtaining the evaluation parameters of all recognized cells specifically means obtaining the evaluation parameters of all recognized valid cells. Determining whether a cell is a valid cell includes:
[0016] Select the direction group of the cell and obtain the gray value difference of the boundary points of each direction group;
[0017] If the gray value difference in at least one direction group of the cell is less than the threshold, it is determined as a valid cell.
[0018] Furthermore, the evaluation parameter of the first cell is also determined based on the uniformity of the lengths of the first cell in multiple directions. The length in a certain direction is the length from the center point of the first cell to the boundary point in that direction.
[0019] Furthermore, the process of determining the evaluation parameter based on the uniformity of the lengths of the first cell in multiple directions specifically includes:
[0020] Obtain the lengths of the first cell in multiple directions;
[0021] Based on the length of the first cell in the selected direction, determine the length reference value;
[0022] Obtain the number of directions in which the length meets the second preset condition, where the second preset condition is set based on the length reference value;
[0023] Determine the evaluation parameter of the first cell according to the number of directions that meet the second preset condition.
[0024] Furthermore, determining whether a cell is a valid cell also includes:
[0025] Obtain the difference in the lengths of the cell in each direction group;
[0026] If the length differences in all direction groups of the cell are greater than the threshold, it is determined that the cell is not a valid cell.
[0027] Furthermore, the selection of the direction group of the cell specifically means taking opposite directions as a group, or taking at least two consecutive adjacent directions as a group.
[0028] Furthermore, the evaluation parameter of the first cell is also determined based on the noise distribution inside the first cell.
[0029] Further, determining the evaluation parameter based on the noise distribution inside the first cell includes:
[0030] From the center of the first cell outwards, obtain the gray value difference index for each circle according to the shape of the first cell;
[0031] Obtain the range of the region where the gray value difference index is less than the threshold;
[0032] Compare the range of the region with the range of the first cell, and determine the evaluation parameter of the first cell according to the comparison result.
[0033] Further, calculating the quality evaluation parameter of the entire cell image according to the evaluation parameters of all recognized cells and the proportion includes:
[0034] Judge whether there is overexposure in the cell image. If so, obtain the proportion of overexposed cells;
[0035] Calculate the quality evaluation parameter of the entire cell image according to the evaluation parameters of all recognized cells, the proportion of cells with various evaluation parameters in the image, and the proportion of overexposed cells.
[0036] The second aspect of the present application provides a quality evaluation device for cell images, including:
[0037] A cell recognition module for recognizing cells in the cell image;
[0038] A single cell evaluation module for obtaining the evaluation parameters of all recognized cells. The evaluation parameter of the first cell is determined based on the uniformity of the gray values of the boundary points of the first cell in multiple directions, and the first cell is any one cell;
[0039] A proportion obtaining module for obtaining the proportion of cells with various evaluation parameters in the image;
[0040] A quality evaluation module for evaluating the quality of the entire cell image according to the evaluation parameters of all recognized cells and the proportion.
[0041] The quality evaluation method and device for cell images provided by this application obtain the evaluation parameters of each recognized cell in the cell image, and then evaluate the quality of the entire cell image based on the evaluation parameters and proportions of all recognized cells. Compared with the quality evaluation method based on the parameters of the entire image, this application conducts quality evaluation on a cell-by-cell basis, taking into account the particularity of cell images, and can obtain a relatively accurate quality evaluation result. Moreover, the evaluation parameter of any cell is determined based on the uniformity of the gray values of the boundary points of the cell in multiple directions, making full use of the specific structural features of the cell in the image, and can obtain relatively accurate evaluation parameters for individual cells, thereby further improving the accuracy of the quality evaluation result of the entire cell image. The quality evaluation method for cell images provided by this application can automatically and accurately evaluate whether the quality of image acquisition can reach an available state. It can not only output the score of the image quality for doctors' reference, but also remind users to re-acquire when the quality is low. According to the method of this application, high-quality images can be screened out, and subsequent cell quantification analysis and other processes can be carried out to obtain true and accurate analysis results, assisting doctors in diagnosis, which has high application value in the medical field, helps to increase the credibility of subsequent cell image analysis and processing results, saves labor costs, caters to the future development trend of automation and intelligence in the medical field, and is also the basis for the future development of AI diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0043] Figure 1 It is a flowchart of an evaluation method for a cell image disclosed in an embodiment of this application;
[0044] Figure 2 It is a flowchart for recognizing cells in the evaluation method for cell images;
[0045] Figure 3 It is a flowchart for calculating the evaluation data of a cell in the cell image in the method for obtaining the quality score of a cell image;
[0046] Figure 4 It is a flowchart for obtaining the total number of cells in the evaluation method for cell images;
[0047] Figure 5 It is a flowchart for optimizing the total number of cells in the evaluation method for cell images;
[0048] Figure 6In the evaluation method of cell images, it is a flowchart for obtaining the quality score of cell images;
[0049] Figure 7 It is a flowchart for determining valid cells;
[0050] Figures 8 - 11 It is an example diagram of the center point, boundary point of a cell in a cell image, and the gray-scale change trend of the center point and the boundary point in the relative direction;
[0051] Figures 12 - 16 It is an example diagram of a cell image, the corresponding heat map, and the quality score. Detailed implementation manners
[0052] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application.
[0053] For general quality evaluation methods, quality evaluation results are usually obtained based on parameters such as the brightness of images. In view of the characteristics of uneven cell distribution and unclear structure of individual cells in cell images, the accuracy and pertinence of the evaluation results obtained by general quality evaluation methods are not high.
[0054] To solve the above problems, an embodiment of the present application discloses a quality evaluation method for cell images, as Figure 1 shown, including the following steps:
[0055] S101. Identify cells in the image.
[0056] Examples of cells include, but are not limited to, cells such as fundus cells, epithelial basal layer cells, or corneal endothelial cells that are densely distributed and have relatively regular shapes in the collected images. In the following embodiments of the present application, fundus cells are taken as an example for illustration.
[0057] In some implementation manners, the center point of the cell is found by looking up the gray-scale values of each pixel in the fundus cell image. The specific process will be described in Figure 2 below.
[0058] S102. Obtain the evaluation parameters of all identified cells.
[0059] The quality evaluation parameter of any cell represents the quality of the cell.
[0060] For ease of description, any identified cell is referred to as the first cell. The evaluation parameter of the first cell is determined based on the uniformity of the gray-scale values of the boundary points of the first cell in multiple directions. Further, in order to improve the accuracy of the evaluation parameter of the first cell, the evaluation parameter of the first cell is also determined based on the noise distribution situation inside the first cell. The specific process of S102 will be described in Figure 3It will be described in . S103. Obtain the proportion of cells with various evaluation parameters in the image.
[0061] It can be understood that different cells may have different evaluation parameters. For example, different cells have different quality scores. Various evaluation parameters refer to each type of evaluation parameter. In this embodiment, taking the quality score as an example, with a full score of 8, various evaluation parameters include each type in the range of quality scores from 0 to 8. In addition, evaluation can also be carried out using grades, such as grades A, B, C, E, F, and various evaluation parameters include each type from A to F.
[0062] The proportion can be the quantity proportion or the area proportion, which is the proportion of cells in the entire cell image rather than the proportion of cells in the recognized cells.
[0063] There may be some areas in the cell image that are relatively blurred and no cells are recognized. Therefore, this situation needs to be considered when calculating the proportion. If calculated using the quantity proportion, a virtual quantity value should be assigned to the area where no cells are recognized, and this quantity value can be indirectly calculated and represented by the ratio of the areas. Based on this, the specific method of S103 can be referred to Figure 4 as shown.
[0064] S104. Evaluate the quality of the entire cell image based on the evaluation parameters and proportions of all recognized cells.
[0065] The specific implementation process will be described in combination with Figure 6 the process shown.
[0066] In the process of this embodiment, the evaluation parameters of each cell in the cell image are obtained, and then the quality of the entire cell image is evaluated based on the evaluation parameters and proportions of all recognized cells. Compared with the quality evaluation method based on the parameters of the entire image, evaluating the quality on a cell-by-cell basis can obtain a quality evaluation result with higher accuracy. Moreover, the evaluation parameter of any cell is determined based on the uniformity of the gray values of the boundary points of the cell in multiple directions, and a relatively accurate evaluation parameter of a single cell can be obtained, thereby further improving the accuracy of the quality evaluation result of the entire cell image.
[0067] Figure 2 This is the process of recognizing cells in the cell image in this embodiment. Recognizing the cells in the cell image can also adopt the methods of the prior art. This embodiment includes the following steps:
[0068] S201. Generate a first mask image.
[0069] Denote the fundus cell image as image, and the first mask image as mask, which has the same size as image and all gray values are 0. It can be understood that the points in the first mask image correspond one by one to the points in image.
[0070] S202. Set the value of the point corresponding to the regional maximum point in the image in the first mask image to 1 to obtain the second mask image.
[0071] In some implementation manners, the process of finding the regional maximum pixels in the image is as follows: Traverse the points in the image, and determine whether the value of the currently traversed point is the maximum value within a range of 3*3 centered on this point. If so, it is a regional maximum point. It can be understood that the 3*3 range is only an example and not a limitation.
[0072] S203. Merge the connected regions in the second mask image to obtain the third mask image.
[0073] A connected region is a region composed of adjacent pixels with a gray value of 1. It can be understood that the area of each connected region is greater than 1.
[0074] For any connected region (referred to as the target connected region), calculate the mean value of the coordinates of each point in the target connected region (rounding if the mean value is not an integer, such as rounding), as the central coordinate, and set the gray value of the central coordinate in the target connected region to 1, and the values of other points to 0, so as to achieve the merging of the connected regions.
[0075] The purpose of S203 is to obtain the regional center point and avoid multiple centers in one region.
[0076] S204. Perform dilation processing on the third mask image to obtain the fourth mask image.
[0077] An example of the dilation kernel is [0,1,0; 1,1,1; 0,1,0]. The purpose of the dilation processing is to facilitate the secondary merging operation to further avoid multiple centers in one region.
[0078] S205. Merge the connected regions in the fourth mask image to obtain the fifth mask image.
[0079] The specific manner of merging the connected regions can refer to S203. Through the two merging operations, a more accurate cell center can be obtained, and it can also avoid identifying multiple centers for one cell.
[0080] S206. Perform screening based on the gray value on the points in the fifth mask image (mask) to obtain the central point mask image MASK.
[0081] In some implementations, traverse the points in the fifth mask image. If the currently traversed grayscale value is 1 (i.e., mask(i, j) is 1), determine whether image(i, j) is less than 60. If it is less than 60, then determine whether the grayscale mean of the image block with a size of 5*5 centered on image(i, j) is less than 50. If it is less than 50, set mask(i, j) = 0 and continue to traverse the next point.
[0082] It can be understood that 60, 50, and 5*5 are all examples and can be pre-configured according to actual needs.
[0083] The purpose of S206 is to remove the pixels of the center points that were misjudged as cells in the previous steps.
[0084] It can be understood that the points with a grayscale value of 1 in MASK, the corresponding points in the fundus cell image, are the center points of the cells.
[0085] Figure 8 C in is an example of the center point of a cell.
[0086] It can be understood that since a cell has a center point, recognizing the center point is equivalent to recognizing the cell.
[0087] The inventor found during the research process that: starting from the center point of a cell, given multiple (such as 8) directions (such as up, down, left, right, upper left, lower right, lower left, upper right) to find distinguishable boundary points, the more distinguishable boundary points, the better the cell quality. Figure 8 are the boundary points found in the fundus cell image with better quality and the schematic diagrams of the gray-scale changes in four relative directions. Figures 9 - 11 are the boundary points found in the cell image with poor quality and the schematic diagrams of the gray-scale changes in four relative directions. Compare Figure 8 with Figures 9 - 11 It can be seen that: Figure 8 In, gray-scale changes in 4 relative directions can all find points with large gray-scale changes. Therefore, 8 boundary points can be found. While Figures 9 - 11 In, among the four relative directions, the gray-scale change in at least one relative direction does not meet certain conditions. Therefore, all 8 boundary points in all directions cannot be found.
[0088] Based on this, obtain the evaluation parameters of each cell. In the following embodiments, the evaluation parameters are taken as the quality score (score) as an example.
[0089] Figure 3 is the process for calculating the quality score of a cell, i.e., the first cell, in the fundus cell image, including the following steps:
[0090] S301. Obtain the attributes of the first cell in multiple directions.
[0091] The attributes include: the grayscale value of the boundary point, and may also include the length. The grayscale value can better reflect the quality of the image. One can only consider the grayscale value, or can also add the length value as an aid.
[0092] In some implementation manners, the lower limit of the number of boundary points of the first cell to be found is 4, and the upper limit is determined based on the size and resolution of the cell. That is to say, there are at least 4 directions, and the upper limit of the number of directions is determined based on the size and resolution of the cell.
[0093] The direction can be understood as the direction from the center point of the first cell to the boundary point. In this embodiment, taking the example of finding the boundary points in 8 directions of the center point of the first cell. The 8 directions refer to the up, down, left, right, upper left, lower right, lower left, and upper right directions.
[0094] In some implementation manners, based on the grayscale change trend in one direction, the boundary points in that direction are found. That is to say, for any one direction, starting from the center point of the first cell, traverse each point along that direction until a point that meets the preset boundary condition is found, and it is used as the boundary point in that direction, or it is determined that there is no boundary in that direction. The boundary condition can be that the trend of the grayscale value decreasing slows down, or the grayscale value stops decreasing, or the grayscale value changes from decreasing to increasing. In addition, for the case where there is no boundary, a stop condition for finding the boundary can be set as the boundary condition.
[0095] In this embodiment, the boundary condition is that the trend of the grayscale value decreasing slows down. The specific boundary conditions include: if the grayscale value meets the first boundary condition, a boundary point is obtained, or if the grayscale value meets the second boundary condition, the search stops.
[0096] The first boundary conditions for each direction are as follows:
[0097] Up:
[0098] Down:
[0099] Left:
[0100] Right:
[0101] Upper left:
[0102] Lower right:
[0103] Lower left:
[0104] Upper right:
[0105] The 0.8 in the above formula is the first boundary threshold, which is only for illustration and not for limitation.
[0106] The second boundary condition is: the gray value of the point is less than the second boundary threshold, such as 50. When the search stops by meeting the second boundary condition, the point where the second condition is met is used as the boundary point.
[0107] It can be understood that if no point meeting the boundary condition is found in a direction, such as the gray values of the points are all greater than 50, it means that there is no boundary point in this direction.
[0108] Still taking Figure 8 as an example, L is a boundary point, Figure 8 the curves in Figure 8 are the gray value change trends in the relative directions respectively. It can be seen that Figure 8 for the center point shown in
[0109] points with relatively large changes in gray value trends can be found in all 4 relative directions, such as points where the decreasing trend of the gray value slows down. Therefore,
[0110] the center point in
[0111] S302. Determine the reference values based on the attributes of the first cell in the selected direction.
[0112] The reference values include the gray reference value and the length reference value. The gray reference value is determined based on the gray values of the boundary points of the first cell in the selected direction. The length reference value is determined based on the length of the first cell in the selected direction.
[0113] The selected direction is the direction selected from multiple directions. The selected direction can be one or multiple. In this embodiment, multiple selected directions form a direction group. The specific way to select the direction group of the cell is to take the opposite directions as a group, or take at least two consecutive adjacent directions as a group. The determination process of the reference values is as follows:
[0114] S3021. Obtain the gray difference and length difference in each relative direction.
[0115] The opposite directions are reverse directions, including up and down, left and right, upper left and lower right, and lower left and upper right. The selection of the opposite directions is based on the prior knowledge of cell morphology. In the collected images of clear cells, their edges generally exhibit the characteristics of relatively uniform gray-scale differences and length differences in the opposite directions.
[0116] The gray-scale difference is the absolute value of the difference between gray-scale differences, denoted as garySub. The length difference is the absolute value of the difference between lengths, denoted as lenSub.
[0117] Taking the up and down direction as an example, the gray-scale difference between the center point and the boundary point above the center point is called the first gray-scale difference, and the gray-scale difference between the center point and the boundary point below the center point is called the second gray-scale difference. The gray-scale difference is the absolute value of the difference between the first gray-scale difference and the second gray-scale difference.
[0118] The length between the center point and the boundary point above the center point is called the first length, and the length between the center point and the boundary point below the center point is called the second length. The length difference is the absolute value of the difference between the first length and the second length.
[0119] It can be understood that, taking 8 boundary points as an example, this step can obtain 4 gray-scale differences and 4 length differences.
[0120] S3022. Determine the selected direction based on the gray-scale difference and length difference in the opposite direction.
[0121] If the gray-scale difference in a certain opposite direction is less than the first gray-scale difference threshold, and the length difference is less than or equal to the minimum length in the opposite direction, then this direction is used as an alternative opposite direction. The opposite direction with the smallest gray-scale difference among the alternative opposite directions is used as the selected direction.
[0122] S3023. Take the mean value garyMean of the gray-scale differences in the two directions of the selected direction as the gray-scale reference value, and take the mean value lenMean of the lengths in the two directions of the selected direction as the length reference value.
[0123] It can be understood that the mean values are all examples, and it can also be the minimum value or other statistical values.
[0124] It can be understood that it is possible that the gray-scale differences in all opposite directions are not less than the first gray-scale difference threshold, and S3022 and S3023 cannot obtain the attributes (i.e., the gray-scale reference value and the length reference value) in the selected direction. Then, execute S3024 to obtain the attributes in the selected direction.
[0125] S3024. Determine the selected direction group based on the mean value of the gray-scale differences and the mean value of the length differences in the continuous direction group.
[0126] A continuous direction group can be understood as at least two adjacent directions in a certain order. For example, with the center point of the cell as the center, based on the clockwise or counterclockwise direction, at least two consecutive directions are divided into a group to obtain a direction group. For example, dividing three consecutive directions in the direction sequence: up, upper right, right, lower right, down, lower left, left, upper left into a group, a total of 8 direction groups are obtained.
[0127] Search for alternative direction groups in the direction group: The alternative direction group meets the first direction group screening condition, and the first direction group screening condition includes: the absolute difference between the gray level difference of any one direction in the direction group and the average gray level difference of the direction group is not greater than the second gray level difference threshold (such as 30), and the absolute difference between the length and the average length of the direction group is not greater than the length of the direction.
[0128] That is to say, for any direction group, calculate the average value of the gray level differences and the average value of the lengths of the three directions in the direction group. If there is a direction in these three directions whose absolute difference between the gray level difference and the average gray level difference is not greater than 30, and the absolute difference between the length of this direction and the average length is not greater than the length of this direction, it means that this direction group is an alternative direction group.
[0129] Select a selected direction group from the alternative direction groups: Based on the absolute difference between the gray level difference of the directions included in the alternative direction groups and the average gray level difference, select a selected direction group from the alternative direction groups. In some implementation manners, the selected direction group meets the second direction group screening condition, and the second direction group screening condition includes: the average value of the absolute differences between the gray level differences of the three directions included therein and the average gray level difference is the smallest.
[0130] That is to say, for any alternative direction group, calculate the absolute differences between the gray level differences of the three directions in the alternative direction group and the average gray level difference respectively, and then calculate the average value of the three obtained absolute differences. Take the alternative direction group with the smallest average value as the selected direction group.
[0131] S3025. Use the average value of the gray level differences and the average value of the lengths of the directions included in the selected direction group as the judgment bases garyMean and lenMean, that is, the gray level reference value and the length reference value.
[0132] The average value is only an example, and it can also be the minimum value or other statistical values.
[0133] It can be understood that it is possible that neither S3022 - S3023 nor S3024 - S3025 can obtain the gray level reference value and the length reference value in the selected direction, which means that the cell defined by the center point and the boundary point is misjudged and it is not a cell, then end the process for this cell.
[0134] It can be understood that, except when the scoring basis cannot be obtained in S3022 - S3023 and S3024 - S3025 are executed, it is also possible to directly execute S3024 - S3025 without executing S3022 - S3023.
[0135] In this embodiment, the gray - scale reference value and the length reference value of the boundary points in the selected direction or the selected direction group are used as the basis for subsequent scoring. It can be understood that only the gray - scale reference value on the selected direction or the selected direction group can also be used as the basis for subsequent scoring, that is, the aforementioned reference values only include the gray - scale reference value.
[0136] In a possible implementation manner, S3022 - S3025 can be not executed, and all directions are used as the selected directions. The total difference of the gray - scale values of all directions is used as the scoring basis. For example, each direction subtracts the minimum gray - scale value among all directions, and the average value of the differences obtained for all directions is used as the gray - scale reference value, or the differences obtained for all directions are added as the total difference sum, and the interval level where the total difference sum is located is determined. The rule for determining the interval level can be to define the interval with the smallest difference sum as level A, the largest as level F, and levels B, C, D, and E are divided in between. In this way, the critical values between adjacent levels are the respective gray - scale reference values. The principle for length is the same as that for gray - scale and will not be elaborated here.
[0137] S303. Obtain the number of directions in which the gray - scale value of the boundary point meets the first preset condition and the length meets the second preset condition.
[0138] The first preset condition is set based on the gray - scale reference value. In some implementation manners, the first preset condition includes being greater than garyMean - 50, where 50 is an example of the gray - scale threshold and can be pre - configured according to actual requirements.
[0139] The second preset condition includes that the length minus lenMean is less than min(2, lenMean), where 2 is an example of the length threshold and can be pre - configured according to actual requirements.
[0140] It can be understood that, taking the gray - scale value and the length as the scoring basis in this embodiment as an example, it is also possible to replace S303 with: obtaining the number of directions in which the gray - scale value of the boundary point meets the first preset condition, or the number of directions in which the length meets the second preset condition.
[0141] S304. Determine the evaluation parameter of the first cell according to the number.
[0142] In some implementation manners, the number is used as the quality score of the first cell. For example, if the number is 8, then the quality score qScore is 8. It can be understood that in the case of taking 8 directions as an example, the minimum value of qScore is 0 and the maximum value is 8. If qScore is 0, it means it is not a cell.
[0143] Since the more distinguishable boundary points there are, the better the cell quality is, the evaluation parameter of the first cell obtained based on the boundary points is more accurate, that is, it can better reflect the true quality of the first cell.
[0144] The inventors also found during the research process that in addition to having more distinguishable boundary points, a cell with better quality also has the characteristic of fewer internal noise points. Based on this, in some implementation manners, in order to further improve the accuracy of the evaluation parameter of each cell, in the embodiments of the present application, the evaluation parameter is also determined based on the noise distribution inside the cell.
[0145] In some implementation manners, after S304, the following steps are further performed:
[0146] S305. From the center of the first cell outward, obtain the gray value difference index of each circle according to the shape of the first cell.
[0147] It can be understood that the shape of the cell can be circular or elliptical, or can be an irregular shape. The shape of any circle can be circular or elliptical, or can be an irregular shape. For the convenience of calculation, all can be processed as circles, or the boundary of the cell can be first fitted to obtain its actual shape, and then processed according to its actual shape.
[0148] Taking the circle as an example, the examples of each circle selected in this step include: the 4-neighborhood points of the center point of the first cell are the first circle, and among the 4-neighborhood points of the points in the first circle, a total of 8 points outside the first circle are the second circle.
[0149] In some implementation manners, the gray value difference index is the standard deviation of the gray value, and can also be the variance or other statistical values representing the size of the difference.
[0150] S306. Obtain the range of the area where the gray value difference index is less than the threshold.
[0151] In some implementation manners, the reliable radius radius is used to represent the range of the area. The specific implementation manner of S306 is:
[0152] A. Set the initial value of the reliable radius radius to 1.
[0153] B. If the standard deviation of the gray values of the 4-neighborhood points of the center point of the first cell is less than the set threshold thresh1, then add 1 to the reliable radius radius (1 is an example of the first value), if it is greater than thresh1, then return the value of the reliable radius radius.
[0154] C. Calculate the standard deviation of the grayscale values of a total of 8 points on the outer circle of the domain points in the 4th calculation. If it is less than thresh1 + 5 (as the number of circles increases, thresh1 is incremented by 5 each time, and 5 is an example of the second value), then increment the reliable radius radius by 1. If it is greater than thresh1 + 5, then return the reliable radius radius.
[0155] D. Until the lenMean-th circle is traversed, obtain the final reliable radius (i.e., the radius of the part without noise inside the first cell), and the region range can also be obtained from the reliable radius.
[0156] S307. Compare the region range with the first cell range, and determine the evaluation parameter of the first cell according to the comparison result. The comparison can be a ratio or a subtraction. The comparison of the region range can also be converted into a comparison of the radii.
[0157] In some implementation manners, the first cell range is the range enclosed by all the boundary points of the first cell. For the convenience of calculation, it can also be represented based on the aforementioned length reference value lenMean.
[0158] In this case, if the ratio of the final reliable radius to lenMean is greater than or equal to 0.75 (0.75 is an example of the second scoring threshold), then the final score of the cell is qScore. If the ratio of the final reliable radius to lenMean is less than 0.75 and greater than 2 (2 is an example of the third scoring threshold), then the final score of the cell is max(0, qScore - 1).
[0159] In other cases, the final score of the cell is max(0, (qScore - 1) * radius / lenMean).
[0160] Based on Figure 3 It can be seen from the embodiments shown that for any cell, i.e., the first cell, by determining the evaluation parameter of the first cell based on the uniformity of the grayscale values of the boundary points of the first cell in multiple directions, a relatively accurate evaluation parameter can be obtained. Also, based on the noise distribution inside the first cell, the evaluation parameter determined based on the uniformity of the grayscale values of the boundary points in multiple directions is adjusted, further improving the accuracy of the evaluation parameter.
[0161] In one implementation manner, the noise distribution inside can also be scored, and the relevant score of the noise inside is added to, or weighted and added to, the score related to the grayscale values of the boundary points as the final score of the first cell.
[0162] It can be understood that Figure 3The features described in the embodiments shown, such as the grayscale reference value, the length reference value, etc., are only examples and are not limitations. For example, for the length reference value, in addition to the determination method described in the above process, the case where the contour of the cell is an ellipse can also be considered, that is, the length reference value can be increased or decreased based on the length in the selected direction, and the length reference values in different directions can also be different. For example, after considering the shape, different sizes of increase or decrease can be performed in different directions.
[0163] In some implementation manners, in order to obtain the proportion of cells with various evaluation parameters in the image, first obtain the total number of cells in the cell image, and then based on the number and the total number of cells with various evaluation parameters, obtain the proportion of cells with various evaluation parameters in the image.
[0164] Figure 4 Taking the fundus cell image as an example, the process for obtaining the proportion of cells with various evaluation parameters in the image includes the following steps:
[0165] S401. For the center points of the cells in the fundus cell image, count the total number of cells (i.e., the first quantity allNum) recognized in the fundus cell image.
[0166] It can be understood that the total number of recognized center points is the total number of recognized cells allNum.
[0167] S402. Obtain the second quality image of the fundus cell image.
[0168] Specifically, it includes the following steps:
[0169] (1) Generate an image definitionMap that is the same size as the fundus cell image image and all the point values are 0.
[0170] (2) Draw the cell area in the definitionMap: For the center point of any cell in the image, if the quality score of the cell centered on this center point is greater than the fourth score threshold (such as 6), and the grayscale value of this center point is less than the first drawing threshold (such as 220), and the average grayscale difference of the boundary points found based on this center point is greater than the second drawing threshold (such as 20), then in the definitionMap, draw the range of this cell. The range of this cell is the area enclosed by all the boundary points of this cell, or for the convenience of operation, a filled circle with a radius of 3 can also be drawn with the point corresponding to this center point as the center (referred to as the drawing center) to represent the range of this cell, and the values of the points within the cell range are all set to 1.
[0171] Process each center point in the image in the above manner to generate the drawn definitionMap (referred to as the first quality image).
[0172] (3) Statistically calculate the area size area1 of the regions with a grayscale value of 1 in the definitionMap after drawing, and record the number number1 of the center points of the drawn cells.
[0173] It can be understood that area1 represents the area of the region occupied by the cells recognized in the fundus cell image. number1 represents the number of cells.
[0174] (4) Process the drawn definitionMap to obtain definitionMapDilate (referred to as the second quality image).
[0175] In some implementation manners, the processing includes at least one of a convolution operation and a normalization operation.
[0176] Examples of the processing include: using a full-1 dilation kernel in the shape of an ellipse with a size of 128*128 as the convolution kernel to perform a convolution operation on the drawn definitionMap. Denote the number of 1s in the dilation kernel as numA.
[0177] Perform a normalization process on the result of the convolution operation:
[0178] definitionMapDilate = (definitionMapDilate - minv) / (maxv - minv) * (maxv / (numA * 0.3) * 255), where minv is the minimum value of the points in the result of the convolution operation, and maxv is the maximum value of the points in the result of the convolution operation.
[0179] (5) Draw a heat map.
[0180] Draw the definitionMapDilate as a heat map definitionMapJET in jet color.
[0181] The heat map can visually display the quality distribution of cell images of different qualities. It can be understood that the heat map can be drawn and displayed, or it can be not drawn and not displayed. The displayed heat map can provide support and basis for scoring the fundus cell image.
[0182] S403. Optimize the total number of cells in the fundus cell image based on the second quality image (that is, optimize the first number allNum so that it can represent all the cell numbers in the whole image, including the unrecognized cell numbers).
[0183] In this step, the basis for the quality scoring of the image is the cells with better quality. The inventor found during the research that there are some images where a large area is very blurred and no cells are recognized, but the quality of the areas where cells are recognized in other parts of the image is good. In this case, if only the recognized cells are considered, the image may obtain a high quality score, but such an image cannot meet the medical needs. Therefore, to avoid the above situation, in this step, the previously obtained quantity allNum is further optimized first to reflect the total quantity of more reasonable cells, and then the quality score is calculated. That is, it is calculated using the quantity ratio, but a virtual value is assigned to the unrecognized area, and this value can be calculated and represented by the ratio of the area. The specific process of optimizing allNum is as Figure 5 shown.
[0184] S404. Obtain the proportion of cells with various evaluation parameters in the image.
[0185] In some implementation manners, the cells with various evaluation parameters are all the cells with evaluation parameters, that is, the recognized cells with evaluation parameters all need to obtain the proportion in the image.
[0186] In some other implementation manners, the cells with various evaluation parameters are the cells whose evaluation parameters are greater than the quality score threshold.
[0187] The quality score threshold is used to distinguish between cells with better quality and cells with worse quality. For example, the quality score threshold is 4. In this step, the number of cells with an evaluation parameter of 8 is denoted as num8, the number of cells with an evaluation parameter of 7 is denoted as num7, the number of cells with an evaluation parameter of 6 is denoted as num6, and the number of cells with an evaluation parameter of 5 is denoted as num5.
[0188] In this case, the proportions of cells with various evaluation parameters in the image are respectively: num8 / allNum, num7 / allNum, um6 / allNum, and num5 / allNum.
[0189] The specific process of optimizing allNum is as Figure 5 shown and includes the following steps:
[0190] S51. Perform binarization processing on the second quality image definitionMapDilate to obtain a binary image.
[0191] In some implementation manners, an example of the threshold for binarization processing (referred to as the first binarization threshold) is 100. It can be understood that the value of the points in definitionMapDilate with a gray value greater than 100 is set to 1, and the value of the points with a gray value less than 100 is set to 0.
[0192] S52. Obtain the area area2 of the non - zero points in the binary image, and the area size area1 of the region with a gray - level value of 1 in the drawn definitionMap. Then, based on the values of area1 and area2, perform the following steps respectively:
[0193] S53. If both area1 and area2 are 0, the score is 0.
[0194] S54. If area2 < area1, reduce the threshold of the binarization process to 60 (i.e., an example of the second binarization threshold), re - binarize definitionMapDilate, and obtain the area area3 of the non - zero region in the re - binarized result. After S54, execute S57 or S59.
[0195] S55. If area2 > area1, count the number number2 of the first target points in the binary image.
[0196] The first target point is: the point corresponding to the center point, and its value in the binary image is 255. That is, count the number of points where MASK(i, j) is 1 and definitionMapDilateBW(i, j) is 255. It can be understood that the first target point is the point corresponding to the center point in the binary image and is included in the cell, which represents the cell center point in the binary image.
[0197] After S55, execute S56.
[0198] S56. If allNum < the area of image / area2 * number2, then allNum = the area of image / area2 * number2. Otherwise, allNum remains unchanged.
[0199] S57. If area3 < area1, use an elliptical dilation kernel of size 9 * 9 to dilate the drawn definitionMap (i.e., the first quality image), and obtain the area area4 of the region with a gray - level value of 1 in the dilated image (i.e., the third quality image). After S57, execute S58.
[0200] S58. If allNum < the area of image / area4 * number1, then allNum = the area of image / area4 * number1, otherwise, allNum remains unchanged.
[0201] S59. If area3 > area1, count the number number3 of second target points in the binary image. If allNum < the area of the image / area3 * number3, then allNum = the area of the image / area3 * number3; otherwise, allNum remains unchanged.
[0202] It can be understood that the purpose of S51 - S59 is to obtain a more reasonable allNum for subsequent score calculation, so as to avoid the problem that in some images, there are large parts where cells are not recognized, the cells in the part with cells have good quality, the total number of cells allNum is not high but the score is relatively high.
[0203] Figure 6 The following shows the process of evaluating the quality of the entire cell image based on the evaluation parameters and proportions of cells. Figure 6 It includes the following steps:
[0204] S61. Determine whether the fundus cell image is overexposed. If it is, execute S62; if not, execute S63. The reason is that in an overexposed image, a single cell can also meet the requirement of clear edges, but an overexposed image should not be evaluated as an image with good quality. Therefore, it is necessary to consider the overexposure factor to adjust the quality evaluation parameters of the entire image.
[0205] In some implementation manners, if exposeNum / allNum is greater than the overexposure threshold such as 0.3, it indicates that there is overexposure; otherwise, there is no overexposure. Of course, other methods can also be used to determine whether there is overexposure.
[0206] exposeNum is the number of overexposed cells, and the acquisition method is as follows: traverse the center point mask image MASK. If mask(i, j) is 1 and image(i, j) > 200, then determine whether the gray - scale mean value of the image block with a size of 3 * 3 centered at this point is greater than 200. If it is greater, increment the exposure count exposeNum by 1. It can be understood that 3 * 3 is an example of the image block size, and 200 is an example of the gray - scale threshold. exposeNum / allNum is the proportion of overexposed cells in the cell image.
[0207] S62. Based on the number of overexposed cells, the number of cells with scores greater than the quality score threshold, and the corresponding weights, obtain the quality score of the fundus cell image image.
[0208] In some implementation manners, the quality score of the fundus cell image image is:
[0209] Score = (num8 / allNum * min(1.2, max(num8 / allNum, 0.1) / 0.1) +
[0210] num7 / allNum * 0.8 + num6 / allNum * 0.5 + num5 / allNum * 0.25) * (1 - exposeNum / allNum)
[0211] Among them, min(1.2, max(num8 / allNum, 0.1) / 0.1) is an example of the weight of the cells with a score of 8. The weight of the cells with a score of 8 can also be directly set to 8, the weight of the cells with a score of 7 can be set to 7, and so on. The purpose is to reflect the score level of each cell in the quality evaluation of the whole image. In this step, the reason for not using a fixed value but adopting the above value for the weight of the cells with a score of 8 is to configure a more reasonable weight for the cells with a score of 8. 0.8 is an example of the weight of the cells with a score of 7, 0.5 is an example of the weight of the cells with a score of 6, and 0.25 is an example of the weight of the cells with a score of 5. The ratio of the number of cells with each score to the total number of cells allNum is the proportion of the cells with each score.
[0212] It can be seen that the influence of overexposure is considered when calculating the score in this step.
[0213] S63. Obtain the quality score of the fundus cell image image based on the number of cells with a score greater than the quality score threshold and the corresponding weights.
[0214] In some implementation manners, the influence of overexposure may not be considered, and the quality score of the cell image image is:
[0215] Score = num8 / allNum * min(1.2, max(num8 / allNum, 0.1) / 0.1) + num7 / allNum * 0.8 + num6 / allNum * 0.5 + num5 / allNum * 0.25.
[0218] It can be understood that obtaining the quality score of the fundus cell image based on the evaluation parameters of a single cell has relatively high accuracy.
[0219] Figures 12 - 16 Examples of the fundus cell image, the corresponding heat map, and the quality score obtained based on the cell image evaluation method provided in the embodiments of the present application:
[0220] Figures 12 - 13 Examples of the fundus cell image with relatively good quality, the corresponding one, and the quality score obtained by using the method provided in the embodiments of the present application.
[0221] It can be seen from the corresponding heat map that Figures 14 - 15 compared with Figure 12 and Figure 13 the quality of the fundus cell image is poor, and thus the quality score is also low.
[0222] Figure 16 is an overexposed fundus cell image. Due to overexposure, its quality is poor as shown in the heat map, and the corresponding quality score is also low.
[0223] In the above embodiment, all the recognized cells are used as the basis for the quality evaluation of the cell image. In some other implementation manners, the valid cells among all the recognized cells are used as the basis for the quality evaluation of the cell image. The process of determining whether a cell is a valid cell is as follows Figure 7 shown, including the following steps:
[0224] S71. Select the direction groups of the cells, and obtain the difference in gray value and the difference in length of the boundary points of each direction group.
[0225] The way of selecting the direction groups is to take the opposite directions as a group, or take at least two consecutive adjacent directions as a group. Specifically, reference can be made to the way of selecting the opposite directions or direction groups in the process shown in Figure 3 the process shown.
[0226] For the way of obtaining the difference in gray value and the difference in length of the boundary points of the direction groups, reference can be made to the process shown in Figure 3 the process shown, which will not be elaborated here.
[0227] S72. If there is at least one direction group in the cell where the difference in gray value is less than the threshold, and the difference in length in all direction groups is greater than the threshold, then it is determined as a valid cell.
[0228] It can be understood that in this embodiment, the difference in gray value and the difference in length are used as the determination basis. In some other implementation manners, the difference in gray value or the difference in length can also be used as the determination basis.
[0229] If it is not a valid cell, it means that the cell defined by the center point and the boundary points is not a real cell, so the subsequent scoring process is no longer carried out to simplify the calculation and save resources. Moreover, based on the determination process of valid cells, the number of valid cells can be further obtained, which provides auxiliary information for medical diagnosis and can also help with the segmentation of cells.
[0230] The embodiment of the present application also discloses a device for obtaining the quality score of a fundus cell image, including:
[0231] a cell recognition module, configured to recognize the cells in the cell image;
[0232] A single-cell evaluation module for obtaining evaluation parameters of all recognized cells. The evaluation parameters of the first cell are determined based on the uniformity of the gray values of the boundary points of the first cell in multiple directions, where the first cell is any one of the cells;
[0233] A proportion acquisition module for obtaining the proportion of cells with various evaluation parameters in the image;
[0234] A quality evaluation module for evaluating the quality of the entire cell image according to the evaluation parameters of all recognized cells and the proportion;
[0235] The device can obtain quality scoring data with higher accuracy. For the specific implementation of the functions of each module, reference can be made to the above method embodiments.
[0236] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts between the various embodiments, reference can be made to each other.
Claims
1. A method for evaluating the quality of cell images, characterized in that, Including: Identifying cells in the cell image; Obtaining evaluation parameters of all identified cells, where the evaluation parameter of the first cell is determined based on the uniformity of the gray values of the boundary points of the first cell in multiple directions, and the first cell is any one cell; Obtaining the proportion of cells with various evaluation parameters in the image; Evaluating the quality of the entire cell image based on the evaluation parameters of all identified cells and the proportion.
2. The method according to claim 1, characterized in that, The evaluation parameter of the first cell being determined based on the uniformity of the gray values of the boundary points of the first cell in multiple directions includes: Obtaining the gray values of the boundary points of the first cell in multiple directions; Determining a gray reference value based on the gray values of the boundary points of the first cell in the selected direction; Obtaining the number of directions in which the gray values of the boundary points meet the first preset condition, where the first preset condition is set based on the gray reference value; Determining the evaluation parameter of the first cell according to the number.
3. The method according to claim 1, wherein The obtaining of the evaluation parameters of all identified cells is specifically obtaining the evaluation parameters of all identified valid cells. Determining whether a cell is a valid cell includes: Selecting a direction group of the cell and obtaining the gray value difference of the boundary points of each direction group; If the gray value difference in at least one direction group of the cell is less than the threshold, it is determined as a valid cell.
4. The method according to claim 2, characterized in that, The evaluation parameter of the first cell is also determined based on the uniformity of the lengths of the first cell in multiple directions. The length in a certain direction is the length from the center point of the first cell to the boundary point in that direction.
5. The method according to claim 4, wherein The process of determining the evaluation parameter based on the uniformity of the lengths of the first cell in multiple directions specifically includes: Obtaining the lengths of the first cell in multiple directions; Determining a length reference value based on the length of the first cell in the selected direction; Obtaining the number of directions in which the length meets the second preset condition, where the second preset condition is set based on the length reference value; Determining the evaluation parameter of the first cell according to the number of directions that meet the second preset condition.
6. The method according to claim 3, wherein Determining whether a cell is a valid cell also includes: Obtaining the difference in lengths of the cell in each direction group; If the length differences in all direction groups of the cell are greater than the threshold, it is determined that the cell is not a valid cell.
7. The method according to claim 3, characterized in that, The selection of the direction group of the cell is specifically taking opposite directions as a group, or taking at least two consecutive adjacent directions as a group.
8. The method according to claim 1, characterized in that, The evaluation parameter of the first cell is also determined based on the noise distribution inside the first cell.
9. The method according to claim 8, characterized in that Determining the evaluation parameter based on the noise distribution inside the first cell includes: From the center of the first cell outwards, obtaining the gray value difference index of each circle according to the shape of the first cell; Obtaining the range of the area where the gray value difference index is less than the threshold; Comparing the area range with the range of the first cell and determining the evaluation parameter of the first cell according to the comparison result.
10. The method according to claim 1, characterized in that, Calculating the quality evaluation parameter of the entire cell image based on the evaluation parameters of all identified cells and the proportion includes: Judging whether there is overexposure in the cell image. If so, obtaining the proportion of overexposed cells; Calculate the quality evaluation parameter of the entire cell image according to the evaluation parameters of all recognized cells, the proportion of cells with various evaluation parameters in the image, and the proportion of overexposed cells.
11. A quality evaluation device for cell images, characterized in that, Including: A cell recognition module for recognizing cells in the cell image; A single cell evaluation module for obtaining the evaluation parameters of all recognized cells. The evaluation parameter of the first cell is determined based on the uniformity of the gray values of the boundary points of the first cell in multiple directions, and the first cell is any cell; A proportion obtaining module for obtaining the proportion of cells with various evaluation parameters in the image; A quality evaluation module for evaluating the quality of the entire cell image according to the evaluation parameters of all recognized cells and the proportion.