A method for transferring annotations of pathological slice images and a method for generating training sets
Through the method of feature matching and corner point group generation, the problem of long time and deviation in the pathological slice image annotation transfer process is solved, and more accurate and efficient annotation transfer is achieved.
Patent Information
- Application Number
- CN202210862189.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-20
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-07-20
AI Technical Summary
In the existing technology, the annotation transfer process of pathological slice images is time-consuming and easily leads to annotation deviation due to scanning differences, affecting accuracy.
By obtaining the position information of the annotation frame of the first scanned image, multiple images to be matched are generated, and feature matching is performed to obtain the matching corner point group, generate a matching frame, and determine whether the matching point is in the matching frame. If so, the coordinate transfer is completed. Avoid mismatches.
The accuracy of label transfer is improved, label transfer errors caused by scanning errors are avoided, and processing time is shortened.
Smart Images

Figure CN115205561B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence training technology, and in particular to a method for labeling and transferring pathological slice images. Background Art
[0002] Pathology slide image refers to a scanned image obtained by scanning and digitizing pathology slides. The scanned image records the image information in the pathology slide, such as specific tissue cells characterized by a specific staining process. The training set refers to the pre-labeled sample data used in the supervised learning process, which is usually used in the training process of artificial intelligence models. At present, digital pathology has been developing rapidly around the world. By scanning pathology slides, physical slides are converted into digital slides, and then handed over to pathologists for remote pathology, combined with artificial intelligence-assisted diagnosis, diagnosis of slides has become an industry "trend". With the development of deep learning, the method of learning deep features of pathology images through neural networks to achieve pathology image prediction has become increasingly mature. ,
[0003] In the prior art, there are technical solutions for annotating pathological slice images and using them in the training process of artificial intelligence models. This type of technical solution usually collects a large number of slide samples corresponding to a certain type of disease in advance, scans, annotates and adds the slide samples to the training set to realize the training process of the artificial intelligence model. During the scanning process, in order to generate more samples, some technical solutions will also change the scanning parameters, move the slide position, scale, rotate, crop the scanned image, etc., to generate a richer training set.
[0004] However, in the actual implementation process, the inventors found that the above technical solution takes a long time to implement because it requires manual annotation of the scanned images. If the annotation content is transferred among multiple scanned images of the same glass slide sample only by means of coordinate mapping, feature matching, etc., it is easy to cause deviations in the annotation transfer process due to the differences brought by the scanning itself, affecting the accuracy of the annotation. Summary of the invention
[0005] In view of the above problems existing in the prior art, a method for labeling and transferring pathological slice images is now provided.
[0006] The specific technical solutions are as follows:
[0007] A method for transferring annotations of pathological slice images, comprising:
[0008] Step S1: acquiring a first scan image and a second scan image for the same pathological slide;
[0009] The scanning parameters of the first scanned image and the second scanned image are different, and a marking frame is pre-set on the first scanned image;
[0010] Step S2: acquiring the position information of the annotation box from the first scanned image, and scanning the second scanned image according to the position information and the scanning parameters to generate a plurality of images to be matched;
[0011] Step S3: performing feature matching on each of the to-be-matched images and the image block where the annotation box is located to generate a matching graph, wherein the matching graph contains at least one matching point;
[0012] Step S4: obtaining a group of diagonal points of the marked box, obtaining a corresponding matching corner point group in the matching graph, and generating a matching box according to the matching corner point group;
[0013] Step S5: Determine whether all the matching points are in the matching box;
[0014] If so, generating annotation content in the matching graph to complete the coordinate transfer;
[0015] If not, it indicates that the matching image is a mismatch, and the transfer process of the second scanned image is terminated.
[0016] Preferably, step S2 comprises:
[0017] Step S21: acquiring the position information of the annotation box from the first scanned image;
[0018] Step S22: generating an offset starting point in the second scanned image according to the position information and the scan parameters;
[0019] Step S23: performing a sliding window scan on the second scanned image from the offset starting point to generate a plurality of images to be matched.
[0020] Preferably, the step S22 includes:
[0021] Step S221: generating position reference points in the second scan image according to the position information and the scan parameters;
[0022] Step S22: offsetting an offset length from the position reference point toward a specific direction according to the scanning parameters to generate the offset starting point;
[0023] The offset length includes: the side length of the image block and an offset value.
[0024] Preferably, step S3 comprises:
[0025] Step S31: for each of the to-be-matched images, image feature matching is performed on the to-be-matched image and the image block where the annotation box is located, and a plurality of matching points and similarities corresponding to the matching points are generated;
[0026] Step S32: generating and recording a first similar matching point according to the similarity and the matching point;
[0027] Step S33: acquiring the first similar matching points in all the images to be matched, and taking the image to be matched with the most first similar matching points as the matching graph.
[0028] Preferably, in step S31, an akaze matching operator is used to perform image feature matching.
[0029] Preferably, the step S32 includes:
[0030] Step S321: generating the first similar matching point and the second similar matching point according to the similarity and the matching point;
[0031] Step S322: generating a matching point distance according to the first similar matching point and the second similar matching point;
[0032] Step S323: determining whether the matching point spacing is less than a matching point spacing limit;
[0033] If yes, record the first similar matching point;
[0034] If not, the first similar matching point is discarded.
[0035] Preferably, step S4 comprises:
[0036] Step S41: obtaining a group of diagonal points of the marked box, and obtaining a corresponding matching corner point group in the matching graph;
[0037] Step S42: judging whether the spacing between the matching corner point groups is greater than a spacing limit according to the spacing between the diagonal points;
[0038] If so, discard the matching corner point group;
[0039] If not, keep the matching corner point group and go to step S43:
[0040] Step S43: generating the matching box according to the matching corner point group.
[0041] Preferably, the scanning parameters include: scaling ratio, gamma value, inter-slice spacing, and field of view size.
[0042] A training set generation method, used to implement the above-mentioned annotation transfer method, comprises:
[0043] Step A1: for a pathology slide, at least two scanned images are collected using different scanning parameters;
[0044] Step A2: generating a labeling frame on one of the scanned images;
[0045] Step A3: transferring the annotation frame to other scanned images;
[0046] Step A4: adding all the scanned images into the training set;
[0047] Repeat steps A1 to A4 until all the pathological slides are collected.
[0048] The above technical solution has the following advantages or beneficial effects: by generating matching points in the process of transferring annotations, and generating diagonal point groups by transferring diagonal points, the verification process of matching points is realized, which effectively avoids the problem of mismatching that is prone to occur based only on feature recognition, and improves the accuracy of annotation transfer. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The embodiments of the present invention will be described more fully with reference to the attached drawings, which are provided for illustration and description only and are not intended to limit the scope of the present invention.
[0050] Figure 1 is an overall schematic diagram of an embodiment of the present invention;
[0051] Figure 2 is a schematic diagram of a marked box in an embodiment of the present invention;
[0052] Figure 3 This is a schematic diagram of sub-steps of step S2 in an embodiment of the present invention;
[0053] Figure 4 This is a schematic diagram of sub-steps of step S22 in an embodiment of the present invention;
[0054] Figure 5 This is a schematic diagram of sub-steps of step S3 in an embodiment of the present invention;
[0055] Figure 6 This is a schematic diagram of sub-steps of step S32 in an embodiment of the present invention;
[0056] Figure 7 This is a schematic diagram of sub-steps of step S4 in an embodiment of the present invention;
[0057] Figure 8 Schematic diagram of the training set generation process in an embodiment of the present invention. DETAILED DESCRIPTION
[0058] 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 only 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.
[0059] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0060] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but they are not intended to limit the present invention.
[0061] The present invention comprises:
[0062] A method for transferring annotations of pathological slice images, such as Figure 1 As shown, including:
[0063] Step S1: acquiring a first scan image and a second scan image for the same pathological slide;
[0064] The scanning parameters of the first scanned image and the second scanned image are different, and a marking frame is pre-set on the first scanned image;
[0065] Step S2: obtaining the position information of the annotation box from the first scanned image, and scanning the second scanned image according to the position information and the scanning parameters to generate a plurality of images to be matched;
[0066] Step S3: performing feature matching on each image to be matched and the image block where the annotation box is located, and generating a matching graph, wherein there is at least one matching point in the matching graph;
[0067] Step S4: obtaining a group of diagonal points of the annotation box, obtaining a corresponding matching corner point group in the matching graph, and generating a matching box according to the matching corner point group;
[0068] Step S5: Determine whether all matching points are in the matching box;
[0069] If so, generate annotation content in the matching graph to complete the coordinate transfer;
[0070] If not, it indicates that the matching image is a mismatch, and the transfer process of the second scanned image ends.
[0071] Specifically, in view of the problem in the prior art that only coordinate transfer or feature recognition is prone to mismatching and annotation position offset, which affects the annotation accuracy, in the present embodiment, in the process of transferring annotations, a matching graph with the same image features as the image block where the annotation box is located and matching points with the same image features in the matching graph are found in advance through feature matching. Subsequently, the diagonal points of the annotation box are transferred, a matching frame is generated in the second scanned image, and it is determined whether the matching point is in the matching frame, and then it is determined whether the matching point currently obtained through feature matching is accurate, so as to improve the accuracy of the annotation transfer process.
[0072] During implementation, the first scanned image and the second scanned image are both digitized images obtained by scanning the same pathology slide. In different embodiments, the digitized image may be a single scanned image or a group of pyramid images with different resolutions. The first scanned image and the second scanned image may be generated by scanning the same pathology slide by the same scanning device or different scanning devices. Scanning parameters refer to relevant parameters input into the scanning device during the scanning process, including information such as the zoom factor, gamma value, brightness, field of view size, resolution, origin position, etc. during scanning, which may also be set to other parameters according to different embodiments. The difference in scanning parameters is used here to generate multiple different scanned images for the same pathology slide. The above method only shows the process of transferring the annotation box in the first scanned image that has been annotated to the second scanned image that does not yet have the annotation box. When there are more than two scanned images for the same pathology slide, this process can be achieved by only performing the above process of transferring the annotation box in the first scanned image that has been annotated to the second scanned image that does not yet have the annotation box on different scanned images. Figure 2As shown, the annotation box is the relevant features obtained by annotating a specific tissue part in the pathology slide, and the process is performed manually or by a software program. The position information is the coordinate position of the annotation box in the first scanned image, which is generally determined by the origin position of the annotation box. In some embodiments, the size of the annotation box is included. The diagonal point refers to the end point position in the annotation box, such as the upper left corner-lower right corner is a group of diagonal points, or the upper right corner-lower left corner. Part of the image features of the first scanned image can be read within a certain range of the position where the diagonal point is located. Since the diagonal point itself has a relative position relationship, including direction and distance, the group of image features corresponding to it in the first scanned image also has a corresponding relative position relationship. The matching corner point group refers to a pair of points with the same image features as the diagonal point found in the second scanned image based on feature matching, which can be regarded as the mapping of the diagonal point in the second scanned image. Since the matching corner point group itself contains the same relative position relationship, the rectangular matching box re-determined based on the matching corner point group can be regarded as the mapping of the annotation box in the matching image. By judging whether the matching point is in the matching box, the image feature matching process can be cross-validated, thereby achieving a more accurate annotation transfer process.
[0073] In a preferred embodiment, Figure 3 As shown, step S2 includes:
[0074] Step S21: obtaining position information of a marked box from the first scanned image;
[0075] Step S22: generating an offset starting point in the second scanned image according to the position information and the scan parameters;
[0076] Step S23: Perform sliding window scanning on the second scanned image from the offset starting point to generate multiple images to be matched.
[0077] Specifically, in order to achieve faster transfer efficiency of the annotation box, in this embodiment, after obtaining the position information of the annotation box, an offset starting point is generated in the second scanning window according to the position information and the scanning parameters. The offset starting point is an area in the second scanned image that is relatively close to the tissue part selected by the annotation box. Subsequently, a sliding window scan is performed along a specific direction from the area using a specific step size, such as an interval of several pixels, to generate multiple images to be matched. Through the above processing, the feature matching and search process for the second scanned image can be simplified to multiple images to be matched scanned through the sliding window based on the offset starting point, thereby shortening the overall processing time.
[0078] In a preferred embodiment, Figure 4 As shown, step S22 includes:
[0079] Step S221: generating position reference points in the second scan image according to the position information and the scan parameters;
[0080] Step S222: moving an offset length from the position reference point to a specific direction according to the scanning parameters to generate an offset starting point;
[0081] The offset length includes: the side length of the image block and the offset value.
[0082] Specifically, in order to achieve faster transfer efficiency of the annotation box, in this embodiment, the position information of the annotation box and the scanning parameters during scanning, including the zoom ratio, the origin position, the image size and other related information that may easily cause the tissue position in the image to shift, are mapped together in the second scanned image to obtain the position reference point, and combined with the scanning parameters, the position reference point is moved in a specific direction by an offset length as the offset starting point, and a sliding window scan is performed from the offset starting point, and finally (1024 / step) is obtained. 2 To achieve a better sliding window matching effect.
[0083] During the implementation process, taking the sliding window scan to the right as an example, in this embodiment, in order to achieve a better matching effect, the origin of the annotation box is mapped to the second scanned image according to the position information and scanning parameters to generate a position reference point. Subsequently, the left side is taken as a specific direction and moved a distance of x+Δw according to the side length x of the image block and the offset value Δw to obtain the offset starting point.
[0084] In a preferred embodiment, Figure 5 As shown, step S3 includes:
[0085] Step S31: for each image to be matched, image feature matching is performed on the image to be matched and the image block where the annotation box is located, and a plurality of matching points and similarities corresponding to the matching points are generated;
[0086] Step S32: Generate and record a first similar matching point according to the similarity and the matching point;
[0087] Step S33: Obtain the first similar matching points in all the images to be matched, and use the image to be matched with the most first similar matching points as the matching graph.
[0088] Specifically, in order to achieve a better annotation transfer effect, in this embodiment, the image block and the image to be matched are matched with image features, and the first similar matching point in each image to be matched that best matches the image feature of the image block is generated. At this time, the coordinates of the first similar matching point are recorded and added to a first similar matching point set, and the first similar matching point set records the first similar matching points in all the images to be matched. It should be noted that the first similar matching points in the first similar matching point set and the image to be matched have corresponding coordinates in the coordinate system of the second scanned image, and the first similar matching points in different images to be matched may be the same first similar matching point, so the number of first similar matching points in the first similar matching point set may be less than or equal to the number of images to be matched. Subsequently, the coordinates of all the first similar matching points in the first similar matching point set are compared with the coordinate range of each image to be matched, and the first similar matching points whose coordinates fall into the coordinate range of the image to be matched are judged and counted, and the image to be matched with the most first similar matching points is output as a matching graph.
[0089] In a preferred embodiment, in step S31, an akaze matching operator is used to perform image feature matching.
[0090] In a preferred embodiment, Figure 6 As shown, step S32 includes:
[0091] Step S321: generating a first similar matching point and a second similar matching point according to the similarity and the matching point;
[0092] Step S322: generating a matching point distance according to the first similar matching point and the second similar matching point;
[0093] Step S323: determining whether the matching point spacing is less than a matching point spacing limit;
[0094] If so, record the first similar matching point;
[0095] If not, discard the first similar matching point.
[0096] Specifically, in order to avoid the occurrence of outlier matching points in the process of image feature matching, thereby causing the problem of mismatching, in this embodiment, in the process of recording the first similar matching point, a second similar matching point whose similarity is only less than that of the first similar matching point is obtained, and the distance between the first similar matching point and the second similar matching point, that is, the matching point spacing, is used to determine whether the first similar matching point is an outlier matching point. Before the matching process begins, a matching point spacing threshold is pre-set, and the matching point spacing threshold will change according to actual scanning parameters, such as magnification, resolution, etc. In one embodiment, the matching point spacing threshold is set to 0.75.
[0097] In a preferred embodiment, Figure 7 As shown, step S4 includes:
[0098] Step S41: obtaining a group of diagonal points of the marked box, and obtaining a corresponding matching corner point group in the matching graph;
[0099] Step S42: judging whether the spacing between the matching corner point groups is greater than the spacing limit according to the spacing between the diagonal points;
[0100] If yes, discard the matching corner point group and return to step S41;
[0101] If not, keep the matching corner point group and go to step S43:
[0102] Step S43: Generate a matching box according to the matching corner point group.
[0103] Specifically, in order to avoid mismatching in the process of mapping the diagonal points to the second scanned image through feature matching, in this embodiment, after the matching corner point groups are generated, the spacing of the matching corner point groups is judged to determine whether the distance between the matching corner point groups is too large. If so, it indicates that a mismatch has occurred and the matching process needs to be repeated, thereby avoiding the problem of generating an erroneous matching box due to feature matching errors in the process of mapping the matching corner point groups, which in turn affects the judgment of the matching image.
[0104] In a preferred embodiment, the scanning parameters include: zoom ratio, gamma value, inter-slice spacing, and field of view size.
[0105] A training set generation method for implementing the above-mentioned annotation transfer method, such as Figure 8 As shown, including:
[0106] Step A1: for a pathology slide, at least two scanned images are collected using different scanning parameters;
[0107] Step A2: generating a labeling frame on one of the scanned images;
[0108] Step A3: transferring the annotation box to other scanned images;
[0109] Step A4: Add all scanned images to the training set;
[0110] Repeat steps A1 to A4 until all pathology slides are collected.
[0111] Specifically, in view of the problem in the prior art that annotation transfer errors are prone to occur in the process of generating training sets, in this embodiment, by adopting the above-mentioned annotation transfer method, in the process of transferring the annotation box, the diagonal points are mapped and it is determined whether the matching points fall within the range of the matching corner point group, thereby effectively eliminating the erroneous annotation content caused by mismatching, thereby ensuring the accuracy of the scanned images added to the training set.
[0112] The beneficial effects of the present invention are as follows: in view of the problem that in the prior art, the annotation box is transferred only by means of coordinate mapping or image feature matching, which is easy to cause the annotation box to be transferred to the wrong place due to the error of the scanning process itself, thereby affecting the accuracy of the training set itself, in this embodiment, a secondary matching process is performed for the image features in the annotation box and the image features of the corner points of the annotation box, and matching points and matching boxes are respectively generated in the second scanned image to be annotated. By judging whether the matching points are located in the coverage range of the matching box, cross-validation of the feature matching process is effectively achieved, thereby ensuring the accuracy of the annotation transfer and avoiding the problem of incorrect annotation transfer due to scanning errors. Furthermore, in the feature matching process, by setting the offset starting point according to the position information and scanning parameters, and then using a sliding window for scanning, the efficiency of image feature matching is effectively improved, and the time of the overall annotation transfer process is shortened.
[0113] The above are only preferred embodiments of the present invention, and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the description and illustrations of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for transferring annotations of pathological slice images, characterized in that: include: Step S1: acquiring a first scan image and a second scan image for the same pathological slide; The scanning parameters of the first scanned image and the second scanned image are different, and a marking frame is pre-set on the first scanned image; Step S2: acquiring the position information of the annotation box from the first scanned image, and scanning the second scanned image according to the position information and the scanning parameters to generate a plurality of images to be matched; Step S3: performing feature matching on each of the to-be-matched images and the image block where the annotation box is located to generate a matching graph, wherein the matching graph contains at least one matching point; Step S4: obtaining a group of diagonal points of the marked box, obtaining a corresponding matching corner point group in the matching graph, and generating a matching box according to the matching corner point group; Step S5: Determine whether all the matching points are in the matching box; If so, generating annotation content in the matching graph to complete the coordinate transfer; If not, it indicates that the matching image is a mismatch, and the transfer process of the second scanned image is terminated.
2. The annotation transfer method according to claim 1, characterized in that: The step S2 comprises: Step S21: acquiring the position information of the annotation box from the first scanned image; Step S22: generating an offset starting point in the second scanned image according to the position information and the scan parameters; Step S23: performing a sliding window scan on the second scanned image from the offset starting point to generate a plurality of images to be matched.
3. The annotation transfer method according to claim 2, characterized in that: The step S22 comprises: Step S221: generating position reference points in the second scan image according to the position information and the scan parameters; Step S222: offsetting an offset length from the position reference point toward a specific direction according to the scanning parameters to generate the offset starting point; The offset length includes: the side length of the image block and an offset value.
4. The annotation transfer method according to claim 1, characterized in that: The step S3 comprises: Step S31: for each of the to-be-matched images, image feature matching is performed on the to-be-matched image and the image block where the annotation box is located, and a plurality of matching points and similarities corresponding to the matching points are generated; Step S32: generating and recording a first similar matching point according to the similarity and the matching point; Step S33: Acquire the first similar matching points in all the images to be matched, and use the image to be matched with the most first similar matching points as the matching graph.
5. The annotation transfer method according to claim 4, characterized in that: In the step S31, the akaze matching operator is used to perform image feature matching.
6. The annotation transfer method according to claim 4, characterized in that: The step S32 comprises: Step S321: generating the first similar matching point and the second similar matching point according to the similarity and the matching point; Step S322: generating a matching point distance according to the first similar matching point and the second similar matching point; Step S323: determining whether the matching point spacing is less than a matching point spacing limit; If yes, record the first similar matching point; If not, the first similar matching point is discarded.
7. The annotation transfer method according to claim 1, characterized in that: The step S4 comprises: Step S41: obtaining a group of diagonal points of the marked box, and obtaining a corresponding matching corner point group in the matching graph; Step S42: judging whether the spacing between the matching corner point groups is greater than a spacing limit according to the spacing between the diagonal points; If yes, discard the matching corner point group and return to step S41; If not, keep the matching corner point group and go to step S43: Step S43: generating the matching box according to the matching corner point group.
8. The annotation transfer method according to claim 1, characterized in that: The scanning parameters include: scaling, gamma value, inter-slice spacing, and field of view size.
9. A training set generation method, characterized in that: The method for implementing the annotation transfer method according to any one of claims 1 to 8 comprises: Step A1: for a pathology slide, at least two scanned images are collected using different scanning parameters; Step A2: generating a labeling frame on one of the scanned images; Step A3: transferring the annotation frame to other scanned images; Step A4: adding all the scanned images into the training set; Repeat steps A1 to A4 until all the pathological slides are collected.
Citation Information
Patent Citations
Image labeling method and device and labeling display method and device based on pathological image
CN110175255A
Image annotation method and device
CN111783820A
