CN111862071B - Method for measuring CT value of lumbar 1 vertebral body based on CT image - Google Patents

Method for measuring CT value of lumbar 1 vertebral body based on CT image Download PDF

Info

Publication number
CN111862071B
CN111862071B CN202010741396.0A CN202010741396A CN111862071B CN 111862071 B CN111862071 B CN 111862071B CN 202010741396 A CN202010741396 A CN 202010741396A CN 111862071 B CN111862071 B CN 111862071B
Authority
CN
China
Prior art keywords
image
pixel
value
edge
lumbar
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010741396.0A
Other languages
Chinese (zh)
Other versions
CN111862071A (en
Inventor
张堃
韩宇
范陆健
张泽众
冯文宇
华亮
李文俊
鲍毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Borazhe Technology Co ltd
Nantong University
Original Assignee
Hangzhou Borazhe Technology Co ltd
Nantong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Borazhe Technology Co ltd, Nantong University filed Critical Hangzhou Borazhe Technology Co ltd
Priority to CN202010741396.0A priority Critical patent/CN111862071B/en
Publication of CN111862071A publication Critical patent/CN111862071A/en
Application granted granted Critical
Publication of CN111862071B publication Critical patent/CN111862071B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration by the use of histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H50/00ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
    • G16H50/20ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for computer-aided diagnosis, e.g. based on medical expert systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10072Tomographic images
    • G06T2207/10081Computed x-ray tomography [CT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20132Image cropping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing
    • G06T2207/30008Bone
    • G06T2207/30012Spine; Backbone
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing
    • G06T2207/30096Tumor; Lesion

Abstract

The invention discloses a method for measuring CT value of lumbar 1 vertebral body based on CT image, which comprises the following steps: preprocessing a CT image to obtain a training set; step 2: performing image block cutting operation on the training set to obtain a data set; step 3: lumbar 1 vertebral body segmentation is carried out through deep learning; step 4: edge detection is used for accurately positioning the lumbar 1 vertebral body; step 5: filling holes; step 6: searching for a lumbar 1 cone pixel point; step 7: and accumulating the lumbar 1 cone pixel points and converting the CT value. The invention designs a method for measuring and calculating the CT value of the lumbar 1 vertebral body, which is based on the thought of dividing and calculating firstly, and can accurately measure and calculate the CT value of the lumbar 1 vertebral body.

Description

Method for measuring CT value of lumbar 1 vertebral body based on CT image
Technical Field
The invention relates to the technical field of lumbar vertebra measurement, in particular to a method for measuring a CT value of a lumbar 1 vertebral body based on CT images.
Background
The CT value of the lumbar 1 vertebral body can be analyzed to evaluate the bone density, so that the diagnosis of diseases such as bone mass reduction, osteoporosis and the like can be assisted.
The traditional CT value for measuring the lumbar 1 vertebral body has the problems of low precision, high cost and the like. The patent provides a method for performing digital image processing by computer deep learning directly based on CT images, and is very convenient for measuring the CT value of the lumbar 1 vertebral body for doctors to diagnose diseases.
Disclosure of Invention
The invention aims to provide a method for measuring a CT value of a lumbar 1 cone based on a CT image, which comprises the steps of preprocessing the CT image, segmenting the lumbar 1 cone through deep learning, traversing the whole slice to accumulate pixel points of the lumbar 1 cone, and multiplying the number of the pixel points by the area of each pixel to obtain the area of the whole lumbar 1 cone, namely the CT value, so as to solve the problems in the background art.
In order to achieve the above purpose, the present invention provides the following technical solutions: a method for measuring CT value of lumbar 1 vertebral body based on CT image, comprising the following steps:
step 1: preprocessing a CT image to obtain a training set;
step 2: performing image block cutting operation on the training set to obtain a data set;
step 3: lumbar 1 vertebral body segmentation is carried out through deep learning;
step 4: edge detection is used for accurately positioning the lumbar 1 vertebral body;
step 5: filling holes;
step 6: searching for a lumbar 1 cone pixel point;
step 7: and accumulating the lumbar 1 cone pixel points and converting the CT value.
Preferably, the step 1 includes the steps of:
step 1.1: performing histogram equalization on the image by adopting a CLAHE algorithm;
step 1.2: adjusting the integral gray level of the image by adopting gamma conversion;
step 1.3: the normalized image pixel value is between 0 and 1.
Preferably, the step 1.1 includes: in the CLAHE algorithm, for a pixel neighborhood, the contrast is calculated by the slope of a transformation function, the slope of the transformation function is proportional to the cumulative distribution function CDF slope of the pixel neighborhood, and the CLAHE algorithm clips the histogram according to a specified threshold value and uniformly distributes the clipping portions into the histogram before calculating the CDF of the pixel neighborhood.
Preferably, the step 1.2 includes: the gamma conversion realizes gray stretching by performing nonlinear operation on gray values to enable the gray values of the processed image to show a nonlinear index relationship with the gray values of the image before processing;
the gamma transformation formula is as follows:
I OUT =cI IN γ
wherein I is in For the gray value of the processed image, I OUT For the gray value of the image before processing, c is the gray scale factor, and gamma is the transformation index;
when gamma takes different values, the input gray value takes 0 to 255 and normalizes the input gray value to be between 0 and 1, and when gamma is smaller than 1, the gray value of the image is improved; when gamma is greater than 1, the overall brightness of the image is pulled down; when gamma is equal to 1, the whole brightness is consistent with the original image, and the value is 0.5.
Preferably, the step 1.3 includes: normalization of the pixels is achieved by dividing all pixel values by a maximum pixel value of 255;
the calculation formula is as follows:
x'=(x-X_min)/(X_max-X_min);
where X' is the normalization result, X is the input pixel value, x_min is the minimum value of all input image pixels, and x_max is the maximum value of all input image pixels.
Preferably, the step 2 includes: for the training set, a group of random coordinates are generated during clipping, the random coordinates are taken as central points, and the image blocks with the sizes of 48 x 48 are clipped, so that a data set is obtained.
Preferably, the step 3 includes: adding an R2 module and a Attention Augment module into the Unet;
the U-shaped structure is generally symmetrical and comprises 12 units F1-F12, wherein the left sides F1-F6 are contracted paths, and the right sides F6-F12 are expanded paths;
the R2 module includes a residual learning unit and a recursive convolution:
residual learning unit: setting an input of a neural network unit as x, an expected output as H (x), defining a residual mapping F (x) =h (x) -x, and directly transmitting x to the output, wherein the target of the neural network unit learning is the residual mapping F (x) =h (x) -x, the residual learning unit consists of a series of convolution layers and a shortcut, the input x is transmitted to the output of the residual learning unit through the shortcut, and the output of the residual learning unit is z=f (x) +x;
recursive convolution: setting the input as x, and carrying out continuous convolution on the input x, wherein the current input is added to the convolution output of each time as the input of the next convolution;
the R2 module replaces the common convolution in the residual error learning unit with the recursive convolution;
attention Augment is a mapping of a series of key-value pairs obtained by querying, and the implementation steps of the Attention Augment module include the following:
by inputting the input size (w, h, c in ) Is subjected to 1*1 convolution output QKV matrix with the size (w, h, 2*d) k +d v ) Wherein w, h,2*d k +d V Respectively representing the width, length and depth of the matrix, C in The number of layers for the input image features;
dividing QKV matrix from depth channel to obtain Q, K, V three matrices, wherein the depth channel of Q, K, V three matrices is d k 、d k 、d v
Dividing Q, K, V three matrixes into N equal matrixes from a depth channel respectively by adopting a structure of a multi-head attention mechanism;
flattening the segmented Q, K, V matrix to generate three matrices of flat_ Q, flat _ K, flat _v, namely compressing the Q, K, V matrix from the length-width direction to 1 dimension while keeping the depth channel of the Q, K, V matrix unchanged, wherein the two matrices of flat_ Q, flat _k have the sizes (w×h, d) k ) The flat_v matrix has a size (w×h, d) v );
Attention Augment performing matrix multiplication operation by using two matrixes of flat_ Q, flat _K, calculating a weight matrix, adding calculation of embedding relative positions on the basis of the weight matrix, and calculating the weights of the Q matrix in the length-width directions to obtain the relative position information of each point on the feature map;
splicing the attention characteristic matrix O and a normal convolution process according to the depth direction to obtain a Attention Augment result, wherein the calculation formula of the attention characteristic matrix O is as follows:
wherein Q is a query matrix of the input image data, K is a target matrix of the input image data, S H And S is W A log matrix of the relative positions of the image along the long and wide dimensions respectively,for scale, V is a numerical matrix of input image data.
Preferably, the step 4 includes: coarsely positioning possible edge points of the whole output result image by utilizing a Sobel operator of a pixel level, wherein the specific steps comprise:
step A1: for points (x, y) with gray values f (x, y) on CT image, x, y are respectivelyFor the abscissa and ordinate of the point, the partial derivative f of the gray value is calculated in both x, y directions x ' and f y ' the calculation formula is as follows:
f x ′=f(x+1,y-1)-f(x-1,y-1)+f(x+1,y)-f(x-1,y)+f(x+1,y+1)-f(x-1,y+1)
f y ′=f(x-1,y+1)-f(x-1,y-1)+f(x,y+1)-f(x-1,y)+f(x,y-1)-f(x+1,y-1);
step A2: the gradient of the point (x, y) is calculated as follows:
wherein f x ' (x, y) and f y ' x, y represents a first order derivative of the x and y directions, G [ f (x, y)]Is a gradient;
step A3: setting a threshold value as t, and when G [ f (x, y) ] & gtt, judging that the point (x, y) is a possible edge point of the image, and storing the possible edge point in a two-dimensional array;
after the pixel-level Sobel operator performs image edge rough positioning, the Zernike moment operator is utilized to accurately position the image edge on the edge points which are stored in the array and are roughly positioned, and the specific steps are as follows:
step B1, carrying out convolution calculation on the roughly positioned edge image and a 7*7 template of the Zernike moment;
step B2, calculating the edge angle theta of each pixel point, and the gray level differences k and l= (l) at two sides of the edge 1 +l 2 ) Parameter/2, where l is the vertical distance from the center of the unit circle to the edge, where l 1 ,l 2 The vertical distance from the center of a circle to the edge of each unit circle of two pixel points in the same edge angle direction;
step B3, when the parameters of the pixel point meet the judgment conditions k is more than or equal to k t ∩|l 2 -l 1 |≤l t Calculating accurate coordinate parameters by using a sub-pixel edge coordinate formula, wherein the formula is as follows:
wherein x is s Is the abscissa of the accurate coordinate point, y s Is the ordinate of the accurate coordinate point, N is the length of the template, l is the vertical distance from the center of a unit circle to the edge, phi is the included angle between the edge and the X axis, and k t For the gray level difference, l, at the two sides of the lower edge of the threshold t t The vertical distance from the center of a circle to the edge is the threshold t;
step B4: and when the parameters of the pixel points do not meet the edge judging conditions, excluding the pixel points, and repeating the steps B1, B2 and B3 until all the edge points are detected.
Preferably, the step 5 includes: the principle formula of hole filling is as follows:
wherein X is k X is the result graph after the Kth treatment k-1 Is a result graph after the K-1 treatment;
filling holes in the A graph to obtain a complement A of the A graph C Wherein the A picture is an input image, namely an image to be filled with holes;
construction of X 0 ,X 0 An image in which one pixel is white and the other pixels are all black;
by B to X 0 Expansion treatment, wherein B is a structural element;
by A C Intersection is calculated on the result after expansion, the result after intersection is limited in the hole, and then iteration is carried out until X k-1 And X is k The same applies to the end of filling.
Preferably, the step 6 includes:
reducing the dimension of the pixel points into one-dimensional data, performing secondary differentiation, and changing all the pixel points into pure black or pure white;
processing the whole image into a two-dimensional array, wherein 0 represents a pure black pixel point, 1 represents a pure white pixel point, and the number of rows and columns of the two-dimensional array are the size of the resolution of the image;
the step of adopting breadth-first traversal, the breadth-first traversal comprises the following steps:
step C1: traversing from line 0, judging the values of the left, right and lower three direction array points when the first pixel point is 1, when the value of the neighbor point around the first pixel point is 1,
the pixels are all in the same bubble;
step C2: pressing neighbor points of the first pixel point into a queue;
step C3: when the access of the first pixel point is finished, setting the value 1 of the first pixel point to 0 to indicate that the access is finished;
step C4: the left side of the pixel point set as the 0 point is stored in a list;
step C5: when the first layer circulation is finished, obtaining a bubble, returning the number of list elements by using a len method, and calculating the number of bubble points, namely the number of lumbar 1 cone pixel points;
step C6: C1-C5 are circulated until the whole image is traversed;
the step 7 comprises the following steps: step 6, obtaining the total pixel occupied by the lumbar 1 cone through breadth-first traversal, and multiplying the total pixel by the area of each pixel to obtain the area of the lumbar 1 cone, namely a CT value, wherein the specific calculation formula is as follows:
s=n×a
s represents the total area of the lumbar 1 vertebral body, namely the Computed Tomography (CT) value, n represents the number of pixels occupied by the lumbar 1 vertebral body, and a represents the area of each pixel.
Compared with the prior art, the invention has the beneficial effects that:
the invention designs a method for calculating the CT value of the lumbar 1 vertebral body, which is based on the thought of dividing and calculating, can accurately calculate the CT value of the lumbar 1 vertebral body, is used as a computer-aided diagnosis mode, helps an imaging doctor to quickly locate a focus, avoids missed diagnosis and misdiagnosis possibly caused by subjective film reading, can accurately and efficiently realize the division of the lumbar 1 vertebral body, and conveniently and effectively realizes the calculation of the CT value of the lumbar 1 vertebral body.
Drawings
FIG. 1 is a flow chart of the present invention for calculating CT values of the lumbar 1 vertebral body;
FIG. 2 is a diagram of the AA R2U-Net model of the present invention;
FIG. 3 is a flowchart of an algorithm for searching for the lumbar 1 cone pixel point and accumulating the same in the invention;
FIG. 4 is a selected CT raw image;
fig. 5 is a graph of the segmentation result after the segmentation process;
FIG. 6 is an edge detection graph;
FIG. 7 is a hole filling diagram;
fig. 8 is a graph of output gray level versus input gray level.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1 to 8, the present invention provides a technical solution: a method for measuring CT value of lumbar 1 vertebral body based on CT image, comprising the following steps:
step one: image preprocessing
The CT original image is subjected to the following operation in the preprocessing aspect:
1. performing histogram equalization on the image by adopting a CLAHE algorithm;
the CLAHE is an AHE improvement which is mainly characterized in that local contrast is limited, and the noise amplified degree is effectively reduced. In the CLAHE algorithm, for a certain pixel neighborhood, the contrast is calculated from the slope of the transformation function, which is proportional to the CDF slope of the neighborhood. Prior to computing the CDF for the neighborhood, the CLAHE will crop the histogram according to a specified threshold and evenly distribute the crop portions into the histogram.
2. Adjusting the integral gray level of the image by adopting gamma conversion;
gamma conversion (Gamma Transform) is a common power law conversion operation in image processing. The gamma transformation realizes gray stretching by performing nonlinear operation on gray values to enable the gray values of the processed image to show a nonlinear index relationship with the gray values of the image before processing.
The gamma transformation formula is as follows:
I out =cI in γ
wherein I is in To process the gray value of the pre-image, I OUT For the gray value of the processed image, c is the gray scale factor and γ is the transform index.
When gamma is smaller than 1, gamma transformation improves the gray value of the image, and the image is visually lightened; when gamma is greater than 1, the gamma transformation will pull down the image gray value, the image darkens visually; when gamma is equal to 1, the whole brightness is consistent with the original image, and the value is 0.5.
3. Normalized image pixel values between 0 and 1;
first, it is to be appreciated that for most image data, the pixel value is an integer between 0 and 255.
The fitting is typically performed using smaller weight values when deep neural network training, while the model training process may be slowed down when the values of the training data are larger integer values. Therefore, it is generally necessary to normalize the pixels of the image so that each pixel value of the image is between 0 and 1. When the pixels of the image are in the 0-1 range, the image is still valid and can be viewed normally, since it is still between 0-255.
Normalization of the pixels may be achieved by dividing all pixel values by a maximum pixel value, typically 255. It should be noted that this method can be used regardless of whether the picture is a single-channel black-and-white picture or a multi-channel color picture; regardless of whether the maximum pixel value of the picture is 255 or not, it is divided by 255.
The calculation formula is as follows:
x'=(x-X_min)/(X_max-X_min)
after the algorithm processing, the overall contrast of the original image is enhanced, the better fitting of the subsequent experimental model training is ensured, and the better segmentation effect is realized.
Step two: image block cropping operation
Since the CT original image data amount is insufficient, image block cropping is performed to expand the training data set. For the training set, a set of random coordinates is generated during clipping, and the coordinates are taken as central points, so that an image block with the size of 48 x 48 is clipped, and a large number of data sets are obtained. Of course, the corresponding standard diagram is cut by the same method, so that the original diagram cutting diagram and the standard diagram cutting diagram are in one-to-one correspondence, and the accuracy of the subsequent model training is ensured.
Step three: lumbar 1 vertebral body segmentation by deep learning
The network for deep learning can be selected independently, a scheme is provided, but the scheme is not exclusive, the more accurate the segmentation of the lumbar 1 vertebral body is, and the more accurate the CT value of the lumbar 1 vertebral body is finally obtained naturally.
R2 modules and Attention Augment modules (namely AA R2U-Net model) are added into the Unet; the Unet structure is a symmetrical U-shaped structure, and comprises 12 units (F1-F12) in design, wherein the left sides F1-F6 are contracted paths for feature extraction; the right side F6-F12 is an expansion path for accurate prediction of the recovery of details.
Wherein the R2 module comprises a residual learning unit and a recursive convolution.
(1) Residual learning unit: assuming that the input of a neural network unit is x, the desired output is H (x), and a residual map F (x) =h (x) -x is additionally defined, if x is directly transferred to the output, the target to be learned by the neural network unit is the residual map F (x) =h (x) -x, the residual learning unit is composed of a series of convolution layers and a shortcut, the input x is transferred to the output of the residual learning unit through the shortcut, and the output of the residual learning unit is z=f (x) +x;
(2) Recursive convolution: assuming that the input is x, the input x is continuously convolved, and the convolved output of each time is added with the current input as the input of the next convolution.
The R2 module replaces the normal convolution in the residual learning unit with a recursive convolution.
The AttenationnAdgement essence is that a series of key-value pair mapping is obtained through inquiry; first, by inputting the input size (w, h, c in ) Is subjected to 1*1 convolution output QKV matrix with the size (w, h, 2*d) k +d v ) Wherein w, h,2*d k +d V Respectively represents the width, length and depth of the matrix, C in The number of layers for the input image features;
dividing QKV matrix from depth channel to obtain Q, K, V three matrices with depth channel sizes d k 、d k 、d v The method comprises the steps of carrying out a first treatment on the surface of the Then, a structure of a multi-head attention mechanism is adopted, and Q, K, V three matrixes are respectively divided into N equal matrixes from a depth channel to carry out subsequent calculation, wherein the multi-head attention mechanism expands the original single attention calculation into a plurality of smaller and parallel independent calculations, so that the model can learn characteristic information in different subspaces.
Flattening the segmented Q, K, V matrix to obtain three matrices of flat_ Q, flat _ K, flat _v, i.e. compressing Q, K, V with depth channel unchanged from length-width direction to 1 dimension, wherein the first two matrices have sizes (w×h, d) k ) The latter matrix size is (w.h, d) v ) The method comprises the steps of carrying out a first treatment on the surface of the Then, the method of preservation of Self-preservation uses two matrixes of flat_ Q, flat _K to carry out matrix multiplication operation, a weight matrix is calculated, relative position embedding calculation is added on the basis, the Q matrix is subjected to weight calculation in the length-width directions to obtain the relative position information of each point on the feature map, and the transformation of the feature positions is prevented to reduce the final effect of the model.
Splicing (concat) the attention characteristic matrix O and the normal convolution process according to the depth direction to obtain a Attention Augment result; the calculation formula of the attention characteristic matrix O is as follows:
wherein Q is a query matrix of input image data, K is a target matrix of input image data, V is a numerical matrix of input image data, SH and SW are relative position log matrices of images along long and wide dimensions respectively,is a scale of dimensions.
Step four: edge detection accurate positioning lumbar 1 vertebral body
And coarsely positioning possible edge points of the whole output result image by using a Sobel operator at a pixel level.
The specific steps for detecting the image coarse edge by utilizing the Sobel edge operator are as follows:
1. for a point (x, y) with gray value f (x, y) on the CT image, calculating partial derivative f of gray value in two directions of x and y x ' and f y ′;
The calculation formula is as follows:
f x ′=f(x+1,y-1)-f(x-1,y-1)+f(x+1,y)-f(x-1,y)+f(x+1,y+1)-f(x-1,y+1)
f y ′=f(x-1,y+1)-f(x-1,y-1)+f(x,y+1)-f(x-1,y)+f(x,y-1)-f(x+1,y-1)
the gradient G [ f (x, y) ] of the point (x, y) is calculated:
wherein f x ' (x, y) and f y ' x, y represents a first order derivative of the x and y directions, G [ f (x, y)]Is a gradient;
when G [ f (x, y) ] & gtt, the threshold value is set as t, and the point can be judged to be the possible edge point of the image. These possible edge points are then saved in a two-dimensional array. Where the threshold may be chosen to be a small value so that all possible edge points can be located.
After coarse positioning of the image edge is performed by using a pixel-level Sobel operator, the edge of the image is accurately positioned by using a Zernike moment operator to the coarse positioning edge point stored in the array. The method comprises the following specific steps:
1. performing convolution calculation on the roughly positioned edge image and a 7*7 template of the Zernike moment;
2. calculating the edge angle theta of each pixel point, and the gray level difference k and l= (l) at two sides of the edge 1 +l 2 ) Parameters such as/2; wherein l 1 ,l 2 The vertical distance from the center of a circle to the edge of the unit circle of two pixel points in the same edge angle direction is l, and is the vertical distance from the center of the circle to the edge of the unit circle;
3. if the parameter of the pixel point meets the judgment condition k is more than or equal to k t ∩|l 2 -l 1 |≤l t The accurate coordinate parameters are calculated by using a sub-pixel edge coordinate formula, and the formula is as follows:
wherein x is s Is the abscissa of the accurate coordinate point, y s Is the ordinate of the accurate coordinate point, N is the length of the template, l is the vertical distance from the center of a unit circle to the edge, phi is the included angle between the edge and the X axis, and k t For the gray level difference, l, at the two sides of the lower edge of the threshold t t The vertical distance from the center of a circle to the edge is the threshold t;
if the edge judgment condition is not satisfied, the pixel point can be eliminated, and the steps are repeated until all the edge points are detected.
Step five: hole filling
Principle formula:
wherein X is 0 An image in which one pixel is white and the other pixels are all black; hole filling is carried out on an A image, wherein the A image is an input image, namely an image to be filled with holes, and a complement A of the A image is obtained firstly C The method comprises the steps of carrying out a first treatment on the surface of the B is a structural element. First we construct X 0 ThenBy B to X 0 Expansion treatment with A C Intersection of the two is performed to limit the result to the hole so as to avoid that the expansion result exceeds the size of the hole, and then iteration is performed until X k-1 And X is k The same applies to the end of filling.
Step six: searching for lumbar 1 cone pixel point
The pixel is reduced to one-dimensional data and is simply halved. The halving is to turn all pixels into pure black or pure white. The whole picture is processed into a two-dimensional array, black is replaced by 0, white is replaced by 1, and the number of rows and columns of the two-dimensional array is the size of the image resolution. Firstly, traversing from line 0, when encountering the first 1 (white pixel point), starting to judge the left, right and lower three direction array point values, wherein the surrounding connection point (neighbor) values are 1 to indicate that the two are in the same bubble, and then pressing neighbors into a queue; then, when the access of the point is completed, the value 1 of the point is required to be set to 0 to indicate that the access is completed, so that the right neighbor point is prevented from pressing the left neighbor point into a queue to access again during the access, and the area of the bubble is enlarged, even the bubble is circulated; then the left side of the 0 point is stored in a list; when the first layer circulation is finished, a bubble is obtained, and the number of bubble points, namely the number of lumbar 1 cone pixel points, is known only by using the len method, namely the number of return list elements. And then the steps are consistent until the whole graph is traversed.
Step seven: accumulating lumbar 1 cone pixel points and converting CT values
The total pixel points occupied by the lumbar 1 cone can be obtained through the previous step, and then the total pixel points are multiplied by the area of each pixel, so that the area of the lumbar 1 cone, namely the CT value, can be obtained. The specific calculation formula is as follows:
s=n×a
s represents the whole area of the lumbar 1 cone, namely the CT value, n represents the number of pixels occupied by the lumbar 1 cone, and a represents the area of each pixel.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (3)

