A method for identifying crypt abscesses
Through the training of neural network models and the introduction of crypt chaos, combined with distance formulas and grouping standards, the problem of inaccurate crypt image segmentation in the prior art is solved, and the diagnostic accuracy and efficiency of crypt abscesses are improved.
Patent Information
- Application Number
- CN202411170317.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-26
AI Technical Summary
The existing automatic threshold-based segmentation method cannot accurately segment the crypt structure when processing complex images, resulting in a reduced diagnostic accuracy, especially when the grayscale values of the crypt and surrounding tissue are not much different or the lighting is uneven.
By collecting and annotating historical crypt images, training them using neural network models, introducing the crypt chaos degree of the image as a penalty factor for loss function, improving the classification accuracy of the model for complex images, and through distance formulas and grouping standards Group similar areas into one group to improve diagnostic efficiency.
The diagnostic accuracy and speed of crypt abscess is improved, and the output of the model helps doctors quickly identify potential problem areas, enhancing the accuracy and efficiency of the diagnosis.
Smart Images

Figure CN118691908B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing. The present invention relates to a method for identifying crypt abscesses. Background Art
[0002] Crypt abscess is a potential and common medical problem, and its prompt recognition is crucial for effective treatment and prevention of further spread of infection. Crypt abscess refers to a localized purulent infection that forms deep within the tissue. It may form anywhere in the body, such as in the tissue under the skin, deep in the muscle, or even in the internal organs.
[0003] At present, a patent application document with publication number CN109255775A discloses a method and system for automatic quantitative analysis of gastrointestinal epithelial crypt structure based on fiber optic microendoscopy images, the method comprising: filtering preprocessing the original fiber optic microendoscopy image; contrast enhancement of the image; segmenting the image to extract the crypt structure, specifically converting the enhanced image into a binary image through a threshold-based automatic segmentation method, segmenting the foreground and background, wherein the crypt-like part with a lower grayscale value is divided into the background, and the rest is the foreground, and the grayscale values of the foreground and background in the image are replaced. At this time, the foreground represents the crypt, and the boundaries of these areas are smoothed without significantly changing the areas of the foreground and background through an opening operation of first corrosion and then expansion, and the edges of each complete crypt in the image are extracted in the segmented binary image; and the morphological characteristics of the crypt structure are calculated.
[0004] The above operations can help endoscopists achieve high-accuracy and consistency in real-time, on-site diagnosis, thereby reducing the workload and training burden of doctors and improving clinical efficiency. However, when segmenting images, the threshold-based automatic segmentation method may have limitations when processing complex images. For example, if the grayscale value difference between the crypt and the surrounding tissue is not large or there is uneven lighting in the image, all crypt structures cannot be accurately segmented, resulting in reduced accuracy of subsequent diagnosis. Summary of the invention
[0005] In order to solve the above-mentioned problem that all crypt structures cannot be accurately segmented, resulting in reduced accuracy of subsequent diagnosis, the present invention provides solutions in the following aspects.
[0006] A method for identifying a crypt abscess, comprising:
[0007] Acquire a current crypt image, input the current crypt image into an optimal model, and output an image classification result of crypt abscess;
[0008] Among them, the training process of the optimal model is:
[0009] Obtain a historical crypt image set, annotate each image in the historical crypt image set, and obtain a label; the label is a normal crypt image and a crypt abscess image;
[0010] The annotated historical crypt image set is used as input data, and the label is used as output data to train the pre-built neural network model. After the training, the optimal model is obtained; the loss function in the neural network model is:
[0011] ; In the formula, is the loss function, For the The predicted value of the image, For the The true value of the image, is the penalty factor of the loss function, where For the The degree of crypt disorder in the first image is used to characterize the The complexity of the image.
[0012] Beneficial effects: The present invention collects historical crypt images and annotates the images, wherein the annotations indicate whether each image is a normal crypt or a crypt abscess, and uses the annotated historical crypt image set as input data and the corresponding labels as output data to train a neural network model. During the training process, the input image is processed, and the degree of crypt disorder in the image is calculated by analyzing the input image features, and the degree of crypt disorder is introduced into the loss function, so that the model pays more attention to samples with high crypt disorder, i.e., more complex images, during training, so as to improve the classification accuracy of crypt images. The output of the model can help doctors quickly identify potential problem areas, thereby improving the speed and accuracy of diagnosis.
[0013] Preferably, after the labeling, the images are grouped, and the grouping includes:
[0014] The coordinates of the center points of the circumscribed rectangles of all crypt regions in the image are calculated, and the distance formula for grouping is: ; In the formula, is the distance between the center points of any two crypt regions, For the The horizontal coordinate of the center point of the crypt area, For the The vertical coordinate of the center point of the crypt area, For the The horizontal coordinate of the center point of the crypt area, For the The vertical coordinates of the center points of the crypt regions; the grouping criteria are: when the distance between the center points of any two crypt regions is less than or equal to the distance threshold, they are grouped into one group; the crypt region includes the normal crypt region and the crypt abscess region;
[0015] Based on the distance formula and the standard, all center point coordinates in the image are traversed to obtain a grouping result.
[0016] Beneficial effects: Based on the distance formula and grouping criteria, similar areas can be grouped together. Through grouping processing, the focus can be placed on those areas that are more likely to contain abscesses, improving diagnostic efficiency.
[0017] Preferably, the grouping results are multiple mixed groups or separately clustered groups; the mixed group includes a normal crypt area and a crypt abscess area; the separately clustered groups include a group with only a normal crypt area and a group with only a crypt abscess area.
[0018] Beneficial effects: In machine learning model training, the grouping results can be used to create a more balanced and diverse training data set to ensure that the model can learn how to distinguish between different types of areas; the existence of mixed groups suggests that in some cases, normal crypt areas and crypt abscess areas may be difficult to distinguish, which requires special attention in model training.
[0019] Preferably, after the grouping, The degree of crypt disorder in the image Satisfies the relationship:
[0020] ; In the formula, For the The degree of crypt disorder in the image, For the image The information entropy of a group, is the number of groups after the image is grouped; is the number of mixed groups in the grouping results, The number of groups that are clustered separately in the grouping result.
[0021] Preferably, the Information entropy of a group for:
[0022] ; In the formula, For the The crypt region is The probability within a group, is an exponential function with the natural base e as base, For the said The number of types of all crypt regions in a group.
[0023] Preferably, The crypt region is The probability within a group is In group The total number of pixels in the crypt area of the first The ratio of the total number of pixels in a group.
[0024] Beneficial effect: The information entropy of each group quantifies the internal complexity of the group or the uncertainty of the pixel value distribution. By summing up the information entropy of all groups, we can get the degree of crypt disorder of the whole image. The larger the value, the higher the internal complexity of the image or the higher the uncertainty of the grayscale distribution.
[0025] Preferably, The crypt region is The probability within a group can also be In group The area of the circumscribed rectangle of the first crypt region is The ratio of the sum of the areas of the bounding rectangles of all crypt regions in a group.
[0026] Beneficial effects: When dealing with crypt abscess identification, this method can effectively quantify the proportion of different areas in the image, providing important information for subsequent image analysis and processing steps.
[0027] Preferably, the condition for the end of training is that the number of training times reaches a preset number threshold or the loss function value is less than a preset loss threshold. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0029] Figure 1 It is a method flow chart of steps S1-S2 in an online monitoring method of a pressure transmitter according to an embodiment of the present invention.
[0030] Figure 2 It is a method flow chart of steps S20-S21 in an online monitoring method of a pressure transmitter according to an embodiment of the present invention.
[0031] Figure 3 Schematic diagram of gastrointestinal crypts under a microscope in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0033] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0034] The present invention provides an effective recognition method based on the application of deep learning and image processing algorithms to improve the diagnostic accuracy of crypt abscesses.
[0035] Reference Figure 1 A method for identifying a crypt abscess includes steps S1-S2, which are as follows:
[0036] S1: Get the current crypt image.
[0037] In an embodiment of the present invention, the current gastrointestinal crypt image is obtained through a microscope. Usually, the pathological image occupies a large amount of memory, about 1G, so the pathological image needs to be sliced to obtain multiple microscopic images with a pixel size of 512×512. The sliced microscopic image is enhanced, such as contrast enhancement and adaptive histogram equalization, and then denoising is performed, such as using mean filtering, median filtering, Gaussian filtering, etc.
[0038] After the pathological image is processed as above, the stained area in the microscopic image is extracted for subsequent image processing.
[0039] S2: Input the current crypt image into the optimal model, and output the image classification result of crypt abscess.
[0040] Reference Figure 2 , the training process of the optimal model includes steps S20-S21:
[0041] S20: Obtain a historical crypt image set, annotate each image in the historical crypt image set, and obtain a label; the label is a normal crypt image and a crypt abscess image.
[0042] The method for processing the current crypt image according to step S1 is similarly used to process the historical crypt images, which are obtained from a medical image database. In an embodiment of the present invention, multiple historical crypt images are obtained to form a historical crypt image set.
[0043] After obtaining the historical crypt image set, each historical crypt image is manually annotated according to the diagnostic report of each historical crypt image, so that each historical crypt image corresponds to a label, and the label category is 0 (normal crypt image) or 2 (crypt abscess image), such as Figure 3 As shown, Figure 3 The square box area represents the crypt abscess area, and the round box area represents the normal crypt area.
[0044] After annotating each historical crypt image, the historical crypt images are further analyzed by understanding the relative position and distribution between different crypt areas (i.e., crypt normal areas and crypt abscess areas) in the historical crypt images. For example, when identifying crypt abscesses, the normal operating areas adjacent to them may provide useful contextual information. Through distance-based grouping, the relationship between the lesion area and the healthy tissue and its distribution in the overall image can be better understood. In addition, in some cases, researchers may only be interested in specific areas or specific types of areas in the image. Through distance-based grouping, specific groups of areas can be easily selected for in-depth study without manually selecting each area, which greatly speeds up the research and reduces human errors.
[0045] Specifically, each historical crypt image is grouped, and taking any one of the historical crypt images as an example, the grouping includes:
[0046] Calculate the center point coordinates of the circumscribed rectangles of all normal crypt areas and crypt abscess areas in the image, and the distance formula for grouping is:
[0047]
[0048] In the formula, is the distance between the center points of any two crypt regions, For the The horizontal coordinate of the center point of the crypt area, For the The vertical coordinate of the center point of the crypt area, For the The horizontal coordinate of the center point of the crypt area, For the The vertical coordinate of the center point of the crypt area.
[0049] The grouping standard is: when the distance between any two crypt region center points is less than or equal to a distance threshold, they are grouped together; in the embodiment of the present invention, the distance threshold is set to 10 based on experience.
[0050] Based on the above distance formula and grouping criteria, multiple groups can be formed by traversing the coordinates of all the center points in the image, each of which may contain the center points of multiple crypt regions that are close to each other in space. Then, the grouping results are obtained, which include multiple mixed groups or separately clustered groups. The mixed group contains groups of different types (normal crypts and crypt abscesses) of regions, and the separately clustered groups are groups mainly composed of regions of the same type.
[0051] Then count the number of groups after the image is grouped, recorded as Similarly, the grouping results corresponding to all historical crypt images can be obtained.
[0052] It should be noted that after grouping, if it is found that the grouping is too loose or strict, the distance threshold can be appropriately increased or decreased to achieve the best grouping effect.
[0053] After performing the above grouping operation on each image, the information entropy of each image is calculated.
[0054] Specifically, select image, calculate the The crypt disorder degree of the image satisfies the following relationship:
[0055]
[0056] In the formula, For the The degree of crypt disorder in the image, For the image The information entropy of a group, is the number of groups after the image is grouped; is the number of mixed groups in the grouping results, The number of groups that are clustered separately in the grouping result.
[0057] By multiplying To adjust the information entropy, this ratio reflects the ratio of mixed groups to clustered rents, so that the information entropy reflects the uncertainty of mixed groups more. When most groups are mixed groups, that is, The larger the value, the greater the contribution of information entropy to the total degree of disorder.
[0058] Among them, Information entropy of a group The acquisition process is as follows:
[0059] Get the The number of all pixels in the group, and then get the All the members of the group In this embodiment of the present invention, The number depends on the The type of group, for example If the group is a mixed group, Equal to 2; groups are separately clustered groups, then is equal to 1.
[0060] The first Information entropy of a group The relationship is as follows:
[0061] ; In the formula, For the The crypt region is The probability within a group, is an exponential function with the natural base e as base, For the said The number of types of all crypt regions in a group; The crypt region is The probability within a group By In group The total number of pixels in the crypt area of the first The total number of pixels in each group is obtained.
[0062] In another embodiment, calculating the The area of the bounding rectangle of all crypt regions in a group. For each bounding rectangle, the area is calculated based on its vertex coordinates. For example, the coordinates of the upper left corner of the bounding rectangle are And the coordinates of the lower right corner are , then its area It can be expressed as: .
[0063] The first The crypt region is The probability within a group It can be calculated by the following formula:
[0064]
[0065] In the formula, For the In group The area of the circumscribed rectangle of the crypt region, For the The sum of the areas of the bounding rectangles of all crypt regions in a group.
[0066] By calculating the crypt disorder level of crypt images, we can quantify the complexity and diversity of each crypt image. The larger the value of the crypt disorder degree of an image, the more different tissue types are contained in the image.
[0067] Obtain the By performing the operation on the crypt disorder degree of each image, the crypt disorder degree corresponding to all historical crypt images can be obtained in the same way.
[0068] S21: The annotated historical crypt image set is used as input data, and the label is used as output data to train the pre-built neural network model, and the optimal model is obtained after the training is completed.
[0069] First, a neural network model is constructed. In the embodiment of the present invention, the preferred neural network model is maskrcnn.
[0070] In the model training process, the loss function is an important indicator to measure the difference between the model prediction value and the true value. In the crypt abscess identification task, the prediction error is minimized by optimizing the loss function.
[0071] In order to reflect the impact of the image crypt disorder on model prediction, a penalty factor negatively correlated with the crypt disorder is introduced. Specifically, the penalty factor decreases as the crypt disorder increases. This setting encourages the model to be more cautious when processing images with high complexity, thereby improving the overall prediction accuracy.
[0072] Specifically, the loss function is:
[0073]
[0074] In the formula, is the loss function, For the The predicted value of Zhang's crypt image, For the The true value of Zhang's crypt image, is the penalty factor of the loss function.
[0075] The annotated historical crypt image set is used as input data, and the label is used as output data to train the pre-built neural network model. The termination condition of the training is that the number of training times reaches the preset number threshold or the loss function value is less than the preset loss threshold. The number threshold or loss threshold can be set based on experience.
[0076] After the training is completed, the hyperparameters are adjusted to train the neural network model multiple times, and the optimal model is selected based on the prediction accuracy of the model's evaluation indicators.
[0077] For the current crypt image obtained in step S1, the trained neural network model is used to classify the current crypt image, the current crypt image is input, and the classification result is output, and the classification result is a crypt abscess image or a crypt normal image.
[0078] At this point, the identification of gastrointestinal crypt abscess is completed.
[0079] The present invention collects historical crypt images and annotates the images, wherein the annotations indicate whether each image is a normal crypt or a crypt abscess, uses the annotated historical crypt image set as input data, and the corresponding labels as output data, to train a neural network model. During the training process, the input image is processed, and the degree of crypt disorder in the image is calculated by analyzing the input image features, and the degree of crypt disorder is introduced into the loss function, so that the model pays more attention to samples with high crypt disorder, i.e., more complex images, during training, so as to improve the classification accuracy of crypt images. The output of the model can help doctors quickly identify potential problem areas, thereby improving the speed and accuracy of diagnosis.
[0080] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0081] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A method for identifying crypt abscesses, characterized in that: include: Get the current crypt image; Inputting the current crypt image into the optimal model, and outputting the image classification result of the crypt abscess; Among them, the training process of the optimal model is: Obtain a historical crypt image set, annotate each image in the historical crypt image set, and obtain a label; the label is a normal crypt image and a crypt abscess image; After the marking, the images are grouped, and the grouping includes: The coordinates of the center points of the circumscribed rectangles of all crypt regions in the image are calculated, and the distance formula for grouping is: ; In the formula, is the distance between the center points of any two crypt regions, For the The horizontal coordinate of the center point of the crypt area, For the The vertical coordinate of the center point of the crypt area, For the The horizontal coordinate of the center point of the crypt area, For the The vertical coordinates of the center points of the crypt regions; the grouping criteria are: when the distance between the center points of any two crypt regions is less than or equal to the distance threshold, they are grouped into one group; the crypt region includes the normal crypt region and the crypt abscess region; Based on the distance formula and the standard, traverse the coordinates of all center points in the image to obtain a grouping result; The annotated historical crypt image set is used as input data, and the label is used as output data to train the pre-built neural network model. After the training, the optimal model is obtained; the loss function in the neural network model is: ; In the formula, is the loss function, For the The predicted value of the image, For the The true value of the image, is the penalty factor of the loss function, where For the The degree of crypt disorder in the first image is used to characterize the The complexity of the image.
2. A method for identifying crypt abscess according to claim 1, characterized in that: The grouping results are multiple mixed groups or separately clustered groups; the mixed group includes a normal crypt area and a crypt abscess area; the separately clustered groups include a group containing only a normal crypt area and a group containing only a crypt abscess area.
3. A method for identifying crypt abscess according to claim 2, characterized in that: After the grouping, The degree of crypt disorder in the image Satisfies the relationship: ; In the formula, For the The degree of crypt disorder in the image, For the image The information entropy of a group, is the number of groups after the image is grouped; is the number of mixed groups in the grouping results, The number of groups that are clustered separately in the grouping result.
4. A method for identifying crypt abscesses according to claim 3, characterized in that: The said Information entropy of a group for: ; In the formula, For the The crypt region is The probability within a group, is an exponential function with the natural base e as the base, For the The number of types of all crypt regions in a group.
5. A method for identifying crypt abscesses according to claim 4, characterized in that: No. The crypt region is The probability within a group is In group The total number of pixels in the crypt area of the first The ratio of the total number of pixels in a group.
6. A method for identifying crypt abscesses according to claim 4, characterized in that: No. The crypt region is The probability within a group can also be In group The area of the circumscribed rectangle of the first crypt region is The ratio of the sum of the areas of the bounding rectangles of all crypt regions in a group.
7. A method for identifying crypt abscess according to claim 1, characterized in that: The condition for the end of training is that the number of training times reaches the preset number threshold or the loss function value is less than the preset loss threshold.
