A method, device and computer storage medium for identifying lesions

By constructing a fully connected network on the capsule endoscope and using Hu invariant moment feature vectors for lesion identification, the problem of insufficient computing power of the capsule endoscope is solved, the detection accuracy is improved and the battery life is extended.

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

Patent Information

Application Number
CN202410774035.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-09-06
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

Capsule endoscopy is limited by computing power in pathological detection and cannot use large-scale neural networks. This results in low detection accuracy and consumes a lot of power when transmitting a large number of images, affecting battery life.

Method used

By segmenting the digestive tract image into regional target sub-tiles, extracting Hu moment invariant feature vectors, building a fully connected network to train on the PC and deploying it on the capsule endoscope, it can realize lesion identification, reduce the amount of data transmission, and improve accuracy. .

Benefits of technology

It reduces the computing power consumption, improves the accuracy of lesion identification, extends the battery life of the capsule, and reduces the burden of manual reading and annotation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118334040B
    Figure CN118334040B
Patent Text Reader

Abstract

The present invention discloses a method for identifying lesions, comprising the following steps: obtaining a digestive tract image and converting it into an RGB matrix; converting the RGB matrix into a YUV matrix and separating it to obtain an original Y component matrix; corroding the original Y component matrix to obtain a first Y component matrix; performing regional segmentation on the first Y component matrix to obtain a set of regional target sub-image blocks and boundary lines; obtaining a first rectangular sub-image sequence corresponding to the RGB matrix; obtaining a second rectangular sub-image sequence of the first rectangular sub-image sequence; obtaining a feature vector of the second rectangular sub-image sequence; constructing a fully connected network based on the feature vector; training and learning sample parameters based on data samples; identifying and determining suspicious lesions in the image and outputting them. The present invention combines the feature vector of the image sample synthesized by hemoglobin data, uses a fully connected network to realize multi-classification of low-dimensional feature vectors, and only transmits sub-images containing lesions, so as to increase endurance and transmit specific lesion images, and improve the accuracy of lesion identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to a lesion recognition method, device and computer storage medium. Background Art

[0002] At present, capsule endoscopes have been combined with AI elements to produce more machine application scenarios. In the process of applying capsule endoscopes to pathological detection, they are limited by the computing power of the embedded main control chip and cannot use large-scale neural networks on the capsule side. Smaller-scale convolutional networks do not have strong detection accuracy. Therefore, most of the current solutions adopt the method of transmitting all detection images to the PC side for neural network inference, which results in a large amount of power consumption in the transmission stage, which is not conducive to the long-term endurance of the capsule and transmits a large number of redundant images of non-lesions.

[0003] Therefore, it is necessary to develop a neural network that reduces computing power consumption and is suitable for the computing power level of the built-in chip of the capsule endoscope, so as to have a more accurate lesion identification and reduce the burden of manual film reading and labeling. Summary of the invention

[0004] The present invention provides a lesion identification method, device and computer storage medium. The specific technical solution is as follows:

[0005] In the first aspect, the present invention provides a method for identifying lesions, including a capsule endoscope, comprising the following steps:

[0006] Get the digestive tract image and convert it into RGB matrix;

[0007] Convert the RGB matrix to a YUV matrix and separate it to get the original Y component matrix;

[0008] Performing corrosion processing on the original Y component matrix to obtain a first Y component matrix;

[0009] Performing regional segmentation on the first Y component matrix to obtain a set of regional target sub-blocks and boundary lines;

[0010] Get the first rectangular sub-image sequence corresponding to the RGB matrix;

[0011] Obtain a second rectangular sub-image sequence of the first rectangular sub-image sequence;

[0012] Obtaining a feature vector of a second rectangular sub-image sequence;

[0013] Build a fully connected network based on the feature vector to predict the lesion category;

[0014] Train and learn sample parameters based on data samples;

[0015] Identify and determine suspicious lesions in the image and output them.

[0016] Furthermore, the method of obtaining the digestive tract image and converting it into an RGB matrix is ​​specifically as follows: an image of the human digestive tract is taken by a camera with a resolution of , and use general image processing conversion to get its memory RGB matrix , define each element as , RGB matrix It is expressed as:

[0017] .

[0018] Furthermore, the RGB matrix is ​​converted into a YUV matrix and separated to obtain the original Y component matrix as follows: a general RGB to YUV image processing algorithm is used to obtain The corresponding YUV matrix, and separate the original Y component matrix .

[0019] Furthermore, the corroding process of the original Y component matrix to obtain the first Y component matrix is ​​specifically as follows: based on general image processing, After executing the corrosion algorithm, the first Y component matrix is ​​obtained .

