A method and device for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease
By performing edge detection and possibility calculation on the pathological section of small intestinal villi, the small intestinal villi edges are enhanced and determined, and the problem of inaccurate edge recognition in the prior art is solved, and a more accurate judgment of small intestinal villi atrophy is achieved.
Patent Information
- Application Number
- CN202411029440.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-07-30
AI Technical Summary
The identification of the edges of small intestinal villi in the prior art is inaccurate, making it difficult to accurately determine whether the small intestinal villi atrophy.
By edge detection on the grayscale map of pathological sections of small intestinal villi, the possibility that the weak edge is the edge of small intestinal villi is calculated. If it is greater than the preset threshold, it will be enhanced to a strong edge, and it will be determined as the edge of small intestinal villi based on the distance between the strong edge and the background area and the closure condition. Calculate its average length and width based on the edge of the small intestine villi to determine whether it is atrophy.
It improves the accuracy of the detection of the edge of small intestinal villi, reduces the interference of structures such as crypts and plasma cells on edge detection, and can more accurately identify whether the small intestinal villi atrophy and dullness.
Smart Images

Figure CN118982551B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and in particular to a method and device for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease. Background Art
[0002] In most cases of common acute colitis or enteritis, even if the intestinal villi are damaged or even destroyed, the damaged villi can be regenerated due to the presence of stem cells and relying on the original interstitial framework, forming basically normal "new" intestinal villi. However, in inflammatory bowel disease, the repair process of the intestinal villi is often interrupted by multiple or repeated villi damage due to various reasons. At this time, the residual stem cells are damaged, and the newly formed villi will show pathological characteristics of villi atrophy, shortening, coarseness, or complete disappearance in tissue morphology.
[0003] With the continuous development of computer vision and image processing technology, digital pathology, artificial intelligence and machine learning are increasingly being used in pathological image analysis. For example, deep learning algorithms, such as convolutional neural networks (CNNs), are widely used to identify and classify various cell and tissue types. For inflammatory bowel disease, these algorithms can be used to automatically identify and measure the morphological characteristics of small intestinal villi.
[0004] However, since the pathological section of the small intestinal villi includes not only the small intestinal villi, but also structures such as crypts and plasma cells, and the small intestinal villi are close to adjacent villi, adhesions may occur, resulting in unclear villi edges, affecting the accuracy of the judgment of whether the small intestinal villi are atrophied. Summary of the invention
[0005] The present invention provides a method and device for identifying atrophy and dullness of small intestinal villi in inflammatory bowel disease, so as to solve the defect of inaccurate identification of the edges of small intestinal villi in small intestinal slice images in the prior art, which makes it difficult to accurately judge whether the small intestinal villi are atrophied, and to achieve a more accurate method and device for identifying atrophy and dullness of small intestinal villi in inflammatory bowel disease.
[0006] The present invention provides a method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease, comprising:
[0007] Performing edge detection on the grayscale image of the pathological section of the small intestinal villi, and when the possibility that the weak edge obtained by the edge detection is the edge of the small intestinal villi is greater than a preset possibility threshold, enhancing the weak edge to a strong edge;
[0008] When the distance between the strong edge and the background area of the grayscale image is less than a preset distance threshold and the strong edge is not closed, determining the strong edge as an edge of a small intestinal villus;
[0009] The average length and average width of the small intestinal villi are calculated based on the edges of the small intestinal villi, and whether the small intestinal villi are atrophied and blunted is determined according to the average length and average width of the small intestinal villi.
[0010] According to a method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease provided by the present invention, when the possibility that the weak edge obtained by edge detection is the edge of small intestinal villi is greater than a preset possibility threshold, before the step of enhancing the weak edge to a strong edge, the method further includes:
[0011] The possibility that the weak edge is the edge of the small intestinal villi is determined according to the curvature of the weak edge and the difference between the weak edge and the adjacent edges.
[0012] According to a method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease provided by the present invention, before the step of determining the possibility that the weak edge is the edge of small intestinal villi according to the degree of curvature of the weak edge and the degree of difference between the weak edge and the adjacent edge, the method further includes:
[0013] Calculating a first ratio between the length of the weak edge and the average length of all weak edges;
[0014] Calculating a second ratio between a straight-line distance between two end points of the weak edge and a length of the weak edge;
[0015] The product of the first ratio and the second ratio is taken as the bending degree.
[0016] According to a method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease provided by the present invention, before the step of determining the possibility that the weak edge is the edge of small intestinal villi according to the degree of curvature of the weak edge and the degree of difference between the weak edge and the adjacent edge, the method further includes:
[0017] Search along two extension directions of the straight line where the gradient direction of the weak edge is located, and determine the first two edges with a length greater than that of the weak edge as adjacent edges;
[0018] The difference degree is determined according to the gradient direction of the weak edge and the gradient directions of the two adjacent edges.
[0019] According to a method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease provided by the present invention, before the step of determining the degree of difference according to the gradient direction of the weak edge and the gradient directions of the two edges, the method further includes:
[0020] Cutting out a matching edge segment having the same length as the weak edge from the adjacent edge;
[0021] The gradient direction of the matching edge segment is determined as the gradient direction of the adjacent edge.
[0022] According to a method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease provided by the present invention, the step of calculating the average length and average width of the small intestinal villi based on the edge of the small intestinal villi specifically includes:
[0023] Marking all corner points detected from the edge corner points of the small intestinal villi;
[0024] A coordinate system is constructed with the leftmost corner point of the edge of the small intestinal villi in the grayscale image as the origin and a straight line obtained by stretching the curve where the corner point is located with a greater than a preset ratio as the horizontal axis;
[0025] The average length and average width of the small intestinal villi are determined according to the extreme points of the small intestinal villi edge in the coordinate system.
[0026] The present invention also provides a device for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease, comprising:
[0027] An enhancement module is used to perform edge detection on the grayscale image of the pathological section of the small intestinal villi, and when the possibility that the weak edge obtained by the edge detection is the edge of the small intestinal villi is greater than a preset possibility threshold, enhance the weak edge to a strong edge;
[0028] A determination module, configured to determine the strong edge as an intestinal villus edge when the distance between the strong edge and the background area of the grayscale image is less than a preset distance threshold and the strong edge is not closed;
[0029] The detection module is used to calculate the average length and average width of the small intestinal villi based on the edges of the small intestinal villi, and determine whether the small intestinal villi are atrophied and blunted according to the average length and average width of the small intestinal villi.
[0030] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements any of the above-described methods for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease.
[0031] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease.
[0032] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above methods for identifying intestinal villus atrophy and blunting in inflammatory bowel disease.
[0033] The method and device for identifying atrophy and dullness of small intestinal villi in inflammatory bowel disease provided by the present invention calculates the possibility that each weak edge is an edge of small intestinal villi during edge detection on pathological sections of small intestinal villi, and enhances weak edges with a possibility greater than a preset possibility threshold to strong edges, thereby reducing the interference of structures such as crypts and plasma cells on the detection and recognition of small intestinal villi edges, and improving the accuracy of small intestinal villi edge detection, so that it can be identified whether the small intestinal villi are atrophied and dulled based on the more accurate small intestinal villi edges obtained by detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 It is a schematic diagram of a process for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease provided by the present invention;
[0036] Figure 2 It is a schematic diagram for showing the coordinate system construction process in the method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease provided by the present invention;
[0037] Figure 3 It is a schematic diagram of the structure of the device for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease provided by the present invention;
[0038] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] Combine the following Figure 1 and Figure 2 The present invention introduces a method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease, such as Figure 1 As shown, including:
[0041] Step 101, edge detection is performed on the grayscale image of the pathological section of small intestinal villi, and when the possibility that the weak edge obtained by edge detection is the edge of small intestinal villi is greater than a preset possibility threshold, the weak edge is enhanced to a strong edge;
[0042] The pathological section of small intestinal villi is a section image of the pathological image of small intestinal villi. Optionally, the pathological section of small intestinal villi is a 512×512 pathological section image.
[0043] Optionally, the pathological slice image is enhanced, such as contrast enhancement, adaptive histogram equalization, and then denoised, such as by using mean filtering, median filtering, Gaussian filtering, etc. The pathological slice image is then converted into a grayscale image of the pathological slice of the small intestinal villi.
[0044] The Canny edge detection algorithm is used to detect the edge of the grayscale image. Specifically, in the pathological slice image, the small intestinal villi are generally distributed on one side. Due to their material composition, they are stained darker in the slice image, while the background is not stained by the dye, so there is a large grayscale difference between the edge of the small intestinal villi and the background. Therefore, the Canny edge detection algorithm can be used to detect the edge of the small intestinal villi.
[0045] Canny edge detection is a classic edge detection algorithm. The Canny edge detection algorithm generally includes five steps: Gaussian filtering, using the Sobel operator to calculate pixel gradients, non-maximum pixel gradient suppression, double threshold detection, and isolated weak edge suppression. These five steps ultimately obtain the edge in the image.
[0046] Among them, for the step of isolated weak edge suppression, generally speaking, the weak edge pixels caused by the real edge will be connected to the strong edge pixels, while the noise response is not connected. By looking at the weak edge pixel and its 8 neighboring pixels, it can be judged based on its connection with the strong edge. Generally, it is defined that as long as one of the neighboring pixels is a strong edge pixel, the weak edge can be retained as a strong edge, that is, a real edge point.
[0047] However, the pathological section of the small intestinal villi not only includes the small intestinal villi, but also includes crypts, plasma cells and other structures. In addition, due to the close distance between the small intestinal villi and the adjacent villi, adhesions may occur, resulting in unclear villi edges, affecting the calculation of the length and width of the small intestinal villi, and further affecting the accuracy of the judgment of whether the small intestinal villi are atrophied.
[0048] Since there is a certain grayscale difference between the edge of the mutually adhered small intestinal villi and the two sides, but the difference is not as large as the grayscale difference between the edge of the small intestinal villi and the background, it will be first identified as a weak edge in Canny edge detection and is likely to be suppressed in subsequent steps, resulting in the final edge detection result not including this part of the edge.
[0049] Therefore, in order to detect the edges of the adhered small intestinal villi, in the step of isolated weak edge suppression of edge detection, for each weak edge detected, the possibility of it being an edge of the small intestinal villi is first calculated, and the weak edges with a probability greater than the preset probability threshold are enhanced to strong edges, so that the detection of the edges of the small intestinal villi is more accurate and complete.
[0050] Optionally, the possibility of each weak edge being an intestinal villus edge is determined according to the degree of curvature of each weak edge and the degree of difference between the weak edge and the background area. It can be understood that the background area represents the unstained area in the pathological section of the small intestinal villus.
[0051] Step 102, when the distance between the strong edge and the background area of the grayscale image is less than a preset distance threshold and the strong edge is not closed, determining the strong edge as an edge of a small intestinal villus;
[0052] Furthermore, for all the strong edges obtained through the above steps, that is, including the strong edges directly detected by the Canny edge detection technology and the strong edges obtained by adding weak edges, it is also necessary to determine whether the strong edge is the edge of the small intestinal villi based on the distance between each strong edge and the background area of the grayscale image, as well as the closure of each strong edge itself.
[0053] Specifically, the edges of the intestinal villi are connected to each other to form one or more edges connected to the external background, while plasma cells or other structures are generally located inside, far away from the background, and most of them are closed.
[0054] Therefore, for each strong edge, if it is not closed and the distance from the background area is less than a preset distance threshold, it can be determined as the edge of the small intestinal villi.
[0055] Optionally, the preset distance threshold is determined based on experience.
[0056] In a specific implementation, any strong edge is used to segment the grayscale image into two regions, the region with the largest average grayscale value is taken as the background region, and the other region is recorded as the non-background region. The strong edge that can minimize the grayscale variance of all pixels in the region and has the largest difference in the average grayscale values of the two regions is taken as the final dividing line. The segmentation result of the final dividing line is used to determine the range of the background region and the non-background region.
[0057] It should be noted that, for the multiple strong edges detected, any strong edge that can divide the grayscale image into two regions can be used in the above steps.
[0058] The average value of the distances from all pixels on the target strong edge to the background area is calculated. If the average value is less than the set parameter 𝛽 (which is set to 10 based on experience in this embodiment) and the strong edge is not closed, the strong edge is determined to be the edge of the small intestinal villi. The target strong edge represents the strong edge being analyzed.
[0059] ;
[0060] Where p represents the mean distance from all pixels on the target strong edge to the background area, I represents the number of pixels on the target strong edge, Indicates the shortest distance from the i-th pixel in the target strong edge to the background area.
[0061] When p<β and the target strong edge is not closed, the target strong edge is determined to be the edge of the small intestinal villi; otherwise, the target strong edge is not determined to be the edge of the small intestinal villi.
[0062] Step 103, calculating the average length and average width of the small intestinal villi based on the edges of the small intestinal villi, and determining whether the small intestinal villi are atrophied and blunted according to the average length and average width of the small intestinal villi.
[0063] Furthermore, after the edge of the small intestinal villi is determined in the grayscale image, the shape of the small intestinal villi can be determined according to the edge, so that the average length of each determined small intestinal villus can be calculated according to the edge of the small intestinal villi. H and the average width W , as the length and width of each small intestinal villus detected in the pathological section of the intestinal villi.
[0064] By comparing it with the length and width of the small intestinal villi under normal conditions, it is possible to determine whether the small intestinal villi are atrophied and blunted.
[0065] In a feasible embodiment, the length threshold is determined according to the length of the small intestinal villi in a normal state. , the width threshold is determined based on the width of the small intestinal villi under normal conditions In this embodiment, Set to 100, Set to 10.
[0066] exist and In the case of and In this case, it is determined that the villi of the small intestine are atrophied and blunted.
[0067] The present invention calculates the possibility that each weak edge is the edge of the small intestinal villi during edge detection on pathological sections of the small intestinal villi, and enhances the weak edges with a possibility greater than a preset possibility threshold into strong edges, thereby reducing the interference of structures such as crypts and plasma cells on the detection and recognition of the small intestinal villi edges, and improving the accuracy of the small intestinal villi edge detection, so that it can be identified whether the small intestinal villi are atrophied and blunted based on the more accurate small intestinal villi edges obtained by detection.
[0068] In the method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease of the present invention, before the step of enhancing the weak edge to a strong edge when the possibility that the weak edge obtained by edge detection is the edge of small intestinal villi is greater than a preset possibility threshold, the method further includes:
[0069] The possibility that the weak edge is the edge of the small intestinal villi is determined according to the curvature of the weak edge and the difference between the weak edge and the adjacent edges.
[0070] Specifically, since the edge of the small intestinal villi is relatively straight locally and has a small curvature, while the edges of other interfering structures such as crypts and plasma cells have a large curvature, for example, the edge of a plasma cell is a closed edge. Therefore, the possibility that each weak edge detected is the edge of a small intestinal villi can be calculated based on the curvature of the weak edge, wherein the higher the curvature, the lower the possibility that the weak edge is the edge of a small intestinal villi.
[0071] Furthermore, the degree of difference characterizes the degree of difference between the extension direction of the weak edge and the surrounding adjacent edges. Normally, for a specific edge of a small intestinal villus, its extension direction is generally close to that of the adjacent small intestinal villus edges, while for other structures present in the pathological sections of the small intestinal villus, such as the edges of plasma cells or crypts, the extension direction of their edges is unrelated to the extension direction of the surrounding edges, and the extension directions are generally far apart. Therefore, the possibility that the weak edge is the edge of the small intestinal villus can be calculated based on the degree of difference between the weak edge and the adjacent edges. Among them, the greater the degree of difference, the lower the possibility that the weak edge is the edge of the small intestinal villus.
[0072] In the method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease of the present invention, before the step of determining the possibility that the weak edge is the edge of small intestinal villi according to the degree of curvature of the weak edge and the degree of difference between the weak edge and the adjacent edge, the method further includes:
[0073] Calculating a first ratio between the length of the weak edge and the average length of all weak edges;
[0074] Specifically, in the dual threshold detection step of the Canny edge detection algorithm, if the gradient value of the edge pixel is higher than the high threshold, it is marked as a strong edge pixel; if the gradient value of the edge pixel is less than the high threshold and greater than the low threshold, it is marked as a weak edge pixel.
[0075] For the detected weak edge pixels, the grayscale image is traversed and the adjacent weak edge pixels are merged to generate multiple coherent weak edges.
[0076] In a feasible implementation, for a weak edge pixel, if there is a weak edge pixel among the eight pixels in its neighborhood, the two weak edge pixels are merged; if there is a strong edge pixel among the eight pixels in its neighborhood, if the strong edge pixel is an isolated pixel, the strong edge pixel is merged, otherwise, it is not merged with the strong edge pixel, wherein, for each strong edge pixel, if there is no other strong edge pixel in its neighborhood, the strong edge pixel is considered to be an isolated pixel.
[0077] Furthermore, for the convenience of description, the weak edge being analyzed is recorded as a target weak edge.
[0078] Count the number of pixels contained in the target weak edge as the length of the target weak edge L In the same way, after determining the length of all weak edges, calculate the length of all weak edges .
[0079] and will L and The ratio between them is taken as the first ratio.
[0080] Calculating a second ratio between a straight-line distance between two end points of the weak edge and a length of the weak edge;
[0081] Furthermore, for the target weak edge, the straight-line distance between the two endpoints of the target weak edge is calculated. d . And will d The length of the weak edge with the target L The ratio between them is taken as the second ratio.
[0082] It should be noted that when the target weak edge is a closed edge, d Assign a value of 0.
[0083] The product of the first ratio and the second ratio is taken as the bending degree.
[0084] The product of the first ratio and the second ratio is taken as the degree of bending. The second ratio is calculated by L - dTo some extent, it characterizes the curvature of the target weak edge. The first ratio is used to weight the second ratio to emphasize the target weak edge with a longer average length than the weak edge.
[0085] In addition, in other feasible implementations, the second ratio may be directly used as the curvature of the target weak edge, or the standard deviation of the curvature of all pixels on the target weak edge may be calculated as the curvature of the target weak edge.
[0086] In the method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease of the present invention, before the step of determining the possibility that the weak edge is the edge of small intestinal villi according to the degree of curvature of the weak edge and the degree of difference between the weak edge and the adjacent edge, the method further includes:
[0087] Search along two extension directions of the straight line where the gradient direction of the weak edge is located, and determine the first two edges with a length greater than that of the weak edge as adjacent edges;
[0088] Specifically, for each target weak edge, the gradient directions of each pixel on it are counted, and each gradient direction is clustered to find the target category containing the most pixels, and the gradient direction of the center point of the target category is used as the gradient direction of the target weak edge.
[0089] Optionally, the gradient direction The angle is expressed in radians, ranging from 0 to between.
[0090] On this basis, starting from the central pixel point of the target weak edge, the search is conducted along the two extension directions of the straight line where the gradient direction of the target weak edge is located. Taking the search on one side as an example, the first edge whose length is greater than the length of the target weak edge is determined as the adjacent edge.
[0091] The difference degree is determined according to the gradient direction of the weak edge and the gradient directions of the two adjacent edges.
[0092] Search in two extension directions of the straight line where the gradient direction is located, and obtain a neighboring edge for each. Determine the gradient directions of the two neighboring edges in the same way. and .
[0093] In a feasible implementation, the absolute value of the difference between the gradient directions of the target weak edge and two adjacent edges is calculated respectively. and . Calculate the average of the two absolute values as the difference degree of the target weak edge.
[0094] On this basis, the probability P that the weak edge is the edge of the small intestinal villi can be expressed as:
[0095] ;
[0096] In the formula, represents the first ratio; represents the second ratio; exp() represents the exponential function with e as the base. The larger the value of is, the smaller P is, and the lower the possibility that the target weak edge is the edge of the small intestinal villi; otherwise, the higher the probability.
[0097] For the probability P of the target weak edge being the edge of the small intestinal villi calculated in the above manner, when P is not less than the preset probability threshold α, the target weak edge is enhanced to a strong edge; when P is less than α, the target weak edge is suppressed to the background.
[0098] Wherein, α is a hyperparameter, and optionally, the value of α can be determined based on experience, and in this embodiment, it is 0.8. The value of α can also be set according to the specific situation of the image.
[0099] In the method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease of the present invention, before the step of determining the degree of difference according to the gradient direction of the weak edge and the gradient directions of the two edges, the method further includes:
[0100] Cutting out a matching edge segment having the same length as the weak edge from the adjacent edge;
[0101] In a feasible implementation, when determining the gradient direction of an adjacent edge, taking an adjacent edge on one side as an example, the first pixel point of the adjacent edge is searched as the starting point, and the search range is searched on both sides with half the length of the target weak edge as the search range, so as to obtain a matching edge segment with the same length as the target weak edge in the adjacent edge.
[0102] In another feasible implementation, the first pixel point of the adjacent edge is searched as the starting point, and searches are conducted on both sides. If the endpoint of the adjacent edge has been reached in the search on one side, but the search length on that side is less than half of the length of the target weak edge, an additional search is performed on the other side for the insufficient length, so that the matching edge segment intercepted in the adjacent edge has the same length as the target weak edge.
[0103] The gradient direction of the matching edge segment is determined as the gradient direction of the adjacent edge.
[0104] According to the above method, the gradient directions of the two matching edge segments obtained by clustering are obtained, and the gradient directions of the two matching edge segments are used as the gradient directions of the adjacent edges to which they belong, so as to calculate the difference between the target weak edge and the adjacent edge.
[0105] In the method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease of the present invention, the step of calculating the average length and average width of the small intestinal villi based on the edge of the small intestinal villi specifically includes:
[0106] Marking all corner points detected from the edge corner points of the small intestinal villi;
[0107] In order to calculate the average length and average width of the small intestinal villi, the extracted small intestinal villi edges are firstly subjected to corner detection, and all detected corner points are marked.
[0108] Optionally, the corner detection may be Harris corner detection or Susan corner detection.
[0109] A coordinate system is constructed with the leftmost corner point of the edge of the small intestinal villi in the grayscale image as the origin and a straight line obtained by stretching the curve where the corner point is located with a greater than a preset ratio as the horizontal axis;
[0110] Construct a coordinate system based on the marked corner points.
[0111] In a feasible implementation, the left starting point of the edge of the small intestinal villi is taken as the origin, the curve where most of the corner points on the side away from the background area are stretched into a straight line as the horizontal axis, and the straight line passing through the origin and perpendicular to the horizontal axis is taken as the vertical axis to construct a coordinate system, and the remaining points on the edge of the small intestinal villi are mapped to the coordinate system in sequence. The process is as follows: Figure 2 Shown
[0112] Among them, the curve where most of the corner points on the side far away from the background area are located are the corner points larger than a preset ratio, and the preset ratio is determined based on experience.
[0113] The average length and average width of the small intestinal villi are determined according to the extreme points of the small intestinal villi edge in the coordinate system.
[0114] Calculate all the maximum and minimum points of the edge of the small intestinal villi in the coordinate system, and calculate the average length of the small intestinal villi based on the extreme values H and the average width W :
[0115] ;
[0116] ;
[0117] In the formula, H It represents the average length of the small intestinal villi in the original image. W It represents the average width of the small intestinal villi in the original image. Indicates the first The ordinate of the maximum point, Indicates the first The coordinates of the minimum points, s represents the number of maximum values on the edge of the small intestinal villi.
[0118] Among them, when The smaller the The shorter the length of the small intestinal villi, the shorter the average length of the small intestinal villi. H The shorter the intestinal tract, the greater the possibility of villous atrophy. The larger the The wider the width of the small intestinal villi, the wider the average width W of the small intestinal villi will be, and the greater the possibility of small intestinal villi atrophy.
[0119] The device for identifying atrophy and dulling of small intestinal villi in inflammatory bowel disease provided by the present invention is described below. The device for identifying atrophy and dulling of small intestinal villi in inflammatory bowel disease described below and the method for identifying atrophy and dulling of small intestinal villi in inflammatory bowel disease described above can be referenced to each other.
[0120] like Figure 3 As shown, the device for identifying the atrophy and blunting of small intestinal villi in inflammatory bowel disease includes an enhancement module 301, a determination module 302 and a detection module 303:
[0121] An enhancement module 301 is used to perform edge detection on the grayscale image of the pathological section of small intestinal villi, and when the possibility that the weak edge obtained by edge detection is the edge of small intestinal villi is greater than a preset possibility threshold, enhance the weak edge to a strong edge;
[0122] The pathological section of small intestinal villi is a section image of the pathological image of small intestinal villi. Optionally, the pathological section of small intestinal villi is a 512×512 pathological section image.
[0123] Optionally, the pathological slice image is enhanced, such as contrast enhancement, adaptive histogram equalization, and then denoised, such as by using mean filtering, median filtering, Gaussian filtering, etc. The pathological slice image is then converted into a grayscale image of the pathological slice of the small intestinal villi.
[0124] The Canny edge detection algorithm is used to detect the edge of the grayscale image. Specifically, in the pathological slice image, the small intestinal villi are generally distributed on one side. Due to their material composition, they are stained darker in the slice image, while the background is not stained by the dye, so there is a large grayscale difference between the edge of the small intestinal villi and the background. Therefore, the Canny edge detection algorithm can be used to detect the edge of the small intestinal villi.
[0125] Canny edge detection is a classic edge detection algorithm. The Canny edge detection algorithm generally includes five steps: Gaussian filtering, using the Sobel operator to calculate pixel gradients, non-maximum pixel gradient suppression, double threshold detection, and isolated weak edge suppression. These five steps ultimately obtain the edge in the image.
[0126] Among them, for the step of isolated weak edge suppression, generally speaking, the weak edge pixels caused by the real edge will be connected to the strong edge pixels, while the noise response is not connected. By looking at the weak edge pixel and its 8 neighboring pixels, it can be judged based on its connection with the strong edge. Generally, it is defined that as long as one of the neighboring pixels is a strong edge pixel, the weak edge can be retained as a strong edge, that is, a real edge point.
[0127] However, the pathological section of the small intestinal villi not only includes the small intestinal villi, but also includes crypts, plasma cells and other structures. In addition, due to the close distance between the small intestinal villi and the adjacent villi, adhesions may occur, resulting in unclear villi edges, affecting the calculation of the length and width of the small intestinal villi, and further affecting the accuracy of the judgment of whether the small intestinal villi are atrophied.
[0128] Since there is a certain grayscale difference between the edge of the mutually adhered small intestinal villi and the two sides, but the difference is not as large as the grayscale difference between the edge of the small intestinal villi and the background, it will be first identified as a weak edge in Canny edge detection and is likely to be suppressed in subsequent steps, resulting in the final edge detection result not including this part of the edge.
[0129] Therefore, in order to detect the edges of the adhered small intestinal villi, in the step of isolated weak edge suppression of edge detection, for each weak edge detected, the possibility of it being an edge of the small intestinal villi is first calculated, and the weak edges with a probability greater than the preset probability threshold are enhanced to strong edges, so that the detection of the edges of the small intestinal villi is more accurate and complete.
[0130] Optionally, the possibility of each weak edge being an intestinal villus edge is determined according to the degree of curvature of each weak edge and the degree of difference between the weak edge and the background area. It can be understood that the background area represents the unstained area in the pathological section of the small intestinal villus.
[0131] A determination module 302, configured to determine the strong edge as an intestinal villus edge when the distance between the strong edge and the background area of the grayscale image is less than a preset distance threshold and the strong edge is not closed;
[0132] Furthermore, for all the strong edges obtained through the above steps, that is, including the strong edges directly detected by the Canny edge detection technology and the strong edges obtained by adding weak edges, it is also necessary to determine whether the strong edge is the edge of the small intestinal villi based on the distance between each strong edge and the background area of the grayscale image, as well as the closure of each strong edge itself.
[0133] Specifically, the edges of the intestinal villi are connected to each other to form one or more edges connected to the external background, while plasma cells or other structures are generally located inside, far away from the background, and most of them are closed.
[0134] Therefore, for each strong edge, if it is not closed and the distance from the background area is less than a preset distance threshold, it can be determined as the edge of the small intestinal villi.
[0135] Optionally, the preset distance threshold is determined based on experience.
[0136] The detection module 303 is used to calculate the average length and average width of the small intestinal villi based on the edges of the small intestinal villi, and determine whether the small intestinal villi are atrophied and blunted according to the average length and average width of the small intestinal villi.
[0137] Furthermore, after the edge of the small intestinal villi is determined in the grayscale image, the shape of the small intestinal villi can be determined according to the edge, so that the average length of each determined small intestinal villus can be calculated according to the edge of the small intestinal villi. H and the average width W , as the length and width of each small intestinal villus detected in the pathological section of the intestinal villi.
[0138] By comparing it with the length and width of the small intestinal villi under normal conditions, it is possible to determine whether the small intestinal villi are atrophied and blunted.
[0139] The present invention calculates the possibility that each weak edge is the edge of the small intestinal villi during edge detection on pathological sections of the small intestinal villi, and enhances the weak edges with a possibility greater than a preset possibility threshold into strong edges, thereby reducing the interference of structures such as crypts and plasma cells on the detection and recognition of the small intestinal villi edges, and improving the accuracy of the small intestinal villi edge detection, so that it can be identified whether the small intestinal villi are atrophied and blunted based on the more accurate small intestinal villi edges obtained by detection.
[0140] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute a method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease, the method comprising: edge detection of a grayscale image of a pathological section of small intestinal villi, and when the possibility that the weak edge obtained by the edge detection is the edge of the small intestinal villi is greater than a preset possibility threshold, the weak edge is enhanced to a strong edge; when the distance between the strong edge and the background area of the grayscale image is less than a preset distance threshold and the strong edge is not closed, the strong edge is determined as the edge of the small intestinal villi; based on the small intestinal villi edge, the average length and average width of the small intestinal villi are calculated, and whether the small intestinal villi are atrophied and blunted is determined according to the average length and average width of the small intestinal villi.
[0141] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0142] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute a method for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease provided by the above-mentioned methods, the method including: performing edge detection on a grayscale image of a pathological section of small intestinal villi, and when the possibility that a weak edge obtained by edge detection is an edge of small intestinal villi is greater than a preset possibility threshold, enhancing the weak edge to a strong edge; when the distance between the strong edge and the background area of the grayscale image is less than a preset distance threshold and the strong edge is not closed, determining the strong edge as an edge of small intestinal villi; calculating the average length and average width of the small intestinal villi based on the small intestinal villi edge, and determining whether the small intestinal villi are atrophied and blunted according to the average length and average width of the small intestinal villi.
[0143] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute a method for identifying atrophy and dullness of small intestinal villi in inflammatory bowel disease provided by the above-mentioned methods, the method comprising: performing edge detection on a grayscale image of a pathological section of small intestinal villi, and enhancing the weak edge to a strong edge when the possibility that a weak edge obtained by edge detection is an edge of small intestinal villi is greater than a preset possibility threshold; determining the strong edge as an edge of small intestinal villi when the distance between the strong edge and the background area of the grayscale image is less than a preset distance threshold and the strong edge is not closed; calculating the average length and average width of the small intestinal villi based on the small intestinal villi edge, and determining whether the small intestinal villi are atrophied and dull based on the average length and average width of the small intestinal villi.
[0144] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0145] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for identifying intestinal villus atrophy and blunting in inflammatory bowel disease, characterized in that: include: Performing edge detection on the grayscale image of the pathological section of the small intestinal villi, and when the possibility that the weak edge obtained by the edge detection is the edge of the small intestinal villi is greater than a preset possibility threshold, enhancing the weak edge to a strong edge; When the distance between the strong edge and the background area of the grayscale image is less than a preset distance threshold and the strong edge is not closed, determining the strong edge as an edge of a small intestinal villus; Calculating the average length and average width of the small intestinal villi based on the edges of the small intestinal villi, and determining whether the small intestinal villi are atrophied and blunted according to the average length and average width of the small intestinal villi; Before the step of enhancing the weak edge to a strong edge when the possibility that the weak edge obtained by edge detection is the edge of the small intestinal villi is greater than a preset possibility threshold, the step further includes: Determining the possibility that the weak edge is the edge of the small intestinal villi according to the degree of curvature of the weak edge and the degree of difference between the weak edge and the adjacent edges; Before the step of determining the possibility that the weak edge is the edge of the small intestinal villi according to the degree of curvature of the weak edge and the degree of difference between the weak edge and the adjacent edge, the method further includes: Calculating a first ratio between the length of the weak edge and the average length of all weak edges; Calculating a second ratio between a straight-line distance between two end points of the weak edge and a length of the weak edge; Taking the product of the first ratio and the second ratio as the bending degree; Before the step of determining the possibility that the weak edge is the edge of the small intestinal villi according to the degree of curvature of the weak edge and the degree of difference between the weak edge and the adjacent edge, the method further includes: Search along two extension directions of the straight line where the gradient direction of the weak edge is located, and determine the first two edges with a length greater than that of the weak edge as adjacent edges; The difference degree is determined according to the gradient direction of the weak edge and the gradient directions of the two adjacent edges.
2. A method for identifying intestinal villus atrophy and blunting in inflammatory bowel disease according to claim 1, characterized in that: Before the step of determining the degree of difference according to the gradient direction of the weak edge and the gradient directions of the two edges, the method further includes: Cutting out a matching edge segment having the same length as the weak edge from the adjacent edge; The gradient direction of the matching edge segment is determined as the gradient direction of the adjacent edge.
3. A method for identifying intestinal villus atrophy and blunting in inflammatory bowel disease according to claim 1 or 2, characterized in that: The step of calculating the average length and average width of the small intestinal villi based on the small intestinal villi edge specifically includes: Marking all corner points detected from the edge corner points of the small intestinal villi; A coordinate system is constructed with the leftmost corner point of the edge of the small intestinal villi in the grayscale image as the origin and a straight line obtained by stretching the curve where the corner point is located with a greater than a preset ratio as the horizontal axis; The average length and average width of the small intestinal villi are determined according to the extreme points of the small intestinal villi edge in the coordinate system.
4. A device for identifying atrophy and blunting of small intestinal villi in inflammatory bowel disease, characterized in that: include: An enhancement module is used to perform edge detection on the grayscale image of the pathological section of the small intestinal villi, and when the possibility that the weak edge obtained by the edge detection is the edge of the small intestinal villi is greater than a preset possibility threshold, enhance the weak edge to a strong edge; A determination module, configured to determine the strong edge as an intestinal villus edge when the distance between the strong edge and the background area of the grayscale image is less than a preset distance threshold and the strong edge is not closed; A detection module, used for calculating the average length and average width of the small intestinal villi based on the edges of the small intestinal villi, and determining whether the small intestinal villi are atrophied and blunted according to the average length and average width of the small intestinal villi; The enhancement module is specifically used for: Determining the possibility that the weak edge is the edge of the small intestinal villi according to the degree of curvature of the weak edge and the degree of difference between the weak edge and the adjacent edges; The enhancement module is specifically used for: Calculating a first ratio between the length of the weak edge and the average length of all weak edges; Calculating a second ratio between a straight-line distance between two end points of the weak edge and a length of the weak edge; Taking the product of the first ratio and the second ratio as the bending degree; The enhancement module is specifically used for: Search along two extension directions of the straight line where the gradient direction of the weak edge is located, and determine the first two edges with a length greater than that of the weak edge as adjacent edges; The difference degree is determined according to the gradient direction of the weak edge and the gradient directions of the two adjacent edges.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for identifying intestinal villus atrophy and blunting in inflammatory bowel disease as claimed in any one of claims 1 to 3 is implemented.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for identifying intestinal villus atrophy and blunting in inflammatory bowel disease according to any one of claims 1 to 3 is implemented.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for identifying intestinal villus atrophy and blunting in inflammatory bowel disease according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Flowage line extracting method based on Canny edge detection and active contour model
CN103123723A
Road surface discrimination device and road surface discrimination method
JP2008262333A