1. The method for measuring the CT value of the lumbar 1 vertebral body based on the CT image is characterized by comprising the following steps of:
step 1: preprocessing a CT image to obtain a training set;
step 2: performing image block cutting operation on the training set to obtain a data set;
step 3: lumbar 1 vertebral body segmentation is carried out through deep learning;
step 4: edge detection is used for accurately positioning the lumbar 1 vertebral body;
step 5: filling holes;
step 6: searching for a lumbar 1 cone pixel point;
step 7: accumulating lumbar 1 cone pixel points and converting CT values;
the step 1 comprises the following steps:
step 1.1: performing histogram equalization on the image by adopting a CLAHE algorithm;
step 1.2: adjusting the integral gray level of the image by adopting gamma conversion;
step 1.3: normalized image pixel values between 0 and 1;
the step 1.1 includes: in the CLAHE algorithm, for a pixel neighborhood, the contrast is calculated by the slope of a transformation function, the slope of the transformation function is in direct proportion to the accumulated distribution function CDF slope of the pixel neighborhood, and before calculating the CDF of the pixel neighborhood, the CLAHE algorithm cuts the histogram according to a specified threshold value and uniformly distributes the cut part into the histogram;
the step 1.2 comprises the following steps: the gamma conversion realizes gray stretching by performing nonlinear operation on gray values to enable the gray values of the processed image to show a nonlinear index relationship with the gray values of the image before processing;
the gamma transformation formula is as follows:
I OUT =cI IN γ
wherein I is IN For the gray value of the processed image, I OUT For the gray value of the image before processing, c is the gray scale factor, and gamma is the transformation index;
when gamma takes different values, the input gray value takes 0 to 255 and normalizes the input gray value to be between 0 and 1, and when gamma is smaller than 1, the gray value of the image is improved; when gamma is greater than 1, the overall brightness of the image is pulled down; when gamma is equal to 1, the overall brightness is consistent with the original image, and the value is 0.5;
the step 1.3 includes: normalization of the pixels is achieved by dividing all pixel values by a maximum pixel value of 255;
the calculation formula is as follows:
x'=(x-X_min)/(X_max-X_min);
wherein X' is a normalization result, X is an input pixel value, x_min is a minimum value in all input image pixels, and x_max is a maximum value in all input image pixels;
the step 2 comprises the following steps: for the training set, generating a group of random coordinates during cutting, and cutting an image block with the size of 48 x 48 by taking the random coordinates as a central point to obtain a data set;
the step 3 comprises the following steps: adding an R2 module and a Attention Augment module into the Unet;
the U-shaped structure is generally symmetrical and comprises 12 units F1-F12, wherein the left sides F1-F6 are contracted paths, and the right sides F6-F12 are expanded paths;
the R2 module includes a residual learning unit and a recursive convolution:
residual learning unit: setting an input of a neural network unit as x, an expected output as H (x), defining a residual mapping F (x) =h (x) -x, and directly transmitting x to the output, wherein the target of the neural network unit learning is the residual mapping F (x) =h (x) -x, the residual learning unit consists of a series of convolution layers and a shortcut, the input x is transmitted to the output of the residual learning unit through the shortcut, and the output of the residual learning unit is z=f (x) +x;
recursive convolution: setting the input as x, and carrying out continuous convolution on the input x, wherein the current input is added to the convolution output of each time as the input of the next convolution;
the R2 module replaces the common convolution in the residual error learning unit with the recursive convolution;
attention Augment is a mapping of a series of key-value pairs obtained by querying, and the implementation steps of the Attention Augment module include the following:
by inputting the input size (w, h, c in ) Is subjected to 1*1 convolution output QKV matrix with the size (w, h, 2*d) k +d v ) Wherein w, h,2*d k +d V Respectively representing the width, length and depth of the matrix, C in The number of layers for the input image features;
dividing QKV matrix from depth channel to obtain Q, K, V three matrices, wherein the depth channel of Q, K, V three matrices is d k 、d k 、d v
Dividing Q, K, V three matrixes into N equal matrixes from a depth channel respectively by adopting a structure of a multi-head attention mechanism;
flattening the segmented Q, K, V matrix to generate three matrices of flat_ Q, flat _ K, flat _v, namely compressing the Q, K, V matrix from the length-width direction to 1 dimension while keeping the depth channel of the Q, K, V matrix unchanged, wherein the two matrices of flat_ Q, flat _k have the sizes (w×h, d) k ) The flat_v matrix has a size (w×h, d) v );
Attention Augment performing matrix multiplication operation by using two matrixes of flat_ Q, flat _K, calculating a weight matrix, adding calculation of embedding relative positions on the basis of the weight matrix, and calculating the weights of the Q matrix in the length-width directions to obtain the relative position information of each point on the feature map;
splicing the attention characteristic matrix O and a normal convolution process according to the depth direction to obtain a Attention Augment result, wherein the calculation formula of the attention characteristic matrix O is as follows:
wherein Q is a query matrix of the input image data, K is a target matrix of the input image data, S H And S is W A log matrix of the relative positions of the image along the long and wide dimensions respectively,for scale, V is a numerical matrix of input image data;
the step 4 comprises the following steps: coarsely positioning possible edge points of the whole output result image by utilizing a Sobel operator of a pixel level, wherein the specific steps comprise:
step A1: for a point (x, y) with gray value f (x, y) on the CT image, x, y are respectively the abscissa and the ordinate of the point, and the partial derivative f 'of the gray value is calculated in the x, y directions' x And f' y The calculation formula is as follows:
f′ x =f(x+1,y-1)-f(x-1,y-1)+f(x+1,y)-f(x-1,y)+f(x+1,y+1)-f(x-1,y+1)
f′ y =f(x-1,y+1)-f(x-1,y-1)+f(x,y+1)-f(x-1,y)+f(x,y-1)-f(x+1,y-1);
step A2: the gradient of the point (x, y) is calculated as follows:
wherein f' x (x, y) and f' y (x, y) represents a first order derivative of the x-direction and the y-direction, G [ f (x, y)]Is a gradient;
step A3: setting a threshold value as t, and when G [ f (x, y) ] & gtt, judging that the point (x, y) is a possible edge point of the image, and storing the possible edge point in a two-dimensional array;
after the pixel-level Sobel operator performs image edge rough positioning, the Zernike moment operator is utilized to accurately position the image edge on the edge points which are stored in the array and are roughly positioned, and the specific steps are as follows:
step B1, carrying out convolution calculation on the roughly positioned edge image and a 7*7 template of the Zernike moment;
step B2, calculating the edge of each pixel pointAngle θ, gray level difference k, l= (l) on both sides of edge 1 +l 2 ) Parameter/2, where l is the vertical distance from the center of the unit circle to the edge, where l 1 ,l 2 The vertical distance from the center of a circle to the edge of each unit circle of two pixel points in the same edge angle direction;
step B3, when the parameters of the pixel point meet the judgment conditions k is more than or equal to k t ∩|l 2 -l 1 |≤l t Calculating accurate coordinate parameters by using a sub-pixel edge coordinate formula, wherein the formula is as follows:
wherein x is s Is the abscissa of the accurate coordinate point, y s Is the ordinate of the accurate coordinate point, N is the length of the template, l is the vertical distance from the center of a unit circle to the edge, phi is the included angle between the edge and the X axis, and k t For the gray level difference, l, at the two sides of the lower edge of the threshold t t The vertical distance from the center of a circle to the edge is the threshold t;
step B4: and when the parameters of the pixel points do not meet the edge judging conditions, excluding the pixel points, and repeating the steps B1, B2 and B3 until all the edge points are detected.
2. The method of claim 1, wherein the step 5 comprises: the principle formula of hole filling is as follows:
k=1,2,3...
wherein X is k X is the result graph after the Kth treatment k-1 Is a result graph after the K-1 treatment;
filling holes in the A graph to obtain a complement A of the A graph C Wherein the A picture is an input image, namely an image to be filled with holes;
construction of X 0 ,X 0 An image in which one pixel is white and the other pixels are all black;
by B to X 0 Expansion treatment, wherein B is a structural element;
by A C Intersection is calculated on the result after expansion, the result after intersection is limited in the hole, and then iteration is carried out until X k-1 And X is k The same applies to the end of filling.
3. The method of claim 1, wherein the step 6 comprises:
reducing the dimension of the pixel points into one-dimensional data, performing secondary differentiation, and changing all the pixel points into pure black or pure white;
processing the whole image into a two-dimensional array, wherein 0 represents a pure black pixel point, 1 represents a pure white pixel point, and the number of rows and columns of the two-dimensional array are the size of the resolution of the image;
the step of adopting breadth-first traversal, the breadth-first traversal comprises the following steps:
step C1: traversing from line 0, judging the values of the array points in the left, right and lower directions when the first pixel point is 1, and when the value of the neighbor point around the first pixel point is 1, putting the pixels in the same bubble;
step C2: pressing neighbor points of the first pixel point into a queue;
step C3: when the access of the first pixel point is finished, setting the value 1 of the first pixel point to 0 to indicate that the access is finished;
step C4: the left side of the pixel point set as the 0 point is stored in a list;
step C5: when the first layer circulation is finished, obtaining a bubble, returning the number of list elements by using a len method, and calculating the number of bubble points, namely the number of lumbar 1 cone pixel points;
step C6: C1-C5 are circulated until the whole image is traversed;
the step 7 comprises the following steps: step 6, obtaining the total pixel occupied by the lumbar 1 cone through breadth-first traversal, and multiplying the total pixel by the area of each pixel to obtain the area of the lumbar 1 cone, namely a CT value, wherein the specific calculation formula is as follows:
s=n×a
s represents the total area of the lumbar 1 vertebral body, namely the Computed Tomography (CT) value, n represents the number of pixels occupied by the lumbar 1 vertebral body, and a represents the area of each pixel.
CN202010741396.0A 2020-07-29 2020-07-29 Method for measuring CT value of lumbar 1 vertebral body based on CT image Active CN111862071B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010741396.0A CN111862071B (en) 2020-07-29 2020-07-29 Method for measuring CT value of lumbar 1 vertebral body based on CT image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010741396.0A CN111862071B (en) 2020-07-29 2020-07-29 Method for measuring CT value of lumbar 1 vertebral body based on CT image

