Capsule endoscope quality inspection method, device and storage medium

The AI ​​model identifies and evaluates capsule endoscopy images, solving the problems of completeness of magnetic capsule endoscopy results and image quality, and improving the accuracy of diagnosis and comprehensiveness of examination.

CN114581402BActive Publication Date: 2024-09-27SHENZHEN JIFU MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210202450.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-03
Publication Date
2024-09-27
Estimated Expiration
2042-03-03

Smart Images

  • Figure CN114581402B
    Figure CN114581402B
Patent Text Reader

Abstract

The present invention discloses a capsule endoscope quality inspection method, comprising the steps of: identifying all images of the target area collected by the capsule endoscope in sequence through a trained AI model, and for each image, when a target node is identified, outputting the target node name and the position information of the target node detection frame of the target node; determining in sequence whether the position of each target node detection frame in the image corresponding to it meets a preset condition, and when the preset condition is met, determining that the target node is completely inspected; determining the completeness according to the number of segmentation units in all identified target nodes and the number of all segmentation units in the target area, and obtaining a completeness result; performing image quality detection on all the images in sequence, and obtaining an image quality detection result; and outputting the target node that is completely inspected, the completeness result, and the image that meets the requirements in the image quality detection result. Thus, the comprehensiveness and completeness of capsule endoscope inspection and the control of image quality are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical device technology, and in particular to a capsule endoscope quality control method, device, system and storage medium. Background Art

[0002] At present, there are two main control methods for magnetically controlled capsule endoscopes. The first is that medical staff manually operate the magnetically controlled device based on their personal clinical experience to guide the capsule endoscope to inspect the target area; the second is that a terminal device equipped with control software controls the magnetically controlled device to guide the capsule endoscope to automatically inspect the target area. Both the first and second control methods have the risk of missed inspections, and a comprehensive scan of the target area is the premise and basis for disease diagnosis. Therefore, how to determine whether the results of capsule endoscopy are complete is an urgent problem to be solved. Summary of the invention

[0003] In order to solve the above-mentioned technical problems existing in the prior art, the present invention provides a capsule endoscope quality control method, device, system and storage medium, which aim to determine the completeness of the inspection results of the magnetically controlled capsule endoscope and ensure the inspection quality.

[0004] The embodiment of the present invention provides a capsule endoscope quality inspection method, comprising the steps of:

[0005] All images of the target area collected by the capsule endoscope are identified in sequence by the trained AI model, and for each image, when a target node is identified, the target node name and the location information of the target node detection box are output;

[0006] Determine in sequence whether the position of each target node detection frame in the corresponding image satisfies a preset condition, and when the preset condition is met, determine that the target node is completely checked, otherwise, the target node is not completely checked;

[0007] Determine completeness according to the total number of segmentation units in all the identified target nodes and the total number of all segmentation units in the target area to obtain a completeness result;

[0008] Performing image quality detection on all images of the target area collected by the capsule endoscope in sequence to obtain image quality detection results;

[0009] Output the target node that has been completely checked, the completeness result, and the image that meets the requirements in the image quality detection result.

[0010] In some embodiments, the step of sequentially determining whether the position of each target node detection frame in the corresponding image satisfies a preset condition comprises:

[0011] The pixel distances between the detected bounding box of the target node and the upper, lower, left, and right sides of the corresponding image are d1, d2, d3, and d4 respectively. When d1, d2, d3, and d4 are all greater than or equal to a preset threshold d, it is determined that the target node has been completely inspected; otherwise, the target node has not been completely inspected.

[0012] In some embodiments, the method further includes: dividing the target area into n adjacent and non-overlapping segmentation units, each of which has a unique identifier, sequentially identified as A1, A2, A3, ……, An. All of the segmentation units form a set S, S = {A1, A2, A3, ……, An}, and the set S covers the target area, where 1 ≤ n ≤ N and N is a positive integer;

[0013] The target area is divided into m target nodes that can partially overlap, each of which is composed of k adjacent segmentation units. Each target node has a unique identifier, sequentially identified as B1, B2, B3, ……, Bm. All of the target nodes form a set T, T = {B1, B2, B3, ……, Bm}, and the set T covers the target area, where 1 ≤ k < n, 1 ≤ m ≤ N, and N is a positive integer.

[0014] In some embodiments, determining the completeness based on the total number of segmentation units within all the identified target nodes and the number of all segmentation units within the target area, and obtaining the completeness result includes:

