Endoscopic image deduplication method, device, computer equipment, readable storage medium and program product
Through the combination of the difference recognition model and the image quality assessment model based on endoscopic image triples, the problem of low deduplication efficiency of endoscopic images is solved, efficient image deduplication and quality screening are achieved, and doctors' reading is improved. efficiency.
Patent Information
- Application Number
- CN202410816332.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-06-24
AI Technical Summary
In the existing technology, the deduplication efficiency of endoscopic images is low, and it is difficult to effectively identify and remove a large number of similar endoscopic images with different local details. As a result, doctors need to process a large number of duplicate images when reading films, which affects efficiency.
A difference recognition model based on endoscopic image triples is used for self-supervised training. The differences between images are identified and grouped. The image quality assessment model is combined with the image quality assessment model to select images that meet the conditions as retained images to achieve endoscopic image removal. Heavy.
It significantly improves the efficiency of endoscopic image deduplication, retains high-quality images, reduces doctors' reading burden, and improves diagnostic efficiency.
Smart Images

Figure CN118410192B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of medical image processing, and in particular to an endoscopic image deduplication method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of medical equipment technology, endoscopy has become a common medical diagnostic method. Portable capsule endoscopy, as one of them, has attracted widespread attention and application due to its many advantages. However, portable capsule endoscopy will take a large number of endoscopic images during use, and the number of images that analysts need to browse is much higher than that of electronic gastroscopes that are manually controlled to take pictures.
[0003] In related technologies, in order to improve analysts' reading efficiency, the endoscopic images taken are deduplicated using a hash algorithm. Specifically, the hash value of the image is calculated, and the similarities between different endoscopic images are determined by comparing the hash values of different images.
[0004] However, most of the collected endoscopic images have the same tone and similar overall content, with only local details that differ. After deduplication using traditional hashing algorithms, a large number of similar endoscopic images are still retained. It can be seen that the efficiency of deduplication of endoscopic images in related technologies still needs to be improved. Summary of the invention
[0005] Based on this, it is necessary to provide an endoscopic image deduplication method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the efficiency of endoscopic image deduplication in response to the above-mentioned technical problems.
[0006] In a first aspect, the present application provides an endoscopic image deduplication method, comprising:
[0007] Acquire multiple redundant endoscopic images collected by capsule endoscopy;
[0008] The redundant endoscopic images are input into a trained difference recognition model, and the difference recognition model determines the difference between the input redundant endoscopic images; the difference recognition model is obtained by self-supervised training based on endoscopic image triplets, each of which includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image;
[0009] Grouping the redundant endoscopic images according to the difference to obtain an endoscopic image set, and screening out images that meet image quality conditions from each of the endoscopic image sets as retained images;
[0010] The endoscopic image deduplication result is obtained according to the retained images corresponding to each of the endoscopic image sets.
[0011] In one embodiment, the difference recognition model is trained by the following steps:
[0012] Acquire endoscopic image triplets; each of the endoscopic image triplets includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image;
[0013] Inputting the endoscopic image triplet into a difference recognition model to be trained, obtaining a first image feature corresponding to the first sample endoscopic image, a second image feature corresponding to the second sample endoscopic image, and a third image feature corresponding to the third sample endoscopic image by the difference recognition model, and determining a first lowest common ancestor feature corresponding to the first image feature and the second image feature, and a second lowest common ancestor feature of the first image feature, the second image feature, and the third image feature;
[0014] Determining a model loss value according to the proximity of each of the first image feature, the second image feature, and the third image feature to the first lowest common ancestor feature and the second lowest common ancestor feature;
[0015] The model parameters of the difference recognition model are adjusted according to the model loss value to obtain a trained difference recognition model.
[0016] In one embodiment, determining the model loss value according to the proximity of the first image feature, the second image feature, and the third image feature to the first lowest common ancestor feature and the second lowest common ancestor feature, comprises:
[0017] Obtaining a first distance between the first image feature and the first lowest common ancestor feature, and a second distance between the first image feature and the second lowest common ancestor feature, and determining a first difference value of the first distance minus the second distance;
[0018] Obtaining a third distance between the second image feature and the first lowest common ancestor feature, and a fourth distance between the second image feature and the second lowest common ancestor feature, and determining a second difference value of the third distance minus the fourth distance;
[0019] Obtaining a fifth distance between the third image feature and the second lowest common ancestor feature, and a sixth distance between the third image feature and the first lowest common ancestor feature, and determining a third difference value of the fifth distance minus the sixth distance;
[0020] The model loss value is determined according to the first difference, the second difference and the third difference; the model loss value is positively correlated with the first difference, the second difference and the third difference.
[0021] In one embodiment, grouping the redundant endoscopic images according to the difference comprises:
[0022] Determine, from the redundant endoscopic images, a reference endoscopic image as a reference object, and images to be grouped whose shooting time is later than the shooting time of the reference endoscopic image;
[0023] If the difference between the image to be grouped and the reference endoscopic image is less than or equal to a first threshold, determining that the image to be grouped and the reference endoscopic image belong to the same endoscopic image set;
[0024] If the difference between the image to be grouped and the reference endoscopic image is greater than the first threshold and less than the second threshold, the image to be grouped is determined to be a potentially similar image, and when multiple potentially similar images and the endoscopic image set are continuous, the multiple potentially similar images and the reference endoscopic image are classified into the same endoscopic image set.
[0025] In one embodiment, the step of acquiring a plurality of redundant endoscopic images acquired by capsule endoscopy includes:
[0026] Acquire multiple endoscopic images collected by a capsule endoscope, and screen out multiple redundant endoscopic images that meet image quality conditions from the multiple endoscopic images through an image quality assessment model;
[0027] The image quality assessment model is trained through the following steps:
[0028] Performing mask processing on the initial sample endoscopic image to obtain a masked endoscopic image;
[0029] Inputting the masked endoscopic image into an image quality assessment model to be trained, performing convolution processing on the masked endoscopic image by the image quality assessment model to obtain masked image features, and predicting a complete endoscopic image based on the masked image features;
[0030] According to the difference between the complete endoscopic image and the initial sample endoscopic image, adjusting the model parameters of the image quality assessment model to obtain a pre-trained image quality assessment model;
[0031] Based on the sample endoscopic images carrying the image quality classification labels, the pre-trained image quality assessment model is fine-tuned to obtain a trained image quality assessment model.
[0032] In one embodiment, performing mask processing on the initial sample endoscopic image to obtain a masked endoscopic image includes:
[0033] Get masks of multiple sizes;
[0034] The initial sample endoscopic images are respectively subjected to mask processing using the masks of the multiple sizes to obtain multiple mask endoscopic images with different mask area sizes.
[0035] In a second aspect, the present application also provides an endoscopic image deduplication device, comprising:
[0036] An image acquisition module, used to acquire multiple redundant endoscopic images collected by the capsule endoscope;
[0037] A difference recognition module is used to input the redundant endoscopic images into a trained difference recognition model, and the difference recognition model determines the difference between the input redundant endoscopic images; the difference recognition model is obtained by self-supervised training based on endoscopic image triplets, each of which includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image;
[0038] a deduplication module, configured to group the redundant endoscopic images according to the difference to obtain an endoscopic image set, and select images that meet image quality conditions from each of the endoscopic image sets as retained images;
[0039] The deduplication result acquisition module is used to obtain the endoscopic image deduplication result according to the retained images corresponding to each of the endoscopic image sets.
[0040] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0041] Acquire multiple redundant endoscopic images collected by capsule endoscopy;
[0042] The redundant endoscopic images are input into a trained difference recognition model, and the difference recognition model determines the difference between the input redundant endoscopic images; the difference recognition model is obtained by self-supervised training based on endoscopic image triplets, each of which includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image;
[0043] Grouping the redundant endoscopic images according to the difference to obtain an endoscopic image set, and screening out images that meet image quality conditions from each of the endoscopic image sets as retained images;
[0044] The endoscopic image deduplication result is obtained according to the retained images corresponding to each of the endoscopic image sets.
[0045] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0046] Acquire multiple redundant endoscopic images collected by capsule endoscopy;
[0047] The redundant endoscopic images are input into a trained difference recognition model, and the difference recognition model determines the difference between the input redundant endoscopic images; the difference recognition model is obtained by self-supervised training based on endoscopic image triplets, each of which includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image;
[0048] Grouping the redundant endoscopic images according to the difference to obtain an endoscopic image set, and screening out images that meet image quality conditions from each of the endoscopic image sets as retained images;
[0049] The endoscopic image deduplication result is obtained according to the retained images corresponding to each of the endoscopic image sets.
[0050] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0051] Acquire multiple redundant endoscopic images collected by capsule endoscopy;
[0052] The redundant endoscopic images are input into a trained difference recognition model, and the difference recognition model determines the difference between the input redundant endoscopic images; the difference recognition model is obtained by self-supervised training based on endoscopic image triplets, each of which includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image;
[0053] Grouping the redundant endoscopic images according to the difference to obtain an endoscopic image set, and screening out images that meet image quality conditions from each of the endoscopic image sets as retained images;
[0054] The endoscopic image deduplication result is obtained according to the retained images corresponding to each of the endoscopic image sets.
[0055] The above-mentioned endoscopic image deduplication method, device, computer equipment, computer-readable storage medium and computer program product can obtain multiple redundant endoscopic images collected by capsule endoscopy, input the redundant endoscopic images into a trained difference recognition model, and determine the difference between the input redundant endoscopic images by the difference recognition model; wherein the difference recognition model is obtained by self-supervised training based on endoscopic image triplets, each endoscopic image triplet includes a similar first sample endoscopic image and a second sample endoscopic image, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image; then, the redundant endoscopic images can be grouped according to the difference to obtain an endoscopic image set, and images that meet the image quality conditions are screened out from each endoscopic image set as retained images; and then, the endoscopic image deduplication results can be obtained according to the retained images corresponding to each endoscopic image set. In this embodiment, on the one hand, by using endoscopic image triplets to train a difference recognition model, the model can effectively recognize the differences between redundant endoscopic images, so that multiple redundant endoscopic images can be accurately grouped according to the acquired differences; on the other hand, by screening out images that meet image quality conditions from each endoscopic image set as retained images, long sequence images can be effectively deduplicated while avoiding filtering out different endoscopic images, and high-quality endoscopic images can be retained, thereby providing physicians with high-quality endoscopic images without duplication or omission, significantly improving the efficiency of endoscopic image deduplication. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 is a schematic flow chart of a method for deduplication of endoscopic images in one embodiment;
[0058] Figure 2 is a schematic diagram of a mask image feature extraction process in one embodiment;
[0059] Figure 3 A schematic diagram of a flow chart of steps for training a difference recognition model in one embodiment;
[0060] Figure 4a is a schematic diagram of an endoscopic image sequence in one embodiment;
[0061] Figure 4b is a schematic diagram of another endoscopic image sequence in one embodiment;
[0062] Figure 5 is a flow chart of another endoscopic image deduplication method in one embodiment;
[0063] Figure 6 is a structural block diagram of an endoscopic image deduplication device in one embodiment;
[0064] Figure 7 is an internal structure diagram of a computer device in one embodiment;
[0065] Figure 8 The figure is a diagram of the internal structure of another computer device in one embodiment. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0067] In order to enable those skilled in the art to better understand the present application, the relevant technology is first introduced below.
[0068] With the development of medical equipment technology, endoscopy has become a common medical diagnostic method. Among them, capsule gastroscopy, as a non-invasive, painless and non-intrusive examination tool, has received extensive attention and application. Compared with the traditional magnetically controlled capsule gastroscopy, which requires large magnetically controlled equipment, professional operators and is expensive, the portable capsule gastroscopy can be completed by the target object through body position change. It has unique characteristics such as full scene, low threshold, low resources and low price.
[0069] In actual applications, portable capsule endoscopes will continue to take endoscopic images during use until the battery runs out or the program is terminated, so the number of images that the reading physician needs to browse is much higher than that of the electronic gastroscope that takes photos manually. In addition, portable capsule endoscopes sometimes produce a large number of duplicate images of the same part, which not only greatly increases the workload of the reading physician, but also easily submerges the images containing lesions in a pile of duplicate images, making it difficult for the reading physician to pay attention in time and causing omissions.
[0070] In related technologies, in order to improve the efficiency of analysts' reading, the endoscopic images taken are deduplicated through a hash algorithm. Specifically, the hash value of the image is calculated, and the hash values of different images are compared to determine whether different endoscopic images are similar. However, most of the endoscopic images collected have the same color tone and similar overall content, with only local details that differ. The hash algorithm is difficult to perform well in this scenario.
[0071] Based on this, the present application provides an endoscopic image deduplication method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the efficiency of endoscopic image deduplication, so as to at least solve the problem of low efficiency of endoscopic image deduplication in related technologies.
[0072] In one embodiment, Figure 1 As shown, a method for deduplication of endoscopic images is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In some exemplary embodiments, the terminal can be, but is not limited to, various medical devices, personal computers, laptops, smart phones, tablet computers, etc.; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0073] In this embodiment, the method may include the following steps:
[0074] S101, acquiring a plurality of redundant endoscopic images collected by a capsule endoscope.
[0075] Exemplarily, the capsule endoscope may be a portable capsule endoscope, such as a portable capsule gastroscope, through which gastroscopic images may be collected; or it may be other types of capsule endoscopes, such as a magnetically controlled capsule endoscope.
[0076] In this step, communication can be performed with the capsule endoscope to obtain multiple redundant endoscopic images captured by the capsule endoscope based on the images provided by the capsule endoscope, wherein the multiple redundant endoscopic images can be understood as an endoscopic image sequence including multiple identical or similar endoscopic images.
[0077] In some embodiments, the multiple redundant endoscopic images may be all endoscopic images collected by the capsule endoscope during the examination process, such as all endoscopic images collected by a single endoscopic examination, or all endoscopic images collected by multiple endoscopic examinations of the same target object; in other embodiments, the multiple redundant endoscopic images may also be endoscopic images obtained after preliminary screening of all endoscopic images collected by the capsule endoscope. For example, all endoscopic images collected by the capsule endoscope may be screened according to image quality and / or tissue structure targeted by the endoscopic images, and the screened endoscopic images may be used as multiple redundant endoscopic images.
[0078] S102, input the redundant endoscopic images into a trained difference recognition model, and the difference recognition model determines the difference between the input redundant endoscopic images; the difference recognition model is obtained by self-supervised training based on endoscopic image triplets, each endoscopic image triplet includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image.
[0079] In practical applications, the difference recognition model can be pre-trained. The difference recognition model is obtained by self-supervised training based on endoscopic image triplets, each of which includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image. In some exemplary embodiments, when training the model, the endoscopic image triplets can be input into the model, and the difference recognition model can be used to perform pairwise recognition of the images to determine the differences between the two images, and then determine the model training effect based on the accuracy of the model's judgment on the image differences, and continue to adjust the model parameters of the difference recognition model.
[0080] That is, in the present embodiment, in the process of training the difference recognition model, the difference recognition model does not need to distinguish the category to which the endoscopic image belongs, but only needs to judge the difference between one sample endoscopic image and another sample endoscopic image. By using the endoscopic image triplet training model, on the one hand, it can be determined whether the model can accurately judge the difference between the endoscopic images, that is, whether it can be identified that the difference between the first sample endoscopic image and the second sample endoscopic image is smaller than the difference between the first sample endoscopic image and the third sample endoscopic image, and that the difference between the first sample endoscopic image and the second sample endoscopic image is smaller than the difference between the second sample endoscopic image and the third sample endoscopic image, thereby prompting the difference recognition model to learn more implicit feature information related to difference recognition during the training process. Compared with the supervised learning method of category labeling, the present embodiment can learn more fine-grained effective information and improve the accuracy of difference recognition. On the other hand, when obtaining training samples, the staff only needs to mark whether the sample endoscopic images are similar or dissimilar. Compared with the fine-grained determination of the category to which the sample endoscopic image belongs, it can effectively save labeling time and improve labeling efficiency.
[0081] Furthermore, after acquiring a plurality of redundant endoscopic images, the redundant endoscopic images can be input into a trained difference recognition model, which determines the difference between the redundant endoscopic images input into the model, wherein each time the redundant endoscopic images input into the difference recognition model include at least two, and the difference recognition model can recognize the difference between every two redundant endoscopic images, or in another embodiment, the difference recognition model can recognize the difference between three or more redundant endoscopic images in addition to recognizing the difference between two redundant endoscopic images.
[0082] In some optional embodiments, redundant endoscopic images can be input into the model multiple times according to the need for comparison. For example, one image can be determined from multiple redundant endoscopic images as a reference endoscopic image, and then the difference between other redundant images and the same reference endoscopic image can be compared. In each comparison, a redundant endoscopic image for comparison can be determined from the multiple redundant endoscopic images except the reference image, and the image and the reference endoscopic image can be input into the model. Repeating the above steps multiple times can obtain the difference between different redundant endoscopic images and the same reference endoscopic image.
[0083] Of course, in some other embodiments, all redundant endoscopic images may be input into a difference recognition model, which in batches determines the difference between each redundant endoscopic image and any other redundant endoscopic image, outputs and records it, and then subsequently obtains specified data from the recorded differences according to processing requirements.
[0084] S103, grouping the redundant endoscopic images according to the difference to obtain an endoscopic image set, and screening out images that meet the image quality condition from each endoscopic image set as retained images.
[0085] In specific implementations, capsule endoscopes sometimes take hundreds or even thousands of pictures of the same part. It is often difficult to effectively deduplicate a large number of pictures using traditional hash algorithms or other deduplication algorithms.
[0086] In this regard, in this embodiment, after obtaining multiple degrees of difference, multiple similar redundant endoscopic images can be determined based on the degrees of difference and merged into the same endoscopic image set, thereby obtaining multiple endoscopic image sets. The same endoscopic image set can contain multiple similar redundant endoscopic images, and the images in different endoscopic image sets are not similar.
[0087] Then, images that meet the image quality conditions can be screened out from each endoscopic image set as retained images. For example, for each endoscopic image set, K (K is a positive integer) images whose image quality meets the quality conditions can be selected as retained images based on the quality scores corresponding to each redundant endoscopic image in the set. For example, a redundant endoscopic image with the highest quality score can be used as a retained image. Compared with the traditional deduplication algorithm that randomly selects retained images from similar images, which affects the quality of the retained images, in this embodiment, by screening out images that meet the image quality conditions from each endoscopic image set, the quality of film reading can be effectively improved.
[0088] S104, obtaining endoscopic image deduplication results according to the retained images corresponding to each endoscopic image set.
[0089] After selecting the retained images from each endoscopic image set, each retained image may be used as an endoscopic image deduplication result.
[0090] In the above-mentioned endoscopic image deduplication method, multiple redundant endoscopic images collected by capsule endoscopy can be obtained, and the redundant endoscopic images can be input into a trained difference recognition model, and the difference recognition model determines the difference between the input redundant endoscopic images; wherein the difference recognition model is obtained by self-supervised training based on endoscopic image triplets, and each endoscopic image triplet includes a similar first sample endoscopic image and a second sample endoscopic image, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image; then, the redundant endoscopic images can be grouped according to the difference to obtain an endoscopic image set, and images that meet the image quality conditions are screened out from each endoscopic image set as retained images; and then, the endoscopic image deduplication results can be obtained according to the retained images corresponding to each endoscopic image set. In this embodiment, on the one hand, by using endoscopic image triplets to train a difference recognition model, the model can effectively recognize the differences between redundant endoscopic images, so that multiple redundant endoscopic images can be accurately grouped according to the acquired differences; on the other hand, by screening out images that meet image quality conditions from each endoscopic image set as retained images, long sequence images can be effectively deduplicated while avoiding filtering out different endoscopic images, and high-quality endoscopic images can be retained, thereby providing physicians with high-quality endoscopic images without duplication or omission, significantly improving the efficiency of endoscopic image deduplication.
[0091] In specific implementations, multiple endoscopic images collected by the capsule endoscope may be blurred, overexposed, or too dark. For example, during the use of the capsule endoscope, the capsule endoscope may move rapidly due to changes in the position of the target object, which may cause the pictures taken by the capsule endoscope to be blurred. In addition, due to the sudden change in the distance between the capsule endoscope and the digestive organs such as the stomach wall, the pictures taken before the light source is adjusted may be overexposed or too dark. As a result, there will be multiple endoscopic images with low image quality in the capsule endoscope, and traditional deduplication algorithms (such as hash algorithms) will retain a large number of these low-quality pictures, significantly reducing the efficiency of doctors' reading.
[0092] In this regard, in one embodiment, step S101, obtaining a plurality of redundant endoscopic images collected by a capsule endoscope, may include the following steps:
[0093] A plurality of endoscopic images collected by a capsule endoscope are obtained, and a plurality of redundant endoscopic images that meet image quality requirements are screened out from the plurality of endoscopic images through an image quality assessment model.
[0094] In practical applications, an image quality assessment model can be pre-trained, and the image quality assessment model can be used to assess the image quality of endoscopic images and determine whether there are image quality problems with endoscopic images. After obtaining multiple endoscopic images collected by capsule endoscopy, the multiple endoscopic images can be input into the trained image quality assessment model, which identifies the image quality of the input endoscopic images and selects endoscopic images that meet the image quality conditions as multiple redundant endoscopic images. In this way, low-quality images that do not meet the image quality conditions can be effectively filtered out, which can effectively avoid the situation where low-quality images interfere with doctors' reading of films, while reducing the subsequent data processing volume and improving the efficiency of endoscopic image deduplication.
[0095] In some embodiments, the image quality assessment model can be a classification model. For example, the image quality assessment model can classify endoscopic images into blurred images, overexposed images, too dark images, and high-quality images. After being processed by the image quality assessment model, multiple endoscopic images of the type of high-quality images can be used as multiple redundant endoscopic images, and other low-quality images (including the blurred images, overexposed images, or too dark images mentioned above) can be filtered. In addition, the image quality assessment model can also be used to determine the image quality score. In some examples, in addition to classifying the images, the image quality model can also output the image quality scores corresponding to the high-quality images, such as the confidence of the high-quality category, for subsequent other processing.
[0096] Among them, the image quality assessment model can be trained through the following steps:
[0097] S1, performing mask processing on the initial sample endoscopic image to obtain a masked endoscopic image.
[0098] In this step, an initial sample endoscopic image can be obtained, and the initial sample endoscopic image can be understood as an image that has not been masked. After obtaining the initial sample endoscopic image, a masking process can be randomly performed on the initial sample endoscopic image, that is, a partial area of the initial sample endoscopic image is randomly masked to obtain a masked endoscopic image with a partial image area blocked.
[0099] S2, inputting the masked endoscopic image into the image quality assessment model to be trained, the image quality assessment model performs convolution processing on the masked endoscopic image to obtain masked image features, and predicting the complete endoscopic image based on the masked image features.
[0100] After obtaining the masked endoscopic image, it can be input into the image quality assessment model to be trained, wherein the image quality assessment model can be a convolutional neural network. After obtaining the input masked endoscopic image, the image quality assessment model can use the convolution kernel in the model to perform convolution processing on the masked endoscopic image, obtain the masked image features corresponding to the masked endoscopic image according to the convolution processing result, and then try to predict and restore the masked part of the masked endoscopic image according to the masked image features to obtain the complete endoscopic image. Figure 2 As shown, the occluded input image can be convolved by the image quality assessment model to obtain hierarchical features, in which some areas are not processed due to the existence of masks. Subsequently, predictions can be made based on the hierarchical features to obtain the decoding target, that is, the complete endoscopic image.
[0101] S3, according to the difference between the complete endoscopic image and the initial sample endoscopic image, the module parameters of the feature extraction module are adjusted to obtain a pre-trained image quality assessment model.
[0102] After obtaining the complete endoscopic image, the difference between the complete endoscopic image and the initial sample endoscopic image can be determined to determine whether the model can currently effectively restore the original image based on the masked image. In this step, the module parameters of the feature extraction module can be adjusted according to the difference between the complete endoscopic image and the initial sample endoscopic image. For example, the model loss value of the image quality assessment model can be determined according to the difference between the complete endoscopic image and the initial sample endoscopic image. The loss value is positively correlated with the difference between the complete endoscopic image and the initial sample endoscopic image, that is, the smaller the difference between the complete endoscopic image and the initial sample endoscopic image, the smaller the model loss value, and the better the model training effect. By iterating the above process until the training end condition is met, a pre-trained image quality assessment model can be obtained.
[0103] S4, based on the sample endoscopic images carrying the image quality classification labels, fine-tune the pre-trained image quality assessment model to obtain a trained image quality assessment model.
[0104] The pre-trained image quality assessment model has acquired excellent feature extraction capabilities through the above method and can accurately extract relevant image features from endoscopic images. In this step, based on the pre-trained image quality assessment model, the model can be further fine-tuned using sample endoscopic images carrying image quality classification labels to obtain a trained image quality assessment model that can be used to classify image quality conditions.
[0105] Specifically, the sample endoscopic images carrying image quality classification labels can be used to supervise the pre-trained image quality assessment model. On the one hand, a classification module (also called a classification head) can be added to the pre-trained image quality assessment model. The classification module can predict the category to which the image belongs based on the image features extracted by the model to obtain the classification result; on the other hand, multiple sample endoscopic images carrying image quality classification labels can be obtained, such as blurred, overexposed, too dark or high quality classification labels. Then, the sample endoscopic images can be input into the pre-trained image quality assessment model, and the model can extract the image features corresponding to the input images, predict the image classification results based on the image features, and fine-tune the model parameters of the image quality assessment model based on the difference between the image classification results and the classification labels until the training end conditions are met to obtain a trained image quality assessment model.
[0106] In some examples, the masked image, i.e., the masked endoscopic image, can be represented as a two-dimensional sparse pixel array, in which the pixels in the masked area can be represented by 0. During pre-training, the standard convolution (also called ordinary convolution) can be replaced with a sparse convolution (submanifold sparse convolution), which allows the model to operate only on visible data points and avoid a large number of convolutions on the "0" in the masked area, saving computing resources while improving processing efficiency. In the classification stage of fine-tuning, the sparse convolution can be directly replaced with the standard convolution without any additional operations.
[0107] In this embodiment, the image quality assessment model is built based on the CMAE (Conv Masked Autoencoders) framework, which combines the idea of MAE (Masked Autoencoders) with the convolution processing of the neural network, and performs self-supervised learning training on the model, which can force the model to learn the global and local features of the endoscopic image, thereby improving its generalization for pictures of different qualities and the accuracy of image feature extraction.
[0108] In addition, compared with the use of fully connected layers in MAE to generate masks and reconstruct images, this embodiment obtains mask image features by performing convolution processing on the masked endoscopic image, which can reduce the amount of parameters and calculations while maintaining spatial information, thereby improving the image processing efficiency of the image quality assessment model.
[0109] In one embodiment, in step S1, masking is performed on the initial sample endoscopic image to obtain a masked endoscopic image, which may include the following steps:
[0110] Obtain masks of multiple sizes; and use the masks of multiple sizes to perform mask processing on the initial sample endoscopic image respectively to obtain multiple mask endoscopic images with different mask area sizes.
[0111] In this embodiment, the initial sample endoscopic image can be masked using multiple masks of different sizes. For example, each of the multiple initial sample endoscopic images obtained can be processed using a mask of a certain size. The sizes of the masks used for the multiple initial sample endoscopic images can be different, so that the multiple masked endoscopic images obtained can have different mask area sizes, that is, the masked ranges in the multiple masked endoscopic images are different.
[0112] In this embodiment, by using masks of multiple sizes to mask the initial sample endoscopic images respectively, and then using multiple masked endoscopic images with different mask area sizes to train the image quality assessment model, the model's perception ability of features of different scales can be effectively increased, so that when the image quality assessment model extracts features from different image contents, the feature extraction accuracy can be effectively increased.
[0113] In one embodiment, Figure 3 As shown, the difference recognition model can be trained through the following steps:
[0114] S301, obtaining endoscopic image triplets; each endoscopic image triplet includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image.
[0115] In this step, a plurality of pre-constructed endoscopic image triplets may be obtained, each of which includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image.
[0116] S302, input the endoscopic image triplet into the difference recognition model to be trained, and the difference recognition model obtains the first image feature corresponding to the first sample endoscopic image, the second image feature corresponding to the second sample endoscopic image, and the third image feature corresponding to the third sample endoscopic image, and determines the first lowest common ancestor feature corresponding to the first image feature and the second image feature, and the second lowest common ancestor feature of the first image feature, the second image feature and the third image feature.
[0117] The lowest common ancestor (LCA) feature corresponding to at least two features can be understood as a feature that is similar to each of the at least two features and has the highest overall similarity; by adjusting the lowest common ancestor feature, any one of the at least two features can be obtained most quickly. For ease of distinction, in this embodiment, the lowest common ancestor feature of the first image feature and the second image feature is referred to as the first lowest common ancestor feature, and the lowest common ancestor feature of the first image feature, the second image feature, and the third image feature is referred to as the second lowest common ancestor feature.
[0118] In order to enable those skilled in the art to better understand the present embodiment, the relevant concepts are first explained below.
[0119] In practical applications, the image features of different images can be mapped to the same feature space, and the degree of similarity or difference between different images can be determined by comparing the distance of image features in the feature space. Modeling in different feature spaces actually implies different data distribution assumptions. Traditional methods mainly measure the similarity of image features in Euclidean space. However, for tree-like hierarchical data, the number of nodes increases exponentially with the number of layers in the tree. If the tree is embedded in a low-dimensional Euclidean space, serious distortion will occur, resulting in the two feature points being very close in the Euclidean space, but far apart in the tree structure.
[0120] The inventors found in practice that embedding the tree structure into the hyperbolic space can achieve excellent distance preservation. Taking a two-dimensional hyperbolic surface as an example, the corresponding Poincare disk is a two-dimensional disk. For two points on the Poincare disk that are equidistant from the center of the circle, the farther the distance between the points and the center of the circle, the greater the curvature of the line between the points in the corresponding position of the hyperbolic space (i.e., the hyperbolic surface), and the longer the distance between the points on the hyperbolic surface, which is similar to the node distance in the tree structure.
[0121] Based on this, in this embodiment, the image features of redundant endoscopic images are mapped to the hyperbolic space, and the hierarchical information implicit in the data is captured by learning the hierarchical representation of the image features in the hyperbolic space. Then, based on the proximity of the image features in the hyperbolic space, the similarity between the redundant endoscopic images is effectively identified.
[0122] In this step, the obtained endoscopic image triplet can be input into the difference recognition model to be trained, and the difference recognition model performs feature extraction to obtain the first image feature corresponding to the first sample endoscopic image, the second image feature corresponding to the second sample endoscopic image, and the third image feature corresponding to the third sample endoscopic image, wherein the first image feature and the second image feature can be neighboring samples in the hyperbolic space. Then, the difference recognition model calculates the first lowest common ancestor feature corresponding to the first image feature and the second image feature, and the second lowest common ancestor feature of the first image feature, the second image feature, and the third image feature based on the model parameters.
[0123] S303, determining a model loss value according to the proximity of the first image feature, the second image feature, and the third image feature to the first lowest common ancestor feature and the second lowest common ancestor feature.
[0124] S304, adjusting the model parameters of the difference recognition model according to the model loss value to obtain a trained difference recognition model.
[0125] It can be understood that the degree of proximity between the first image feature and the second image feature and the first lowest common ancestor feature should be different from the degree of proximity between the first image feature and the second image feature and the second lowest common ancestor feature, and the former degree of proximity will be greater than the latter. Similarly, the degree of proximity between the third image feature and the first lowest common ancestor feature should be different from the degree of proximity between the third image feature and the second lowest common ancestor feature, and the former degree of proximity will be less than the latter.
[0126] Based on the above concept, the model loss value can be determined according to the degree of proximity of the first image feature, the second image feature and the third image feature to the first lowest common ancestor feature and the second lowest common ancestor feature. By adjusting according to the model loss value, the first image feature and the second image feature are at the same level, and the third image feature and the first image feature or the second image feature are at a different level, so that a tree-like hierarchical structure is formed between the image features, which is convenient for effectively distinguishing the differences between endoscopic image samples.
[0127] In this embodiment, by determining the first lowest common ancestor feature and the second lowest common ancestor feature, and according to the degree of proximity of the first image feature, the second image feature, and the third image feature to the first lowest common ancestor feature and the second lowest common ancestor feature, the model loss value is determined and the model parameters of the difference recognition model are adjusted. This enables the trained difference recognition model to effectively extract different levels of features of similar images, thereby improving the accuracy of difference recognition.
[0128] In one embodiment, S303, determining the model loss value according to the proximity of the first image feature, the second image feature, and the third image feature to the first lowest common ancestor feature and the second lowest common ancestor feature may include the following steps:
[0129] Obtain a first distance between the first image feature and the first lowest common ancestor feature, and a second distance between the first image feature and the second lowest common ancestor feature, and determine a first difference of the first distance minus the second distance; obtain a third distance between the second image feature and the first lowest common ancestor feature, and a fourth distance between the second image feature and the second lowest common ancestor feature, and determine a second difference of the third distance minus the fourth distance; obtain a fifth distance between the third image feature and the second lowest common ancestor feature, and a sixth distance between the third image feature and the first lowest common ancestor feature, and determine a third difference of the fifth distance minus the sixth distance; determine the model loss value based on the first difference, the second difference and the third difference; the model loss value is positively correlated with the first difference, the second difference and the third difference.
[0130] In this embodiment, the purpose of the loss function is, on the one hand, to make the first image feature and the second image feature as close as possible to their first lowest common ancestor feature, and away from the second lowest common ancestor feature related to the irrelevant third image feature. Based on this, the model loss value is positively correlated with the first difference and the second difference, that is, the closer the first distance of the first image feature to the first lowest common ancestor feature and the farther the second distance from the second lowest common ancestor feature, the smaller the first difference, and the model loss value decreases accordingly; the influence of the second difference on the model loss value is the same as this, which will not be repeated here.
[0131] On the other hand, the third image feature is also made closer to the second lowest common ancestor feature and farther away from the first lowest common ancestor feature, that is, the closer the fifth distance between the third image feature and the second lowest common ancestor feature and the farther the sixth distance from the first lowest common ancestor feature, the smaller the third difference value and the corresponding decrease in the model loss value. As a result, the first lowest common ancestor feature will be further away from the center of the corresponding Poincare disk, represented as a low-level category center, while the second lowest common ancestor feature will be closer to the center of the Poincare disk, represented as a high-level category center, so that a tree-like hierarchical structure is formed between the samples, and the first image feature, the second image feature and the third image feature are also accurately distributed at the corresponding levels.
[0132] In some optional embodiments, the model loss value L may be determined as follows:
[0133] L=[d H (x i ,ρ ij )-d H (x i ,ρ ijk )+δ]+[ d H (x j ,ρ ij )-d H (x j ,ρ ijk ) +δ]+[ d H (x k ,ρ ijk )-d H (x k ,ρ ij ) +δ]
[0134] Among them, x i is the first image feature, x j is the second image feature, x k is the third image feature, ρ ij is the first lowest common ancestor characteristic, ρ ijk is the second lowest common ancestor feature, and δ is used to control the model loss value and can be set to 0.1.
[0135] In one embodiment, grouping redundant endoscopic images according to differences may include the following steps:
[0136] A reference endoscopic image as a reference object and an image to be grouped whose shooting time is after the shooting time of the reference endoscopic image are determined from redundant endoscopic images; if the difference between the image to be grouped and the reference endoscopic image is less than or equal to a first threshold, the image to be grouped and the reference endoscopic image are determined to belong to the same endoscopic image set; if the difference between the image to be grouped and the reference endoscopic image is greater than the first threshold and less than a second threshold, the image to be grouped is determined to be a potentially similar image, and when multiple potentially similar images and the endoscopic image set are continuous, the multiple potentially similar images and the reference endoscopic image are classified into the same endoscopic image set.
[0137] The first threshold is smaller than the second threshold, the first threshold is also called a low threshold, and the second threshold is also called a high threshold.
[0138] In the process of deduplication of long sequence images, if the similarity threshold is set too low (or the difference threshold is set too high), although different images (such as images of different parts) will not be lost, the deduplication effect will be poor. If the similarity threshold is set too high (or the difference threshold is set too low), although the deduplication effect is good, it will cause the loss of images of some parts.
[0139] In this regard, in this embodiment, the timestamps of each redundant endoscopic image can be used to determine the shooting time of each redundant endoscopic image. After determining the reference endoscopic image as a reference object for comparison from the redundant endoscopic images, multiple images to be grouped whose shooting time is after the shooting time of the reference endoscopic image can be obtained based on the shooting time of other redundant endoscopic images.
[0140] In one embodiment, for a redundant endoscopic image sequence sorted from early to late according to the shooting time, for example, Figure 4a The original images shown can be sorted by image number. Then the first image in the sequence can be used as a reference endoscopic image, and then the matching is performed backward in sequence, and the redundant mirror images sorted later are used as images to be grouped.
[0141] If the difference between the image to be grouped and the reference endoscopic image is less than or equal to the first threshold, it can be directly determined that the image to be grouped and the reference endoscopic image belong to the same endoscopic image set. If the difference between the image to be grouped and the reference endoscopic image is greater than or equal to the second threshold, it is not incorporated into the endoscopic image set and is left for subsequent processing.
[0142] If the difference between the image to be grouped and the reference endoscopic image is greater than the first threshold and less than the second threshold, that is, the difference appears to be higher than the lower threshold but lower than the upper threshold, it can be recorded as a potential similar image, but not directly merged into the above endoscopic image set. After multiple images are matched, for example, all images are compared or the difference between multiple consecutive images is higher than the second threshold, the continuity of the recorded multiple potential similar images can be identified. In one example, the difference identification situation is as follows Figure 4a shown.
[0143] When multiple potentially similar images are continuous with the endoscopic image set, e.g. Figure 4b If the portion in the middle dashed box is continuous with the images below the low threshold at both ends, then multiple potential similar images and the reference endoscopic image can be classified into the same endoscopic image set. That is, during the recording process, the potential similar images recorded because they are greater than the low threshold and less than the high threshold cause the image sequence to be interrupted in the set. If all the interrupted sequence numbers belong to the images recorded as potential similar images, they can be incorporated into the same endoscopic image set. For the portion that is discontinuous with the endoscopic image set, such as Figure 4b The part within the solid line frame will not be merged. Then you can start from the first picture that has not been added to the group and repeat the above process.
[0144] In this embodiment, by setting the first threshold and the second threshold, the boundaries of multiple consecutive similar images can be effectively identified, the seed point can be determined by a low threshold, and the range of similar images can be expanded by a high threshold, thereby effectively improving the screening accuracy of the endoscopic image set.
[0145] In order to enable those skilled in the art to better understand the above steps, the embodiment of the present application is illustrated below by using an example, but it should be understood that the embodiment of the present application is not limited to this.
[0146] like Figure 5 As shown in the figure, after obtaining all endoscopic images collected by the portable capsule gastroscopy, the image quality assessment algorithm (i.e., the image quality assessment model) can be used to filter out low-quality images such as blur, dark or overexposed images, retain high-quality images and obtain the corresponding quality scores.
[0147] After that, the image difference can be determined by image deduplication algorithm and post-processing, that is, the difference recognition model. After grouping the long sequence, it is divided into multiple endoscopic image sets, each of which contains multiple repeated or similar images. Then, from each endoscopic image set, a picture with the highest quality score in the group is selected as the retained picture. Then, based on the retained pictures of each set, high-quality and high-discrimination pictures can be obtained and output to the physician for reading.
[0148] The endoscopic image deduplication method of the present application improves the efficiency of doctors' reading while ensuring the quality of reading. It enables doctors to make quick, efficient and accurate judgments, greatly shortens the time patients wait for reports, and brings greater convenience and prospects to the application and development of portable capsule gastroscopy.
[0149] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0150] Based on the same inventive concept, the embodiment of the present application also provides an endoscopic image deduplication device for implementing the endoscopic image deduplication method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more endoscopic image deduplication device embodiments provided below can refer to the limitations of the endoscopic image deduplication method above, and will not be repeated here.
[0151] In an exemplary embodiment, Figure 6 As shown, an endoscopic image deduplication device is provided, comprising:
[0152] An image acquisition module 601 is used to acquire a plurality of redundant endoscopic images collected by a capsule endoscope;
[0153] A difference recognition module 602 is used to input the redundant endoscopic images into a trained difference recognition model, and the difference recognition model determines the difference between the input redundant endoscopic images; the difference recognition model is obtained by self-supervised training based on endoscopic image triplets, each of which includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image;
[0154] a deduplication module 603, configured to group the redundant endoscopic images according to the difference to obtain an endoscopic image set, and select an image that meets an image quality condition from each of the endoscopic image sets as a retained image;
[0155] The deduplication result acquisition module 604 is used to obtain the endoscopic image deduplication result according to the retained images corresponding to each of the endoscopic image sets.
[0156] In one embodiment, the device further comprises a difference recognition model training module, wherein the difference recognition model training module is used to:
[0157] Acquire endoscopic image triplets; each of the endoscopic image triplets includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image;
[0158] Inputting the endoscopic image triplet into a difference recognition model to be trained, obtaining a first image feature corresponding to the first sample endoscopic image, a second image feature corresponding to the second sample endoscopic image, and a third image feature corresponding to the third sample endoscopic image by the difference recognition model, and determining a first lowest common ancestor feature corresponding to the first image feature and the second image feature, and a second lowest common ancestor feature of the first image feature, the second image feature, and the third image feature;
[0159] Determining a model loss value according to the proximity of each of the first image feature, the second image feature, and the third image feature to the first lowest common ancestor feature and the second lowest common ancestor feature;
[0160] The model parameters of the difference recognition model are adjusted according to the model loss value to obtain a trained difference recognition model.
[0161] In one embodiment, the difference recognition model training module is used to:
[0162] Obtaining a first distance between the first image feature and the first lowest common ancestor feature, and a second distance between the first image feature and the second lowest common ancestor feature, and determining a first difference value of the first distance minus the second distance;
[0163] Obtaining a third distance between the second image feature and the first lowest common ancestor feature, and a fourth distance between the second image feature and the second lowest common ancestor feature, and determining a second difference value of the third distance minus the fourth distance;
[0164] Obtaining a fifth distance between the third image feature and the second lowest common ancestor feature, and a sixth distance between the third image feature and the first lowest common ancestor feature, and determining a third difference value of the fifth distance minus the sixth distance;
[0165] The model loss value is determined according to the first difference, the second difference and the third difference; the model loss value is positively correlated with the first difference, the second difference and the third difference.
[0166] In one embodiment, the deduplication module 603 is used to:
[0167] Determine, from the redundant endoscopic images, a reference endoscopic image as a reference object, and images to be grouped whose shooting time is later than the shooting time of the reference endoscopic image;
[0168] If the difference between the image to be grouped and the reference endoscopic image is less than or equal to a first threshold, determining that the image to be grouped and the reference endoscopic image belong to the same endoscopic image set;
[0169] If the difference between the image to be grouped and the reference endoscopic image is greater than the first threshold and less than the second threshold, the image to be grouped is determined to be a potentially similar image, and when multiple potentially similar images and the endoscopic image set are continuous, the multiple potentially similar images and the reference endoscopic image are classified into the same endoscopic image set.
[0170] In one embodiment, the image acquisition module 601 is used to:
[0171] Acquire multiple endoscopic images collected by a capsule endoscope, and screen out multiple redundant endoscopic images that meet image quality conditions from the multiple endoscopic images through an image quality assessment model;
[0172] The device also includes an image quality assessment model training module, and the image quality assessment model training module is used to:
[0173] Performing mask processing on the initial sample endoscopic image to obtain a masked endoscopic image;
[0174] Inputting the masked endoscopic image into an image quality assessment model to be trained, performing convolution processing on the masked endoscopic image by the image quality assessment model to obtain masked image features, and predicting a complete endoscopic image based on the masked image features;
[0175] According to the difference between the complete endoscopic image and the initial sample endoscopic image, adjusting the model parameters of the image quality assessment model to obtain a pre-trained image quality assessment model;
[0176] Based on the sample endoscopic images carrying the image quality classification labels, the pre-trained image quality assessment model is fine-tuned to obtain a trained image quality assessment model.
[0177] In one embodiment, the image quality assessment model training module is used to:
[0178] Get masks of multiple sizes;
[0179] The initial sample endoscopic images are respectively subjected to mask processing using the masks of the multiple sizes to obtain multiple mask endoscopic images with different mask area sizes.
[0180] Each module in the above-mentioned endoscopic image deduplication device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0181] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store endoscopic image data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an endoscopic image deduplication method is implemented.
[0182] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for deduplication of endoscopic images is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0183] Those skilled in the art will understand that Figure 7 and Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0184] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0185] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0186] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0187] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0188] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0189] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0190] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for deduplication of endoscopic images, It is characterized in that The method comprises: Acquire multiple redundant endoscopic images collected by capsule endoscopy; The redundant endoscopic images are input into a trained difference recognition model, and the difference recognition model determines the difference between the input redundant endoscopic images; the difference recognition model is obtained by self-supervised training based on endoscopic image triplets, each of which includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image; Grouping the redundant endoscopic images according to the difference to obtain an endoscopic image set, and screening out images that meet image quality conditions from each of the endoscopic image sets as retained images; Obtaining endoscopic image deduplication results according to the retained images corresponding to each of the endoscopic image sets; The difference recognition model is trained by the following steps: Acquire endoscopic image triplets; each of the endoscopic image triplets includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image; Inputting the endoscopic image triplet into a difference recognition model to be trained, obtaining a first image feature corresponding to the first sample endoscopic image, a second image feature corresponding to the second sample endoscopic image, and a third image feature corresponding to the third sample endoscopic image by the difference recognition model, and determining a first lowest common ancestor feature corresponding to the first image feature and the second image feature, and a second lowest common ancestor feature of the first image feature, the second image feature, and the third image feature; A model loss value is determined according to the proximity of the first image feature, the second image feature and the third image feature to the first lowest common ancestor feature and the second lowest common ancestor feature, respectively; the model loss value is positively correlated with the first distance, the third distance and the fifth distance, and is negatively correlated with the second distance, the fourth distance and the sixth distance; the first distance is the distance between the first image feature and the first lowest common ancestor feature, the second distance is the distance between the first image feature and the second lowest common ancestor feature, the third distance is the distance between the second image feature and the first lowest common ancestor feature, the fourth distance is the distance between the second image feature and the second lowest common ancestor feature, the fifth distance is the distance between the third image feature and the second lowest common ancestor feature, and the sixth distance is the distance between the third image feature and the first lowest common ancestor feature; The model parameters of the difference recognition model are adjusted according to the model loss value to obtain a trained difference recognition model.
2. The method according to claim 1, It is characterized in that The capsule endoscope includes at least one of a portable capsule endoscope and a magnetically controlled capsule endoscope.
3. The method according to claim 1, It is characterized in that The determining of the model loss value according to the proximity of each of the first image feature, the second image feature and the third image feature to the first lowest common ancestor feature and the second lowest common ancestor feature comprises: Obtaining a first distance between the first image feature and the first lowest common ancestor feature, and a second distance between the first image feature and the second lowest common ancestor feature, and determining a first difference value of the first distance minus the second distance; Obtaining a third distance between the second image feature and the first lowest common ancestor feature, and a fourth distance between the second image feature and the second lowest common ancestor feature, and determining a second difference value of the third distance minus the fourth distance; Obtaining a fifth distance between the third image feature and the second lowest common ancestor feature, and a sixth distance between the third image feature and the first lowest common ancestor feature, and determining a third difference value of the fifth distance minus the sixth distance; The model loss value is determined according to the first difference, the second difference and the third difference; the model loss value is positively correlated with the first difference, the second difference and the third difference.
4. The method according to claim 1, It is characterized in that The grouping of the redundant endoscopic images according to the difference comprises: Determine, from the redundant endoscopic images, a reference endoscopic image as a reference object, and images to be grouped whose shooting time is later than the shooting time of the reference endoscopic image; If the difference between the image to be grouped and the reference endoscopic image is less than or equal to a first threshold, determining that the image to be grouped and the reference endoscopic image belong to the same endoscopic image set; If the difference between the image to be grouped and the reference endoscopic image is greater than the first threshold and less than the second threshold, the image to be grouped is determined to be a potentially similar image, and when multiple potentially similar images and the endoscopic image set are continuous, the multiple potentially similar images and the reference endoscopic image are classified into the same endoscopic image set.
5. The method according to any one of claims 1 to 4, It is characterized in that The step of acquiring a plurality of redundant endoscopic images collected by the capsule endoscope comprises: Acquire multiple endoscopic images collected by a capsule endoscope, and screen out multiple redundant endoscopic images that meet image quality conditions from the multiple endoscopic images through an image quality assessment model; The image quality assessment model is trained through the following steps: Performing mask processing on the initial sample endoscopic image to obtain a masked endoscopic image; Inputting the masked endoscopic image into an image quality assessment model to be trained, performing convolution processing on the masked endoscopic image by the image quality assessment model to obtain masked image features, and predicting a complete endoscopic image based on the masked image features; According to the difference between the complete endoscopic image and the initial sample endoscopic image, adjusting the model parameters of the image quality assessment model to obtain a pre-trained image quality assessment model; Based on the sample endoscopic images carrying the image quality classification labels, the pre-trained image quality assessment model is fine-tuned to obtain a trained image quality assessment model.
6. The method according to claim 5, It is characterized in that The masking process is performed on the initial sample endoscopic image to obtain a masked endoscopic image, including: Get masks of multiple sizes; The initial sample endoscopic images are respectively subjected to mask processing using the masks of the multiple sizes to obtain multiple mask endoscopic images with different mask area sizes.
7. An endoscopic image deduplication device, It is characterized in that The device comprises: An image acquisition module, used to acquire multiple redundant endoscopic images collected by the capsule endoscope; A difference recognition module is used to input the redundant endoscopic images into a trained difference recognition model, and the difference recognition model determines the difference between the input redundant endoscopic images; the difference recognition model is obtained by self-supervised training based on endoscopic image triplets, each of which includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image; a deduplication module, configured to group the redundant endoscopic images according to the difference to obtain an endoscopic image set, and select images that meet image quality conditions from each of the endoscopic image sets as retained images; A deduplication result acquisition module, used for obtaining an endoscopic image deduplication result according to the retained images corresponding to each of the endoscopic image sets; The difference recognition model training module is used to: Acquire endoscopic image triplets; each of the endoscopic image triplets includes a first sample endoscopic image and a second sample endoscopic image that are similar, and a third sample endoscopic image that is dissimilar to both the first sample endoscopic image and the second sample endoscopic image; Inputting the endoscopic image triplet into a difference recognition model to be trained, obtaining a first image feature corresponding to the first sample endoscopic image, a second image feature corresponding to the second sample endoscopic image, and a third image feature corresponding to the third sample endoscopic image by the difference recognition model, and determining a first lowest common ancestor feature corresponding to the first image feature and the second image feature, and a second lowest common ancestor feature of the first image feature, the second image feature, and the third image feature; A model loss value is determined according to the proximity of the first image feature, the second image feature and the third image feature to the first lowest common ancestor feature and the second lowest common ancestor feature, respectively; the model loss value is positively correlated with the first distance, the third distance and the fifth distance, and is negatively correlated with the second distance, the fourth distance and the sixth distance; the first distance is the distance between the first image feature and the first lowest common ancestor feature, the second distance is the distance between the first image feature and the second lowest common ancestor feature, the third distance is the distance between the second image feature and the first lowest common ancestor feature, the fourth distance is the distance between the second image feature and the second lowest common ancestor feature, the fifth distance is the distance between the third image feature and the second lowest common ancestor feature, and the sixth distance is the distance between the third image feature and the first lowest common ancestor feature; The model parameters of the difference recognition model are adjusted according to the model loss value to obtain a trained difference recognition model.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
