Lesion detection method and device, lesion detection model acquisition method
By using polygonal frames instead of rectangular frames under the endoscopy, image features are extracted and polygonal frames are generated to locate the lesions, the problem of inaccurate lesions in the prior art is solved, and higher positioning accuracy and diagnostic consistency are achieved.
Patent Information
- Application Number
- CN202111674364.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2041-12-31
AI Technical Summary
The existing artificial intelligence endoscopic lesion recognition technology uses rectangular boxes to mark the location of the lesion, and the positioning effect is limited and it is impossible to accurately predict the location of the lesion.
A polygon box is used instead of a rectangular box. By extracting features from the image, a polygon box is generated to frame the lesions. The polygon box is formed by connecting the end points of multiple vectors in sequence, and multiple vectors start with the same pixel.
It improves the accuracy of lesion positioning, and the polygonal frame can more accurately fit the outline of the real lesion, reduces interference from human factors, and improves diagnosis consistency and detection rate.
Smart Images

Figure CN114332858B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a lesion detection method, a lesion detection model acquisition method and a lesion detection device. Background Art
[0002] Endoscopic examination is the most effective means and gold standard for screening and diagnosing mucosal lesions of various organs in the human body. Compared with imaging examination methods such as ultrasound imaging or computed tomography (CT), endoscopy has the advantages of intuitive diagnosis of lesions and the treatment advantages of endoscopic biopsy and lesion cutting surgery. It is currently widely used in departments such as digestion, throat, gynecology, and surgery.
[0003] However, endoscopic examinations are overly dependent on the subjective judgment and decision-making of doctors. It is common for examination results to differ (such as missed or misdiagnosed) depending on the doctor's experience and level or the doctor's fatigue level. With the leapfrog development of artificial intelligence technology and its deep integration with various industries in recent years, image recognition and target detection methods based on artificial intelligence technology have also been widely used in endoscopy-assisted diagnosis, thereby greatly improving the consistency and detection rate of endoscopic diagnosis and reducing the interference of human factors.
[0004] The existing AI endoscopic lesion recognition technology uses deep learning target detection methods to mark the lesion locations in the collected images with rectangular boxes to construct a training set, trains with a target detection model, and uses the trained target detection model to predict the image and give the approximate location and category of the lesion. However, the use of rectangular boxes to mark the lesion location has limited positioning effect and cannot accurately predict the lesion location. Summary of the invention
[0005] The purpose of the present invention is to provide a lesion detection method and device, which can mark the lesion in an image with a polygonal frame to achieve lesion positioning, and can improve the accuracy of lesion positioning compared with the prior art. The present invention also provides a lesion detection model acquisition method.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A lesion detection method, comprising:
[0008] Acquire an image of the detected part;
[0009] Extracting features from the image to obtain a feature map;
[0010] According to the feature map of the image, a polygonal box that frames the lesion in the image and category information corresponding to the polygonal box are generated to obtain a detection result of the image, wherein the polygonal box is formed by connecting the end points of multiple vectors in sequence, and the multiple vectors take the same pixel as the starting point.
[0011] Preferably, generating a polygonal frame framing a lesion in the image and category information corresponding to the polygonal frame according to the feature map of the image, and obtaining the detection result of the image includes:
[0012] generating, according to the feature map of the image, a plurality of polygonal frames framing lesions in the image and category information corresponding to each of the polygonal frames;
[0013] For the two polygonal boxes with the same prediction category, if the overlap of the two polygonal boxes meets the first preset requirement, the polygonal box with the higher prediction score is retained, or / and, if the overlap of the two polygonal boxes meets the second preset requirement, the two polygonal boxes are retained.
[0014] Preferably, the first preset requirement includes: an intersection-and-union ratio of the two polygonal frames is greater than a preset threshold, and the intersection-and-union ratio of the two polygonal frames refers to the ratio of the intersection area to the union area of the two polygonal frames.
[0015] Preferably, the second preset requirement includes: an intersection-and-union ratio of the two polygonal frames is less than or equal to a preset threshold, and the intersection-and-union ratio of the two polygonal frames refers to the ratio of the intersection area to the union area of the two polygonal frames.
[0016] Preferably, extracting features from the image to obtain a feature map includes: extracting features from the image at multiple scales to obtain feature maps at multiple scales, and splicing and fusing the obtained feature maps at multiple scales.
[0017] A method for acquiring a lesion detection model, comprising:
[0018] For an image used as a training sample, marking the lesion in the image with a polygonal frame and marking the category information;
[0019] A preset detection model is trained using labeled training samples to obtain a lesion detection model, wherein the lesion detection model takes an image as input and predicted category information and a polygonal box as output, and the generated polygonal box frames the lesion in the image, and the generated polygonal box is formed by sequentially connecting the end points of multiple vectors, and the multiple vectors take the same pixel as the starting point.
[0020] Preferably, using the labeled training samples to train the preset detection model includes: calculating the position loss of the prediction box and the labeling box, and training the preset detection model according to the position loss, the labeling box is a polygonal box that marks the lesion in the image, and the prediction box is a polygonal box that frames the lesion in the image and is output after the image is input into the preset detection model;
[0021] The position loss is described by the intersection-over-union ratio of the prediction box and the annotation box, or / and the distance between the center of the prediction box and the center of the annotation box, or / and the module length difference and angle difference between the vector of the prediction box and the vector of the annotation box.
[0022] Preferably, the position loss is described by the distance between the center of the prediction box and the center of the annotation box, and the position loss described by the distance between the center of the prediction box and the center of the annotation box is expressed according to the following formula:
[0023]
[0024] Among them, ρ represents the distance between the center of the prediction box and the center of the annotation box, p and g represent the center of the prediction box and the center of the annotation box respectively, and c represents the diagonal length of the minimum circumscribed rectangular box of the prediction box and the annotation box.
[0025] Preferably, the position loss is described by the modulus difference and angle difference between the vector of the prediction box and the vector of the annotation box, and the position loss described by the modulus difference and angle difference between the vector of the prediction box and the vector of the annotation box is expressed according to the following formula:
[0026] υ=△l+△θ
[0027]
[0028]
[0029] Among them, Δl represents the difference in modulus between the vector of the prediction box and the vector of the annotation box, Δθ represents the angular difference between the vector of the prediction box and the vector of the annotation box, They represent the modulus of the i-th vector of the prediction box and the modulus of the i-th vector of the annotation box, respectively. They represent the angle of the i-th vector of the prediction box and the angle of the i-th vector of the annotation box, respectively, i∈[1,n], where n is an integer greater than or equal to 3.
[0030] A lesion detection device is used to execute the lesion detection method described above, or to process an image using a lesion detection model, wherein the lesion detection model is obtained using the lesion detection module acquisition method described above.
[0031] It can be seen from the above technical scheme that the lesion detection method and device provided by the present invention first obtain an image collected from the detected part, extract features from the image, obtain a feature map, and further generate a polygonal frame that frames the lesion in the image and the category information corresponding to the polygonal frame based on the feature map of the image to obtain the detection result of the image, wherein the polygonal frame is formed by connecting the end points of multiple vectors in sequence, and multiple vectors start from the same pixel. The lesion detection method and device of the present invention extract features from the image, generate a polygonal frame based on the feature map of the image to frame the lesion in the image, and locate the lesion. Compared with the method of locating the lesion with a rectangular frame in the prior art, the polygonal frame can more accurately fit the contour of the real lesion, thereby improving the accuracy of locating the lesion.
[0032] The present invention provides a method for acquiring a lesion detection model, and the obtained lesion detection model can achieve the above-mentioned beneficial effects.
[0033] The present invention provides a lesion detection device that can achieve the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 only 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 A flow chart of a lesion detection method provided by an embodiment of the present invention;
[0036] Figure 2 is a schematic diagram of a polygonal frame used in an embodiment of the present invention;
[0037] Figure 3 A flow chart of a method for generating a polygonal frame according to a feature map of an image and obtaining a detection result of the image in a lesion detection method provided by an embodiment of the present invention;
[0038] Figure 4 A flowchart of a method for acquiring a lesion detection model provided by an embodiment of the present invention;
[0039] Figure 5 A schematic diagram of a lesion detection device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0041] Please refer to Figure 1 , Figure 1 A flow chart of a lesion detection method provided in this embodiment, as shown in the figure, the lesion detection method comprises the following steps:
[0042] S11: Acquire an image of the detected part.
[0043] S12: Extract features from the image to obtain a feature map.
[0044] S13: Based on the feature map of the image, a polygonal box that frames the lesion in the image and category information corresponding to the polygonal box are generated to obtain a detection result of the image, wherein the polygonal box is formed by sequentially connecting the end points of multiple vectors, and the multiple vectors take the same pixel as the starting point.
[0045] In this embodiment, there is no limitation on the method of extracting features from an image, including but not limited to using a neural network based on convolution operations to process the image to extract features or using a neural network based on multi-layer neurons to process the image to extract features.
[0046] The category information corresponding to the polygonal frame refers to the category information of the image feature framed by the polygonal frame. In this embodiment, the category information corresponding to the polygonal frame includes the category information of the lesion to which the image feature framed by the polygonal frame belongs.
[0047] The generated polygonal frame is described by multiple vectors. The multiple vectors start from the same pixel. The end points of each vector are connected in sequence to form a polygonal frame. The starting point of each vector determines the position of the polygonal frame. The modulus and angle of each vector determine the shape and size of the polygonal frame. In this embodiment, there is no limitation on the number of vectors contained in the polygonal frame or the number of edges contained in the polygonal frame. For example, see Figure 2 , Figure 2 This is a schematic diagram of a polygonal frame used in this embodiment. The polygonal frame is formed by connecting the end points of vector OA, vector OB, vector OC, vector OD, vector OE, and vector OF in sequence, and each vector starts at point O.
[0048] The lesion detection method of this embodiment extracts features from the image and generates a polygonal frame based on the feature map of the image to frame the lesion in the image, thereby locating the lesion. Compared with the method of locating the lesion with a rectangular frame in the prior art, the polygonal frame can more accurately fit the contour of the real lesion, thereby improving the accuracy of locating the lesion.
[0049] Optionally, in step S13, a polygonal frame that frames the lesion in the image and category information corresponding to the polygonal frame are generated according to the feature map of the image to obtain the detection result of the image, which may include the following process, please refer to Figure 3 The flowchart shown includes the following steps:
[0050] S131: Generate a plurality of polygonal frames for framing lesions in the image and category information corresponding to each polygonal frame according to the feature map of the image.
[0051] S132: For the two polygonal boxes with the same prediction category, if the overlap of the two polygonal boxes meets the first preset requirement, retain the polygonal box with the higher prediction score, or / and, if the overlap of the two polygonal boxes meets the second preset requirement, retain the two polygonal boxes.
[0052] According to the feature map of the image, a polygonal frame is generated to frame the lesion in the image through feature learning of the image. And for each polygonal frame, corresponding category information including predicted category and predicted score is given, and the predicted score of the polygonal frame represents the probability that the image area framed by the polygonal frame belongs to the predicted category.
[0053] In practical applications, for two polygonal boxes that are close to each other, if the predicted categories of the two polygonal boxes are the same, the two polygonal boxes may correspond to the same lesion in the image. In this case, the two polygonal boxes with the same predicted category can be screened according to their overlap to decide whether to retain each polygonal box, thereby improving the accuracy of locating the lesion and the accuracy of the detection result. In this embodiment, the specific method of screening two polygonal boxes with the same predicted category according to their overlap is not limited. In practical applications, it can be set according to the lesion situation of the detected part, the situation of extracting features from the image, or the detection accuracy requirement.
[0054] Optionally, the first preset requirement may include: the intersection ratio of the two polygonal boxes is greater than a preset threshold. The intersection ratio of the two polygonal boxes refers to the ratio of the intersection (intersection area) of the two polygonal boxes to the union (total area), which can be expressed as: the overlapping area of the first polygonal box and the second polygonal box / the area of the first polygonal box and the total area of the union of the second polygonal box. That is, for two polygonal boxes with the same prediction category, if the intersection ratio of the two polygonal boxes is greater than a preset threshold, the polygonal box with a higher prediction score is retained. In this case, it is believed that the lesions framed by the two polygonal boxes correspond to the same lesion, so the one with a higher prediction score is retained. This method can be called a non-maximum suppression method.
[0055] Optionally, the second preset requirement may include: the intersection-and-union ratio of the two polygonal frames is less than or equal to a preset threshold, and the intersection-and-union ratio of the two polygonal frames refers to the ratio of the intersection (intersection area) to the union (total area) of the two polygonal frames. That is, for two polygonal frames with the same predicted category, if the intersection-and-union ratio of the two polygonal frames is less than or equal to the preset threshold, the two polygonal frames are retained. In this case, it is considered that the lesions framed by the two polygonal frames are not the same lesion, so both polygonal frames are retained.
[0056] In this embodiment, the specific size of the preset threshold is not limited. In practical applications, it can be set accordingly based on experience or detection requirements.
[0057] Optionally, if the predicted categories of the two polygonal boxes are different, both polygonal boxes may be retained. If the predicted categories of the two polygonal boxes are different, it is considered that the two polygonal boxes correspond to different lesions.
[0058] For multiple polygonal boxes generated in the image for framing the lesions in the image, each polygonal box can be traversed in turn, and the polygonal boxes can be screened according to the overlap between the polygonal boxes and their adjacent polygonal boxes, as well as the predicted category and the predicted score, to obtain the final screened polygonal boxes and obtain the detection results of the lesions in the image.
[0059] Preferably, extracting features from the image to obtain a feature map in step S12 may include: extracting features from the image at multiple different scales to obtain feature maps at multiple different scales, and splicing and fusing the obtained feature maps at multiple different scales. Then, detection is performed based on the feature maps obtained after splicing and fusion. By extracting features from the image at multiple different scales, features of various perception fields can be obtained, so that the image detection takes into account the features of larger lesions and smaller lesions, thereby improving the accuracy of locating lesions and the accuracy of detection results.
[0060] Preferably, before extracting features from an image, the process may also include: preprocessing the image to make the image meet the requirements. The specific method of image preprocessing is not limited in this embodiment, and can be set according to actual detection requirements in practical applications, for example, the image can be resized, format converted, or normalized.
[0061] Please refer to Figure 4 , Figure 4 A flow chart of a method for acquiring a lesion detection model provided in this embodiment is shown in the figure. The method for acquiring a lesion detection model comprises the following steps:
[0062] S21: For an image used as a training sample, marking the lesion in the image with a polygonal frame and marking the category information.
[0063] S22: Use labeled training samples to train a preset detection model to obtain a lesion detection model, wherein the lesion detection model takes an image as input and predicted category information and a polygonal box as output, and the generated polygonal box frames the lesion in the image. The generated polygonal box is formed by sequentially connecting the end points of multiple vectors, and the multiple vectors take the same pixel as the starting point.
[0064] For the image used as the training sample, the lesion is marked in the image with a polygonal frame, and the category information can be marked corresponding to each polygonal frame, and the category information can include a category label and a category score. When the lesion is marked in the image with a polygonal frame, it is preferred to make the polygonal frame fit the outline of the lesion as closely as possible.
[0065] The trained lesion detection model takes the image as input and the predicted category information and polygonal box as output. The generated polygonal box frames the lesion in the image. The generated polygonal box is described by multiple vectors. Multiple vectors start from the same pixel. The end points of each vector are connected in sequence to form a polygonal box. The starting point of each vector determines the position of the polygonal box, and the modulus and angle of each vector determine the shape and size of the polygonal box.
[0066] The lesion detection model acquisition method of this embodiment can obtain a lesion detection model, input the image collected from the detected part into the lesion detection model, and output a detection result that frames the lesion in the image with a polygonal frame, thereby locating the lesion. Compared with the method of locating the lesion with a rectangular frame in the prior art, the lesion detection model of this embodiment uses a polygonal frame to more accurately fit the contour of the real lesion, thereby improving the accuracy of locating the lesion.
[0067] Optionally, the image processing process of the lesion detection model may include: extracting features from the image to obtain a feature map; generating a polygonal frame that frames the lesion in the image and category information corresponding to the polygonal frame based on the feature map of the image, wherein the polygonal frame is formed by sequentially connecting the end points of multiple vectors, and the multiple vectors start from the same pixel. The specific implementation methods of extracting features from the image by the lesion detection model and the specific implementation methods of generating a polygonal frame that frames the lesion based on the feature map can be referred to the corresponding descriptions of the lesion detection method above, and will not be repeated here.
[0068] Optionally, using the labeled training samples to train the preset detection model includes: extracting features from the labeled training samples to obtain feature maps of the training samples; generating a polygonal box that frames the lesion in the image and category information corresponding to the polygonal box based on the feature maps of the training samples; calculating the category loss and position loss of the predicted box and the labeled box, and then optimizing the detection model based on the loss. The preset detection model is trained according to this process until the loss between the predicted box and the labeled box meets the requirements, such as reaching the minimum, so as to train and obtain the lesion detection model.
[0069] Preferably, using labeled training samples to train a preset detection model includes: calculating the position loss of a prediction box and a labeling box, and training the preset detection model based on the position loss, the labeling box is a polygonal box that marks the lesion in the image, and the prediction box is a polygonal box that frames the lesion in the image and is output after the image is input into the preset detection model.
[0070] Optionally, the position loss of the prediction box and the annotation box can be described by the intersection of the prediction box and the annotation box. The position loss described by the intersection of the prediction box and the annotation box can be expressed according to the following formula:
[0071]
[0072] Among them, P represents the prediction box and G represents the annotation box.
[0073] Optionally, the position loss of the prediction box and the annotation box can be described by the distance between the center of the prediction box and the center of the annotation box. The position loss described by the distance between the center of the prediction box and the center of the annotation box can be expressed according to the following formula:
[0074]
[0075] Among them, ρ represents the distance between the center of the prediction box and the center of the annotation box, p and g represent the center of the prediction box and the center of the annotation box respectively, and c represents the diagonal length of the smallest circumscribed rectangular box of the prediction box and the annotation box. When the distance between the prediction box and the annotation box is infinite, the center point distance and the diagonal length of the circumscribed rectangular box are infinitely close.
[0076] Optionally, the position loss can be described by the difference in modulus and angle between the vector of the prediction box and the vector of the annotation box. The position loss described by the difference in modulus and angle between the vector of the prediction box and the vector of the annotation box can be expressed according to the following formula:
[0077] υ=△l+△θ
[0078]
[0079]
[0080] Among them, Δl represents the difference in modulus between the vector of the prediction box and the vector of the annotation box, Δθ represents the angular difference between the vector of the prediction box and the vector of the annotation box, and l i p , l i g represents the modulus of the i-th vector of the prediction box and the modulus of the i-th vector of the annotation box, respectively, and θ i p ,θ i g represents the angle of the i-th vector of the prediction box and the angle of the i-th vector of the annotation box, i∈[1,n], and n is an integer greater than or equal to 3. A coordinate system can be established with the center of the polygonal box (i.e., the starting point of each vector) as the origin, and the vectors of the polygonal box can be named in a counterclockwise order.
[0081] Further preferably, the position loss described by the difference in modulus and angle between the vector of the prediction box and the vector of the annotation box can be expressed according to the following formula: αυ;
[0082] Among them, α represents the balance coefficient, which is expressed as follows:
[0083]
[0084] Preferably, the position loss of the prediction box and the annotation box can be comprehensively described by the intersection-over-union ratio of the prediction box and the annotation box, the distance between the center of the prediction box and the center of the annotation box, and the module length difference and angle difference between the vector of the prediction box and the vector of the annotation box. It can be expressed by the following formula:
[0085]
[0086] Among them, R(P,G) represents the penalty term.
[0087] Optionally, using the labeled training samples to train the preset detection model includes: calculating the category loss of the prediction box and the labeled box, and training the preset detection model according to the category loss. Optionally, the category loss of the prediction box and the labeled box can be expressed by the following formula:
[0088] FL(pt )=-(1-p t ) γ log(p t );
[0089] Among them, p t represents the confidence of the correct category, γ represents the adjustment factor, and γ≥0. The category loss adopts the cross entropy loss function improved by Focal Loss. It can be understood that in other embodiments, other methods can be used to calculate the category loss of the prediction box and the annotation box, which is also within the protection scope of the present invention.
[0090] This embodiment also provides a lesion detection device for executing the lesion detection method described above, or for processing an image using a lesion detection model, wherein the lesion detection model is obtained using the lesion detection module acquisition method described above.
[0091] The lesion detection device of this embodiment extracts features from the image and generates a polygonal frame based on the feature map of the image to frame the lesion in the image, thereby locating the lesion. Compared with the method of locating the lesion with a rectangular frame in the prior art, the polygonal frame can more accurately fit the contour of the real lesion, thereby improving the accuracy of locating the lesion.
[0092] Optional reference Figure 5 , Figure 5 A schematic diagram of a lesion detection device provided for the present embodiment, as shown in the figure, the lesion detection device may include a feature extraction module 31 and a frame generation module 32, the feature extraction module 31 is used to extract features from an image to obtain a feature map; the frame generation module 32 is used to generate a polygonal frame that frames the lesion in the image and category information corresponding to the polygonal frame according to the feature map of the image, so as to obtain a detection result of the image, wherein the polygonal frame is formed by sequentially connecting the end points of a plurality of vectors, and the plurality of vectors take the same pixel as a starting point.
[0093] A preprocessing module 33 may also be included to preprocess the image so that the image meets the requirements. The specific method of image preprocessing is not limited in this embodiment, and can be set according to actual detection requirements in practical applications. For example, the preprocessing module 33 can scale the image, convert the format, or perform normalization processing.
[0094] Optionally, the lesion detection device may also include a processor, a computer-readable storage medium, a human-computer interaction device or a display, etc. The human-computer interaction device includes but is not limited to a keyboard, a mouse, a touch screen, a voice receiver, etc.
[0095] The above is a detailed introduction to the lesion detection method and device, and the lesion detection model acquisition method provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention, and the description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A lesion detection method, characterized in that: include: Acquire an image of the detected part; Extracting features from the image to obtain a feature map; According to the feature map of the image, a polygonal frame that frames a lesion in the image and category information corresponding to the polygonal frame are generated to obtain a detection result of the image, wherein the polygonal frame is formed by sequentially connecting the end points of a plurality of vectors, and the plurality of vectors take the same pixel as a starting point; Generating, according to the feature map of the image, a polygonal frame framing a lesion in the image and category information corresponding to the polygonal frame, and obtaining a detection result of the image includes: generating, according to the feature map of the image, a plurality of polygonal frames framing lesions in the image and category information corresponding to each of the polygonal frames; For two polygonal frames with the same prediction category, if the overlap of the two polygonal frames meets a first preset requirement, retain the polygonal frame with a higher prediction score; or / and, if the overlap of the two polygonal frames meets a second preset requirement, retain the two polygonal frames; The first preset requirement includes: the intersection-and-union ratio of the two polygonal frames is greater than a preset threshold, and the intersection-and-union ratio of the two polygonal frames refers to the ratio of the intersection area to the union area of the two polygonal frames; The second preset requirement includes: the intersection-and-union ratio of the two polygonal frames is less than or equal to a preset threshold, and the intersection-and-union ratio of the two polygonal frames refers to the ratio of the intersection area to the union area of the two polygonal frames.
2. The lesion detection method according to claim 1, characterized in that: Extracting features from the image to obtain a feature map includes: extracting features from the image at multiple scales to obtain feature maps at multiple scales, and splicing and fusing the obtained feature maps at multiple scales.
3. A method for acquiring a lesion detection model, characterized in that: include: For an image used as a training sample, marking the lesion in the image with a polygonal frame and marking the category information; Using the labeled training samples to train the preset detection model, to obtain a lesion detection model, wherein the lesion detection model takes the image as input and the predicted category information and the polygonal box as output, the generated polygonal box frames the lesion in the image, and the generated polygonal box is formed by sequentially connecting the end points of multiple vectors, and the multiple vectors take the same pixel as the starting point; The image processing process of the lesion detection model includes: extracting features from the image to obtain a feature map; generating a polygonal frame that frames the lesion in the image and category information corresponding to the polygonal frame according to the feature map of the image, including: generating multiple polygonal frames that frame the lesion in the image and category information corresponding to each polygonal frame according to the feature map of the image; for two polygonal frames with the same predicted category, if the overlap of the two polygonal frames meets a first preset requirement, retaining the polygonal frame with a higher prediction score, or / and, if the overlap of the two polygonal frames meets a second preset requirement, retaining the two polygonal frames; The first preset requirement includes: the intersection-and-union ratio of the two polygonal boxes is greater than a preset threshold, and the intersection-and-union ratio of the two polygonal boxes refers to the ratio of the intersection area of the two polygonal boxes to the union area; the second preset requirement includes: the intersection-and-union ratio of the two polygonal boxes is less than or equal to a preset threshold, and the intersection-and-union ratio of the two polygonal boxes refers to the ratio of the intersection area of the two polygonal boxes to the union area.
4. The method for acquiring a lesion detection model according to claim 3, characterized in that: Using the labeled training samples to train the preset detection model includes: calculating the position loss of the prediction box and the labeling box, and training the preset detection model according to the position loss, wherein the labeling box is a polygonal box that labels the lesion in the image, and the prediction box is a polygonal box that frames the lesion in the image and is output after the image is input into the preset detection model; The position loss is described by the intersection-over-union ratio of the prediction box and the annotation box, or / and the distance between the center of the prediction box and the center of the annotation box, or / and the module length difference and angle difference between the vector of the prediction box and the vector of the annotation box.
5. The method for acquiring a lesion detection model according to claim 4, characterized in that: The position loss is described by the distance between the center of the prediction box and the center of the annotation box. The position loss described by the distance between the center of the prediction box and the center of the annotation box is expressed according to the following formula: Among them, ρ represents the distance between the center of the prediction box and the center of the annotation box, p and g represent the center of the prediction box and the center of the annotation box respectively, and c represents the diagonal length of the minimum circumscribed rectangular box of the prediction box and the annotation box.
6. The method for acquiring a lesion detection model according to claim 4, characterized in that: The position loss is described by the modulus difference and angle difference between the vector of the prediction box and the vector of the annotation box. The position loss described by the modulus difference and angle difference between the vector of the prediction box and the vector of the annotation box is expressed according to the following formula: Among them, Δl represents the difference in modulus between the vector of the prediction box and the vector of the annotation box, Δθ represents the angular difference between the vector of the prediction box and the vector of the annotation box, They represent the modulus of the i-th vector of the prediction box and the modulus of the i-th vector of the annotation box, respectively. They represent the angle of the i-th vector of the prediction box and the angle of the i-th vector of the annotation box, respectively, i∈[1,n], where n is an integer greater than or equal to 3.
7. A lesion detection device, characterized in that: Used to execute the lesion detection method according to any one of claims 1 to 2, or used to process an image using a lesion detection model, wherein the lesion detection model is obtained by using the lesion detection module acquisition method according to any one of claims 3 to 6; The lesion detection device includes a feature extraction module and a frame generation module. The feature extraction module is used to extract features from an image to obtain a feature map. The frame generation module is used to generate a polygonal frame that frames the lesion in the image and category information corresponding to the polygonal frame based on the feature map of the image to obtain a detection result of the image.
Citation Information
Patent Citations
Chronic atrophic gastritis image recognition system, device and method
CN109544526A
A construction method and application of an atrophic gastritis image recognition model
CN109670530A
Gastric cancer image recognition system and device and application thereof
CN109671053A