[0020] Furthermore, the first Y component matrix is ​​segmented into regions to obtain a set of regional target sub-blocks and boundary lines. Specifically, a watershed algorithm is used to segment the first Y component matrix into regions. Perform region segmentation to obtain s region target sub-blocks separated by boundaries, where s is a positive integer, and each sub-block is surrounded by a closed-loop boundary line, thereby generating s boundary line sets L.

[0021] Furthermore, the first rectangular sub-image sequence corresponding to the RGB matrix is ​​obtained by: based on the general minimum bounding rectangle algorithm and the boundary line set L, The corresponding s first rectangular sub-images are obtained and marked as , and sort the rectangles from large to small based on their area to get the first data sequence , expressed as: .

[0022] Furthermore, the step of obtaining the second rectangular sub-image sequence of the first rectangular sub-image sequence is as follows: setting a threshold ,filter Medium area size is less than The subgraph of The second data sequence of rectangular sub-graphs , expressed as: ;

[0023] For the second data sequence The pixel elements within the closed-loop boundary line of the non-sub-block area in each minimum bounding rectangle in are set to 0, and the second rectangular sub-image containing only the regional target after segmentation is obtained, which is marked as , and then get the third data sequence , expressed as: .

[0024] Furthermore, the step of obtaining the feature vector of the second rectangular sub-image sequence specifically comprises: , choose any second rectangular sub-image ,in The resolution is ,in for The RGB three-dimensional vector element at row x and column y, where , It is expressed as:

[0025] ;

[0026] Further obtain the invariant moment group, specifically: use the general RGB to YUV image processing algorithm to obtain the second rectangular sub-image The corresponding YUV matrix, and separate the Y component matrix ,make for The value of the element at row x and column y is defined as of Origin of order :

[0027] ;

[0028] Based on the zero-order origin moment (p=0, q=0) and the first-order origin moment (p=1, q=0), obtain the coordinates of the center of mass of the rectangle ( ): , ;

[0029] Then combined with the centroid, define the center for: ;

[0030] Based on the Hu moment transformation principle, first The central moment is normalized to get: ;

[0031] Based on the normalized , the invariant moment group is further obtained using the following formula:

[0032] ;

[0033] ;

[0034] ;

[0035] ;

[0036] ;

[0037] ;

[0038] ;

[0039] The following method is further used to obtain the hemoglobin absorption coefficient:

[0040] right The r component and g component of each element are converted according to the following biologically defined hemoglobin absorption coefficient formula: , and obtain it according to the following formula The mean coefficient of : , finally, synthesize the second rectangular sub-image The corresponding eigenvector :

[0041] .

[0042] It further includes: constructing a fully connected network based on the feature vector to predict the lesion category, specifically: input And use the topology model of fully connected + BatchNorm + Softmax to build a k + 1 layer fully connected network to predict five common lesion categories.

[0043] It further includes: training and learning sample parameters based on data samples, specifically: through N number of samples containing common lesions, combining the model in the fully connected network on the PC side, training in Pytorch through the graphics card, obtaining the weight parameters of each layer of the learning fully connected layer, and writing them into the built-in chip Flash of the capsule endoscope, using a general model conversion method to deploy the network inference operation to the chip side.

[0044] It further includes: identifying and determining suspicious lesions in the image and outputting them, specifically: implementing reasoning by the capsule endoscope to determine Corresponding to prect00, prect01, ..., set the prediction probability threshold , , for each RGB matrix The following algorithm is used:

[0045] Define the output probability value ,if And other probability values , , then we get The corresponding The sub-image data of the W-th category lesion is extracted as image data using a general image algorithm and transmitted to the PC for further processing; otherwise, this sub-image data is discarded. , and repeat the above steps for the next eigenvector until the RGB matrix All first data sequences is processed and lesion identification is completed.

[0046] In the second aspect, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the lesion identification method as described in any one of the first aspects.

[0047] A third aspect: The present invention provides a lesion identification device, comprising:

[0048] one or more processors;

[0049] Memory; and

[0050] One or more computer programs, wherein the one or more computer programs are stored in the memory and are configured to be executed by the one or more processors, and when the processor executes the computer program, the steps of the lesion identification method as described in any one of the first aspects are implemented.

[0051] The lesion recognition technology solution of the present invention divides the image sample into specific areas, extracts Hu invariant moment data for the area, and synthesizes the feature vector of the image sample in combination with the biological hemoglobin data. For the low-dimensional feature vector, a low-scale fully connected network is further used to realize multi-classification, and the network is used to obtain learning data based on the graphics card and the training set on the PC side. Finally, the fully connected network is deployed on the capsule side for reasoning, so that only the sub-image containing the lesion can be transmitted based on a small amount of data calculation, thereby achieving the purpose of delaying battery life and transmitting specific lesion images, reducing computing power consumption, and improving the accuracy of lesion recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 : Flow chart of the lesion identification method of the present invention.

[0053] Figure 2 : Schematic diagram of the lesion identification principle of the present invention.

[0054] Figure 3 : Schematic diagram of the composition of the lesion identification device of the present invention. DETAILED DESCRIPTION

[0055] In order to make the technical problems, technical solutions and beneficial effects to be solved by 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 used to limit the present invention.

[0056] refer to Figure 1 Flow chart of the lesion identification method of the present invention, the lesion identification method of the present invention comprises the following steps:

[0057] Step 101: Obtain a digestive tract image and convert it into an RGB matrix. Specifically, take an image of the human digestive tract with a camera, and its resolution is , and use general image processing conversion to get its memory RGB matrix , define each element as , RGB matrix It is expressed as:

[0058] ;

[0059] Step 102: Convert the RGB matrix to a YUV matrix and separate the original Y component matrix. Specifically, use a general RGB to YUV image processing algorithm to obtain The corresponding YUV matrix, and separate the original Y component matrix ;

[0060] Step 103: Corrosion processing is performed on the original Y component matrix to obtain a first Y component matrix, specifically: based on general image processing, After executing the corrosion algorithm, the first Y component matrix is ​​obtained ;

[0061] Step 104: perform regional segmentation on the first Y component matrix to obtain a set of regional target sub-blocks and boundary lines. Specifically, use a watershed algorithm to Perform region segmentation to obtain s region target sub-blocks separated by boundaries, where s is a positive integer, and each sub-block is surrounded by a closed-loop boundary line, thereby generating s boundary line sets L;

[0062] Step 105: Obtain the first rectangular sub-image sequence corresponding to the RGB matrix, specifically: based on the universal minimum enclosing rectangle algorithm, based on the boundary line set L, The corresponding s first rectangular sub-images are obtained and marked as , and sort the rectangles from large to small based on their area to get the first data sequence , expressed as: ;

[0063] Step 106: Obtain a second rectangular sub-image sequence of the first rectangular sub-image sequence, specifically: set a threshold ,filter Medium area size is less than The subgraph of The second data sequence of rectangular sub-graphs , expressed as: ;

[0064] For the second data sequence The pixel elements within the closed-loop boundary line of the non-sub-block area in each minimum bounding rectangle in are set to 0, and the second rectangular sub-image containing only the regional target after segmentation is obtained, which is marked as , and then get the third data sequence , expressed as: ;

[0065] Step 107: Obtain the feature vector of the second rectangular sub-image sequence, specifically: , choose any second rectangular sub-image ,in The resolution is ,in for The RGB three-dimensional vector element at row x and column y, where , It is expressed as: ;

[0066] Further obtain the invariant moment group, specifically: use the general RGB to YUV image processing algorithm to obtain the second rectangular sub-image The corresponding YUV matrix, and separate the Y component matrix ,make for The value of the element at row x and column y is defined as of Origin of order :

[0067] ;

[0068] Based on the zero-order origin moment (p=0, q=0) and the first-order origin moment (p=1, q=0), obtain the coordinates of the center of mass of the rectangle ( ):

[0069] , ;

[0070] Then combined with the centroid, define the center for:

[0071] ;

[0072] Based on the Hu moment transformation principle, first The central moment is normalized to get:

[0073] ;

[0074] Based on the normalized , the invariant moment group is further obtained using the following formula:

[0075] ;

[0076] ;

[0077] ;

[0078] ;

[0079] ;

[0080] ;

[0081] ;

[0082] The following method is further used to obtain the hemoglobin absorption coefficient:

[0083] right The r component and g component of each element are converted according to the following biologically defined hemoglobin absorption coefficient formula: , and obtain it according to the following formula The mean coefficient of : , finally, synthesize the second rectangular sub-image The corresponding eigenvector :

[0084] ;

[0085] Step 108: Construct a fully connected network based on the feature vector to predict the lesion category. Specifically, input , and use the topology model of fully connected + BatchNorm + Softmax to build a k+1 layer fully connected network to predict five common lesion categories, for example, k = 16, reference Figure 2 Schematic diagram of the principle of lesion recognition in the present invention, where BN(Hu1), BN(Hu2), ... are BatchNorm processing The data values ​​after each vector component, are the output data values ​​of each fully connected layer, class0, class1,… are the output data values ​​of the fully connected layer, prect00, prect01,… are the probability values ​​after lesion category conversion;

[0086] Step 109: training and learning sample parameters based on data samples, specifically: using a certain number of N samples, for example, N=10000 samples containing common lesions, combining the model in the fully connected network on the PC side, training in Pytorch through the graphics card, obtaining the weight parameters of each layer of the learning fully connected layer, and writing them into the built-in chip Flash of the capsule endoscope, using a general model conversion method to deploy the network inference operation to the chip side;

[0087] Step 110: Identify and determine suspicious lesions in the image and output them. Specifically, the capsule endoscope implements reasoning to determine Corresponding to prect00, prect01, ..., set the prediction probability threshold , , for each RGB matrix The following algorithm is used:

[0088] Define the output probability value ,if And other probability values , , then we get The corresponding The sub-image data of the W-th category lesion is extracted as image data using a general image algorithm and transmitted to a PC for further processing;

[0089] Otherwise discard this , and repeat the above steps for the next eigenvector until the RGB matrix All first data sequences is processed and lesion identification is completed.

[0090] refer to Figure 3 Schematic diagram of the composition of the lesion identification device of the present invention. The lesion identification device 10 of the present invention further includes one or more memories 20 and one or more processors 30, wherein the one or more computer programs are stored in the memories 20 and are configured to be executed by the one or more processors 30, and the processor 30 implements the steps of the lesion identification method when executing the computer program.

