Pixel classification method, model training method, device, equipment and medium
By obtaining the pixel set and adjacency matrix in the pulmonary artery image sequence, extracting features and using the graph attention network, the problem of pulmonary artery classification errors is solved, and the classification accuracy and segmentation staining effect of pulmonary artery images are improved.
Patent Information
- Application Number
- CN202210545928.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-19
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-05-19
AI Technical Summary
Existing pulmonary artery classification methods are prone to classification errors in medical images, leading to inaccurate identification of the anatomical structures of the pulmonary arteries.
By obtaining the adjacency matrix representing the pixel set of the pulmonary artery skeleton and the adjacency relationship between pixels in the pulmonary artery image sequence, primary classification features are extracted, and combined with the graph attention network to determine the pulmonary artery category to improve classification accuracy.
It improves the classification accuracy of pulmonary artery pixels and enhances the accuracy of segmented staining of pulmonary arteries, making it easier for doctors to understand the patient's pulmonary artery anatomy.
Smart Images

Figure CN114972859B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of image processing, specifically pixel classification methods, model training methods, devices, equipment and media. Background Art
[0002] As the role of medical imaging in assisting medical diagnosis and treatment gradually increases, pulmonary medical imaging helps doctors understand the patient's lung condition. Classifying the pixels representing the pulmonary artery in pulmonary medical images helps doctors understand the anatomical structure of the patient's pulmonary artery when performing surgery on the patient. The existing pulmonary artery classification method mainly directly inputs the pulmonary artery image extracted from pulmonary medical images into the neural network for classification, which is prone to pulmonary artery classification errors. Summary of the invention
[0003] In view of this, multiple embodiments of the present specification are dedicated to providing pixel classification methods, model training methods, devices, equipment and media, so as to provide a method that can improve the accuracy of classification of pixels representing the pulmonary artery in a pulmonary artery image sequence to a certain extent.
[0004] One embodiment of the present specification proposes a pixel classification method, including: obtaining a pixel set representing a pulmonary artery skeleton in a pulmonary artery image sequence, and an adjacency matrix representing the adjacency relationship between pixels in the pixel set of the pulmonary artery skeleton; extracting primary classification features of the pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton; and using the primary classification features and the adjacency matrix to determine the pulmonary artery category to which the pixels in the pixel set of the pulmonary artery skeleton belong.
[0005] One embodiment of the present specification proposes a method for training a pixel classification model, comprising: constructing a training sample; wherein the training sample includes a pulmonary artery image sequence and a category label corresponding to a pixel representing the pulmonary artery in the pulmonary artery image sequence; obtaining a pixel set representing a pulmonary artery skeleton in the pulmonary artery image sequence, and an adjacency matrix representing the adjacency relationship between pixels in the pixel set of the pulmonary artery skeleton; extracting primary classification features of pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton; predicting the pulmonary artery category of the pixels in the pixel set of the pulmonary artery skeleton based on the primary classification features and the adjacency matrix; and updating the pixel classification model according to the loss generated by the predicted pulmonary artery category and the category label corresponding to the pixel representing the pulmonary artery.
[0006] One embodiment of the present specification proposes a pixel classification device, including: a pulmonary artery skeleton and adjacency matrix acquisition module, used to acquire a pixel set representing a pulmonary artery skeleton in a pulmonary artery image sequence, and an adjacency matrix representing the adjacency relationship between pixels in the pixel set of the pulmonary artery skeleton; a primary classification feature extraction module, used to extract primary classification features of pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton; a pulmonary artery skeleton classification module, used to use the primary classification features and the adjacency matrix to determine the pulmonary artery category to which the pixels in the pixel set of the pulmonary artery skeleton belong.
[0007] The present description is an embodiment that proposes a training device for a pixel classification model, including: a training sample construction module, used to construct training samples; wherein the training samples include a pulmonary artery image sequence and a category label corresponding to the pixel representing the pulmonary artery in the pulmonary artery image sequence; a pulmonary artery skeleton and adjacency matrix acquisition module, used to acquire a pixel set representing the pulmonary artery skeleton in the pulmonary artery image sequence, and an adjacency matrix representing the adjacency relationship between pixels in the pixel set of the pulmonary artery skeleton; a primary classification feature extraction module, used to extract primary classification features of pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton; a pulmonary artery category prediction module, used to predict the pulmonary artery category of the pixels in the pixel set of the pulmonary artery skeleton based on the primary classification features and the adjacency matrix; a pixel classification model generation module, used to update the pixel classification model according to the loss generated by the predicted pulmonary artery category and the category label corresponding to the pixel representing the pulmonary artery.
[0008] One embodiment of the present specification provides an electronic device, including: a processor; a memory for storing instructions executable by the processor; and the processor is used to execute the method described in the above embodiment.
[0009] One embodiment of the present specification provides a computer-readable storage medium, including: the storage medium stores a computer program, and the computer program is used to execute the method described in the above embodiment.
[0010] Multiple embodiments of the present specification extract a set of pixels representing the pulmonary artery skeleton in a pulmonary artery image sequence, construct an adjacency matrix based on the adjacency relationship between pixels in the pixel set, and then determine the pulmonary artery category of the pixels in the pixel set based on the primary pixel features of the pixels representing the pulmonary artery skeleton extracted by an initial pulmonary artery classification model of the pulmonary artery image and the adjacency matrix, thereby improving the accuracy of classification of the pixels representing the pulmonary artery skeleton to a certain extent, and further improving the accuracy of segmented staining of the pixels representing the pulmonary artery, which facilitates doctors to view the anatomical structure of the patient's pulmonary artery. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 Shown is a schematic diagram of the interaction of a pulmonary artery classification system in a scenario example provided by an embodiment.
[0012] Figure 2 Shown is a schematic diagram of the pulmonary artery segmentation staining results in a scenario example provided by an embodiment.
[0013] Figure 3 Shown is a schematic diagram of the interaction of a pulmonary artery classification system in a scenario example provided by an embodiment.
[0014] Figure 4 Shown is a schematic flow chart of a pixel classification method provided by one embodiment.
[0015] Figure 5 Shown is a schematic diagram of the classification results of the pulmonary artery skeleton provided by one embodiment.
[0016] Figure 6 Shown is a schematic diagram of a binary classification result of a pulmonary artery skeleton provided by one embodiment.
[0017] Figure 7 Shown is a flowchart of a training method for a pixel classification model provided by one embodiment.
[0018] Figure 8 Shown is a schematic diagram of a pixel classification device provided by one embodiment.
[0019] Fig. 9 Shown is a schematic diagram of a training device for a pixel classification model provided by one embodiment.
[0020] Fig.10 Shown is a schematic diagram of an electronic device provided in one embodiment. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the solution of this specification, the technical solution in the implementation of this specification will be clearly and completely described below in conjunction with the drawings in the implementation of this specification. Obviously, the described implementation is only a part of the implementation of this specification, not all of the implementations. Based on the implementation in this specification, all other implementations obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0022] See also Figure 1 and Figure 2, the embodiment of this specification provides a scenario example of a pulmonary artery classification system. When patient A is seeing a doctor, the doctor can prescribe a lung CT imaging examination form to patient A. After the lung CT imaging examination, patient A can obtain a lung CT image sequence, and then send the lung CT image sequence to the client. The client can send the lung CT image sequence to the server. The server first divides the lung CT image sequence into a first lung image sequence representing the left lung and a second lung image sequence representing the right lung. Then the server can process the first lung image sequence and the second lung image sequence into a first target lung image sequence and a second target lung image sequence with a data volume of 192*128*96 by upsampling and / or downsampling. The server preprocesses the first lung image sequence and the second lung image sequence respectively to obtain a pulmonary vascular image sequence representing the left lung and a pulmonary vascular image sequence representing the right lung, as well as a pulmonary trachea image sequence representing the left lung and a pulmonary trachea image sequence representing the right lung. The pulmonary vascular image sequence representing the left lung and the pulmonary vascular image sequence representing the right lung are spliced to obtain a pulmonary vascular image sequence. The pulmonary trachea image sequence representing the left lung and the pulmonary trachea image sequence representing the right lung are spliced to obtain the pulmonary trachea image sequence. Then, the server can perform pre-segmentation processing on the pulmonary vascular image sequence to obtain a pulmonary artery image sequence representing the pulmonary artery.
[0023] After acquiring the pulmonary artery image sequence, the server can input the pulmonary artery image sequence and the pulmonary trachea image sequence into the ResU-net model to extract the initial pixel features of the pixels representing the pulmonary artery in the pulmonary artery image sequence. The server can also use the skeletonize algorithm to extract the first pixel representing the pulmonary artery skeleton in the pulmonary artery image sequence, and construct a first adjacency matrix representing the adjacency relationship between the first pixels. Then, the server can use the first adjacency matrix as the attention mechanism of the ResU-net model, and extract the extended features corresponding to the first pixel based on the initial pixel features, and generate the pulmonary artery category corresponding to the first pixel based on the extended features.
[0024] After generating the pulmonary artery category corresponding to the first pixel, the server can generate a second pixel representing the pulmonary artery skeleton branch based on the classification result of the first pixel, and construct a second adjacency matrix representing the adjacency relationship between the second pixels. Then, the server can use the second adjacency matrix as the attention mechanism of the ResU-net model, extract the branch extension feature of the second pixel object based on the extension feature, and generate the pulmonary artery category corresponding to the second pixel based on the branch extension feature. When the pulmonary artery category corresponding to the second pixel is inconsistent with the pulmonary artery corresponding to the first pixel, the pulmonary artery category corresponding to the second pixel replaces the pulmonary artery category corresponding to the first pixel.
[0025] Finally, the first pixel is used as the seed point, and the preset region growing algorithm is used to determine the pulmonary artery category corresponding to the pixel representing the pulmonary artery, and different colors are assigned to the pixels representing the pulmonary artery according to the preset colors. For example, the main trunk of the pulmonary artery is assigned red, the apical segment of the right upper lobe is assigned blue, the posterior end of the right upper lobe is assigned yellow, and the dorsal segment of the left lower lobe is assigned orange. Finally, the server can send the segmented and dyed pulmonary artery image sequence to the client for the doctor to view the detailed anatomical structure of the pulmonary artery and understand the degree of the patient's lung disease.
[0026] The above is only an example scenario provided in this specification and is not intended to limit the present invention. Any modifications, equivalent substitutions, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0027] See also Figure 3, the embodiment of this specification provides a pulmonary artery classification system. And the classification method of pulmonary artery images and / or the training method of pulmonary artery image classification model provided in this specification can be applied to the pulmonary artery classification system. The pulmonary artery classification system may include a hardware environment formed by a medical imaging device 110, a client 120 and a server 130. The medical imaging device 110 is connected to the client 120, and the server 130 is connected to the client 120 through a communication network through a network. Among them, the communication network can be a wired network or a wireless network. The medical imaging device 110 examines and images the lungs to obtain a lung image sequence. The lung image sequence is transmitted to the client 120 through the communication medical imaging device 110. The client 120 sends the lung image sequence to the server 130, and the server 130 receives the lung image sequence. Among them, the medical imaging device 110 can be but is not limited to at least one of an ultrasonic medical device, a CT medical examination device, and an MRI medical examination device. The client 120 can be an electronic device with network access capability. Specifically, for example, the client can be a desktop computer, a tablet computer, a laptop computer, a smart phone, a digital assistant, a smart wearable device, a shopping guide terminal, a television, a smart speaker, a microphone, etc. Among them, the smart wearable device includes but is not limited to a smart bracelet, a smart watch, a smart glasses, a smart helmet, a smart necklace, etc. Alternatively, the client can also be software that can be run in the electronic device. Those skilled in the art can know that the number of the above-mentioned clients 120 can be one or more, and their types can be the same or different. For example, the above-mentioned client 120 can be one, or the above-mentioned client 120 can be dozens or hundreds, or more. The number and device type of the client 120 are not limited in the implementation of the present application. The server 130 can be an electronic device with a certain computing and processing capability. It can have a network communication module, a processor and a memory, etc. Of course, the server can also refer to software running in the electronic device. The server can also be a distributed server, which can be a system with multiple processors, memories, network communication modules, etc. operating in collaboration. Alternatively, the server can also be a server cluster formed by several servers. Alternatively, with the development of science and technology, the server can also be a new technical means that can realize the corresponding functions of the implementation method of the specification. For example, it could be a new form of “server” based on quantum computing.
[0028] See also Figure 4 and Figure 5 The embodiment of this specification provides a method for classifying pixels. The method for classifying pixels can be applied to electronic devices. The method for classifying pixels can include the following steps.
[0029] Step S210: Acquire a pixel set representing a pulmonary artery skeleton in a pulmonary artery image sequence, and an adjacency matrix representing adjacency relationships between pixels in the pixel set representing the pulmonary artery skeleton.
[0030] In some cases, the pixels representing the pulmonary artery on the same pulmonary artery branch have the same image features. If the pixel categories representing the pulmonary artery are directly classified, classification errors may occur. Therefore, the adjacency relationship between the pixels representing the pulmonary artery skeleton and the pixels representing the pulmonary artery skeleton can be extracted first.
[0031] The pulmonary artery image sequence is an image sequence representing the pulmonary artery extracted based on the lung medical image. Specifically, after the patient undergoes a lung CT (Computed Tomography, electronic computer tomography) scan, a lung CT medical image sequence can be generated. By segmenting the lung CT medical image sequence, the pixels representing the pulmonary artery in the lung CT medical image sequence are assigned a value of 1, and the pixels representing the non-pulmonary artery are assigned a value of 0, thereby generating a three-dimensional pulmonary artery image sequence.
[0032] The pulmonary artery skeleton is based on the connected area of the pixels representing the pulmonary artery in the pulmonary artery image sequence being thinned into a width of one pixel, and is used for feature extraction and topological representation of the pixels in the pixel set representing the pulmonary artery. Specifically, for example, the binary pulmonary artery image sequence is used as the input of the skeleton extraction model, and the Skeletonize() function in the morphology module is used to obtain a thinned pulmonary artery skeleton image sequence including a width. Among them, the pulmonary artery skeleton image sequence is also a binary image sequence.
[0033] The adjacency matrix is used to represent the adjacency relationship between the pixels in the pixel set. Specifically, for example, if the pixel set includes 3000 pixels, a 3000*3000 two-dimensional matrix can be constructed. There is no adjacency relationship between two identical pixels, so the pixels on the diagonal of the two-dimensional matrix are represented by "0"; for two different pixels, if the two pixels are adjacent in the 26 neighborhoods in the spatial range, then they are represented by "1" in the two-dimensional matrix, and if they are not adjacent in the 26 neighborhoods, then the correlation relationship between the two pixels is represented by "0" in the two-dimensional matrix.
[0034] Step S220: extracting primary classification features of pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton.
[0035] In some cases, in the process of classifying pixels in an image, the features of the pixels in the pulmonary artery image must first be extracted, and then the classification is performed based on the features of the pixels in the image. Therefore, the features of the pixels in the image can be first extracted using a conventional image classification method.
[0036] The primary classification features are extracted based on the encoder of the primary pixel classification model. Specifically, for example, the encoder of the ResU-net model is used to extract the initial pixel features representing the pulmonary artery pixels in the pulmonary artery image sequence. The pulmonary artery image sequence can be sliced in three directions to obtain two-dimensional data in three viewing directions (top view, front view, and side view), and then the two-dimensional data in the three viewing directions are respectively input into the ResU-net network model, and the features extracted in the three directions are fused to obtain the primary classification features representing the pulmonary artery pixels in the pulmonary artery image sequence. Then, the features of the pixels representing the pulmonary artery skeleton in the primary classification features representing the pulmonary artery pixels are extracted as the primary classification features of the pixels in the pixel set.
[0037] Step S230: using the primary classification features and the adjacency matrix to determine the pulmonary artery category to which the pixels in the pixel set of the pulmonary artery skeleton belong.
[0038] In some cases, if the pixels of the pulmonary artery skeleton are classified based only on the primary classification features, misclassification may occur. Therefore, the adjacency matrix can be used as a graph attention network for the pixel classification model, and then the extended features of the pixels in the pixel set are extracted based on the graph attention network and the primary classification features, and then the extended features are used to determine the pulmonary artery category of the pixels in the pixel set.
[0039] The method of using the primary classification features and the adjacency matrix to determine the pulmonary artery category of the pixel in the pixel set can be to use the primary pixel features as the features of the pixel in the pixel set, and then use the Graph Attention Networks (GATs) to further describe the importance of the adjacent pixels for the classification of the pixel, and use the adjacency matrix as a mask of the Graph Attention Network, thereby further enriching the features of the pixels representing the skeleton in the pulmonary artery image sequence. However, the above is only an exemplary method for extracting features of pixels in an image in this specification, and the embodiment of this specification does not limit the method for extracting features of images.
[0040] By extracting the primary classification features of the pixels representing the pulmonary artery skeleton and constructing the adjacency matrix of the pixels in the pixel set representing the pulmonary artery skeleton as the pixel classification model, the graph attention network is used to fuse the features of the pixels in the pixel set to improve the classification accuracy of the pixels representing the pulmonary artery in the pulmonary artery image sequence.
[0041] In some embodiments, the step of extracting primary classification features of pixels in the pixel set of the pulmonary artery skeleton may include: obtaining a pulmonary trachea image sequence corresponding to the pulmonary artery image sequence; wherein the pulmonary trachea image sequence and the pulmonary artery image sequence are obtained based on the same lung image sequence; constructing a pixel set representing the pulmonary artery in the pulmonary artery image sequence; wherein the pixel set of the pulmonary artery skeleton is a subset of the pixel set of the pulmonary artery; based on the pulmonary artery image sequence and the pulmonary trachea image sequence, extracting primary classification features of pixels in the pixel set of the pulmonary artery; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton.
[0042] In some cases, the pulmonary artery and the bronchus are in a companion relationship. Therefore, in the process of classifying the pulmonary artery, the distribution information of the bronchus can be used as a reference to more accurately and quickly determine the classification information of the pulmonary artery, thereby improving the accuracy of the pulmonary artery classification.
[0043] In some embodiments, the pixel classification method may further include: adjusting the acquired lung image sequence to a specified resolution to obtain a target lung image sequence; based on the target lung image sequence, determining a set of pixels representing pulmonary blood vessels in the lung image sequence; wherein the pulmonary blood vessels include pulmonary arterial vessels and pulmonary venous vessels; classifying pixels in the set of pixels representing pulmonary blood vessels in the lung image sequence to obtain a set of arterial pixels representing pulmonary arterial vessels; and generating a pulmonary artery image sequence based on the set of arterial pixels.
[0044] In some cases, before classifying the pixels representing the pulmonary artery in the pulmonary artery image sequence, it is also necessary to obtain the pixels representing the pulmonary artery in the pulmonary image sequence, and form a pulmonary artery image sequence based on the pixels representing the pulmonary artery. Before inputting the pulmonary image sequence into the pulmonary artery segmentation model, in order to facilitate the operation of the model, the pulmonary image sequence also needs to be adjusted to a specified resolution. Specifically, for example, based on the average ratio of the pixels representing the pulmonary artery in the patient's lung CT image after isotropy in a specific range of the lung CT image is 1.84:1.28:1, the input of the model is then changed to [192, 128, 96]. When the size of the lung image sequence is greater than [192, 128, 96], the lung image sequence is downsampled to [192, 128, 96] through the convolution kernel to obtain the target lung image sequence; when the size of the lung image sequence is less than [192, 128, 96], the lung image sequence is upsampled to [192, 128, 96] through bilinear interpolation to obtain the target lung image sequence, thereby ensuring that the proportion of the image in the model is consistent. Then, the target lung image sequence is input into the U-net image segmentation model to obtain the pulmonary vascular image sequence. Finally, the pixels representing the pulmonary artery in the pulmonary vascular image sequence are further extracted to obtain the pulmonary artery image sequence.
[0045] In some embodiments, the pixel classification method may further include: dividing the initial lung image sequence into a first lung image sequence and a second lung image sequence; wherein the first lung image sequence represents the left lung area; and the second lung image sequence represents the right lung area; accordingly, in the step of adjusting the acquired lung image sequence to a specified resolution to obtain a target lung image sequence, it may include: adjusting the first lung image sequence and the second lung image sequence to the specified resolution respectively to obtain a first target lung image sequence and a second target lung image sequence; wherein the first target lung image sequence and the second target lung image sequence belong to the target lung image sequence.
[0046] In some cases, directly processing the entire lung image sequence can easily lead to incorrect classification of the pulmonary blood vessels in the left and right lungs. Therefore, the lung image sequence can be divided into a first lung image sequence representing the left lung and a second lung image sequence representing the right lung. On the one hand, the resolution of the lung image sequence input to the image segmentation model is improved; on the other hand, the video memory of the model during operation can also be reduced. However, it should be noted that the first lung image sequence and the second lung image sequence described in the implementation mode of this specification are only used to represent the difference between the two, and are not limited to the first lung image sequence representing the left lung and the second lung image sequence representing the right lung.
[0047] In some embodiments, the step of using the primary classification features and the adjacency matrix to determine the pulmonary artery category to which a pixel in the pixel set of the pulmonary artery skeleton belongs may include: extracting extended classification features of the pixels in the pixel set of the pulmonary artery skeleton using the primary classification features and the adjacency matrix; and generating the pulmonary artery category of the pixels in the pixel set of the pulmonary artery skeleton based on the extended classification features.
[0048] In some cases, in order to determine the pulmonary artery category of a pixel in a pulmonary artery pixel set, it is first necessary to obtain the pixel features corresponding to the pixel representing the pulmonary artery. Therefore, the pixel features of the pulmonary artery pixels can be first extracted based on a commonly used image classification model, and then the expression of the pixel features can be enriched by combining the adjacency relationship between the pixels in the pixel set of the pulmonary artery skeleton.
[0049] The extended classification features are obtained based on the primary classification features and the adjacency relationship between pixels in the adjacency matrix. Specifically, for example, the primary classification features are first obtained using the ResU-net network, and then the primary classification features and the adjacency matrix are input into the graph attention network model to extract features as extended classification features. Then, the pulmonary artery category of the pixel in the pixel set representing the pulmonary artery in the pulmonary artery image sequence is determined based on the extended classification features.
[0050] See also Figure 6 In some embodiments, the pixel classification method may also include: determining multiple branch pixel sets representing pulmonary artery skeleton branches in the pixel set of the pulmonary artery skeleton based on the pulmonary artery category of the pixels in the pixel set of the pulmonary artery skeleton; wherein the pulmonary artery skeleton branches are connected to the pulmonary artery skeleton trunk; the branch pixel set is a subset of the pixel set of the pulmonary artery skeleton; obtaining a branch adjacency matrix representing the adjacency relationship of the pixels in the branch pixel set; and determining the pulmonary artery category of the pixels in the branch pixel set using the extended classification feature and the branch adjacency matrix.
[0051] In some cases, pulmonary artery pixels on the same pulmonary artery branch have the same pulmonary artery characteristics. Therefore, the pixels on one branch can be taken as a whole to determine the pulmonary artery category of the entire pulmonary artery branch.
[0052] In some embodiments, the step of using the extended classification features and the branch adjacency matrix to determine the pulmonary artery category of the pixels in the branch pixel set may include: selecting a specified number of pixels in the branch pixel set as a reference pixel set; obtaining the extended classification features of the pixels in the reference pixel set; and determining the pulmonary artery category of the pixels in the branch pixel set based on the extended classification features and the branch adjacency matrix.
[0053] In some cases, pulmonary artery pixels on the same branch have the same pulmonary artery characteristics. Therefore, a specified number of pixels can be randomly selected on the pulmonary artery branch. Then, the pulmonary artery category of the pixel in the branch pixel set is determined based on the extended characteristics of the selected pixels and the branch adjacency matrix.
[0054] The method of using the extended classification features and the branch adjacency matrix to determine the pulmonary artery category of the pixels in the branch pixel set can be to randomly select a specified number of pixels on the skeleton branch, and then perform a linear transformation on the specified number of pixels to obtain features on the skeleton branch, and determine the pulmonary artery category of the pulmonary artery skeleton branch based on the features of the skeleton branch.
[0055] In some embodiments, the pixel classification method may further include: using pixels in the pixel set as seed pixels; based on the seed pixels, using a preset region growing algorithm to determine the pulmonary artery category of the pixels representing the pulmonary artery in the pulmonary artery image sequence.
[0056] In some cases, other pixels on the pulmonary artery need to be classified. Therefore, region growing can be performed based on the classification results of the pixels on the pulmonary artery skeleton branches, and then the classification results of the pixels on the pulmonary artery skeleton branches are assigned to the pixels that perform region growing based on the pulmonary artery skeleton branches, thereby obtaining the classification results of the pixels representing the pulmonary artery in the pulmonary artery image sequence.
[0057] In some embodiments, the pixel classification method may further include: coloring the pulmonary artery categories of the pixels representing the pulmonary arteries in the pulmonary artery image sequence; wherein different pulmonary artery categories correspond to different colors.
[0058] In some cases, in order to allow doctors to see the anatomical structure of the pulmonary artery more intuitively, different categories of pulmonary arteries can also be stained to obtain segmented staining results of the pulmonary artery. Specifically, for example, the pulmonary artery categories include the pulmonary artery trunk, the tip of the right upper lobe, the posterior segment of the right upper lobe, the anterior segment of the right upper lobe, the lateral segment of the right middle field of the lung, and the upper segment of the right lower lobe. Therefore, the pulmonary artery trunk can be assigned red, the tip of the right upper lobe can be assigned blue, the posterior segment of the right upper lobe can be assigned green, the anterior segment of the right upper lobe can be assigned orange, the lateral segment of the right middle field of the lung can be assigned purple, and the upper segment of the right lower lobe can be assigned yellow. Different categories correspond to different colors, and the color differences of pulmonary artery categories that are close in space should be more obvious.
[0059] See also Figure 7 The embodiment of the present specification provides a training method for a pixel classification model. The training method for the pixel classification model can be applied to electronic devices. The training method for the pixel classification model can include the following steps.
[0060] Step S310: constructing training samples; wherein the training samples include a pulmonary artery image sequence and category labels corresponding to pixels representing the pulmonary artery in the pulmonary artery image sequence.
[0061] In some cases, the quality of training sample construction directly affects the accuracy of the model. Therefore, when annotating the pulmonary artery image sequence, it is necessary to select doctors with high professional level and rich professional experience to annotate. However, it should be noted that the specific form of the training sample is not limited in the implementation of the present application. It can be the original medical image, the pre-processed medical image, or a part of the original medical image.
[0062] Step S320: Acquire a pixel set representing a pulmonary artery skeleton in the pulmonary artery image sequence, and an adjacency matrix representing adjacency relationships between pixels in the pixel set representing the pulmonary artery skeleton.
[0063] Step S330: extracting primary classification features of pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton.
[0064] Step S340: predicting pulmonary artery categories of pixels in the pixel set of the pulmonary artery skeleton determined based on the primary classification features and the adjacency matrix.
[0065] Step S350: updating the pixel classification model according to the loss generated by the predicted pulmonary artery category and the category label corresponding to the pixel representing the pulmonary artery.
[0066] The pixel classification model is used to generate the predicted pulmonary artery category of the pixels in the pixel set representing the pulmonary artery skeleton in the training sample. Then, the loss function of the predicted pulmonary artery category and the category label corresponding to the pixel representing the pulmonary artery is calculated. The pixel classification model is updated according to the loss function, and when the loss function converges, the parameters of the updated model are used as the parameters of the pixel classification model.
[0067] The primary classification features can be obtained by the encoder of the initial classification model. Among them, the primary classification model can be a convolutional neural network (CNN), a deep neural network (DNN) or a recurrent neural network (RNN), etc., and the specific type of the primary classification model is not limited in this embodiment. In this embodiment, the primary classification model may include neural network layers such as input layer, convolution layer, pooling layer, connection layer, etc., and this is not specifically limited in this embodiment. In addition, the number of each neural network layer is not limited in this embodiment.
[0068] In some embodiments, the pulmonary artery image sequence also corresponds to a pulmonary artery skeleton trunk label and a pulmonary artery skeleton branch label; wherein the pulmonary artery skeleton branch label corresponds to a branch adjacency matrix; the method may also include: selecting a specified number of pixels in the pulmonary artery skeleton branch label as a reference pixel set; obtaining extended classification features of the pixels in the reference pixel set; wherein the extended classification features are used to characterize the pixels in the reference pixel set; accordingly, in the step of predicting the pulmonary artery category of the pixels in the pixel set based on the primary classification features and the adjacency matrix, it may also include: determining the predicted pulmonary artery category of the pixels in the pixel set based on the extended features and the branch adjacency matrix.
[0069] In some cases, the pixels on a certain branch have the same image features. Therefore, a specified number of pixels can be randomly selected on the pulmonary artery branch for feature extraction, and then the pulmonary artery category of the pixels on the entire branch can be obtained by linear transformation. The method for determining the pulmonary artery category described in this embodiment is the same as the method in the above embodiment, and the specific details are not repeated here, please refer to the above embodiment. However, it should be noted that the trunk and branches of the pulmonary artery have been marked in this embodiment, so it is not necessary to determine the pulmonary artery branch based on the results of the binary classification of the pulmonary artery skeleton.
[0070] See also Figure 8 The embodiment of the present specification provides a pixel classification device, which may include: a pulmonary artery skeleton and adjacency matrix acquisition module, a primary classification feature extraction module and a pulmonary artery skeleton classification module.
[0071] The pulmonary artery skeleton and adjacency matrix acquisition module is used to acquire a pixel set representing the pulmonary artery skeleton in a pulmonary artery image sequence, and an adjacency matrix representing the adjacency relationship between pixels in the pixel set of the pulmonary artery skeleton.
[0072] The primary classification feature extraction module is used to extract the primary classification features of the pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton.
[0073] The pulmonary artery skeleton classification module is used to determine the pulmonary artery category to which the pixels in the pixel set of the pulmonary artery skeleton belong by using the primary classification features and the adjacency matrix.
[0074] See also Fig. 9 The embodiment of this specification provides a training device for a pixel classification model, which may include: a training sample construction module, a pulmonary artery skeleton and adjacency matrix acquisition module, a primary classification feature extraction module, a pulmonary artery category prediction module and a pixel classification model generation module.
[0075] The training sample construction module is used to construct training samples; wherein the training samples include a pulmonary artery image sequence and a category label corresponding to a pixel representing the pulmonary artery in the pulmonary artery image sequence.
[0076] The pulmonary artery skeleton and adjacency matrix acquisition module is used to acquire a pixel set representing the pulmonary artery skeleton in a pulmonary artery image sequence, and an adjacency matrix representing the adjacency relationship between pixels in the pixel set of the pulmonary artery skeleton.
[0077] The primary classification feature extraction module is used to extract the primary classification features of the pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton.
[0078] A pulmonary artery category prediction module is used to predict the pulmonary artery category of pixels in the pixel set of the pulmonary artery skeleton determined based on the primary classification features and the adjacency matrix.
[0079] A pixel classification model generation module is used to update the pixel classification model according to the loss generated by the predicted pulmonary artery category and the category label corresponding to the pixel representing the pulmonary artery.
[0080] Regarding the specific functions and effects achieved by the pixel classification device and / or the pixel classification model training device, reference can be made to other embodiments of this specification for comparative explanation, and no further details will be given here. The various modules in the pixel classification device and / or the pixel classification model training device can be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to the above modules.
[0081] See also Fig.10 In some implementations, an electronic device may be provided, the electronic device comprising: a processor; a memory for storing instructions executable by the processor; the processor for executing the method described in the above implementations.
[0082] In some embodiments, a computer-readable storage medium may be provided, on which a computer program is stored. When the computer program is executed by a processor, the method steps in the embodiments are implemented.
[0083] Those of ordinary skill in the art can understand that all or part of the processes in the implementation method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the implementation methods of the methods described. Among them, any reference to memory, storage, database or other media used in the various implementations provided in this specification may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0084] It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0085] The descriptions of the various embodiments of this specification are made in a progressive manner. Different embodiments focus on describing the parts that are different from other embodiments. After reading this specification, a person skilled in the art can know that the various embodiments in this specification, as well as the various technical features disclosed in the embodiments, can be combined in more ways. To make the description concise, not all possible combinations of the various technical features in the embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0086] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0087] The multiple embodiments in this specification emphasize the parts that are different from other embodiments, and the various embodiments can be explained in comparison with each other. Any combination of the multiple embodiments in this specification by technicians in the relevant field based on general technical knowledge is included in the disclosure scope of this specification.
[0088] The above description is only an implementation method of this case and is not intended to limit the scope of protection of the claims of this case. For those skilled in the art, this case may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this case should be included in the scope of the claims of this case.
Claims
1. A pixel classification method, characterized in that: The method comprises: Acquire a pixel set representing a pulmonary artery skeleton in a pulmonary artery image sequence, and an adjacency matrix representing adjacency relations between pixels in the pixel set representing the pulmonary artery skeleton; Extracting primary classification features of pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton; Extracting pixel extended classification features in the pixel set of the pulmonary artery skeleton using the primary classification features and the adjacency matrix; Generate pulmonary artery categories of pixels in the pixel set of the pulmonary artery skeleton based on the extended classification feature; Determine a plurality of branch pixel sets representing pulmonary artery skeleton branches in the pixel set of the pulmonary artery skeleton based on the pulmonary artery category of the pixel in the pixel set of the pulmonary artery skeleton; wherein the pulmonary artery skeleton branches are connected to the pulmonary artery skeleton trunk; and the branch pixel set is a subset of the pixel set of the pulmonary artery skeleton; Acquire a branch adjacency matrix representing the adjacency relationship of pixels in the branch pixel set; Determine the pulmonary artery category of the pixel in the branch pixel set using the extended classification feature and the branch adjacency matrix; When the pulmonary artery category of the pixels in the branch pixel set is inconsistent with the pulmonary artery category of the pixels in the pixel set of the pulmonary artery skeleton, the pulmonary artery category of the pixels in the branch pixel set is used to replace the pulmonary artery category of the pixels in the pixel set of the pulmonary artery skeleton.
2. The method according to claim 1, characterized in that The step of extracting primary classification features of pixels in the pixel set of the pulmonary artery skeleton comprises: Acquire a lung-trachea image sequence corresponding to the pulmonary artery image sequence; wherein the lung-trachea image sequence and the pulmonary artery image sequence are obtained based on the same lung image sequence; Constructing a pixel set representing the pulmonary artery in the pulmonary artery image sequence; wherein the pixel set of the pulmonary artery skeleton is a subset of the pixel set of the pulmonary artery; Based on the pulmonary artery image sequence and the pulmonary trachea image sequence, primary classification features of pixels in the pixel set of the pulmonary artery are extracted; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton.
3. The method according to claim 1, characterized in that The method further comprises: The acquired lung image sequence is adjusted to a specified resolution to obtain a target lung image sequence; Based on the target lung image sequence, determining a set of pixels representing pulmonary blood vessels in the lung image sequence; wherein the pulmonary blood vessels include pulmonary arterial blood vessels and pulmonary venous blood vessels; Classifying the pixels in the pixel set representing the pulmonary blood vessels in the pulmonary image sequence to obtain an arterial pixel set representing the pulmonary artery blood vessels; A pulmonary artery image sequence is generated based on the artery pixel set.
4. The method according to claim 3, characterized in that The method further comprises: The initial lung image sequence is divided into a first lung image sequence and a second lung image sequence; wherein the first lung image sequence represents a left lung region; and the second lung image sequence represents a right lung region; Accordingly, the step of adjusting the acquired lung image sequence to a specified resolution to obtain a target lung image sequence includes: The first lung image sequence and the second lung image sequence are respectively adjusted to a specified resolution to obtain a first target lung image sequence and a second target lung image sequence; wherein the first target lung image sequence and the second target lung image sequence belong to a target lung image sequence.
5. The method according to claim 1, characterized in that The step of determining the pulmonary artery category of the pixel in the branch pixel set using the extended classification feature and the branch adjacency matrix comprises: Selecting a specified number of pixels from the branch pixel set as a reference pixel set; Obtaining extended classification features of pixels in the reference pixel set; The pulmonary artery category of the picture element in the branch picture element set is determined based on the expanded classification feature and the branch adjacency matrix.
6. The method according to claim 1, characterized in that The method further comprises: Taking the pixels in the pixel set as seed pixels; Based on the seed pixel, a preset region growing algorithm is used to determine the pulmonary artery category of the pixel representing the pulmonary artery in the pulmonary artery image sequence.
7. The method according to claim 6, characterized in that The method further comprises: The pulmonary artery categories of the pixels representing the pulmonary arteries in the pulmonary artery image sequence are dyed; wherein different pulmonary artery categories correspond to different colors.
8. A training method for a pixel classification model, characterized in that: include: Constructing training samples; wherein the training samples include a pulmonary artery image sequence and a category label corresponding to a pixel representing the pulmonary artery in the pulmonary artery image sequence; the pulmonary artery image sequence also corresponds to a pulmonary artery skeleton trunk label and a pulmonary artery skeleton branch label; wherein the pulmonary artery skeleton branch label corresponds to a branch adjacency matrix; Acquire a pixel set representing a pulmonary artery skeleton in a pulmonary artery image sequence, and an adjacency matrix representing adjacency relations between pixels in the pixel set representing the pulmonary artery skeleton; Extracting primary classification features of pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton; A predicted pulmonary artery category of a pixel in a set of pixels of the pulmonary artery skeleton determined based on the primary classification features and the adjacency matrix; Selecting a specified number of pixels in the pulmonary artery skeleton branch label as a reference pixel set; Acquire extended classification features of pixels in the reference pixel set; wherein the extended classification features are used to characterize the pixels in the reference pixel set; Determining a predicted pulmonary artery category of a pixel in the pixel set based on the expanded classification feature and the branch adjacency matrix; When the predicted pulmonary artery category determined based on the branch adjacency matrix is inconsistent with the predicted pulmonary artery category determined based on the adjacency matrix, replacing the predicted pulmonary artery category of the pixel in the pixel set of the pulmonary artery skeleton with the predicted pulmonary artery category determined by the branch adjacency matrix; The pixel classification model is updated according to the loss generated by the predicted pulmonary artery category and the category label corresponding to the pixel representing the pulmonary artery.
9. A pixel classification device, characterized in that: include: A pulmonary artery skeleton and adjacency matrix acquisition module, used to acquire a pixel set representing a pulmonary artery skeleton in a pulmonary artery image sequence, and an adjacency matrix representing adjacency relations between pixels in the pixel set of the pulmonary artery skeleton; A primary classification feature extraction module, used to extract primary classification features of pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton; A pulmonary artery skeleton classification module is used to extract extended classification features of pixels in the pixel set of the pulmonary artery skeleton using the primary classification features and the adjacency matrix; generate pulmonary artery categories of pixels in the pixel set of the pulmonary artery skeleton based on the extended classification features; determine multiple branch pixel sets representing pulmonary artery skeleton branches in the pixel set of the pulmonary artery skeleton based on the pulmonary artery categories of pixels in the pixel set of the pulmonary artery skeleton; wherein the pulmonary artery skeleton branches are connected to the pulmonary artery skeleton trunk; the branch pixel set is a subset of the pixel set of the pulmonary artery skeleton; obtain a branch adjacency matrix representing the adjacency relationship of pixels in the branch pixel set; determine the pulmonary artery categories of pixels in the branch pixel set using the extended classification features and the branch adjacency matrix; when the pulmonary artery categories of pixels in the branch pixel set are inconsistent with the pulmonary artery categories of pixels in the pixel set of the pulmonary artery skeleton, replace the pulmonary artery categories of pixels in the pixel set of the pulmonary artery skeleton with the pulmonary artery categories of pixels in the pixel set of the pulmonary artery skeleton.
10. A training device for a pixel classification model, characterized in that: include: A training sample construction module, used to construct training samples; wherein the training samples include a pulmonary artery image sequence and a category label corresponding to a pixel representing the pulmonary artery in the pulmonary artery image sequence; the pulmonary artery image sequence also corresponds to a pulmonary artery skeleton trunk label and a pulmonary artery skeleton branch label; wherein the pulmonary artery skeleton branch label corresponds to a branch adjacency matrix; A pulmonary artery skeleton and adjacency matrix acquisition module, used to acquire a pixel set representing a pulmonary artery skeleton in a pulmonary artery image sequence, and an adjacency matrix representing adjacency relations between pixels in the pixel set of the pulmonary artery skeleton; A primary classification feature extraction module, used to extract primary classification features of pixels in the pixel set of the pulmonary artery skeleton; wherein the primary classification features are used to characterize the pixels in the pixel set of the pulmonary artery skeleton; A pulmonary artery category prediction module, used for predicting the pulmonary artery category of pixels in the pixel set of the pulmonary artery skeleton determined based on the primary classification features and the adjacency matrix; selecting a specified number of pixels in the pulmonary artery skeleton branch labels as a reference pixel set; obtaining extended classification features of pixels in the reference pixel set; wherein the extended classification features are used to characterize the pixels in the reference pixel set; determining the predicted pulmonary artery category of the pixels in the pixel set based on the extended classification features and the branch adjacency matrix; when the predicted pulmonary artery category determined based on the branch adjacency matrix is inconsistent with the predicted pulmonary artery category determined based on the adjacency matrix, using the predicted pulmonary artery category determined by the branch adjacency matrix to replace the predicted pulmonary artery category of the pixels in the pixel set of the pulmonary artery skeleton; A pixel classification model generation module is used to update the pixel classification model according to the loss generated by the predicted pulmonary artery category and the category label corresponding to the pixel representing the pulmonary artery.
11. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to execute the method according to any one of claims 1 to 8. 12 . A computer-readable storage medium storing a computer program for executing the method according to claim 1 .
Citation Information
Patent Citations
Pulmonary vessel classification method and device, storage medium and electronic equipment
CN112861961A
Lung bronchus classification method and device, electronic equipment and storage medium
CN113011509A
Image processing method and device and network model training method and device
CN113256670A
