CN109377500B - Image segmentation method based on neural network and terminal equipment - Google Patents
Image segmentation method based on neural network and terminal equipment Download PDFInfo
- Publication number
- CN109377500B CN109377500B CN201811086125.5A CN201811086125A CN109377500B CN 109377500 B CN109377500 B CN 109377500B CN 201811086125 A CN201811086125 A CN 201811086125A CN 109377500 B CN109377500 B CN 109377500B
- Authority
- CN
- China
- Prior art keywords
- neural network
- pixel point
- preset
- slices
- image
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10072—Tomographic images
- G06T2207/10081—Computed x-ray tomography [CT]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Abstract
The invention is applicable to the technical field of artificial intelligence, and provides an image segmentation method and terminal equipment based on a neural network.
Description
Technical Field
The invention belongs to the technical field of artificial intelligence, and particularly relates to an image segmentation method and terminal equipment based on a neural network.
Background
In real life, engineering personnel often need to extract a target image from a single image, for example: a doctor needs to screen out images of different organs, such as heart images, liver images, etc., from CT images of the human body.
At present, screening of different target objects in a human CT image is often completed by doctors or scientific researchers with expert knowledge, but because of the large number of images to be identified, a great deal of time is consumed for manually screening and cutting the target objects.
Disclosure of Invention
In view of the above, the embodiment of the invention provides an image segmentation method and terminal equipment based on a neural network, so as to solve the problems of low security and outdated data existing in the prior art.
A first aspect of an embodiment of the present invention provides an image segmentation method based on a neural network, including:
acquiring an original image, wherein the original image contains an object image to be segmented;
processing the original image through a preset equalization algorithm to generate a reference image;
dividing the reference image into a plurality of slices, reading pixel point data of each pixel point in the slices, and numbering the slices according to a preset sequence;
inputting pixel point data of a preset number of adjacent slices into a preset neural network model at the same time, and outputting segmentation parameters corresponding to the slices with the central numbers, wherein the preset number is an odd number larger than 1;
and taking the pixel covered by the slice corresponding to the segmentation parameter meeting the preset condition as the pixel covered by the target object image so as to segment the target object image.
A second aspect of an embodiment of the present invention provides a terminal device, including a memory and a processor, where the memory stores a computer program executable on the processor, and when the processor executes the computer program, the processor implements the following steps:
acquiring an original image, wherein the original image contains an object image to be segmented;
processing the original image through a preset equalization algorithm to generate a reference image;
dividing the reference image into a plurality of slices, reading pixel point data of each pixel point in the slices, and numbering the slices according to a preset sequence;
inputting pixel point data of a preset number of adjacent slices into a preset neural network model at the same time, and outputting segmentation parameters corresponding to the slices with the central numbers, wherein the preset number is an odd number larger than 1;
and taking the pixel covered by the slice corresponding to the segmentation parameter meeting the preset condition as the pixel covered by the target object image so as to segment the target object image.
A third aspect of the embodiments of the present invention provides a computer readable storage medium storing a computer program which when executed by a processor performs the steps of:
acquiring an original image, wherein the original image contains an object image to be segmented; processing the original image through a preset equalization algorithm to generate a reference image; dividing the reference image into a plurality of slices, reading pixel point data of each pixel point in the slices, and numbering the slices according to a preset sequence; inputting pixel point data of a preset number of adjacent slices into a preset neural network model at the same time, and outputting segmentation parameters corresponding to the slices with the central numbers, wherein the preset number is an odd number larger than 1; and taking the pixel covered by the slice corresponding to the segmentation parameter meeting the preset condition as the pixel covered by the target object image so as to segment the target object image.
Optionally, the processing the original image by a preset equalization algorithm to generate a reference image includes:
reading CT values corresponding to all pixel points in the original image; calculating the average value of CT values corresponding to all pixel points in the original image, dividing the CT value corresponding to each pixel point by the quotient of the average value, and taking the quotient as the normalization value corresponding to each pixel point; dividing all the normalized values into a preset number of sections, distributing section grades to each section according to the order of the normalized values from small to large, and determining the section grade to which the normalized value corresponding to each pixel point belongs;
by the formula:converting the normalized value corresponding to each pixel point into a reference value, wherein conv is as follows i The classtotal is the total amount of the interval divided by the normalized value, the pixnum is the number of pixels in the original image, and the preconv is the reference value corresponding to the pixel point i i The section grade to which the normalized value corresponding to the pixel point i belongs is that the pixel point i corresponds toclassnum j Is the number of normalized values contained in the interval class j. And generating a reference image according to the corresponding relation between each pixel point and the reference value.
Optionally, the pixel point data includes a reference value corresponding to the pixel point;
the pixel point data of the slices with adjacent numbers in the preset number are simultaneously input into a preset neural network model, and the segmentation parameters corresponding to the slices with the central numbers are output, and the method comprises the following steps: selecting and combining a preset number of adjacent serial numbers of slices to generate a target slice group; constructing a pixel matrix of the target slice group according to the reference value of each pixel point in the target slice group and the position coordinates of each pixel point in the target slice group; performing dimension reduction operation on the pixel matrix through five pooling layers Maxpool of the VGG neural network to obtain a visual feature vector; and importing the visual feature vector into a full connection layer of the VGG neural network, and outputting the segmentation parameters corresponding to the centrally numbered slices in the target slice group.
Optionally, before the capturing the original image, the method further includes:
acquiring training feature vectors of a plurality of training slice groups and training segmentation parameters of a slice centered in the training slice groups; the following steps are repeatedly executed until the adjusted VGG neural network meets the preset convergence condition: taking the training feature vector as input of a VGG neural network, taking the training segmentation parameter as output of the VGG neural network, and updating each layer of parameters in a full-connection layer of the VGG neural network by a random gradient descent method; and outputting the adjusted VGG neural network as a preset neural network model.
Optionally, the method further comprises: calculating the cross entropy loss function value of the adjusted VGG neural network; and if the cross entropy loss function value is smaller than a preset threshold value, judging that the adjusted VGG neural network meets a preset convergence condition.
In the embodiment of the invention, the original image is processed based on a preset equalization algorithm to generate the reference image, after the reference image is divided into a plurality of slices, the pixel data of each pixel in the slices is read, the numbers are allocated to the slices, the pixel data of the slices with the preset numbers adjacent to each other are simultaneously input into a preset neural network model, the dividing parameters corresponding to the slices with the central numbers are output, and the pixel covered by the slice corresponding to the dividing parameters meeting the preset conditions is taken as the pixel covered by the target object image, so that the target object image is divided, and the automation degree of image division and recognition is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an implementation of an image segmentation method based on a neural network according to an embodiment of the present invention;
fig. 2 is a flowchart of a specific implementation of an image segmentation method S102 based on a neural network according to an embodiment of the present invention;
fig. 3 is a flowchart of a specific implementation of an image segmentation method S104 based on a neural network according to an embodiment of the present invention;
FIG. 4 is a training flow diagram of a neural network model provided by an embodiment of the present invention;
fig. 5 is a block diagram of an image segmentation apparatus based on a neural network according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to illustrate the technical scheme of the invention, the following description is made by specific examples.
Fig. 1 shows a flow of implementation of the neural network-based image segmentation method according to the embodiment of the present invention, where the flow of the method includes steps S101 to S105. The specific implementation principle of each step is as follows.
S101: and acquiring an original image, wherein the original image contains the target object image to be segmented.
In the embodiment of the invention, the original image exists mainly in the form of a CT image, and it can be understood that the CT technology uses precisely collimated X-ray beams, gamma rays, ultrasonic waves and the like to scan a section around a certain area of a human body together with a detector with extremely high sensitivity to generate a CT image. Because the CT image reflects the data of an area of the human body, the area contains the target object image and the non-target object image, and only the target object image is segmented from the CT image, the scientific research personnel can conduct targeted deep research on the target object image in the follow-up research.
S102, processing the original image through a preset equalization algorithm to generate a reference image.
It can be understood that, in the embodiment of the present invention, although the CT data of the pixels of one original image may be directly extracted from the original image data, the unprocessed CT data, due to the error occurring in the scanning process and the non-uniformity of each CT image, may occur if the segmentation is directly performed by the neural network model, and thus, in the embodiment of the present invention, the original image needs to be processed by an equalization algorithm first to generate a reference image with different pixels having different differences and uniform manufacturing standards of different CT images.
As an embodiment of the present invention, as shown in fig. 2, the step S102 includes:
s1021: and reading CT values corresponding to all pixel points in the original image.
It can be understood that in the embodiment of the present invention, when an original image in the form of a CT image is produced, the CT values corresponding to the respective pixels in the original image are obtained according to the CT values corresponding to the respective pixels in the original image.
In the present embodiment, the CT value is a unit of measurement for measuring the density of a certain local tissue or organ of a human body, and is generally called Henry's unit. Different CT values exhibit different gray values in the original image.
S1022, calculating an average value of CT values corresponding to all the pixel points in the original image, and dividing the CT value corresponding to each pixel point by a quotient of the average value to obtain a normalized value corresponding to each pixel point.
S1023, dividing all the normalized values into a preset number of sections, distributing section grades to the sections according to the order of the normalized values from small to large, and determining the section grade to which the normalized value corresponding to each pixel point belongs.
Illustratively, assuming that the normalized value of all pixels is between intervals [0-5], if all normalized values are divided into 20 intervals, the span of each interval is 0.25, and interval ranks are assigned to the respective intervals: interval class corresponding to interval 0-0.25) is 1, interval class corresponding to interval 0.25-0.5) is 2, and so on. And determining the section grade to which each normalized value belongs according to the actual situation.
And S1024, converting the normalized value corresponding to each pixel point into a reference value through a formula 1.
Optionally, the formula 1 includes:wherein the conv i The classtotal is the total amount of the interval divided by the normalized value, the pixnum is the number of pixels in the original image, and the preconv is the reference value corresponding to the pixel point i i The class num is the section class to which the normalized value corresponding to the pixel point i belongs j For normalization contained in interval class jNumber of values.
S1025, generating a reference image according to the corresponding relation between each pixel point and the reference value.
In the embodiment of the invention, since each pixel point corresponds to a reference value and each pixel point corresponds to a position coordinate, the reference image can be generated based on the correspondence between the pixel point and the reference value.
According to the embodiment of the invention, the method for converting the CT value corresponding to each pixel point into the reference value generates the reference image with outstanding difference of each pixel point and uniform manufacturing standard of different CT images, and is beneficial to cutting the reference image through the neural network.
S103, dividing the reference image into a plurality of slices, reading pixel point data of each pixel point in the slices, and numbering the slices according to a preset sequence.
Notably, a reference image is divided into slices of substantially equal shaped area, each front slice being in fact a part of the reference image.
Optionally, in the embodiment of the present invention, the pixel point data is a reference value corresponding to one pixel point.
S104, inputting pixel point data of a preset number of adjacent slices into a preset neural network model at the same time, and outputting segmentation parameters corresponding to the slices with the central numbers, wherein the preset number is an odd number larger than 1.
Notably, in the embodiment of the present invention, instead of inputting the pixel data of each slice into the preset neural network model separately, in order to avoid occasional errors that may be caused by intermittent slice calculation as much as possible due to the continuous coverage of the object image in each slice, the embodiment of the present invention inputs the pixel data of a preset number of slices adjacent to each other into the neural network model simultaneously (for example, inputs the pixel data of 3 continuous slices into the neural network model simultaneously), and outputs only the segmentation parameters corresponding to the slice with the center number for distinguishing the slice covered by the object image or the slice covered by the non-object image when outputting the result.
It can be understood that, only the input parameters are set to the pixel point data of the preset number of adjacent slices in the training process of the neural network model, and the output parameters are set to the segmentation parameters corresponding to the preset number-centered slices, so that the neural network model trained in this way can realize the segmentation parameters corresponding to the output number-centered slices.
For example, assuming that there are 100 slices in total, if the preset number is 3, the pixel point data of the slices with numbers 1-3 are input into the neural network model, and then the segmentation parameters of the slices with numbers 2 are output; inputting pixel point data of the slice with the number of 2-4 into the neural network model, and outputting segmentation parameters of the slice with the number of 3; after inputting the pixel data of the slices with the numbers 3-5 into the neural network model, the segmentation parameters of the slice with the number 4 are output, and the segmentation parameters of the slice with the number 99 are output.
Notably, the above method cannot obtain the segmentation parameters of the slices with the numbers 1 and 100, but since the final purpose of obtaining the segmentation parameters of the slices is to segment the target image from the original image, according to the actual condition of CT scan, the probability of covering the pixel points of the edge of the original image with the target image is very small, and since the proportion of the area of the slices to the original image is very small in practical application, although the embodiment of the present invention cannot calculate the segmentation parameters of the slices with the largest numbers and the smallest numbers, the segmentation of the target image is not affected in practical application.
As another embodiment of the present invention, as shown in fig. 3, the step S104 includes:
s1041, selecting and combining a preset number of adjacent numbered slices to generate a target slice group.
It will be appreciated that the embodiment of the present invention first needs to select a preset number of odd numbered adjacent slices, for example 3 slices, to form the target slice group.
S1042, constructing a pixel matrix of the target slice group according to the reference value of each pixel point in the target slice group and the position coordinates of each pixel point in the target slice group.
In this embodiment, each pixel point of the target slice group corresponds to a reference value, and therefore, based on the position coordinates of each pixel point in the target slice group as the position coordinates in the pixel matrix, the reference value corresponding to the pixel point is used as the value of the element of the pixel matrix corresponding to the coordinates of the pixel point, so that one target slice group can be converted into one pixel matrix.
S1043, performing dimension reduction operation on the pixel matrix through five pooling layers Maxpool of the VGG neural network to obtain a visual feature vector.
In the embodiment of the invention, the pixel matrixes corresponding to the target slice groups are respectively processed through the pre-trained visual geometry group (Visual Geometry Group, VGG) neural network.
In the embodiment of the invention, the constructed pixel matrix is imported into a five-layer pooling layer of the VGG neural network, and the visual feature vector corresponding to the pixel matrix is generated through five dimension reduction operations. It should be noted that, the convolution kernel of the pooling layer may be determined based on the size of the pixel matrix, the device records a corresponding relation table between the size of the matrix and the convolution kernel in advance, after the pixel matrix is constructed, the number of rows and the number of columns of the matrix are obtained, so as to determine the size of the matrix, query the size of the convolution kernel corresponding to the size, and adjust the pooling layer in the VGG neural network based on the size of the convolution kernel, so that the convolution kernel used in the process of performing the dimension reduction operation is matched with the pixel matrix.
In this embodiment, a parameter output interface is configured after the five-layer pooling layer Maxpool of the VGG neural network to derive the visual feature vector of the intermediate variable for subsequent operations.
S1044, importing the visual feature vector into a full connection layer of the VGG neural network, and outputting the segmentation parameters corresponding to the centrally numbered slices in the target slice group.
In this embodiment, the visual feature vector is imported to the full-connection layer of the VGG neural network, and since the VGG neural network is trained and learned, a plurality of segmentation parameters corresponding to the visual feature vector can be generated after the operation of the full-connection layer.
Because the output result of the VGG neural network is a vector formed by numbers, each element of the vector corresponds to a segmentation parameter, in the embodiment of the invention, the average value of each element in the vector is taken as the segmentation parameter corresponding to the centrally numbered slice in the target slice group, and the average value is taken as the final output result of the VGG neural network.
Further, before the original image is acquired, there is a training process for the neural network model, as another embodiment of the present invention, as shown in fig. 4, the training process for the neural network model includes:
s401, training feature vectors of a plurality of training slice groups and training segmentation parameters of a slice centered in the training slice groups are obtained.
Preferably, the number of the training slice groups is greater than 1000, so that the identification accuracy of the neural network is improved. The training slice group may be a training slice group whose segmentation parameters have been determined historically, and the training segmentation parameters are preset segmentation parameters corresponding to the training slice group.
It should be noted that, the training feature vectors of each training slice group have the same format, so that the meaning of the parameters output by each channel is fixed when the training is performed on the network, and the accuracy of the neural network is improved.
S402, repeatedly executing the following steps until the adjusted VGG neural network meets the preset convergence condition: and taking the training feature vector as input of the VGG neural network, taking the training segmentation parameter as output of the VGG neural network, and updating each layer parameter in the full-connection layer of the VGG neural network by a random gradient descent method.
Optionally, determining that the adjusted VGG neural network meets a preset convergence condition includes: and calculating a cross entropy loss function value of the adjusted VGG neural network, and if the cross entropy loss function value is smaller than a preset threshold value, judging that the adjusted VGG neural network meets a preset convergence condition.
S403, outputting the adjusted VGG neural network as a preset neural network model.
S105, taking the pixel covered by the slice corresponding to the segmentation parameter meeting the preset condition as the pixel covered by the target object image so as to segment the target object image.
Alternatively, in the embodiment of the present invention, if the segmentation parameter smaller than the preset parameter threshold is used as the segmentation parameter that satisfies the preset condition, each slice of the reference image may be divided into a slice covered by the target image and a slice covered by the non-target image. Since the reference image and the pixel points in the original image are in one-to-one correspondence, the target image can be segmented from the original image.
In the embodiment of the invention, the original image is processed based on a preset equalization algorithm to generate the reference image, after the reference image is divided into a plurality of slices, the pixel data of each pixel in the slices is read, the numbers are allocated to the slices, the pixel data of the slices with the preset numbers adjacent to each other are simultaneously input into a preset neural network model, the dividing parameters corresponding to the slices with the central numbers are output, and the pixel covered by the slice corresponding to the dividing parameters meeting the preset conditions is taken as the pixel covered by the target object image, so that the target object image is divided, and the automation degree of image division and recognition is improved.
Corresponding to the neural network-based image segmentation method described in the above embodiments, fig. 5 shows a block diagram of the neural network-based image segmentation apparatus according to the embodiment of the present invention, and for convenience of explanation, only the portions related to the embodiment of the present invention are shown.
Referring to fig. 5, the apparatus includes:
the acquiring module 501 is configured to acquire an original image, where the original image includes an image of a target object to be segmented;
the generating module 502 is configured to process the original image through a preset equalization algorithm, and generate a reference image;
a reading module 503, configured to divide the reference image into a plurality of slices, read pixel point data of each pixel point in the slices, and number the slices according to a preset sequence;
the calculating module 504 is configured to input pixel point data of a preset number of slices adjacent to each other in number into a preset neural network model at the same time, and output a segmentation parameter corresponding to a slice with a central number, where the preset number is an odd number greater than 1;
the segmentation module 505 is configured to segment the target image by using a pixel covered by a slice corresponding to a segmentation parameter that satisfies a preset condition as the pixel covered by the target image.
Optionally, the processing the original image by a preset equalization algorithm to generate a reference image includes:
reading CT values corresponding to all pixel points in the original image;
calculating the average value of CT values corresponding to all pixel points in the original image, dividing the CT value corresponding to each pixel point by the quotient of the average value, and taking the quotient as the normalization value corresponding to each pixel point;
dividing all the normalized values into a preset number of sections, distributing section grades to each section according to the order of the normalized values from small to large, and determining the section grade to which the normalized value corresponding to each pixel point belongs;
by the formula:converting the normalized value corresponding to each pixel point into a reference value, wherein conv is as follows i The classtotal is the total amount of the interval divided by the normalized value, the pixnum is the number of pixels in the original image, and the preconv is the reference value corresponding to the pixel point i i The normalized value corresponding to the pixel point i belongs toInterval level of (C), said classnum j Is the number of normalized values contained in the interval class j.
And generating a reference image according to the corresponding relation between each pixel point and the reference value.
Optionally, the pixel point data includes a reference value corresponding to the pixel point;
the pixel point data of the slices with adjacent numbers in the preset number are simultaneously input into a preset neural network model, and the segmentation parameters corresponding to the slices with the central numbers are output, and the method comprises the following steps:
selecting and combining a preset number of adjacent serial numbers of slices to generate a target slice group;
constructing a pixel matrix of the target slice group according to the reference value of each pixel point in the target slice group and the position coordinates of each pixel point in the target slice group;
performing dimension reduction operation on the pixel matrix through five pooling layers Maxpool of the VGG neural network to obtain a visual feature vector;
and importing the visual feature vector into a full connection layer of the VGG neural network, and outputting the segmentation parameters corresponding to the centrally numbered slices in the target slice group.
Optionally, before the capturing the original image, the method further includes:
acquiring training feature vectors of a plurality of training slice groups and training segmentation parameters of a slice centered in the training slice groups;
the following steps are repeatedly executed until the adjusted VGG neural network meets the preset convergence condition:
taking the training feature vector as input of a VGG neural network, taking the training segmentation parameter as output of the VGG neural network, and updating each layer of parameters in a full-connection layer of the VGG neural network by a random gradient descent method;
and outputting the adjusted VGG neural network as a preset neural network model.
Optionally, the method further comprises: calculating the cross entropy loss function value of the adjusted VGG neural network;
and if the cross entropy loss function value is smaller than a preset threshold value, judging that the adjusted VGG neural network meets a preset convergence condition.
In the embodiment of the invention, the original image is processed based on a preset equalization algorithm to generate the reference image, after the reference image is divided into a plurality of slices, the pixel data of each pixel in the slices is read, the numbers are allocated to the slices, the pixel data of the slices with the preset numbers adjacent to each other are simultaneously input into a preset neural network model, the dividing parameters corresponding to the slices with the central numbers are output, and the pixel covered by the slice corresponding to the dividing parameters meeting the preset conditions is taken as the pixel covered by the target object image, so that the target object image is divided, and the automation degree of image division and recognition is improved.
Fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 6, the terminal device 6 of this embodiment includes: a processor 60, a memory 61 and a computer program 62 stored in the memory 61 and executable on the processor 60, such as a neural network based image segmentation program. The processor 60, when executing the computer program 62, implements the steps of the various neural network-based image segmentation method embodiments described above, such as steps 101 through 105 shown in fig. 1. Alternatively, the processor 60, when executing the computer program 62, performs the functions of the modules/units of the apparatus embodiments described above, e.g., the functions of the units 501 to 505 shown in fig. 5.
Illustratively, the computer program 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60 to complete the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions for describing the execution of the computer program 62 in the terminal device 6.
The terminal device 6 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The terminal device may include, but is not limited to, a processor 60, a memory 61. It will be appreciated by those skilled in the art that fig. 6 is merely an example of the terminal device 6 and does not constitute a limitation of the terminal device 6, and may include more or less components than illustrated, or may combine certain components, or different components, e.g., the terminal device may further include an input-output device, a network access device, a bus, etc.
The processor 60 may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or a memory of the terminal device 6. The memory 61 may be an external storage device of the terminal device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used for storing the computer program and other programs and data required by the terminal device. The memory 61 may also be used for temporarily storing data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.
Claims (6)
1. An image segmentation method based on a neural network, comprising the steps of:
acquiring an original image, wherein the original image contains an object image to be segmented;
processing the original image through a preset equalization algorithm to generate a reference image;
dividing the reference image into a plurality of slices, reading pixel point data of each pixel point in the slices, and numbering the slices according to a preset sequence;
inputting pixel point data of a preset number of adjacent slices into a preset neural network model at the same time, and outputting segmentation parameters corresponding to the slices with the central numbers, wherein the preset number is an odd number larger than 1;
taking pixel points covered by slices corresponding to segmentation parameters meeting preset conditions as the pixel points covered by the target object image so as to segment the target object image;
the processing the original image through a preset equalization algorithm to generate a reference image comprises the following steps:
reading CT values corresponding to all pixel points in the original image;
calculating the average value of CT values corresponding to all pixel points in the original image, dividing the CT value corresponding to each pixel point by the quotient of the average value, and taking the quotient as the normalization value corresponding to each pixel point;
dividing all the normalized values into a preset number of sections, distributing section grades to each section according to the order of the normalized values from small to large, and determining the section grade to which the normalized value corresponding to each pixel point belongs;
by the formula:converting the normalized value corresponding to each pixel point into a reference value, wherein conv is as follows i The classtotal is the normalized value and is the reference value corresponding to the pixel point iThe total amount of the divided intervals, i.e. the number of pixels in the original image, the preconv i The class num is the section class to which the normalized value corresponding to the pixel point i belongs j The number of normalized values contained in interval class j;
generating a reference image according to the corresponding relation between each pixel point and the reference value;
the pixel point data comprise reference values corresponding to the pixel points;
the pixel point data of the slices with adjacent numbers in the preset number are simultaneously input into a preset neural network model, and the segmentation parameters corresponding to the slices with the central numbers are output, and the method comprises the following steps:
selecting and combining a preset number of adjacent serial numbers of slices to generate a target slice group;
constructing a pixel matrix of the target slice group according to the reference value of each pixel point in the target slice group and the position coordinates of each pixel point in the target slice group;
performing dimension reduction operation on the pixel matrix through five pooling layers Maxpool of the VGG neural network to obtain a visual feature vector;
and importing the visual feature vector into a full connection layer of the VGG neural network, and outputting the segmentation parameters corresponding to the centrally numbered slices in the target slice group.
2. The neural network-based image segmentation method of claim 1, further comprising, prior to the acquiring the original image:
acquiring training feature vectors of a plurality of training slice groups and training segmentation parameters of a slice centered in the training slice groups;
the following steps are repeatedly executed until the adjusted VGG neural network meets the preset convergence condition:
taking the training feature vector as input of a VGG neural network, taking the training segmentation parameter as output of the VGG neural network, and updating each layer of parameters in a full-connection layer of the VGG neural network by a random gradient descent method;
and outputting the adjusted VGG neural network as a preset neural network model.
3. The neural network-based image segmentation method of claim 2, further comprising: calculating the cross entropy loss function value of the adjusted VGG neural network;
and if the cross entropy loss function value is smaller than a preset threshold value, judging that the adjusted VGG neural network meets a preset convergence condition.
4. A terminal device comprising a memory and a processor, said memory storing a computer program executable on said processor, characterized in that said processor, when executing said computer program, performs the steps of:
acquiring an original image, wherein the original image contains an object image to be segmented;
processing the original image through a preset equalization algorithm to generate a reference image;
dividing the reference image into a plurality of slices, reading pixel point data of each pixel point in the slices, and numbering the slices according to a preset sequence;
inputting pixel point data of a preset number of adjacent slices into a preset neural network model at the same time, and outputting segmentation parameters corresponding to the slices with the central numbers, wherein the preset number is an odd number larger than 1;
taking pixel points covered by slices corresponding to segmentation parameters meeting preset conditions as the pixel points covered by the target object image so as to segment the target object image;
the processing the original image through a preset equalization algorithm to generate a reference image comprises the following steps:
reading CT values corresponding to all pixel points in the original image;
calculating the average value of CT values corresponding to all pixel points in the original image, dividing the CT value corresponding to each pixel point by the quotient of the average value, and taking the quotient as the normalization value corresponding to each pixel point;
dividing all the normalized values into a preset number of sections, distributing section grades to each section according to the order of the normalized values from small to large, and determining the section grade to which the normalized value corresponding to each pixel point belongs;
by the formula:converting the normalized value corresponding to each pixel point into a reference value, wherein conv is as follows i The classtotal is the total amount of the interval divided by the normalized value, the pixnum is the number of pixels in the original image, and the preconv is the reference value corresponding to the pixel point i i The class num is the section class to which the normalized value corresponding to the pixel point i belongs j The number of normalized values contained in interval class j;
generating a reference image according to the corresponding relation between each pixel point and the reference value;
the pixel point data comprise reference values corresponding to the pixel points;
the pixel point data of the slices with adjacent numbers in the preset number are simultaneously input into a preset neural network model, and the segmentation parameters corresponding to the slices with the central numbers are output, and the method comprises the following steps:
selecting and combining a preset number of adjacent serial numbers of slices to generate a target slice group;
constructing a pixel matrix of the target slice group according to the reference value of each pixel point in the target slice group and the position coordinates of each pixel point in the target slice group;
performing dimension reduction operation on the pixel matrix through five pooling layers Maxpool of the VGG neural network to obtain a visual feature vector;
and importing the visual feature vector into a full connection layer of the VGG neural network, and outputting the segmentation parameters corresponding to the centrally numbered slices in the target slice group.
5. The terminal device of claim 4, further comprising, prior to said acquiring the original image:
acquiring training feature vectors of a plurality of training slice groups and training segmentation parameters of a slice centered in the training slice groups;
the following steps are repeatedly executed until the adjusted VGG neural network meets the preset convergence condition:
taking the training feature vector as input of a VGG neural network, taking the training segmentation parameter as output of the VGG neural network, and updating each layer of parameters in a full-connection layer of the VGG neural network by a random gradient descent method;
and outputting the adjusted VGG neural network as a preset neural network model.
6. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811086125.5A CN109377500B (en) | 2018-09-18 | 2018-09-18 | Image segmentation method based on neural network and terminal equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811086125.5A CN109377500B (en) | 2018-09-18 | 2018-09-18 | Image segmentation method based on neural network and terminal equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109377500A CN109377500A (en) | 2019-02-22 |
CN109377500B true CN109377500B (en) | 2023-07-25 |
Family
ID=65405507
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811086125.5A Active CN109377500B (en) | 2018-09-18 | 2018-09-18 | Image segmentation method based on neural network and terminal equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109377500B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110266645A (en) * | 2019-05-21 | 2019-09-20 | 平安科技(深圳)有限公司 | Verification method, device, server and the medium of real time data |
CN110163864B (en) * | 2019-05-28 | 2020-12-04 | 北京迈格威科技有限公司 | Image segmentation method and device, computer equipment and storage medium |
CN110285764B (en) * | 2019-06-14 | 2021-07-02 | 南京中电熊猫平板显示科技有限公司 | Display panel cutting precision measuring method and display panel |
CN110853045B (en) * | 2019-09-24 | 2022-02-11 | 西安交通大学 | Vascular wall segmentation method and device based on nuclear magnetic resonance image and storage medium |
CN110826566B (en) * | 2019-11-01 | 2022-03-01 | 北京环境特性研究所 | Target slice extraction method based on deep learning |
CN111612689B (en) * | 2020-05-28 | 2024-04-05 | 上海联影医疗科技股份有限公司 | Medical image processing method, medical image processing device, computer equipment and readable storage medium |
CN111738236B (en) * | 2020-08-14 | 2020-11-20 | 之江实验室 | Image segmentation identification method, device and system of self-adaptive hierarchy |
CN112331310A (en) * | 2020-10-10 | 2021-02-05 | 深圳市智影医疗科技有限公司 | Medical image data display method and device, storage medium and intelligent equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105488781A (en) * | 2015-06-01 | 2016-04-13 | 深圳市第二人民医院 | Dividing method based on CT image liver tumor focus |
CN105574859A (en) * | 2015-12-14 | 2016-05-11 | 中国科学院深圳先进技术研究院 | Liver tumor segmentation method and device based on CT (Computed Tomography) image |
CN107203989A (en) * | 2017-04-01 | 2017-09-26 | 南京邮电大学 | End-to-end chest CT image dividing method based on full convolutional neural networks |
CN107220980A (en) * | 2017-05-25 | 2017-09-29 | 重庆理工大学 | A kind of MRI image brain tumor automatic division method based on full convolutional network |
CN107977969A (en) * | 2017-12-11 | 2018-05-01 | 北京数字精准医疗科技有限公司 | A kind of dividing method, device and the storage medium of endoscope fluorescence image |
CN108447062A (en) * | 2018-02-01 | 2018-08-24 | 浙江大学 | A kind of dividing method of the unconventional cell of pathological section based on multiple dimensioned mixing parted pattern |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7627173B2 (en) * | 2004-08-02 | 2009-12-01 | Siemens Medical Solutions Usa, Inc. | GGN segmentation in pulmonary images for accuracy and consistency |
US10580131B2 (en) * | 2017-02-23 | 2020-03-03 | Zebra Medical Vision Ltd. | Convolutional neural network for segmentation of medical anatomical images |
-
2018
- 2018-09-18 CN CN201811086125.5A patent/CN109377500B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105488781A (en) * | 2015-06-01 | 2016-04-13 | 深圳市第二人民医院 | Dividing method based on CT image liver tumor focus |
CN105574859A (en) * | 2015-12-14 | 2016-05-11 | 中国科学院深圳先进技术研究院 | Liver tumor segmentation method and device based on CT (Computed Tomography) image |
CN107203989A (en) * | 2017-04-01 | 2017-09-26 | 南京邮电大学 | End-to-end chest CT image dividing method based on full convolutional neural networks |
CN107220980A (en) * | 2017-05-25 | 2017-09-29 | 重庆理工大学 | A kind of MRI image brain tumor automatic division method based on full convolutional network |
CN107977969A (en) * | 2017-12-11 | 2018-05-01 | 北京数字精准医疗科技有限公司 | A kind of dividing method, device and the storage medium of endoscope fluorescence image |
CN108447062A (en) * | 2018-02-01 | 2018-08-24 | 浙江大学 | A kind of dividing method of the unconventional cell of pathological section based on multiple dimensioned mixing parted pattern |
Non-Patent Citations (1)
Title |
---|
基于自适应区域的医学图像自动分割;刘有军 等;北京工业大学学报(第08期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN109377500A (en) | 2019-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109377500B (en) | Image segmentation method based on neural network and terminal equipment | |
US11521380B2 (en) | Shadow and cloud masking for remote sensing images in agriculture applications using a multilayer perceptron | |
CN111429421B (en) | Model generation method, medical image segmentation method, device, equipment and medium | |
CN109584209B (en) | Vascular wall plaque recognition apparatus, system, method, and storage medium | |
CN109147890A (en) | A kind of generation method and equipment of medical report | |
CN111028327A (en) | Three-dimensional point cloud processing method, device and equipment | |
US11120297B2 (en) | Segmentation of target areas in images | |
CN110210543B (en) | Image classification system, method, apparatus and storage medium | |
WO2020168648A1 (en) | Image segmentation method and device, and computer-readable storage medium | |
CN111882565B (en) | Image binarization method, device, equipment and storage medium | |
CN109410189B (en) | Image segmentation method, and image similarity calculation method and device | |
CN111223128A (en) | Target tracking method, device, equipment and storage medium | |
CN109961435B (en) | Brain image acquisition method, device, equipment and storage medium | |
CN108597589B (en) | Model generation method, target detection method and medical imaging system | |
CN112200780B (en) | Bone tissue positioning method, device, computer equipment and storage medium | |
CN116228753B (en) | Tumor prognosis evaluation method, device, computer equipment and storage medium | |
CN111369489B (en) | Image identification method and device and terminal equipment | |
CN110929731B (en) | Medical image processing method and device based on pathfinder intelligent search algorithm | |
CN110633630B (en) | Behavior identification method and device and terminal equipment | |
CN112734740B (en) | Method for training target detection model, target detection method and device | |
CN113240681B (en) | Image processing method and device | |
CN112233126B (en) | Windowing method and device for medical image | |
CN111932538B (en) | Method, device, computer equipment and storage medium for analyzing thyroid gland atlas | |
CN111784705A (en) | Method, device and equipment for delineating region of interest and storage medium | |
CN107341799B (en) | Diagnostic data acquisition method and device |
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 |