[0091] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0092] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for identifying lesions, comprising a capsule endoscope, characterized in that: The following steps are involved: Get the digestive tract image and convert it into RGB matrix; Convert the RGB matrix to a YUV matrix and separate it to get the original Y component matrix; Performing corrosion processing on the original Y component matrix to obtain a first Y component matrix; Performing regional segmentation on the first Y component matrix to obtain a set of regional target sub-blocks and boundary lines; Get the first rectangular sub-image sequence corresponding to the RGB matrix; Obtain the second rectangular sub-image sequence of the first rectangular sub-image sequence, and obtain the feature vector of the second rectangular sub-image sequence specifically as follows: for the third data sequence S2, randomly select a second rectangular sub-image in The resolution is K i ×W i ,in for The RGB three-dimensional vector element in the xth row and yth column, where x=0, 1, 2, ..., y=0, 1, 2, ..., the It is expressed as: Further obtain the invariant moment group, specifically: use the general RGB to YUV image processing algorithm to obtain the second rectangular sub-image The corresponding YUV matrix, and separate the Y component matrix make for The value of the element at row x and column y is defined as The origin m of the p+q order pq , where p∈0,1,2,...,q∈0,1,2,..., expressed as: Based on the zero-order origin moment (p=0, q=0) and the first-order origin moment (p=1, q=0), get the coordinates of the center of mass of the rectangle (x0, y0): Then combined with the center of mass, define the center μ pq for: Based on the Hu moment transformation principle, the p+q central moment is first normalized to obtain: Based on the normalized η pq , the invariant moment group is further obtained using the following formula: Hu1=h 20 +n 02 ; Hu3=(h 30 -3rd 12 ) 2 +(3rd 21 -or 03 ) 2 ; Hu4=(η 30 +n 12 ) 2 +(the 21 +n 03 ) 2 ; Hu5=(h 30 -3rd 12 )(or 30 +n 12 )[(or 30 +n 12 ) 2 -3(h 21 +n 03 ) 2 ]+(3rd 21 -or 03 )(or 21 +n 03 ([(or 30 +n 12 ) 2 -(or 21 +n 03 ) 2 ]; Hu6=(h 20 -or 02 )[(or 30 +n 12 ) 2 -(or 21 +n 02 ) 2 ]+4th 11 (or 30 +n 12 )(or 21 +n 03 ); Hu7=(3rd 21 -or 03 )(or 21 +n 03 )[(or 30 +n 12 ) 2 -3(h 21 +n 03 ) 2 ]+(n 30 -3rd 12 )(or 21 +n 03 )[3(h 30 +n 12 ) 2 -(or 21 +n 03 ) 2 ]; The following method is further used to obtain the hemoglobin absorption coefficient: right The r component and g component of each element are converted according to the following biologically defined hemoglobin absorption coefficient formula: And obtain it according to the following formula The mean coefficient of : Finally, the second rectangular sub-image is synthesized The corresponding eigenvector F i : Obtaining a feature vector of a second rectangular sub-image sequence; Build a fully connected network based on the feature vector to predict the lesion category; Train and learn sample parameters based on data samples; Identify and determine suspicious lesions in the image and output them.

2. The lesion identification method according to claim 1, characterized in that: The method of obtaining the digestive tract image and converting it into an RGB matrix is ​​as follows: a human digestive tract image is captured by a camera, with a resolution of M×M, and a general image processing conversion is performed to obtain its memory RGB matrix M rgb , define each element as p m,n , m = 0, 1, 2, ..., n = 0, 1, 2, ..., RGB matrix M rgb It is expressed as:

3. The lesion identification method as claimed in claim 2, characterized in that: The method of converting the RGB matrix into a YUV matrix and separating the original Y component matrix is ​​as follows: using a general RGB to YUV image processing algorithm, M is obtained. rgb The corresponding YUV matrix, and separate the original Y component matrix MY rgb .

4. The method for identifying lesions according to claim 3, characterized in that: The method of corroding the original Y component matrix to obtain the first Y component matrix is ​​specifically as follows: based on general image processing, MY rgb After executing the corrosion algorithm, the first Y component matrix is ​​obtained 5. The method for identifying lesions according to claim 4, characterized in that: The method of performing regional segmentation on the first Y component matrix to obtain a set of regional target sub-blocks and boundary lines is specifically as follows: using a watershed algorithm, Perform region segmentation to obtain s region target sub-blocks separated by boundaries, where s is a positive integer, and each sub-block is surrounded by a closed-loop boundary line, thereby generating s boundary line sets L.

6. The method for identifying lesions according to claim 5, characterized in that: The first rectangular sub-image sequence corresponding to the RGB matrix is ​​obtained by: based on the general minimum bounding rectangle algorithm, based on the boundary line set L, in M rgb The corresponding s first rectangular sub-images are obtained, marked as M i , where i = 0, 1, 2, ... s-1, and the rectangles are sorted from large to small based on their area, to obtain the first data sequence S0, expressed as: S0 = {M0, M1, ..., M k-1 }.

7. The method for identifying lesions according to claim 6, characterized in that: The specific method for obtaining the second rectangular sub-graph sequence of the first rectangular sub-graph sequence is as follows: Set a threshold θ, where θ > 50 * 50, filter out the sub-graphs in S0 with an area smaller than θ, and obtain the second data sequence S1 of the second rectangular sub-graph sequence with j sub-graphs, where j < s, which is expressed as: S1 = {M0, M1,..., M j-1}; The pixel elements within the closed-loop boundary line of the non-sub-block region within each minimum bounding rectangle in the second sequence S1 are set to 0, and a second rectangular sub-image containing only the regional target after segmentation is obtained, which is marked as Then the third data sequence S2 is obtained, where 0, 1, 2, ... j-1, is expressed as:

8. The method for identifying lesions according to claim 1, characterized in that: It further includes: constructing a fully connected network based on the feature vector to predict the lesion category, specifically: input F i And use the topology model of fully connected + BatchNorm + Softmax to build a k + 1 layer fully connected network to predict five common lesion categories.

9. The method for identifying lesions according to claim 8, characterized in that: It further includes: training and learning sample parameters based on data samples, specifically: through N number of samples containing common lesions, combining the model in the fully connected network on the PC side, training in Pytorch through the graphics card, obtaining the weight parameters of each layer of the learning fully connected layer, and writing them into the built-in chip Flash of the capsule endoscope, using a general model conversion method to deploy the network inference operation to the chip side.

10. The method for identifying lesions according to claim 9, characterized in that: It further includes: identifying and determining suspicious lesions in the image and outputting them, specifically: implementing reasoning by the capsule endoscope to determine F i Corresponding to prect00, prect01, ..., set the prediction probability threshold po, ​​0.85<po≤1.0, pi, pi<0.4, for each RGB matrix M rgb The following algorithm is used: Define the output probability value prectW, W∈{1, 2, 3, 4, 5}, if prectW≥po and other probability values ​​prectG, G≠W, G∈{1, 2, 3, 4, 5}, prectG≤pi, then we get F i The corresponding M i The sub-image data of the W-th category lesion is extracted as image data using a general image algorithm and transmitted to a PC for further processing; Otherwise, discard this F i , and repeat the above steps for the next eigenvector until the RGB matrix M rgb All first data sequences S0 are processed to complete lesion identification.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the lesion identification method according to any one of claims 1 to 10 are implemented.

12. A lesion identification device, comprising: one or more processors; Memory; as well as One or more computer programs, wherein the one or more computer programs are stored in the memory and are configured to be executed by the one or more processors, wherein the processor implements the steps of the lesion identification method as described in any one of claims 1 to 10 when executing the computer program.