Method, device and equipment for recognizing colonoscopy parts based on image features of in-scope images
By performing feature extraction and vector distance calculation on colonoscopy images, combined with linear discriminant analysis and Encoder-Decoder model, the problem of difficult identification of colonoscopy parts is solved, the recognition accuracy and efficiency are improved, and the diagnosis and treatment of digestive tract diseases are supported.
Patent Information
- Application Number
- CN202311380267.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-24
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-10-24
AI Technical Summary
The anatomical structures of colonoscopy sites are similar and lack clear boundaries, which makes it difficult to identify colonoscopy sites, increases doctors' workload and affects efficiency. Deep learning technology is difficult to effectively identify the large number of changes in individual differences.
By performing feature vector extraction and category recognition on the images collected during the colonoscope entry process, the vector distance between the target image and the entry image is calculated to form a sample subset, and the categories are statistically determined to determine the location of the target image, combined with linear discriminant analysis and Encoder -Decoder model, performs dimensionality reduction and category correction to improve recognition accuracy.
It improves the accuracy and efficiency of colonoscopy site identification, supports the auxiliary diagnosis and treatment of digestive tract diseases, and reduces the complexity and time of doctors' operations.
Smart Images

Figure CN117392449B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image data recognition technology, and in particular to a method, device and equipment for recognizing the site of a colonoscopy based on the features of an image inserted into the colonoscopy. Background Art
[0002] Colonoscopy is a medical examination method that inserts an endoscope into the patient's lower digestive tract to observe, diagnose and treat digestive tract diseases. Lesions in different colonoscopy sites may be related to different diseases. Accurately locating the colonoscopy site can better observe and evaluate the nature, scope and severity of the lesions, thereby guiding the subsequent treatment plan formulation and disease management. At the same time, site identification can also provide more accurate descriptions and records of the condition, which helps the medical team communicate and collaborate, and improves the treatment effect and quality of life of patients.
[0003] However, the anatomical structures of the colonoscopy sites are similar, with no clear boundaries. The location and morphology of the colon may vary in different populations or under different circumstances. For example, the curvature, length, and location vary from person to person. In view of the above reasons, accurate distinction between the ascending colon, transverse colon, descending colon, sigmoid colon, and rectum in the colonoscopy site requires the use of professional colonoscopy doctors with rich experience and skills, combined with intestinal anatomical knowledge and colonoscopy results for comprehensive judgment. There are certain difficulties in actual operation, which increases the workload of doctors and affects work efficiency.
[0004] Although deep learning inference recognition has been widely used in the medical field, it is difficult to recognize the parts of colonoscopy based on deep learning due to the particularity of the colonoscope structure and the large individual differences. Therefore, how to accurately realize the recognition of colonoscopy parts is of great significance to assist in the diagnosis and treatment of digestive tract diseases. Summary of the invention
[0005] In view of the above problems, the present invention is proposed to provide a method, device and equipment for colonoscopy site recognition based on endoscope image features that solve the above technical problems or at least partially solve the above technical problems.
[0006] One aspect of the present invention provides a method for recognizing the site of a colonoscopy based on the features of an in-scope image, the method comprising:
[0007] Extract feature vectors from each colonoscopy image collected during the colonoscopy process;
[0008] According to the feature vectors of each colonoscopy image, the colonoscopy part category of each colonoscopy image is identified to obtain the initial colonoscopy part category corresponding to each colonoscopy image;
[0009] Extracting feature vectors of target colonoscopy images collected during the colonoscopy withdrawal process to obtain target feature vectors of the target colonoscopy images;
[0010] Calculate the vector distance between the target feature vector and the feature vector of each colonoscopy image, select a preset number of colonoscopy images in order of vector distance from small to large, and use the colonoscopy site categories corresponding to the selected colonoscopy images as samples to form a sample subset;
[0011] The colonoscopic part categories corresponding to each sample in the sample subset are counted, and the colonoscopic part categories whose counted number is greater than or equal to one half of the number of samples in the sample subset are taken as the colonoscopic part categories of the target colonoscopic image.
[0012] Optionally, the method further comprises:
[0013] The initial colonoscopy part category corresponding to each colonoscopy image is corrected to obtain a corrected colonoscopy part category.
[0014] Optionally, the correcting of the initial colonoscopy part category corresponding to each in-scope colonoscopy image to obtain a corrected colonoscopy part category includes:
[0015] Obtaining the distribution density of the colonoscopic images of different initial colonoscopic site categories in an image set consisting of all the colonoscopic images, and taking the image distribution area with the highest distribution density corresponding to the colonoscopic images of each initial colonoscopic site category as the category interval of the corresponding colonoscopic site category, and sorting the colonoscopic images in the image set according to the image acquisition time;
[0016] The initial colonoscopic part categories of the colonoscopic images within each category interval are all corrected to the colonoscopic part categories corresponding to the category interval to which they belong, or the initial colonoscopic part categories of the colonoscopic images with non-unknown part categories within each category interval are all corrected to the colonoscopic part categories corresponding to the category interval to which they belong.
[0017] Optionally, the distribution density of the in-scope colonoscopic images of different initial colonoscopic site categories in the image set composed of all in-scope colonoscopic images is obtained, and the image distribution area with the highest distribution density corresponding to the in-scope colonoscopic images of each initial colonoscopic site category is used as the category interval of the corresponding colonoscopic site category, including:
[0018] The combination of the colonoscopy sequence number x and the initial colonoscopy site category y is used as a sample to form the first sample set D = {(x1, y1), (x2, y2), (x3, y3)…(x n-1 ,y n-1 ),(x n ,y n)}, where n is the number of enteroscope images collected during the enteroscope process;
[0019] The distribution density of samples containing different initial colonoscopy site categories in the first sample set D is obtained, and the sample distribution area with the highest distribution density corresponding to the samples of each initial colonoscopy site category is used as the category interval of the corresponding colonoscopy site category.
[0020] Optionally, the calculating of the vector distance between the target feature vector and the feature vector of each colonoscopy image, selecting a preset number of colonoscopy images in order of vector distance from small to large, and using the colonoscopy site categories corresponding to the selected colonoscopy images as samples to form a sample subset includes:
[0021] The feature vector f of the colonoscopy image and the corresponding updated colonoscopy part category The combination of is a sample, forming the second sample set ,in, is the colonoscopy part category after the colonoscopy part category of the colonoscopy images in the interval is updated based on the colonoscopy part category corresponding to each category interval, and n is the number of colonoscopy images collected during the insertion process;
[0022] Take the feature vector f as sample data and the updated colonoscopy site category For labels, a first dimension reduction projection matrix is calculated according to a preset target dimension based on a linear discriminant analysis algorithm;
[0023] According to the first dimension reduction projection matrix, the feature vector f of the colonoscopy image in each sample in the second sample set is reduced in dimension to obtain the third sample set ,in, is the low-dimensional feature vector after dimensionality reduction calculation of the feature vector f;
[0024] According to the first dimension reduction projection matrix, the target feature vector Perform dimensionality reduction calculation to obtain the low-dimensional target feature vector after dimensionality reduction ;
[0025] Traverse the third sample set and calculate the low-dimensional target feature vector According to the vector distance between each low-dimensional feature vector in the third sample set, a preset number of samples are selected from the third sample set in the order of vector distance from small to large to form a sample subset.
[0026] Optionally, the calculating of the vector distance between the target feature vector and the feature vector of each colonoscopy image, selecting a preset number of colonoscopy images in order of vector distance from small to large, and using the colonoscopy site categories corresponding to the selected colonoscopy images as samples to form a sample subset includes:
[0027] The combination of the feature vector f of the colonoscopy image and the corresponding colonoscopy part category y is used as a sample to form the second sample set F={(f1,y1),(f2,y2),(f3,y3)…(f n-1 ,y n-1 ),(f n ,y n )}, n is the number of enteroscope images collected during the enteroscope process;
[0028] Taking the feature vector f as sample data and the colonoscopy site category y as the label, the second dimension reduction projection matrix is calculated according to the preset target dimension based on the linear discriminant analysis algorithm;
[0029] According to the second dimension reduction projection matrix, the feature vector f of the colonoscopy image in each sample in the second sample set is reduced in dimension to obtain the third sample set ,in, is the low-dimensional feature vector after dimensionality reduction calculation of the feature vector f;
[0030] According to the second dimension reduction projection matrix, the target feature vector Perform dimensionality reduction calculation to obtain the low-dimensional target feature vector after dimensionality reduction ;
[0031] Traverse the third sample set and calculate the low-dimensional target feature vector According to the vector distance between each low-dimensional feature vector in the third sample set, a preset number of samples are selected from the third sample set in the order of vector distance from small to large to form a sample subset.
[0032] Optionally, the method further comprises:
[0033] When the colonoscopy part category is identified for the corresponding colonoscopy images based on the feature vectors of the colonoscopy images collected during the colonoscopy process, when there are multiple consecutive colonoscopy images with the identification results of the ileocecal part, and the consecutive number of colonoscopy images is greater than the preset number threshold, it is determined that the advancement process is completed and the withdrawal process begins.
[0034] Optionally, feature vector extraction is performed on each enteroscope image collected during the enteroscope insertion process, including:
[0035] A pre-trained Encoder-Decoder model is used to train the encoding and decoding of each colonoscopy image from image to feature vector and then to image, and the feature vector output by the feature vector layer of the Encoder-Decoder model is used as the feature vector of the current input colonoscopy image;
[0036] Among them, the Encoder-Decoder model includes an image input layer, an encoding layer, a feature vector layer, a decoding layer and an image output layer.
[0037] Optionally, colonoscopy part category recognition is performed on each colonoscopy image according to the feature vector of each colonoscopy image to obtain an initial colonoscopy part category corresponding to each colonoscopy image, including:
[0038] A pre-trained image classification model is used to learn the feature vector of each colonoscopy image to obtain the initial colonoscopy site category corresponding to each colonoscopy image;
[0039] The image classification model includes an image input layer, a coding layer, a feature vector layer, a linear layer and a category output layer. The image input layer, coding layer and feature vector layer in the image classification model reuse the image input layer, coding layer and feature vector layer in the Encoder-Decoder model.
[0040] Another aspect of the present invention provides a device for recognizing the site of a colonoscopy based on the features of an in-scope image, the device comprising a functional module for implementing the method for recognizing the site of a colonoscopy based on the features of an in-scope image as described in any one of the above items, specifically comprising:
[0041] A feature extraction module is used to extract feature vectors from each enteroscope image collected during the enteroscope process;
[0042] The first category recognition module is used to identify the colonoscopy part category of each colonoscopy image according to the feature vector of each colonoscopy image, and obtain the initial colonoscopy part category corresponding to each colonoscopy image;
[0043] The feature extraction module is also used to extract feature vectors from the target colonoscopy image collected during the colonoscopy withdrawal process to obtain a target feature vector of the target colonoscopy image;
[0044] A vector calculation module, used for calculating the vector distance between the target feature vector and the feature vector of each colonoscopy image, selecting a preset number of colonoscopy images in the order of vector distance from small to large, and taking the colonoscopy part categories corresponding to the selected colonoscopy images as samples to form a sample subset;
[0045] The second category recognition module is used to count the colonoscopic part categories corresponding to each sample in the sample subset, and take the colonoscopic part categories with a statistical number greater than or equal to one-half of the number of samples in the sample subset as the colonoscopic part category of the target colonoscopic image.
[0046] Another aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor; when the computer program is executed by the processor, the steps of the method for recognizing the site of a colonoscopy based on the features of an image taken during colonoscopy as described in any one of the above items are implemented.
[0047] The embodiments of the present invention provide a method, device and equipment for recognizing colonoscopy site based on the features of the insertion image. Feature vectors are extracted and the colonoscopy site categories are identified for the insertion colonoscopy images collected during the insertion process. During the withdrawal process, the feature vector of the collected target colonoscopy image, i.e., the target feature vector, is calculated as the vector distance with the feature vectors of all the insertion colonoscopy images collected during the insertion process. A plurality of insertion colonoscopy images with shorter distances are selected in order of vector distance from small to large. A category with more than half of the statistical number is selected based on the colonoscopy site categories of the selected insertion colonoscopy images, and the category is used as the colonoscopy site category of the current target withdrawal image. This improves the recognition accuracy of the colonoscopy site category during the withdrawal process through feature analysis and site category identification of the insertion colonoscopy images, and reliably realizes auxiliary diagnosis and treatment of gastrointestinal diseases.
[0048] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only used for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. In the accompanying drawings:
[0050] Figure 1 It is a flow chart of a method for recognizing the site of a colonoscopy based on the features of an image of the colonoscopy according to an embodiment of the present invention;
[0051] Figure 2 This is a network structure diagram of the Encoder-Decoder model in an embodiment of the present invention;
[0052] Figure 3 A network structure diagram of an image classification model in an embodiment of the present invention;
[0053] Figure 4 Schematic diagram of the structure of a colonoscopy part recognition device based on the image features of the colonoscopy according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0055] Those skilled in the art will understand that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined.
[0056] Embodiment 1
[0057] The embodiment of the present invention provides a method for recognizing the part of a colonoscopy based on the features of an image of the colonoscopy. Figure 1 As shown, the colonoscopy part recognition method based on the image features of the in-scope image proposed by the present invention comprises the following steps:
[0058] S1. Extract feature vectors from each colonoscopy image collected during the colonoscopy process.
[0059] In this embodiment, colonoscopic images are collected during the colonoscope insertion process, and feature vectors of each colonoscopic image are extracted using an image feature extraction algorithm or a pre-trained image feature extraction model.
[0060] S2. Perform colonoscopy part category recognition on each colonoscopy image according to the feature vector of each colonoscopy image to obtain the initial colonoscopy part category corresponding to each colonoscopy image. In this embodiment, the colonoscopy part categories include ileocecal part, ascending colon, transverse colon, descending colon, sigmoid colon, rectum and unknown.
[0061] S3. Extract feature vectors of the target colonoscopy image collected during the colonoscopy withdrawal process to obtain a target feature vector of the target colonoscopy image.
[0062] S4, calculating the vector distance between the target feature vector and the feature vector of each colonoscopy image, selecting a preset number of colonoscopy images in order of vector distance from small to large, and using the colonoscopy part categories corresponding to the selected colonoscopy images as samples to form a sample subset. The vector distance may be Euclidean distance, cosine distance, etc., which is not specifically limited in the present invention.
[0063] S5. Count the colonoscopic part categories corresponding to the samples in the sample subset, and use the colonoscopic part categories whose counted number is greater than or equal to one half of the number of samples in the sample subset as the colonoscopic part categories of the target colonoscopic image.
[0064] In this embodiment, the colonoscopic part category of the target colonoscopic image is determined by statistical voting. Specifically, the colonoscopic part category with a number of votes greater than or equal to one-half of the number of samples in the sample subset can be used as the colonoscopic part category of the target colonoscopic image, or the colonoscopic part category with the highest number of votes can be used as the colonoscopic part category of the target colonoscopic image. Furthermore, if the number of votes for each colonoscopic part category is less than one-half of the number of samples in the sample subset, that is, the number of votes for the colonoscopic part category with the highest number of votes is also less than one-half of the number of samples in the sample subset, then the target colonoscopic image is determined to be an unknown category.
[0065] In this embodiment, by calculating the vector distance between the target feature vector of the target colonoscopy image collected during the process of colonoscopy withdrawal and the feature vectors of each colonoscopy image collected during the process of colonoscopy advancement, a plurality of colonoscopy images with shorter distances are selected in order of vector distance from small to large, so as to select the category with the largest statistical number or the category with more than half of the statistical number according to the colonoscopy part categories of the selected colonoscopy images as the colonoscopy part category of the current target colonoscopy withdrawal image.
[0066] The embodiment of the present invention provides a colonoscopy site recognition method based on the features of the insertion image. Feature vectors are extracted and the colonoscopy site categories are identified for the insertion colonoscopy images collected during the insertion process. During the withdrawal process, the feature vector of the collected target colonoscopy image, i.e., the target feature vector, is calculated as the vector distance with the feature vectors of all the insertion colonoscopy images collected during the insertion process. A plurality of insertion colonoscopy images with shorter distances are selected in order of vector distance from small to large. A category with more than half of the statistical number is selected based on the colonoscopy site categories of the selected insertion colonoscopy images, and the category is used as the colonoscopy site category of the current target withdrawal image. This improves the recognition accuracy of the colonoscopy site category during the withdrawal process through feature analysis and site category identification of the insertion colonoscopy images, and reliably realizes auxiliary diagnosis and treatment of gastrointestinal diseases.
[0067] In an embodiment of the present invention, step S1 extracts feature vectors from each colonoscopy image collected during the colonoscopy process, specifically including: using a pre-trained Encoder-Decoder model to perform encoding and decoding training from image to feature vector and then to image for each colonoscopy image, and using the feature vector output by the feature vector layer of the Encoder-Decoder model as the feature vector of the currently input colonoscopy image; wherein the Encoder-Decoder model includes an image input layer, a coding layer, a feature vector layer, a decoding layer and an image output layer.
[0068] Specifically, the black borders of each unlabeled colonoscopy image in the preset data set are cut off to obtain image samples with effective visual areas for model training. Then, based on the Encoder-Decoder mode, the image samples are trained from image to feature vector and then to image encoding and decoding models to obtain the Encoder-Decoder model. Figure 2 As shown in the figure, the Encoder-Decoder model includes an "encoding / feature extraction network" and a "decoding network", wherein the "encoding / feature extraction network" includes an Input image input layer, an Encoder encoding layer, and a Feature vector feature vector layer, and the "decoding network" includes a Decoder decoding layer and an Output1 image output layer.
[0069] Furthermore, the loss function of the model training is to perform a mean square error loss between the generated image output by Output1 and the original image input by Input, so as to realize the conversion from image to feature vector and then from feature vector to image. In this embodiment, the output of the Feature vector layer in the middle of the Encoder-Decoder model is used as the feature vector of the original image.
[0070] In an embodiment of the present invention, step S2 performs colonoscopy part category recognition on each colonoscopy image according to its feature vector to obtain an initial colonoscopy part category corresponding to each colonoscopy image, specifically comprising: using a pre-trained image classification model to learn the feature vector of each colonoscopy image to obtain an initial colonoscopy part category corresponding to each colonoscopy image; the image classification model comprises an image input layer, a coding layer, a feature vector layer, a linear layer and a category output layer, and the image input layer, coding layer and feature vector layer in the image classification model reuse the image input layer, coding layer and feature vector layer in the Encoder-Decoder model.
[0071] Specifically, some randomly collected colonoscopy images are pre-labeled with part categories. Figure 3As shown, the "decoding network" is replaced by the "classification network" composed of the Linear layer and the Output2 category output layer, and all layer parameters of the "encoding / feature extraction network" are reused. The image classification model of colonoscopy images is obtained by training with pre-labeled colonoscopy images.
[0072] The method for recognizing the part of the colonoscope based on the features of the image of the in-scope proposed in the embodiment of the present invention improves the recognition accuracy of the part category of the colonoscope during the withdrawal examination by analyzing the features of the in-scope colonoscope image and identifying the part category, and reliably realizes the auxiliary diagnosis and treatment of digestive tract diseases. In this embodiment, when the colonoscope part category of the corresponding in-scope colonoscope image is recognized according to the feature vector of the in-scope colonoscope image collected during the in-scope examination, when there are multiple consecutive in-scope colonoscope images with the recognition result of the ileocecal part, and the continuous number of in-scope colonoscope images is greater than the preset number threshold, it is determined that the in-scope process is over and the withdrawal process is entered. In a specific embodiment, during the in-scope examination, 10 frames of images are collected at equal intervals per second, and the pre-trained image classification model is used for recognition, and the feature vector Feature vectory extracted from each in-scope colonoscope image and the category to which it belongs are recorded. When more than half of the image frames in the multiple frames of images collected continuously, such as 20-30 frames, are recognized as the ileocecal part, it means that the lens has reached the ileocecal part, the entire in-scope process is over, and the hysteresis analysis is started.
[0073] It should be noted that colonoscopy is divided into two processes: inserting the endoscope and withdrawing the endoscope. The judgment of whether there is a disease or not is based on the observation of the withdrawal process. Inserting the endoscope is just a preparatory work. The beginning of a complete examination is when the endoscope reaches the ileocecal region. Therefore, in the process of implementing the technical solution of this application, it is necessary to accurately distinguish between the insertion process and the withdrawal process.
[0074] In an embodiment of the present invention, a method can be used to collect data during the process of entering the scope and analyze it, and to correct each category feature during the process of entering the scope for a single examination, thereby improving the recognition rate of the part of the examination to be withdrawn. Specifically, the method also includes: correcting the initial colonoscopy part category corresponding to each enter colonoscopy image to obtain a corrected colonoscopy part category. The correction of the initial colonoscopy part category corresponding to each enter colonoscopy image to obtain a corrected colonoscopy part category specifically includes: obtaining the distribution density of enter colonoscopy images of different initial colonoscopy part categories in an image set composed of all enter colonoscopy images, and taking the image distribution area with the highest distribution density corresponding to the enter colonoscopy images of each initial colonoscopy part category as the category interval of the corresponding colonoscopy part category, and the enter colonoscopy images in the image set are sorted according to the image acquisition time; the initial colonoscopy part category of the enter colonoscopy images in each category interval is all corrected to the colonoscopy part category corresponding to the category interval to which it belongs, so as to realize that the labels of the enter colonoscopy images in the credible distribution interval corresponding to each colonoscopy part category are corrected to the colonoscopy part category label corresponding to the category interval. Furthermore, when there are colonoscopy images with a part category of "unknown" within the category interval, the initial colonoscopy part categories of the colonoscopy images with a part category of "non-unknown" within each category interval can all be corrected to the colonoscopy part category corresponding to the category interval. For example, the interval for the ascending colon is 900 images between the 100th and 1000th images, but 500 of them are identified as ascending colon, 200 as unknown, and 200 as other parts such as transverse colon and rectum. Because there is a high probability that the same part is within an interval, but the similar anatomical structure characteristics of the colonoscope cause misidentification, the categories of these 200 images of other parts are corrected to ascending colon.
[0075] The distribution density of the colonoscopy images of different initial colonoscopy part categories in the image set composed of all the colonoscopy images is obtained, and the image distribution area with the highest distribution density corresponding to the colonoscopy images of each initial colonoscopy part category is used as the category interval of the corresponding colonoscopy part category, specifically including: taking the combination of the acquisition sequence number x of the colonoscopy image and the initial colonoscopy part category y as a sample, forming a first sample set D={(x1,y1),(x2,y2),(x3,y3)…(x n-1 ,y n-1 ),(x n ,y n)}, where n is the number of colonoscopic images collected during the process of entering the scope; obtain the distribution density of samples containing different initial colonoscopic site categories in the first sample set D, and use the sample distribution area with the highest distribution density corresponding to the samples of each colonoscopic site category as the category interval of the corresponding colonoscopic site category. In this embodiment, for each category (except the "unknown" category), the kernel density estimation method can be used to obtain the density distribution of the points of this category in the entire sample set D. According to the density distribution, a high-density area of the point set of each category is obtained, and the interval I to which each category belongs is obtained. According to the interval to which each category that is not "unknown class" belongs, all non-unknown image labels in the correction interval are the categories to which they belong. Among them, the "unknown" category images do not need to be re-labeled according to the interval to which they belong. At this point, the image acquisition reasoning and hysteresis analysis in the process of entering the scope are completed. After correcting the image labels collected during the process of entering the scope, the process of withdrawing the scope for colonoscopic site recognition begins.
[0076] Among them, after all the initial colonoscopy part categories of the colonoscopy images in each category interval are corrected to the colonoscopy part categories corresponding to the category intervals to which they belong, the vector distance between the target feature vector and the feature vector of each colonoscopy image is calculated in step S4, and a preset number of colonoscopy images are selected in order of vector distance from small to large, and the colonoscopy part categories corresponding to the selected colonoscopy images are used as samples to form a sample subset, which specifically includes the following steps not shown in the accompanying drawings:
[0077] S41, using the feature vector f of the colonoscopy image and the corresponding updated colonoscopy part category The combination of is a sample, forming the second sample set ,in, is the colonoscopy part category after updating the colonoscopy part category of the colonoscopy images within the interval based on the colonoscopy part category corresponding to each category interval, and n is the number of colonoscopy images collected during the insertion process.
[0078] S42, taking the feature vector f as sample data and the updated colonoscopy site category As labels, the first dimensionality reduction projection matrix is calculated based on the linear discriminant analysis algorithm according to the preset target dimension. In this embodiment, the feature vector output by the feature vector layer of the "encoding / feature extraction module" of the image collected during the lens entry process is used as the sample data, and the category corrected based on the interval to which each category belongs in step three is used as the label, and the dimensionality reduction projection matrix W is calculated based on the linear discriminant analysis (LDA) method with 3 as the target dimension number. The LDA dimensionality reduction process is a supervised learning with "minimum variance within the class and maximum variance between classes". Dimensionality reduction is not only simple for subsequent distance calculations. The process of hysteresis analysis of the present invention corrects the individual misidentified image category, which is equivalent to using the individual data for secondary model training, so that in the subsequent lens withdrawal process, it can ensure that the feature matching is more accurate.
[0079] S43, performing dimensionality reduction calculation on the feature vector f of the colonoscopy image in each sample in the second sample set according to the first dimensionality reduction projection matrix to obtain a third sample set ,in, is the low-dimensional feature vector after dimensionality reduction calculation of the feature vector f. Specifically, the feature vector f obtained by all inferences during the lens entry process is multiplied by the dimensionality reduction projection matrix W obtained in the above steps to obtain its 3D feature vector representation .
[0080] S44, according to the first dimension reduction projection matrix, the target feature vector Perform dimensionality reduction calculation to obtain the low-dimensional target feature vector after dimensionality reduction During the quieting process, the "encoding / feature extraction module" inference is performed on the real-time collected image to obtain the feature vector output by the Feature vector layer , for the feature vector Perform dot multiplication with the dimension reduction projection matrix W to obtain the reduced eigenvector .
[0081] S45, traverse the third sample set and calculate the low-dimensional target feature vector The vector distances between the low-dimensional feature vectors in the third sample set and the vector distances between the low-dimensional feature vectors in the third sample set are used to select a preset number of samples from the third sample set in the order of vector distances from small to large to form a sample subset. And traverse the sample set The Euclidean distance is calculated for the 3D feature vector in , and the m sample labels with the smallest distance are selected for voting. If the number of votes for a certain category exceeds half (m / 2), the category to which the current image belongs can be determined. If no category has more than half of the votes, the current image is determined to be an unknown category. For example, after the Euclidean distance calculation, 10 samples with the smallest distance are found. If 6 of them belong to the descending colon after the category is corrected by hysteresis analysis, then the current image belongs to the descending colon.
[0082] In another optional embodiment of the present invention, the step S4 calculates the vector distance between the target feature vector and the feature vector of each colonoscopy image, selects a preset number of colonoscopy images in order of vector distance from small to large, and uses the colonoscopy site categories corresponding to the selected colonoscopy images as samples to form a sample subset, specifically including the following steps not shown in the accompanying drawings:
[0083] S41', taking the combination of the feature vector f of the colonoscopy image and the corresponding colonoscopy part category y as samples, a second sample set F={(f1,y1),(f2,y2),(f3,y3)…(f n-1 ,y n-1 ),(f n ,y n )}, n is the number of enteroscope images collected during the enteroscope process;
[0084] S42', taking the feature vector f as sample data and the colonoscopy site category y as a label, calculating the second dimension reduction projection matrix according to the preset target dimension based on the linear discriminant analysis algorithm;
[0085] S43′, perform dimensionality reduction calculation on the feature vector f of the colonoscopy image in each sample in the second sample set according to the second dimensionality reduction projection matrix to obtain the third sample set ,in, is the low-dimensional feature vector after dimensionality reduction calculation of the feature vector f;
[0086] S44', according to the second dimension reduction projection matrix, the target feature vector Perform dimensionality reduction calculation to obtain the low-dimensional target feature vector after dimensionality reduction ;
[0087] S45', traverse the third sample set and calculate the low-dimensional target feature vector According to the vector distance between each low-dimensional feature vector in the third sample set, a preset number of samples are selected from the third sample set in the order of vector distance from small to large to form a sample subset.
[0088] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0089] Embodiment 2
[0090] Another embodiment of the present invention further provides a device for recognizing colonoscopy parts based on the features of the in-scope image, the device comprising a functional module for implementing the method for recognizing colonoscopy parts based on the features of the in-scope image as described in any one of the above items. Figure 4 The schematic diagram of the structure of the colonoscopy part recognition device based on the image features of the in-scope provided by the embodiment of the present invention is shown schematically. Figure 4 The device for recognizing the part of a colonoscope based on the features of an in-scope image according to an embodiment of the present invention specifically comprises a feature extraction module 401, a first category recognition module 402, a vector calculation module 403, and a second category recognition module 404, wherein:
[0091] The feature extraction module 401 is used to extract feature vectors from each enteroscope image collected during the enteroscope process;
[0092] The first category recognition module 402 is used to identify the colonoscopy part category of each colonoscopy image according to the feature vector of each colonoscopy image, and obtain the initial colonoscopy part category corresponding to each colonoscopy image;
[0093] The feature extraction module 401 is also used to extract feature vectors from the target colonoscopy image collected during the colonoscopy withdrawal process to obtain a target feature vector of the target colonoscopy image;
[0094] A vector calculation module 403 is used to calculate the vector distance between the target feature vector and the feature vector of each colonoscopy image, select a preset number of colonoscopy images in the order of vector distance from small to large, and use the colonoscopy part categories corresponding to the selected colonoscopy images as samples to form a sample subset;
[0095] The second category recognition module 404 is used to count the colonoscopic part categories corresponding to each sample in the sample subset, and take the colonoscopic part categories with a counted number greater than or equal to one half of the number of samples in the sample subset as the colonoscopic part category of the target colonoscopic image.
[0096] In one embodiment of the present invention, the device further includes a category correction module not shown in the accompanying drawings, and the category correction module is used to correct the initial colonoscopy part category corresponding to each in-scope colonoscopy image to obtain a corrected colonoscopy part category.
[0097] Furthermore, the category correction module is specifically used to obtain the distribution density of the in-guineascope images of different initial colonoscopy part categories in the image set composed of all the in-guineascope images, and use the image distribution area with the highest distribution density corresponding to the in-guineascope images of each initial colonoscopy part category as the category interval of the corresponding colonoscopy part category, and the in-guineascope images in the image set are sorted according to the image acquisition time; the initial colonoscopy part categories of the in-guineascope images in each category interval are all corrected to the colonoscopy part categories corresponding to the category interval to which they belong, or the initial colonoscopy part categories of the in-guineascope images whose part categories are not unknown in each category interval are all corrected to the colonoscopy part categories corresponding to the category interval to which they belong.
[0098] The distribution density of the colonoscopic images of different initial colonoscopic part categories in the image set composed of all the colonoscopic images is obtained, and the image distribution area with the highest distribution density corresponding to the colonoscopic images of each initial colonoscopic part category is used as the category interval of the corresponding colonoscopic part category, including:
[0099] The combination of the colonoscopy sequence number x and the initial colonoscopy site category y is used as a sample to form the first sample set D = {(x1, y1), (x2, y2), (x3, y3)…(x n-1 ,y n-1 ),(x n ,y n )}, where n is the number of enteroscope images collected during the enteroscope process;
[0100] The distribution density of samples containing different initial colonoscopy site categories in the first sample set D is obtained, and the sample distribution area with the highest distribution density corresponding to the samples of each initial colonoscopy site category is used as the category interval of the corresponding colonoscopy site category.
[0101] In an optional embodiment, the vector calculation module 403 is specifically configured to perform the following operations:
[0102] The feature vector f of the colonoscopy image and the corresponding updated colonoscopy part category The combination of is a sample, forming the second sample set ,in, is the colonoscopy part category after the colonoscopy part category of the colonoscopy images in the interval is updated based on the colonoscopy part category corresponding to each category interval, and n is the number of colonoscopy images collected during the insertion process;
[0103] Take the feature vector f as sample data and the updated colonoscopy site category For labels, a first dimension reduction projection matrix is calculated according to a preset target dimension based on a linear discriminant analysis algorithm;
[0104] According to the first dimension reduction projection matrix, the feature vector f of the colonoscopy image in each sample in the second sample set is reduced in dimension to obtain the third sample set ,in, is the low-dimensional feature vector after dimensionality reduction calculation of the feature vector f;
[0105] According to the first dimension reduction projection matrix, the target feature vector Perform dimensionality reduction calculation to obtain the low-dimensional target feature vector after dimensionality reduction ;
[0106] Traverse the third sample set and calculate the low-dimensional target feature vector According to the vector distance between each low-dimensional feature vector in the third sample set, a preset number of samples are selected from the third sample set in the order of vector distance from small to large to form a sample subset.
[0107] In another optional embodiment, the vector calculation module 403 is specifically configured to perform the following operations:
[0108] The combination of the feature vector f of the colonoscopy image and the corresponding colonoscopy part category y is used as a sample to form the second sample set F={(f1,y1),(f2,y2),(f3,y3)…(f n-1 ,y n-1 ),(f n ,y n )}, n is the number of enteroscope images collected during the enteroscope process;
[0109] Taking the feature vector f as sample data and the colonoscopy site category y as the label, the second dimension reduction projection matrix is calculated according to the preset target dimension based on the linear discriminant analysis algorithm;
[0110] According to the second dimension reduction projection matrix, the feature vector f of the colonoscopy image in each sample in the second sample set is reduced in dimension to obtain the third sample set ,in, is the low-dimensional feature vector after dimensionality reduction calculation of the feature vector f;
[0111] According to the second dimension reduction projection matrix, the target feature vector Perform dimensionality reduction calculation to obtain the low-dimensional target feature vector after dimensionality reduction ;
[0112] Traverse the third sample set and calculate the low-dimensional target feature vector According to the vector distance between each low-dimensional feature vector in the third sample set, a preset number of samples are selected from the third sample set in the order of vector distance from small to large to form a sample subset.
[0113] In the embodiment of the present invention, the feature extraction module 401 is specifically used to use a pre-trained Encoder-Decoder model to perform encoding and decoding training on each input colonoscopy image from image to feature vector and then to image, and use the feature vector output by the feature vector layer of the Encoder-Decoder model as the feature vector of the currently input colonoscopy image; wherein the Encoder-Decoder model includes an image input layer, a coding layer, a feature vector layer, a decoding layer and an image output layer.
[0114] Furthermore, the first category recognition module 402 is specifically used to use a pre-trained image classification model to learn the feature vector of each colonoscopy image to obtain the initial colonoscopy site category corresponding to each colonoscopy image; the image classification model includes an image input layer, a coding layer, a feature vector layer, a linear layer and a category output layer, and the image input layer, coding layer, and feature vector layer in the image classification model reuse the image input layer, coding layer, and feature vector layer in the Encoder-Decoder model.
[0115] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment, and it has corresponding technical effects.
[0116] Embodiment 3
[0117] An embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned embodiments of the method for recognizing the site of a colonoscopy based on the features of an image of an in-scope are implemented, for example Figure 1 Alternatively, when the processor executes the computer program, the functions of each module in the above-mentioned embodiments of the device for recognizing the site of a colonoscopy based on the features of the image entering the colonoscopy are realized, for example Figure 4 The illustrated module includes a feature extraction module 401 , a first category identification module 402 , a vector calculation module 403 and a second category identification module 404 .
[0118] As for the computer device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment, and it has the corresponding technical effects.
[0119] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, any one of the claimed embodiments may be used in any combination.
[0120] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for recognizing the site of a colonoscopy based on the features of an in-scope image, characterized in that: The method comprises: Extract feature vectors from each colonoscopy image collected during the colonoscopy process; Perform colonoscopy part category identification on each colonoscopy image according to the feature vector of each colonoscopy image to obtain the initial colonoscopy part category corresponding to each colonoscopy image, and correct the initial colonoscopy part category corresponding to each colonoscopy image to obtain the corrected colonoscopy part category; wherein correcting the initial colonoscopy part category corresponding to each colonoscopy image to obtain the corrected colonoscopy part category specifically includes: obtaining the distribution density of colonoscopy images of different initial colonoscopy part categories in an image set composed of all colonoscopy images, and taking the image distribution area with the highest distribution density corresponding to the colonoscopy images of each initial colonoscopy part category as the category interval of the corresponding colonoscopy part category, and sorting the colonoscopy images in the image set according to the image acquisition time; correcting all the initial colonoscopy part categories of the colonoscopy images in each category interval to the colonoscopy part category corresponding to the category interval to which they belong, or correcting all the initial colonoscopy part categories of the colonoscopy images whose part categories in each category interval are non-unknown to the colonoscopy part category corresponding to the category interval to which they belong; Extracting feature vectors of target colonoscopy images collected during the colonoscopy withdrawal process to obtain target feature vectors of the target colonoscopy images; Calculate the vector distance between the target feature vector and the feature vector of each colonoscopy image, select a preset number of colonoscopy images in order of vector distance from small to large, and use the colonoscopy part categories corresponding to the selected colonoscopy images as samples to form a sample subset. Use the colonoscopy part categories corresponding to the selected colonoscopy images as samples to form a sample subset, including: using the feature vectors of the colonoscopy images and the corresponding updated colonoscopy site categories as a sample, calculating the vector distance between the low-dimensional target feature vector after dimensionality reduction calculation and the low-dimensional feature vector of each in-scope colonoscopy image after dimensionality reduction calculation, and selecting a preset number of samples in order of the vector distance between the low-dimensional feature vector and the low-dimensional feature vector from small to large to form a sample subset; The colonoscopic part categories corresponding to each sample in the sample subset are counted, and the colonoscopic part categories whose counted number is greater than or equal to one half of the number of samples in the sample subset are taken as the colonoscopic part categories of the target colonoscopic image.
2. The method according to claim 1, characterized in that: The distribution density of the colonoscopic images of different initial colonoscopic part categories in the image set composed of all the colonoscopic images is obtained, and the image distribution area with the highest distribution density corresponding to the colonoscopic images of each initial colonoscopic part category is used as the category interval of the corresponding colonoscopic part category, including: The combination of the colonoscopy sequence number x and the initial colonoscopy site category y is used as a sample to form the first sample set D = {(x1, y1), (x2, y2), (x3, y3) ... (x n-1 ,y n-1 ), (x n ,y n )}; wherein n is the number of enteroscope images collected during the enteroscope process; The distribution density of samples containing different initial colonoscopy site categories in the first sample set D is obtained, and the sample distribution area with the highest distribution density corresponding to the samples of each initial colonoscopy site category is used as the category interval of the corresponding colonoscopy site category.
3. The method according to claim 1, characterized in that The step of calculating the vector distance between the target feature vector and the feature vector of each colonoscopy image, selecting a preset number of colonoscopy images in ascending order of the vector distance, and using the colonoscopy site categories corresponding to the selected colonoscopy images as samples to form a sample subset includes: The feature vector of the colonoscopy image and the corresponding updated colonoscopy site categories The combination of is a sample, forming the second sample set ,in, is the colonoscopy part category after the colonoscopy part category of the colonoscopy images in the interval is updated based on the colonoscopy part category corresponding to each category interval, and n is the number of colonoscopy images collected during the insertion process; With feature vector is the sample data, with the updated colonoscopy site category For labels, a first dimension reduction projection matrix is calculated according to a preset target dimension based on a linear discriminant analysis algorithm; The feature vectors of the colonoscopy images in each sample in the second sample set are calculated based on the first dimension reduction projection matrix. Perform dimensionality reduction calculation to obtain the third sample set ,in, For the feature vector The low-dimensional feature vector after dimensionality reduction calculation; According to the first dimension reduction projection matrix, the target feature vector Perform dimensionality reduction calculation to obtain the low-dimensional target feature vector after dimensionality reduction ; Traverse the third sample set and calculate the low-dimensional target feature vector According to the vector distance between each low-dimensional feature vector in the third sample set, a preset number of samples are selected from the third sample set in the order of vector distance from small to large to form a sample subset.
4. The method according to claim 1, characterized in that: The step of calculating the vector distance between the target feature vector and the feature vector of each colonoscopy image, selecting a preset number of colonoscopy images in ascending order of the vector distance, and using the colonoscopy site categories corresponding to the selected colonoscopy images as samples to form a sample subset includes: The feature vector of the colonoscopy image The combination of the corresponding colonoscopy site category y is a sample to form the second sample set , n is the number of enteroscopic images collected during the enteroscopic process; With feature vector is the sample data, with the colonoscopy site category y as the label, and the second dimension reduction projection matrix is calculated according to the preset target dimension based on the linear discriminant analysis algorithm; The feature vectors of the colonoscopy images in each sample in the second sample set are calculated according to the second dimensionality reduction projection matrix. Perform dimensionality reduction calculation to obtain the third sample set ,in, For the feature vector The low-dimensional feature vector after dimensionality reduction calculation; According to the second dimension reduction projection matrix, the target feature vector Perform dimensionality reduction calculation to obtain the low-dimensional target feature vector after dimensionality reduction ; Traverse the third sample set and calculate the low-dimensional target feature vector According to the vector distance between each low-dimensional feature vector in the third sample set, a preset number of samples are selected from the third sample set in the order of vector distance from small to large to form a sample subset.
5. The method according to any one of claims 1 to 4, characterized in that: Feature vector extraction is performed on each colonoscopy image collected during the colonoscopy process, including: A pre-trained Encoder-Decoder model is used to train the encoding and decoding of each colonoscopy image from image to feature vector and then to image, and the feature vector output by the feature vector layer of the Encoder-Decoder model is used as the feature vector of the current input colonoscopy image; Among them, the Encoder-Decoder model includes an image input layer, an encoding layer, a feature vector layer, a decoding layer and an image output layer.
6. The method according to claim 5, characterized in that The colonoscopy part category of each colonoscopy image is identified according to the feature vector of each colonoscopy image, and the initial colonoscopy part category corresponding to each colonoscopy image is obtained, including: A pre-trained image classification model is used to learn the feature vector of each colonoscopy image to obtain the initial colonoscopy site category corresponding to each colonoscopy image; The image classification model includes an image input layer, a coding layer, a feature vector layer, a linear layer and a category output layer. The image input layer, coding layer and feature vector layer in the image classification model reuse the image input layer, coding layer and feature vector layer in the Encoder-Decoder model.
7. A device for recognizing the position of a colonoscopy based on the image features of the colonoscopy, characterized in that: The device comprises: A feature extraction module is used to extract feature vectors from each enteroscope image collected during the enteroscope process; The first category recognition module is used to identify the colonoscopy part category of each colonoscopy image according to the feature vector of each colonoscopy image, and obtain the initial colonoscopy part category corresponding to each colonoscopy image; The feature extraction module is also used to extract feature vectors from the target colonoscopy image collected during the colonoscopy withdrawal process to obtain a target feature vector of the target colonoscopy image; The vector calculation module is used to calculate the vector distance between the target feature vector and the feature vector of each colonoscopy image, select a preset number of colonoscopy images in the order of vector distance from small to large, and use the colonoscopy part categories corresponding to the selected colonoscopy images as samples to form a sample subset. The colonoscopy part categories corresponding to the selected colonoscopy images as samples to form a sample subset include: using the feature vectors of the colonoscopy images and the corresponding updated colonoscopy site categories as a sample, calculating the vector distance between the low-dimensional target feature vector after dimensionality reduction calculation and the low-dimensional feature vector of each in-scope colonoscopy image after dimensionality reduction calculation, and selecting a preset number of samples in order of the vector distance between the low-dimensional feature vector and the low-dimensional feature vector from small to large to form a sample subset; A second category recognition module is used to count the colonoscopic part categories corresponding to each sample in the sample subset, and use the colonoscopic part categories whose counted number is greater than or equal to one-half of the number of samples in the sample subset as the colonoscopic part category of the target colonoscopic image; The device further comprises a category correction module, which is used to correct the initial colonoscopy part category corresponding to each in-scope colonoscopy image to obtain a corrected colonoscopy part category; Furthermore, the category correction module is specifically used to obtain the distribution density of the in-guineascope images of different initial colonoscopy part categories in the image set composed of all the in-guineascope images, and use the image distribution area with the highest distribution density corresponding to the in-guineascope images of each initial colonoscopy part category as the category interval of the corresponding colonoscopy part category, and the in-guineascope images in the image set are sorted according to the image acquisition time; the initial colonoscopy part categories of the in-guineascope images in each category interval are all corrected to the colonoscopy part categories corresponding to the category interval to which they belong, or the initial colonoscopy part categories of the in-guineascope images whose part categories are not unknown in each category interval are all corrected to the colonoscopy part categories corresponding to the category interval to which they belong.
8. A computer device, characterized in that: comprising a memory, a processor, and a computer program stored in the memory and executable on the processor; When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