Publications (2)

Publication Number Publication Date
CN111862071A CN111862071A (en) 2020-10-30
CN111862071B true CN111862071B (en) 2024-03-05

Family

ID=72948587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010741396.0A Active CN111862071B (en) 2020-07-29 2020-07-29 Method for measuring CT value of lumbar 1 vertebral body based on CT image

Country Status (1)

Country Link
CN (1) CN111862071B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112494063B (en) * 2021-02-08 2021-06-01 四川大学 Abdominal lymph node partitioning method based on attention mechanism neural network
CN113506308B (en) * 2021-07-06 2023-03-28 同济大学 Deep learning-based vertebra positioning and spine segmentation method in medical image

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1024457A2 (en) * 1999-01-29 2000-08-02 Mitsubishi Denki Kabushiki Kaisha Method for rendering graphical objects represented as surface elements
DE102004051508A1 (en) * 2003-10-21 2005-06-16 Leica Microsystems Wetzlar Gmbh Laser micro-dissection method for extraction of microscopic object from biological preparation using image analysis technique for automatic object identifcation and marking of required separation line
CN102637300A (en) * 2012-04-26 2012-08-15 重庆大学 Improved Zernike moment edge detection method
CN109087302A (en) * 2018-08-06 2018-12-25 北京大恒普信医疗技术有限公司 A kind of eye fundus image blood vessel segmentation method and apparatus
CN110264483A (en) * 2019-06-19 2019-09-20 东北大学 A kind of semantic image dividing method based on deep learning
CN110276356A (en) * 2019-06-18 2019-09-24 南京邮电大学 Eye fundus image aneurysms recognition methods based on R-CNN
CN110838126A (en) * 2019-10-30 2020-02-25 东莞太力生物工程有限公司 Cell image segmentation method, cell image segmentation device, computer equipment and storage medium
CN110930390A (en) * 2019-11-22 2020-03-27 郑州智利信信息技术有限公司 Chip pin missing detection method based on semi-supervised deep learning
CN111047605A (en) * 2019-12-05 2020-04-21 西北大学 Construction method and segmentation method of vertebra CT segmentation network model
CN111369623A (en) * 2020-02-27 2020-07-03 复旦大学 Lung CT image identification method based on deep learning 3D target detection

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1024457A2 (en) * 1999-01-29 2000-08-02 Mitsubishi Denki Kabushiki Kaisha Method for rendering graphical objects represented as surface elements
DE102004051508A1 (en) * 2003-10-21 2005-06-16 Leica Microsystems Wetzlar Gmbh Laser micro-dissection method for extraction of microscopic object from biological preparation using image analysis technique for automatic object identifcation and marking of required separation line
CN102637300A (en) * 2012-04-26 2012-08-15 重庆大学 Improved Zernike moment edge detection method
CN109087302A (en) * 2018-08-06 2018-12-25 北京大恒普信医疗技术有限公司 A kind of eye fundus image blood vessel segmentation method and apparatus
CN110276356A (en) * 2019-06-18 2019-09-24 南京邮电大学 Eye fundus image aneurysms recognition methods based on R-CNN
CN110264483A (en) * 2019-06-19 2019-09-20 东北大学 A kind of semantic image dividing method based on deep learning
CN110838126A (en) * 2019-10-30 2020-02-25 东莞太力生物工程有限公司 Cell image segmentation method, cell image segmentation device, computer equipment and storage medium
CN110930390A (en) * 2019-11-22 2020-03-27 郑州智利信信息技术有限公司 Chip pin missing detection method based on semi-supervised deep learning
CN111047605A (en) * 2019-12-05 2020-04-21 西北大学 Construction method and segmentation method of vertebra CT segmentation network model
CN111369623A (en) * 2020-02-27 2020-07-03 复旦大学 Lung CT image identification method based on deep learning 3D target detection

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A fast subpixel edge detection method using Sobel–Zernike moments operator;Qu Ying-Dong;《Image and Vision Computing》;第23卷(第1期);Pages 11-17 *
Recurrent Residual Convolutional Neural Network based on U-Net (R2U-Net) for Medical Image Segmentation;Md ZahangirAlom;《arXiv:1802.06955》;参见第1节、第3节、第4节、图 3、图 6 *
大视场大规模目标精确检测算法应用研究;张堃;《仪器仪表学报》;第41卷(第4期);参见第1节 *