[0015] Incorporating each of the identified target nodes into a set T′, where the set T′ is initially an empty set, and

[0016] Decomposing each target node in the set T′ into k segmentation units according to the correspondence between the target node and the k adjacent segmentation units;

[0017] Incorporating the k segmentation units obtained by decomposing each target node into a set S′, where the set S′ is initially an empty set, and Calculating the percentage of the number of all segmentation units in the set S′ to the number of all segmentation units in the set S to obtain the completeness result.

[0018] In some embodiments, detecting the image quality of all images of the target area collected by the capsule endoscope in sequence, and obtaining the image quality detection result includes: performing blur detection on each image in sequence to obtain the blur detection result.

[0019] In some embodiments, the performing blur detection on each of the images in sequence to obtain a blur detection result includes:

[0020] Performing convolution operation on the image, calculating the gradient change variance of the color channel of the image, and obtaining the gradient change variance value;

[0021] When the gradient change variance value is less than a preset threshold, the image is blurred, and the blur detection result is obtained that the image does not meet the requirements;

[0022] When the gradient change variance value is greater than or equal to the preset threshold, the image is clear, and the blur detection result is obtained that the image meets the requirements.

[0023] An embodiment of the present invention provides a capsule endoscope quality inspection device, comprising:

[0024] Identification module: configured to sequentially identify all images of the target area collected by the capsule endoscope through the trained AI model, and for each of the images, when the target node is not identified, output a null value, and when the target node is identified, output the target node name and the target node detection box position information of the target node;

[0025] An inspection integrity determination module is configured to sequentially determine whether the position of each target node detection frame in the corresponding image satisfies a preset condition, and when the preset condition is met, determine that the target node is completely inspected, otherwise, the target node is not completely inspected;

[0026] A completeness determination module is configured to determine the completeness according to the total number of segmentation units in all the identified target nodes and the number of all segmentation units in the target area to obtain a completeness result;

[0027] An image quality detection module is configured to detect the image quality of all images of the target area collected by the capsule endoscope in sequence to obtain an image quality detection result;

[0028] The output module is configured to output the image that meets the requirements among the completeness result and the image quality detection result.

[0029] In some embodiments, the capsule endoscope quality inspection device further comprises:

[0030] First partitioning module: configured to partition the target area into n adjacent and non-overlapping segmentation units, each of the segmentation units having a unique identifier, sequentially identified as A1, A2, A3, ……, An, and all of the segmentation units form a set S, S = {A1, A2, A3, ……, An}, and the set S covers the target area, where 1 ≤ n ≤ N and N is a positive integer;

[0031] Second partitioning module, configured to partition the target area into m partially overlapping target nodes, each of the target nodes being composed of k adjacent segmentation units, each of the target nodes having a unique identifier, sequentially identified as B1, B2, B3, ……, Bm, and all of the target nodes form a set T, T = {B1, B2, B3, ……, Bm}, and the set T covers the target area, where 1 ≤ k < n, 1 ≤ m ≤ N, and N is a positive integer.

[0032] In some embodiments, the completeness determination module includes:

[0033] First union sub-module, configured to incorporate each of the identified target nodes into a set T′, the set T′ being initially an empty set, and Decomposition sub-module, configured to decompose each of the target nodes in the set T′ into k segmentation units according to the correspondence between the target node and the k adjacent segmentation units;

[0034] Second union sub-module, configured to incorporate the k segmentation units obtained by decomposing each of the target nodes into a set S′, the set S′ being initially an empty set, and Calculation sub-module, configured to calculate the percentage of the number of all the segmentation units in the set S′ to the number of all the segmentation units in the set S to obtain the completeness result.

[0035] An embodiment of the present invention provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the instruction, the program, the code set or the instruction set is loaded and executed by the processor to implement the operations performed in the method according to any one of the above embodiments.

[0036] The embodiment of the present invention provides a capsule endoscope quality inspection method, device and storage medium, the capsule endoscope quality inspection method comprising: identifying all images of the target area collected by the capsule endoscope in sequence through a trained AI model, and for each of the images, when the target node is identified, outputting the target node name and the location information of the target node detection box of the target node; determining in sequence whether the position of each target node detection box in the image corresponding to it meets the preset conditions, and when the preset conditions are met, determining that the target node is completely inspected, otherwise, the target node is not completely inspected; determining the completeness according to the total number of segmentation units in all the identified target nodes and the total number of all segmentation units in the target area, and obtaining the completeness result; performing image quality detection on all images of the target area collected by the capsule endoscope in sequence, and obtaining the image quality detection result; outputting the target node that is completely inspected, the completeness result and the image that meets the requirements in the image quality detection result. The judgment of the completeness and image quality of capsule endoscope inspection is realized, which helps to achieve the comprehensiveness of capsule endoscope inspection and improve the accuracy of diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings are used to provide further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementation methods, they are used to explain the embodiments of the present invention, but do not constitute a limitation to the embodiments of the present invention.

[0038] Figure 1 This is a flow chart of a capsule endoscope quality inspection method according to an embodiment of the present invention;

[0039] Figure 2 A schematic diagram of the position of a target node and its detection frame in an image in an embodiment of the present invention;

[0040] Figure 3 It is a partial flow chart of another capsule endoscope quality inspection method in an embodiment of the present invention;

[0041] Figure 4 The figure is a schematic structural diagram of a capsule endoscope quality inspection device in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention 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 invention and are not intended to limit the present invention.

[0043] like Figure 1 As shown, an embodiment of the present invention provides a capsule endoscope quality inspection method, comprising the following steps:

[0044] S01: All images of the target area collected by the capsule endoscope are sequentially identified by the trained AI model. For each of the images, when a target node is identified, the target node name and the location information of the target node detection box are output; when the target node is not identified, a null value is output;

[0045] S02: determining in sequence whether the position of each target node detection frame in the corresponding image satisfies a preset condition, and when the preset condition is satisfied, determining that the target node is completely checked, otherwise, the target node is not completely checked;

[0046] S03: Determine completeness according to the total number of segmentation units in all the identified target nodes and the total number of all segmentation units in the target area to obtain a completeness result;

[0047] S04: performing image quality detection on all images of the target area collected by the capsule endoscope in sequence to obtain an image quality detection result;

[0048] S05: Outputting the target node that has been completely checked, the completeness result, and the image that meets the requirements in the image quality detection result.

[0049] Specifically, in step S01, after the capsule endoscope completes image acquisition of the target area, all images are identified in turn through the trained AI model. For each image, when the target node is identified, the target node name and the location information of the target node detection box are output; when the target node is not identified, a null value is output.

[0050] In step S02, it is determined in turn whether the position of each target node detection frame in the corresponding image satisfies a preset condition, and when the preset condition is satisfied, it is determined that the target node is completely checked, otherwise, the target node is not completely checked. The preset condition is to ensure that the target node is within the restriction condition of the corresponding image.

[0051] In step S03, the segmentation unit refers to the smallest characteristic unit constituting the target area, and the segmentation units constituting the target area do not overlap each other. Each target node is respectively composed of one or more adjacent segmentation units. The completeness is characterized by the percentage of the total number of segmentation units in all the identified target nodes to the total number of all segmentation units in the target area.

[0052] In step S04, image quality detection is performed on all images of the target area collected by the capsule endoscope in sequence to obtain image quality detection results. The image quality detection may include image-related detection such as blur detection.

[0053] Step S05, output the target nodes that have been completely inspected, the completeness result, and the images that meet the requirements in the image quality detection result. The form of outputting the target nodes that have been completely inspected can be a list, or the target nodes that have been completely inspected can be highlighted in the three-dimensional gastric model. The specific form is not limited here. Medical staff can determine which target nodes have not been completely inspected based on the output target nodes that have been completely inspected, so as to inspect the target nodes that have not been completely inspected. Medical staff can know whether this inspection is comprehensive and complete according to the completeness result. Medical staff can make a more accurate diagnosis result based on the images that meet the requirements in the image quality detection result, avoiding misjudgment of the result. In some embodiments, in step S02, successively determining whether the position of each target node detection frame in its corresponding image meets a preset condition includes: the pixel distances between the target node detection frame and the upper, lower, left, and right sides of its corresponding image are d1, d2, d3, and d4 respectively. When d1, d2, d3, and d4 are all greater than or equal to a preset threshold d, it is determined that the target node has been completely inspected; otherwise, the target node has not been completely inspected.

[0054] As Figure 2 shown, the pixel distances between the detection frame of the target node and the upper, lower, left, and right sides of its所在图像 (the image where it is located) are d1, d2, d3, and d4 respectively. Compare d1, d2, d3, and d4 with the preset threshold d respectively. The preset threshold d is the distance value to ensure the current target node in the corresponding image. The resolution of the image is L*L, then 0 < d < L / 2. When d1, d2, d3, and d4 are all greater than or equal to the preset threshold d, it indicates that the target node has been completely detected; otherwise, the target node has not been completely detected. In some embodiments, the capsule endoscope quality inspection method further includes: dividing the target area into n adjacent and non-overlapping segmentation units, each segmentation unit has a unique identifier, which are sequentially identified as A1, A2, A3,..., An. All the segmentation units form a set S, S = {A1, A2, A3,..., An}, and the set S covers the target area, where 1 ≤ n ≤ N and N is a positive integer; dividing the target area into m partially overlapping target nodes, each target node is composed of k adjacent segmentation units, each target node has a unique identifier, which are sequentially identified as B1, B2, B3,..., Bm. All the target nodes form a set T, T = {B1, B2, B3,..., Bm}, and the set T covers the target area, where 1 ≤ k < n, 1 ≤ m ≤ N, and N is a positive integer.

[0055] Specifically, taking the human stomach model as the target area, the stomach model is divided into 24 parts, namely, fundus A1, cardia A2, lower posterior wall of cardia A3, lower anterior wall of cardia A4, upper anterior wall of gastric body A5, upper posterior wall of gastric body A6, upper greater curvature of gastric body A7, upper lesser curvature of gastric body A8, anterior wall of middle gastric body A9, posterior wall of middle gastric body A10, greater curvature of middle gastric body A11, lesser curvature of middle gastric body A12, anterior wall of lower gastric body A13, posterior wall of lower gastric body A14, gastric body The lower greater curvature A15, the lower lesser curvature of the gastric body A16, the gastric angle A17, the anterior wall of the gastric angle A18, the posterior wall of the gastric angle A19, the anterior wall of the gastric antrum A20, the posterior wall of the gastric antrum A21, the greater curvature of the gastric antrum A22, the lesser curvature of the gastric antrum A23, and the pylorus A24, the above 24 parts are regarded as 24 adjacent and non-overlapping segmentation units of the target area, and the above segmentation units are grouped into a set S, S = {A1, A2, A3, ..., A24}, and the set S covers the entire target area.

[0056] The stomach model is divided into 9 partially overlapping target nodes, namely, the fundus B1, the cardia B2, the lesser curvature B3, the greater curvature B4, the upper gastric body B5, the lower gastric body B6, the gastric angle B7, the gastric antrum B8, and the pylorus B9. The above target nodes are combined into a set T, T = {B1, B2, B3, ..., B9}, and the set T covers the entire target area. Among them:

[0057] The fundus B1 cannot be divided any further, so the target node fundus B1 is equivalent to the segmentation unit fundus A1;

[0058] The target node cardia B2 is composed of segmentation units cardia A2, lower posterior wall of cardia A3, and lower anterior wall of cardia A4; the target node lesser curvature of stomach B3 is composed of segmentation units upper lesser curvature of stomach body A8, middle lesser curvature of stomach body A12, and lower lesser curvature of stomach body A16;

[0059] The target node greater curvature B4 is composed of the segmentation units greater curvature A7 of the upper part of the gastric body, greater curvature A11 of the middle part of the gastric body, and greater curvature A15 of the lower part of the gastric body;

[0060] The target node upper gastric body cavity B5 is composed of segmentation units of the upper gastric body anterior wall A5, the upper gastric body posterior wall A6, the upper gastric body greater curvature A7, the upper gastric body lesser curvature A8, the middle gastric body anterior wall A9, the middle gastric body posterior wall A10, the middle gastric body greater curvature A11, and the middle gastric body lesser curvature A12;

[0061] The target node lower gastric body cavity B6 is composed of segmentation units of the middle gastric body anterior wall A9, the middle gastric body posterior wall A10, the middle gastric body greater curvature A11, the middle gastric body lesser curvature A12, the lower gastric body anterior wall A13, the lower gastric body posterior wall A14, the lower gastric body greater curvature A15, and the lower gastric body lesser curvature A16;

[0062] The target node gastric angle B7 is composed of segmentation units gastric angle A17, gastric angle anterior wall A18, and gastric angle posterior wall A19;

[0063] The target node gastric antrum B8 is composed of segmentation units gastric antrum anterior wall A20, gastric antrum posterior wall A21, gastric antrum greater curvature A22, and gastric antrum lesser curvature A23;

[0064] Pylorus B9 cannot be further divided, so the identification unit Pylorus B9 is equivalent to the target node Pylorus A24. A corresponding relationship between each target node and the segmentation unit constituting the target node is established.

[0065] In some embodiments, the training process of the AI ​​model is as follows:

[0066] A set of images pre-taken by a capsule endoscope at different locations in a target area is selected, and each image in the image set contains at least one complete and identifiable target node; all target nodes in the selected image set are completely labeled, and a labeling file is generated according to the identification name and the labeling box; the labeled images are divided into a training set and a test set, and there is no overlap between the images in the training set and the images in the test set; an initial deep convolutional neural network model is trained with the training set; the initial deep convolutional neural network model is based on a natural scene detection network architecture, and its weights are initialized to the weights of a pre-trained model of a natural scene detection network; during the training process, the feature maps generated by each network convolution layer of the initial deep convolutional neural network model are transmitted to each other in a cascade manner, and a detection box is generated at the same time, and the parameters of the initial deep convolutional neural network model are updated by back propagation of the gradient of the loss function to obtain the current deep convolutional neural network model.

[0067] The current deep convolutional neural network model is trained using the training set, and the current deep convolutional neural network model generated by a single iterative training is tested using the test set to obtain the recognition accuracy, sensitivity, specificity, or one or a combination thereof of the current deep convolutional neural network model. The recognition accuracy, sensitivity, specificity, or one or a combination thereof is used to determine whether the corresponding indicator of the current deep convolutional neural network model meets the predetermined recognition accuracy, sensitivity, and specificity requirements. If so, the training is terminated, and the current deep convolutional neural network model at the termination time is used as the final deep convolutional neural network model, i.e., the trained AI model; if not, the training is continued until the predetermined recognition accuracy, sensitivity, and specificity requirements are met. Figure 3 As shown, in some embodiments, the step S03 determines the completeness according to the total number of segmentation units in all the identified target nodes and the number of all segmentation units in the target area, and obtains the completeness result, including the following sub-steps:

[0068] S03-1: merge each of the identified target nodes into a set T′, where the set T′ is initially an empty set, and S03-2: Decomposing each of the target nodes in the set T′ into k segmentation units according to the correspondence between the target node and k adjacent segmentation units;

[0069] S03-3: Merge the k segmentation units obtained by decomposing each target node into a set S′, where the set S′ is initially an empty set, and S0:3-4: Calculate the percentage of the total number of all the segmentation units in the set S′ to the total number of all the segmentation units in the set S to obtain the completeness result.

[0070] Specifically, all images collected by the capsule endoscope are identified by the trained AI model, and each identified target node is incorporated into the set T', which is initially an empty set, and According to the correspondence between the target node and the k adjacent segmentation units, each target node is decomposed into k adjacent segmentation units, and the obtained k segmentation units are incorporated into a set S', where the set S' is initially an empty set, and The completeness is obtained by calculating the percentage of the total number of all the segmentation units in the set S' to the total number of all the segmentation units in the set S. For example, the images collected by the capsule endoscope are identified by the trained AI model, and the fundus B1, cardia B2, lesser curvature B3, greater curvature B4, and upper gastric body cavity B5 are identified. Then T' = {B1, B2, B3, B4, B5}, and according to the correspondence between each target node and the segmentation unit constituting the target node, S' = {A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A15, A16} is obtained, and S = {A1, A2, A3, A4, ..., A22, A23, A24}, then the completeness = (14 / 24) * 100% = 58.3%.

[0071] In some embodiments, the step S04 of sequentially performing image quality detection on all images of the target area captured by the capsule endoscope to obtain image quality detection results includes: sequentially performing blur detection on each image to obtain blur detection results.

[0072] In some embodiments, blur detection is performed on each of the images in turn to obtain a blur detection result, including: performing a convolution operation on the image, calculating the gradient change variance of the color channel of the image, and obtaining a gradient change variance value; calculating the gradient change variance of the color channel of the processed image to obtain a gradient change variance value; when the gradient change variance value is less than a preset threshold value D, the image is blurred, and the blur detection result is that the image does not meet the requirements, where 0<D<100*100; when the gradient change variance value is greater than or equal to the preset threshold value, the image is clear, and the blur detection result is that the image meets the requirements.

[0073] In some embodiments, performing image quality detection on all images of the target area collected by the capsule endoscope in sequence, and obtaining the image quality detection result further includes:

[0074] Sub-step S04-01: performing overexposure detection on each of the images in turn to obtain an overexposure detection result.

[0075] Specifically, the noise of the image is removed by Gaussian filtering to obtain a denoised image; the denoised image is binarized according to a preset brightness threshold V to obtain a binarized image, wherein 0<V<1.0; the high-brightness area in the binarized image is detected to obtain a plurality of first high-brightness areas; the area of ​​the plurality of first high-brightness areas whose area is greater than a first preset area threshold S1 is determined to obtain a plurality of second high-brightness areas, wherein 0<S1<L*L; the sum of the area of ​​the plurality of second high-brightness areas is counted to obtain a first total area; when the first total area is greater than the second preset area threshold S2, the image is overexposed, and the overexposure detection result is that the image does not meet the requirements, wherein S1≤S2≤L*L; when the first total area is less than or equal to the second preset area threshold S2, the overexposure detection result is that the image meets the requirements.

[0076] Sub-step S04-02: Perform underexposure detection on each of the images in turn to obtain an underexposure detection result. Specifically, calculate the average grayscale of the image to obtain the average grayscale value; when the average grayscale value is less than a preset grayscale threshold Gray, the image is underexposed, and the underexposure detection result is that the image does not meet the requirements, where 0<Gray<255; when the average grayscale value is greater than or equal to the preset grayscale threshold, the image is not underexposed, and the underexposure detection result is that the image meets the requirements.

[0077] Sub-step S04-03: Perform mucus detection on each of the images in turn to obtain a mucus detection result.

[0078] Specifically, the image is converted into an HSV space to obtain an HSV image; an area in the HSV image whose S space value is less than a preset S threshold is determined to obtain a plurality of low-saturation areas, wherein 0<S<1.0; a plurality of the low-saturation areas are used as seeds, and flood filling is performed in the S space according to a color gradient change to obtain a plurality of first mucus areas; an area in the plurality of the first mucus areas whose area is greater than a third preset area threshold S3 is determined to obtain a plurality of second mucus areas, wherein 0<S3<L*L; the sum of the area areas of the plurality of the second mucus areas is counted to obtain a second total area; when the second total area is greater than a fourth preset area threshold S4, the image has more mucus, and the mucus detection result is that the image does not meet the requirements, wherein S3≤S4≤L*L; when the second total area is less than or equal to the fourth preset area threshold, the image has less mucus, and the mucus detection result is that the image meets the requirements.

[0079] The images that meet the requirements in the output quality inspection results can be output only when they meet the requirements in the overexposure inspection results, underexposure inspection results, mucus inspection results, and blur inspection results. Since the resolution of the images collected by the capsule endoscope is lower than that of the traditional intubation endoscope, and the capsule endoscope lacks the function of cleaning the lens, the images collected by the capsule endoscope cannot always be guaranteed to be clear. By performing quality inspection on the images collected by the capsule endoscope, the images that meet the requirements in the quality inspection results are output, thereby improving the efficiency of medical staff in reviewing images, and it is also more conducive to medical staff to make accurate diagnosis results based on the images that meet the quality inspection results. Based on the same idea as the capsule endoscope quality inspection method in the above embodiment, the present invention also provides a capsule endoscope quality inspection device, which can be used to execute the above capsule endoscope quality inspection method. For the sake of convenience, the structural schematic diagram of the embodiment of the capsule endoscope quality inspection device only shows the parts related to the embodiment of the present invention. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than the illustrated components, or combine certain components, or arrange the components differently.

[0080] like Figure 4 As shown, an embodiment of the present invention provides a capsule endoscope quality inspection device, which can use a software module or a hardware module, or a combination of the two to become a part of a computer device. The device specifically includes: an identification module, an inspection integrity determination module, a completeness determination module, an image quality detection module and an output module, wherein:

[0081] Recognition module: Configured to sequentially recognize all images of the target area collected by the capsule endoscope through a trained AI model. For each of the images, when the target node is not recognized, a null value is output. When the target node is recognized, the target node name of the target node and the position information of the target node detection frame are output;

[0082] Inspection integrity determination module: Configured to sequentially determine whether the position of each of the target node detection frames in its corresponding image meets a preset condition. When the preset condition is met, it is determined that the target node has been completely inspected. Otherwise, the target node has not been completely inspected;

[0083] Completeness determination module: Configured to determine the completeness based on the total number of segmentation units within all the recognized target nodes and the number of all segmentation units within the target area, and obtain a completeness result;

[0084] Image quality detection module: Configured to sequentially detect the image quality of all images of the target area collected by the capsule endoscope, and obtain an image quality detection result;

[0085] Output module: Configured to output the images that meet the requirements among the completeness result and the image quality detection result.

[0086] In some embodiments, the capsule endoscope quality inspection device further includes:

[0087] First partitioning module: Configured to partition the target area into n adjacent and non-overlapping segmentation units. Each of the segmentation units has a unique identifier, which are sequentially identified as A1, A2, A3,..., An. All the segmentation units form a set S, S = {A1, A2, A3,..., An}, and the set S covers the target area, where 1 ≤ n ≤ N and N is a positive integer;

[0088] Second partitioning module, configured to partition the target area into m partially overlapping target nodes. Each of the target nodes is composed of k adjacent segmentation units. Each of the target nodes has a unique identifier, which are sequentially identified as B1, B2, B3,..., Bm. All the target nodes form a set T, T = {B1, B2, B3,..., Bm}, and the set T covers the target area, where 1 ≤ k < n, 1 ≤ m ≤ N, and N is a positive integer.

[0089] In some embodiments, the completeness determination module includes:

[0090] First union sub-module: Configured to incorporate each of the recognized target nodes into a set T'. The set T' is initially an empty set, and a decomposition submodule, configured to decompose each of the target nodes in the set T′ into k segmentation units according to a correspondence between the target node and k adjacent segmentation units;

[0091] The second merging submodule is configured to merge the k segmentation units obtained by decomposing each target node into a set S′, where the set S′ is initially an empty set, and The calculation submodule is configured to calculate the percentage of the number of all the segmentation units in the set S′ to the number of all the segmentation units in the set S, so as to obtain the completeness result.

[0092] For the specific implementation of the device item, please refer to the specific description of the above method item embodiment, which will not be repeated here. The embodiment of the present invention also provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set, and the instruction, program, code set or instruction set is loaded and executed by the processor to implement the operations of the capsule endoscope quality inspection method in the above embodiment.

[0093] Those skilled in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or by instructing related hardware through a program, and the program can be stored in a computer storage medium, and the storage medium mentioned above can be a read-only memory, a disk or an optical disk, etc. The optional implementation methods of the embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the embodiments of the present invention are not limited to the specific details of the above implementation methods. Within the technical concept of the embodiments of the present invention, the technical solutions of the embodiments of the present invention can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the embodiments of the present invention.

[0094] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not further describe various possible combinations.

[0095] In addition, various implementation modes of the embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the embodiments of the present invention, they should also be regarded as the contents disclosed by the embodiments of the present invention.

Claims

1. A method for quality inspection of capsule endoscopes, characterized in that, it includes the steps: Sequentially identify all images of the target area collected by the capsule endoscope through a trained AI model. For each of the images, when a target node is identified, output the target node name of the target node and the position information of the target node detection frame; Sequentially determine whether the position of each target node detection frame in its corresponding image meets a preset condition. When the preset condition is met, it is determined that the target node has been completely inspected; otherwise, the target node has not been completely inspected; Determine the completeness according to the total number of segmentation units within all the identified target nodes and the total number of segmentation units within the target area, and obtain a completeness result; Sequentially perform image quality detection on all images of the target area collected by the capsule endoscope to obtain an image quality detection result; Output the images that meet the requirements among the target nodes that have been completely inspected, the completeness result, and the image quality detection result.

2. The method for quality inspection of capsule endoscopes according to claim 1, characterized in that, The step of sequentially determining whether the position of each target node detection frame in its corresponding image meets a preset condition includes: the pixel distances between the target node detection frame and the upper, lower, left, and right sides of its corresponding image are d1, d2, d3, and d4 respectively. When d1, d2, d3, and d4 are all greater than or equal to a preset threshold d, it is determined that the target node has been completely inspected; otherwise, the target node has not been completely inspected.

3. The method for quality inspection of capsule endoscopes according to claim 1, characterized in that, The method further includes: dividing the target area into n adjacent and non-overlapping segmentation units, each segmentation unit having a unique identifier, sequentially identified as A1, A2, A3,..., An. All the segmentation units form a set S, S = {A1, A2, A3,..., An}, and the set S covers the target area, where 1 ≤ n ≤ N and N is a positive integer; Dividing the target area into m partially overlapping target nodes, each target node consisting of k adjacent segmentation units, each target node having a unique identifier, sequentially identified as B1, B2, B3,..., Bm. All the target nodes form a set T, T = {B1, B2, B3,..., Bm}, and the set T covers the target area, where 1 ≤ k < n, 1 ≤ m ≤ N, and N is a positive integer.

4. The method for quality inspection of capsule endoscopes according to claim 3, characterized in that, The step of determining the completeness according to the total number of segmentation units within all the identified target nodes and the number of all segmentation units within the target area to obtain a completeness result includes: Each of the identified target nodes is incorporated into a set T′, which is initially an empty set, and According to the correspondence between the target node and the k adjacent segmentation units, decompose each target node in the set T' into k segmentation units; The k segmentation units obtained by decomposing each target node are merged into a set S′, where the set S′ is initially an empty set, and The percentage of the number of all the segmentation units in the set S′ to the number of all the segmentation units in the set S is calculated to obtain the completeness result.

5. The method for quality inspection of capsule endoscopes according to claim 1, characterized in that, All the images of the target area collected by the capsule endoscope are sequentially subjected to image quality detection, and the image quality detection results obtained include: sequentially performing blur detection on each of the images to obtain blur detection results.

6. The capsule endoscope quality control method according to claim 5, characterized in that the sequentially performing blur detection on each of the images to obtain blur detection results includes: performing convolution operation processing on the image, calculating the gradient change variance of the color channels of the image to obtain a gradient change variance value; when the gradient change variance value is less than a preset threshold, the image is blurred, and the obtained blur detection result is that the image does not meet the requirements; when the gradient change variance value is greater than or equal to the preset threshold, the image is clear, and the obtained blur detection result is that the image meets the requirements.

7. A capsule endoscope quality inspection device, characterized in that it includes: An identification module: configured to sequentially identify all the images of the target area collected by the capsule endoscope through a trained AI model. For each of the images, when the target node is not identified, a null value is output, and when the target node is identified, the target node name and the position information of the target node detection frame of the target node are output; An inspection integrity determination module, configured to sequentially determine whether the position of each of the target node detection frames in its corresponding image meets a preset condition. When the preset condition is met, it is determined that the target node has been completely inspected, otherwise, the target node has not been completely inspected; A completeness determination module, configured to determine the completeness according to the total number of segmentation units within all the identified target nodes and the number of all segmentation units within the target area to obtain a completeness result; An image quality detection module, configured to sequentially perform image quality detection on all the images of the target area collected by the capsule endoscope to obtain image quality detection results; An output module, configured to output the completeness result and the images that meet the requirements in the image quality detection results.

8. The capsule endoscope quality inspection device according to claim 7, characterized in that it further includes: A first division module: configured to divide the target area into n adjacent and non-overlapping segmentation units. Each of the segmentation units has a unique identifier, which are sequentially identified as A1, A2, A3,..., An. All the segmentation units form a set S, S = {A1, A2, A3,..., An}, and the set S covers the target area, where 1 ≤ n ≤ N and N is a positive integer; A second division module, configured to divide the target area into m partially overlapping target nodes. Each of the target nodes is composed of k adjacent segmentation units. Each of the target nodes has a unique identifier, which are sequentially identified as B1, B2, B3,..., Bm. All the target nodes form a set T, T = {B1, B2, B3,..., Bm}, and the set T covers the target area, where 1 ≤ k < n, 1 ≤ m ≤ N, and N is a positive integer.

9. The capsule endoscope quality inspection device according to claim 8, It is characterized in that The completeness determination module comprises: A first merging submodule is configured to merge each of the identified target nodes into a set T′, wherein the set T′ is initially an empty set, and a decomposition submodule, configured to decompose each of the target nodes in the set T′ into k segmentation units according to a correspondence between the target node and k adjacent segmentation units; The second merging submodule is configured to merge the k segmentation units obtained by decomposing each target node into a set S′, where the set S′ is initially an empty set, and The calculation submodule is configured to calculate the percentage of the number of all the segmentation units in the set S′ to the number of all the segmentation units in the set S, so as to obtain the completeness result.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores at least one instruction, at least one program, code set or instruction set, and the instruction, the program, the code set or the instruction set is loaded and executed by the processor to implement the operations performed in any one of the methods described in claims 1 to 6.