Also Published As

Publication number Publication date
CN111862071A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
CN111798462B (en) Automatic delineation method of nasopharyngeal carcinoma radiotherapy target area based on CT image
CN111784628B (en) End-to-end colorectal polyp image segmentation method based on effective learning
CN110675406A (en) CT image kidney segmentation algorithm based on residual double-attention depth network
CN110321920A (en) Image classification method, device, computer readable storage medium and computer equipment
CN110889853A (en) Tumor segmentation method based on residual error-attention deep neural network
CN111862071B (en) Method for measuring CT value of lumbar 1 vertebral body based on CT image
CN110648331B (en) Detection method for medical image segmentation, medical image segmentation method and device
CN113592794B (en) Spine graph segmentation method of 2D convolutional neural network based on mixed attention mechanism
CN112686336A (en) Burn surface of a wound degree of depth classification system based on neural network
CN112750137A (en) Liver tumor segmentation method and system based on deep learning
CN115601268A (en) LDCT image denoising method based on multi-scale self-attention generation countermeasure network
CN111862123B (en) Deep learning-based CT abdominal artery blood vessel hierarchical recognition method
CN111047559A (en) Method for rapidly detecting abnormal area of digital pathological section
CN113052774B (en) Image optimization method, training method of related model, related device and equipment
CN112330613B (en) Evaluation method and system for cytopathology digital image quality
CN112529863B (en) Method and device for measuring bone mineral density
CN111126424B (en) Ultrasonic image classification method based on convolutional neural network
CN111798463A (en) Method for automatically segmenting multiple organs in head and neck CT image
CN111489318A (en) Medical image enhancement method and computer-readable storage medium
CN108447066B (en) Biliary tract image segmentation method, terminal and storage medium
CN116309806A (en) CSAI-Grid RCNN-based thyroid ultrasound image region of interest positioning method
CN114494952B (en) Mammary gland MRI image time sequence generation method based on perception loss
CN115797186A (en) Image restoration method and device, electronic equipment and storage medium
CN115880358A (en) Construction method of positioning model, positioning method of image mark points and electronic equipment
CN115578400A (en) Image processing method, and training method and device of image segmentation network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant