Fat mass determination method and device, electronic equipment and storage medium
The attention segmentation model and fat prediction model are used to segment and measure fat on CT images, which solves the problems of low accuracy and high cost of traditional methods, and achieves efficient and accurate fat mass measurement.
Patent Information
- Application Number
- CN202310305297.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-27
- Publication Date
- 2024-10-01
AI Technical Summary
Traditional fat mass measurement methods have low accuracy and high cost, and are difficult to distinguish between subcutaneous fat and intermuscular fat, resulting in low measurement efficiency and large errors.
The attention segmentation model is used to segment CT images, and combined with the fat prediction model, the measurement accuracy is improved and the measurement cost is reduced by calculating the fat proportion.
It improves the accuracy of fat mass measurement, reduces measurement costs, simplifies the fat segmentation and measurement process, and enhances the segmentation effect of subcutaneous fat.
Smart Images

Figure CN118735833A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, electronic device and storage medium for determining fat mass. Background Art
[0002] Traditionally, crude fat content is generally measured by Soxhlet extraction, which uses dried poultry meat as raw material and petroleum ether as solvent to extract fat. The fat content is obtained by measuring the increase in the flask and the decrease in the filter paper tube. When determining fatty acids, fresh poultry meat is taken, freeze-dried for 24 hours, and determined by gas chromatography. The results are expressed as dry sample mass. This method has a single means and requires manual extraction of poultry meat specimens, which has high slaughtering costs.
[0003] In addition, the traditional method of determining fat mass has confusing labeling of subcutaneous fat and intermuscular fat, bone marrow, soft tissue, etc., and the related areas are highly redundant and difficult to distinguish. At the same time, the whole process is time-consuming and labor-intensive, inefficient, and has a large subjective influence. It is easy to produce large random errors, which affects the measurement accuracy of fat mass.
[0004] Based on the above problems, it is currently necessary to find a new method for determining fat mass to solve the problem of low accuracy in fat mass measurement. Summary of the invention
[0005] The present invention provides a method, device, electronic device and storage medium for determining fat mass, which are used to solve the problem of low fat mass measurement accuracy. A CT image is segmented by an attention segmentation model, and the fat percentage of the first segmented image is determined based on the first segmented image obtained by segmentation. Then, the fat percentage is input into a fat prediction model to obtain the fat mass of the target object. Based on this, the measurement accuracy is improved and the measurement cost is reduced.
[0006] The present invention provides a method for determining fat mass, comprising:
[0007] Acquire a CT image of a target object;
[0008] Inputting the CT image into an attention segmentation model to obtain a first segmented image of the CT image output by the attention segmentation model; the attention segmentation model is obtained by training a pre-constructed first model with a first training sample;
[0009] Determine the fat percentage of the first segmented image, and input the fat percentage into a fat prediction model to obtain the fat amount of the target object output by the fat prediction model; the fat prediction model is obtained by training a pre-constructed second model with a second training sample.
[0010] In one embodiment, determining the fat percentage of the first segmented image includes:
[0011] Acquire fat pixels in the first segmented image;
[0012] A ratio of the fat pixel points to the total pixel points in the first segmented image is determined, and the ratio is used as the fat percentage of the first segmented image.
[0013] In one embodiment, the attention segmentation model is obtained based on the following steps:
[0014] Acquiring multiple frames of CT sample images of the target object;
[0015] Preprocessing the CT sample image, and performing pixel annotation on the fat area in the preprocessed CT sample image to construct a plurality of the first training samples;
[0016] The pre-constructed first model is trained using a plurality of the first training samples to obtain the attention segmentation model.
[0017] In one embodiment, the fat prediction model is obtained based on the following steps:
[0018] Inputting the CT sample image into an attention segmentation model to obtain a second segmented image of the CT sample image output by the attention segmentation model;
[0019] constructing a plurality of second training samples based on the fat percentage and fat detection value of each frame of the second segmented image;
[0020] The pre-constructed second model is trained using a plurality of the second training samples to obtain the fat prediction model.
[0021] In one embodiment, the attention segmentation model includes a channel attention module and a spatial attention module;
[0022] The process of image segmentation of the CT image by the attention segmentation model is as follows:
[0023] Based on the channel attention module, performing maximum pooling and average pooling processing on the CT image to obtain a first target feature map;
[0024] Inputting the first target feature map into a multi-layer perception network to obtain a second target feature map output by the multi-layer perception network;
[0025] Performing an arithmetic operation on the second target feature map, and processing the second target feature map after the arithmetic operation using an activation function to obtain a channel attention feature map;
[0026] Based on the spatial attention module, performing maximum pooling and average pooling processing on the channel attention feature map to obtain a third target feature map;
[0027] Splicing the third target feature map, and performing a convolution operation on the spliced third target feature map based on a convolutional network;
[0028] The activation function is used to process the third target feature map after the convolution operation to obtain a spatial attention feature map, and the spatial attention feature map is used as the first segmented image.
[0029] In one embodiment, the preprocessing of the CT sample image includes:
[0030] Based on the CT sample image, three-dimensionally reconstruct the target object;
[0031] Segmenting the three-dimensionally reconstructed image to obtain multiple frames of target CT sample images;
[0032] The format of each frame of the target CT sample image is adjusted to perform Gaussian filtering and image enhancement processing on the target CT sample image after the format adjustment.
[0033] In one embodiment, segmenting the three-dimensionally reconstructed image to obtain multiple frames of target CT sample images includes:
[0034] Determining a segmentation method for the three-dimensionally reconstructed image;
[0035] The segmentation method is used to segment the three-dimensionally reconstructed image to obtain multiple frames of target CT sample images.
[0036] The present invention also provides a device for determining fat mass, comprising:
[0037] An acquisition module, used for acquiring a CT image of a target object;
[0038] A segmentation module, used for inputting the CT image into an attention segmentation model to obtain a first segmented image of the CT image output by the attention segmentation model; the attention segmentation model is obtained by training a pre-constructed first model with a first training sample;
[0039] The fat mass prediction module is used to determine the fat percentage of the first segmented image and input the fat percentage into a fat prediction model to obtain the fat mass of the target object output by the fat prediction model; the fat prediction model is obtained by training a pre-constructed second model with a second training sample.
[0040] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-described methods for determining fat mass is implemented.
[0041] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for determining fat mass.
[0042] The method, device, electronic device and storage medium for determining fat mass provided by the present invention collect a CT image of a target object; input the CT image into an attention segmentation model to obtain a first segmented image of the CT image output by the attention segmentation model; the attention segmentation model is obtained by training a pre-constructed first model with a first training sample; determine the fat percentage of the first segmented image, input the fat percentage into a fat prediction model to obtain the fat mass of the target object output by the fat prediction model; the fat prediction model is obtained by training a pre-constructed second model with a second training sample. The present invention solves the problem of low accuracy of traditional fat measurement methods by establishing an attention segmentation model and a fat prediction model, performing fat segmentation and fat mass measurement on the CT image of the target object, improving measurement accuracy and reducing measurement costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 is a schematic flow chart of the method for determining fat mass provided by the present invention;
[0045] Figure 2 It is a schematic diagram of the construction process of the attention segmentation model provided by the present invention;
[0046] Figure 3 It is a schematic diagram of the process of constructing a fat mass prediction model based on the U-net network of UAM combined with industrial CT images provided by the present invention;
[0047] Figure 4 The present invention provides a flow chart of constructing a fat prediction model using fat detection values and fat percentage obtained based on an attention segmentation model;
[0048] Figure 5is a schematic structural diagram of a device for determining fat mass provided by the present invention;
[0049] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] Combine the following Figure 1-Figure 6 The present invention describes a method, device, electronic device and storage medium for determining fat mass.
[0052] Specifically, the present invention provides a method for determining fat mass, referring to Figure 1 , Figure 1 It is a schematic flow chart of the method for determining fat mass provided by the present invention.
[0053] The method for determining fat mass provided by an embodiment of the present invention includes:
[0054] S100, acquiring a CT image of a target object;
[0055] It should be noted that the target object may be any one of live poultry such as chickens, ducks, sheep, cattle, etc. The embodiment of the present invention uses live chickens as an example to analyze and illustrate the method for determining the amount of fat.
[0056] Computed Tomography (CT) technology is a means of obtaining internal microscopic structural information of an object under non-destructive conditions. Its main principle is to reflect the density of an object based on the degree of X-ray absorption by the object.
[0057] Acquire a CT image of the target object. For example, use an industrial CT device to perform a full-body three-dimensional scan of a living chicken whose fat content needs to be measured to obtain a scanned image of the living chicken, and perform three-dimensional reconstruction of the scanned image to obtain a CT image.
[0058] S200, inputting the CT image into an attention segmentation model to obtain a first segmented image of the CT image output by the attention segmentation model; the attention segmentation model is obtained by training a pre-constructed first model with a first training sample;
[0059] It should be noted that the traditional image analysis process based on industrial CT requires the input of all cross sections in each direction, but some cross sections cannot fully show the outline of the chicken leg. After visualizing the cross-sectional data set, it can be found that the shape, size and distribution of subcutaneous fat are relatively complex. The traditional U-Net network has a good segmentation effect for some organs with a fixed number and little difference in size and shape, but it is not outstanding for subcutaneous tissue with complex distribution and unplanned marginalization, especially for subcutaneous tissue in smaller areas and the edge parts that are closely connected to the tissue. The segmentation effect of the U-Net network is not ideal. In addition, because subcutaneous fat is closely connected, each area is distributed in a complex manner, and may be interfered with by other areas. Secondly, the above method of the U-Net network does not deeply consider the unique characteristics of CT images when extracting features, which affects the segmentation accuracy.
[0060] Based on the above problems, the embodiment of the present invention introduces a U-Net network based on an improved spatial attention mechanism and a channel attention mechanism, which combines a segmentation network of an attention mechanism and integrates spatial attention and channel attention. Due to the combination of the attention mechanism, the dimension of the data will not be changed. It only highlights the important content from the channel dimension and the spatial dimension and suppresses the unimportant content. Therefore, it can be used in each layer of the network, and has a stronger degree of distinction for the edge area, which can be better distinguished from the various areas in the organization to a certain extent. In addition, when the channel attention module calculates the different weights of the generated channel, the fully connected layer is used to map the features. The fully connected layer has a square-level operation amount. Even when designing a shared fully connected layer, the channel features are first compressed. The parameter amount of the shared fully connected layer is still positively correlated with the square of the number of channels of the input feature map. Furthermore, in the spatial attention module, in order to include more contextual features and information between adjacent closer sections, a large receptive field convolution kernel is used to aggregate spatial features. Compared with the use of a small convolution kernel, while increasing the receptive field, the parameter amount of the module also increases accordingly. Therefore, when a channel attention module and a spatial attention module are inserted into a convolutional neural network, the number of network parameters will increase significantly.
[0061] It should be further explained that the attention segmentation model is obtained by training a pre-built first model with a first training sample, wherein the first training sample is determined based on a CT sample image, and the first model can be a neural network model.
[0062] After acquiring the CT image, the CT image is preprocessed and pixel-annotated, and then the processed CT image is input into a pre-built attention segmentation model to obtain a first segmented image of the CT image output by the attention segmentation model, wherein the fat area is annotated in the first segmented image.
[0063] S300, determining the fat percentage of the first segmented image, and inputting the fat percentage into a fat prediction model to obtain the fat amount of the target object output by the fat prediction model; the fat prediction model is obtained by training a pre-constructed second model with a second training sample.
[0064] It should be noted that the fat prediction model is obtained by training a pre-constructed second model with a second training sample, wherein the second training sample is determined based on the fat percentage and fat detection value of the first segmented image, and the second model can be a neural network model.
[0065] After obtaining the first segmented image output by the attention segmentation model, the fat percentage of the first segmented image of different sections is determined, and then the fat percentage of the different sections is input into the fat prediction model, and the fat amount of the target object is output by the fat prediction model.
[0066] The method for determining the amount of fat provided in the embodiment of the present invention is as follows: collecting a CT image of the target object; inputting the CT image into an attention segmentation model to obtain a first segmented image of the CT image output by the attention segmentation model; the attention segmentation model is obtained by training a pre-constructed first model with a first training sample; determining the fat percentage of the first segmented image, and inputting the fat percentage into a fat prediction model to obtain the amount of fat of the target object output by the fat prediction model; the fat prediction model is obtained by training a pre-constructed second model with a second training sample. The embodiment of the present invention develops a subcutaneous fat segmentation model and a fat amount test model for living chickens through industrial CT, and obtains the segmentation results and fat content results of subcutaneous fat of living chickens. The present invention solves the problem of low fat measurement accuracy, improves fat measurement accuracy, and reduces measurement costs.
[0067] Based on the above embodiment, determining the fat percentage of the first segmented image includes:
[0068] S310, obtaining fat pixels in the first segmented image;
[0069] S311, determining a ratio of fat pixels in the first segmented image to total pixels in the first segmented image, and using the ratio as a fat percentage of the first segmented image.
[0070] Obtain fat pixels in the first segmented image. For example, based on the fat area marked in the first segmented image, count the number of fat pixels in the fat area, and then calculate the ratio of the number of fat pixels to the number of all pixels in the first segmented image to obtain the fat percentage.
[0071] For example, in the first segmented image, the number of fat pixels is N1, and the number of non-fat pixels is N2, then the fat ratio of the first segmented image is N1 / (N1+N2).
[0072] The embodiment of the present invention realizes the calculation of fat percentage by determining the ratio of fat pixels to total pixels in the first segmented image, solves the problem of calculating fat amount by slaughtering method, and reduces measurement cost.
[0073] Based on the above embodiment, the attention segmentation model is obtained based on the following steps:
[0074] S210, acquiring multiple frames of CT sample images of the target object;
[0075] S211, preprocessing the CT sample image, and annotating pixels of the fat area in the preprocessed CT sample image to construct a plurality of first training samples;
[0076] S212: Use multiple first training samples to train the pre-constructed first model to obtain an attention segmentation model.
[0077] Collect CT sample images of the target object, for example, perform a full-body 3D scan of a living chicken to obtain CT sample images, wherein the CT sample images are used to train the attention segmentation model.
[0078] The fat area in the preprocessed CT sample image is pixel-annotated. For example, 3Dslice software is used for pixel annotation. A live chicken is slaughtered and cut based on the CT sample image to obtain the actual cutting surface of the live chicken corresponding to the CT sample image. The fat area in the CT sample image is annotated with fat pixels according to the fat distribution on the actual cutting surface.
[0079] The first training model is trained using CT sample images with fat pixel annotations, wherein the segmentation effect of different sections in the same direction of different individuals can be trained based on the attention segmentation model.
[0080] The embodiment of the present invention obtains a first training sample through a CT sample image of the target object, and trains a first model through the first training sample to obtain an attention segmentation model. The attention segmentation model obtained after training can more accurately perform fat segmentation on the CT sample image of the target object, and also simplifies the measurement process of the fat amount of the target object.
[0081] Based on the above embodiment, the fat prediction model is obtained based on the following steps:
[0082] S320, inputting the CT sample image into the attention segmentation model to obtain a second segmented image of the CT sample image output by the attention segmentation model;
[0083] S321, constructing a plurality of the second training samples based on the fat percentage and the fat detection value of each frame of the second segmented image;
[0084] S322, using a plurality of second training samples to train the pre-constructed second model to obtain a fat prediction model.
[0085] After acquiring a CT sample image of the target object, the CT sample image is input into the attention segmentation model, and then a second segmented image of the CT sample image output by the attention segmentation model is obtained, wherein the fat area of the second segmented image can be clearly identified through pixel annotation.
[0086] It should be noted that a second segmented image with a clear and complete outline and more fat areas is selected to segment the continuous second segmented image, and then the fat percentage of the second segmented image is determined, for example, the ratio of fat pixels in the second segmented image to the total pixels in the second segmented image is calculated, and the ratio is used as the fat percentage of the second segmented image. Finally, multiple second training samples are constructed based on the fat percentage and fat detection value of each frame of the second segmented image.
[0087] Among them, the fat detection value is obtained based on the amino acid content test. For example, according to the segmented image, a live chicken is physically dissected to obtain a physical sample of the segmented image, and the amino acid content of the physical sample is tested to obtain the fat detection value. The fat detection value measures the fat content through chemical principles, has a high accuracy rate, and is used in the field of live chicken breeding.
[0088] In the embodiment of the present invention, the fat prediction model adopts the Xgboost model, and the second training sample is the fat percentage and fat detection value corresponding to the second segmented image of the top 20 fat percentages in each individual. During the training process, by constructing multiple prediction functions and fusing them, each weak predictor is improved, thereby performing feature extraction and fat percentage prediction.
[0089] For example, the training process of the fat prediction model includes the following steps:
[0090] The input sample set is (x1, y1), (x2, y2)....(x i ,y i ), where y represents the true fat detection value of the individual, x represents the fat percentage of the second segmented image, and x i The dimension feature is 20, that is, each x i Contains fat percentage of 20 second segmentation images.
[0091] (1) Create the first regression tree, i.e., f1(x);
[0092] (2) For the 2nd to mth regression trees, calculate the training target of each tree, that is, calculate the residual, denoted as r mi :
[0093]
[0094] Among them, L represents the loss function, f(x) represents the output learner, and f(x i ) indicates the use of sample x i When the output of the learner, f m-1 (x) represents the learner output by the m-1th subtree when using sample x, y i represents the fat detection value of the i-th sample, Represents the predicted value of fat percentage of the i-th sample.
[0095] (3) For the current m-th subtree, traverse its feasible split points and thresholds to find the optimal fat percentage prediction value. The corresponding parameter is c, which makes it as close to the residual as possible:
[0096]
[0097] Among them, c mj Represents the parameter corresponding to the mth subtree, R mj represents the set of possible fat percentages of the mth subtree, where j ranges from 1, 2, 3, 4…j, L represents the loss function, and y i Represents the fat detection value of the i-th sample.
[0098] Then, update f m (x), we get:
[0099]
[0100] Among them, f m (x) represents the learner output by the mth subtree when using sample x, f m-1 (x) represents the learner output by the m-1th subtree when using sample x, and I represents a function. mj On the node, then I = 1, otherwise I = 0.
[0101] Finally, we get:
[0102]
[0103] Where M represents the number of decision trees, F M (x) represents the whole after the Mth round of training, F M (x) is the subcutaneous fat content predicted based on sample x.
[0104] The embodiment of the present invention constructs multiple second training samples based on the fat percentage and fat detection value of the second segmented image; uses multiple second training samples to train the pre-constructed second model, and uses the Xgboost model for fitting to obtain a fat prediction model. In each individual, the fat percentage of each cross section is combined with the fat detection value to fit the model, and the subcutaneous fat percentage of each chicken is calculated based on the machine learning method. Compared with the traditional threshold-based segmentation method, this method has the characteristics of high efficiency and short calculation response time.
[0105] Based on the above embodiment, the attention segmentation model includes a channel attention module and a spatial attention module; the process of image segmentation of the CT image by the attention segmentation model is as follows:
[0106] S330, based on the channel attention module, performing maximum pooling and average pooling processing on the CT image to obtain a first target feature map;
[0107] S331, inputting the first target feature map into the multi-layer perception network to obtain a second target feature map output by the multi-layer perception network;
[0108] S332, performing an arithmetic operation on the second target feature map, and processing the second target feature map after the arithmetic operation using an activation function to obtain a channel attention feature map;
[0109] S333, based on the spatial attention module, performing maximum pooling and average pooling processing on the channel attention feature map to obtain a third target feature map;
[0110] S334, splicing the third target feature map, and performing a convolution operation on the spliced third target feature map based on a convolutional network;
[0111] S335, using an activation function to process the third target feature map after the convolution operation to obtain a spatial attention feature map, and using the spatial attention feature map as the first segmented image.
[0112] It should be noted that the Unitive Attention Module (UAM) module in the attention segmentation model includes a channel attention module and a spatial attention module. The channel attention module is mainly used to determine what is the useful information in the image, while the spatial attention module is mainly used to determine where the effective information of the image is.
[0113] refer to Figure 2After the CT image (i.e., the input feature map F) is input into the attention segmentation model, in order to more efficiently calculate the channel attention features and reduce the information loss caused by pooling, it is necessary to compress the spatial dimension of the CT image, that is, perform maximum pooling and average pooling on the CT image. For example, the maximum pooling block is used to perform maximum pooling on the CT image to obtain a maximum pooling feature map; the average pooling block is used to perform average pooling on the CT image to obtain an average pooling feature map; wherein the first target feature map includes the maximum pooling feature map and the average pooling feature map.
[0114] Then, the first target feature map is input into the multi-layer perceptron network to obtain the second target feature map output by the multi-layer perceptron network, for example, the first target feature map is input into the multi-layer perceptron (MLP) network to reduce or increase the dimension of the first target feature map through the multi-layer perceptron network, thereby reducing the amount of calculation. The second target feature map refers to the maximum pooling feature map and the average pooling feature map after the multi-layer perceptron network performs the dimension reduction or dimension increase operation.
[0115] Perform an arithmetic operation on the second target feature map, and use an activation function to process the second target feature map after the arithmetic operation to obtain a channel attention feature map. For example, perform a sum operation on the second target feature map, and then use a sigmoid function to process the second target feature map after the sum operation to obtain a channel attention feature map F′.
[0116] The channel attention feature map F′ is used as the input of the spatial attention module. In order to calculate the spatial attention, the channel attention feature map F′ needs to be processed by maximum pooling and average pooling in the channel dimension to obtain the third target feature map, wherein the third target feature map includes the maximum pooling feature map and the average pooling feature map obtained after the maximum pooling and average pooling in the channel dimension. The third target feature map is further spliced, and the spliced third target feature map is convolved based on the convolutional network. Finally, the sigmoid function is used to process the third target feature map after the convolution operation to obtain the spatial attention feature map F", and the spatial attention feature map F" is used as the first segmented image.
[0117] In one embodiment, reference Figure 2In the intermediate feature map of the convolutional neural network, the correlation between adjacent channels is relatively large. The fully connected layer will generate many redundant calculations when mapping channel features. Based on this, the embodiment of the present invention uses one-dimensional convolution to aggregate channel features of channel attention, which can reduce the number of parameters of the channel attention module. In spatial attention, adding a residual network can prevent network degradation, gradient disappearance and gradient explosion problems. At the same time, batch normalization is used, and dorpout is discarded to increase the generalization ability of the model, so that the network can find the optimal solution in a smoother space.
[0118] For example, use a one-dimensional convolution of length m to aggregate the information of k channels in the channel neighborhood, add the two features after convolution element by element, and generate the channel attention M through the sigmoid function operation. C (F). Then the generated channel attention is expanded in dimension and multiplied with the input feature map F by corresponding elements to obtain the processed channel attention feature map F′. C The calculation formula of (F) is:
[0119]
[0120] Among them, σ represents the sigmoid activation function, AvgPool() and MaxPool() represent average pooling and maximum pooling respectively. Represents a one-dimensional convolution operation with a convolution kernel size of m.
[0121] In the spatial attention module, a residual module is added to prevent problems such as overfitting and gradient explosion. S The calculation formula of (F′) is:
[0122] M S (F′)=F′+σ(AvgPool(F′); MaxPool(F′));
[0123] Among them, F' represents the channel attention feature map, σ represents the sigmoid activation function, AvgPool() and MaxPool() represent average pooling and maximum pooling, respectively.
[0124] Among them, the relationship between the input feature map F, the channel attention feature map F′ and the spatial attention feature map F" is as follows:
[0125]
[0126] The input feature map F is first merged with the channel attention M C (F) dot product, and then with the spatial attention M S (F ′) dot product to get the final feature map.
[0127] The attention segmentation model provided by the embodiment of the present invention forms a spatial and channel fused attention segmentation model by establishing a channel attention module and a spatial attention module. The channel attention model obtains two feature maps by pooling the input feature map by the maximum value and the average value respectively, so as to reduce the information loss caused by pooling; then, the two feature maps are simultaneously input into a multi-layer perception network. This process does not use fully connected layers and large convolution kernels, which greatly reduces the amount of calculation. In the spatial attention module, a residual module is added to prevent problems such as network degradation, gradient disappearance, overfitting and gradient explosion; at the same time, batch normalization is used to increase the generalization ability of the model, so that the network can find the optimal solution in a smoother space. The embodiment of the present invention fully considers the characteristics and edge contour information of the target object CT image, extracts the subcutaneous related areas to the greatest extent, and improves the efficiency and accuracy of CT image segmentation.
[0128] Based on the above embodiment, the CT sample image is preprocessed, including:
[0129] S340, performing three-dimensional reconstruction of the target object based on the CT sample image;
[0130] S341, segmenting the three-dimensionally reconstructed image to obtain multiple frames of target CT sample images;
[0131] S342, adjusting the format of each frame of the target CT sample image, and performing Gaussian filtering and image enhancement processing on the target CT sample image after the format adjustment.
[0132] After collecting CT sample images, the target object is reconstructed in three dimensions based on the CT sample images to obtain a three-dimensional model of the target object. For example, a live chicken is reconstructed in three dimensions based on the CT sample images to obtain a three-dimensional image of the live chicken, and the information such as bones, muscles and fat tissues of the live chicken can be quickly and accurately segmented and measured based on the three-dimensional image.
[0133] The three-dimensional reconstructed image is segmented to obtain multiple frames of target CT sample images, and then the format of each frame of the target CT sample image is adjusted, for example, the target CT sample image is converted into DICOM format data, and then converted into a common PNG image format.
[0134] The target CT sample image after the format adjustment is subjected to Gaussian filtering and image enhancement processing. For example, the target CT sample image is smoothed by Gaussian filtering; and the target CT sample image is subjected to image enhancement processing such as scale reduction, scale enlargement, translation, random rotation, etc.
[0135] The embodiment of the present invention improves the accuracy and robustness of the model by preprocessing the CT sample images. At the same time, it improves the quality of the training sample set so that the model can better fit the characteristic distribution of the training data. Data enhancement makes the distribution of training data more complex, which makes the model more generalizable and suppresses the occurrence of overfitting.
[0136] Based on the above embodiment, the three-dimensional reconstructed image is segmented to obtain multiple frames of target CT sample images, including:
[0137] S3411, determining an image segmentation method;
[0138] S3412, segmenting the three-dimensionally reconstructed image using a segmentation method to obtain multiple frames of target CT sample images.
[0139] After determining the three-dimensional model of the target object based on three-dimensional reconstruction, determine the image segmentation method, such as determining the segmentation direction of the three-dimensional reconstructed image. Then, use the segmentation method to segment the three-dimensional reconstructed image to obtain multiple frames of target CT sample images. For example, in order to obtain multiple frames of different target CT sample images, it is necessary to segment the living chicken in different directions.
[0140] Segmenting the three-dimensional reconstructed image in different directions can ensure that the obtained multi-frame target CT sample images can comprehensively record the fat distribution of various parts of the living chicken.
[0141] The embodiment of the present invention obtains multi-frame target CT sample images by segmenting the three-dimensional reconstructed image. Based on this, by obtaining two-dimensional sections from the three-dimensional image, the data form of the first training sample is simplified, and the construction process of the attention segmentation model is further simplified.
[0142] Based on the above embodiments, the embodiments of the present invention propose a method for constructing a fat mass prediction model based on a U-Net network of UAM combined with industrial CT images.
[0143] refer to Figure 3 , the model passes the feature map of the contraction path in U-Net through an attention network first, and then splices it with the feature map of the expansion path. Figure 3 The numbers 1, 2, 64, 128, 256, 512, and 1024 in the formula represent the number of channels. Introducing the attention mechanism in the combined model is conducive to increasing the weight of the image edge, suppressing minor information, and thus improving the segmentation effect of the model. In the prediction part, the Xgboost model is used, and the input feature is the fat percentage corresponding to the second segmentation image of the top 20 fat percentages in each individual. During the training process, by constructing many prediction functions and fusing them, each weak predictor is improved, thereby performing feature extraction and predicting the true fat content.
[0144] For example, the collected CT sample images of living chickens are preprocessed and then input into the U-Net network based on UAM. The subcutaneous fat of the living chickens is annotated with pixels after processing by the U-Net network to obtain a segmented image, and the fat percentage of the segmented image is calculated. The subcutaneous fat detection value of the cross section corresponding to each frame of the segmented image is obtained through dissection and chemical detection of living chickens. The fat percentage and subcutaneous fat detection value are input into the Xgboost model for training, so that the Xgboost model has the function of predicting the subcutaneous fat content.
[0145] The embodiment of the present invention is based on improved channel attention and spatial attention modules, and is matched with a U-Net network to identify and segment subcutaneous fat on a selected chicken leg cross section to obtain a segmented image. The segmentation results of all segmented images are integrated, and the Xgboost model in machine learning is used to select the top 20 segmented images with the highest fat content. According to the fat content of each segmented image and the fat detection value, a subcutaneous fat content prediction model is fitted.
[0146] Based on the above embodiments, the present invention provides a method for constructing a fat prediction model through fat detection values and fat percentage obtained based on an attention segmentation model.
[0147] Reference Figure 4 , Figure 4 The present invention provides a flow chart of constructing a fat prediction model through fat detection values and fat percentage obtained based on an attention segmentation model, including:
[0148] S410, using industrial CT equipment to perform CT scanning on a live chicken leg to obtain data and perform three-dimensional reconstruction;
[0149] S420, selecting a coronal CT section for preprocessing and image enhancement, and training an attention segmentation model;
[0150] S430, inputting the test set data into the attention segmentation model to achieve subcutaneous fat segmentation;
[0151] S440, performing pixel count and amino acid content and true fat value detection on the segmentation result of each individual to obtain a fat percentage and a fat detection value;
[0152] S450, using the fat percentages and fat detection values of multiple cross sections, training and establishing a fat prediction model.
[0153] The preprocessing operation process of selecting the coronal CT section for preprocessing in S420 includes:
[0154] S421, three-dimensionally reconstructing the original projection format of the live chicken CT, converting the reconstructed data into dicom format data, and then converting it into a common png image format to obtain a live chicken CT image;
[0155] S422, fat pixel annotation of subcutaneous fat area in CT images of living chickens using 3Dslice software;
[0156] S423, dividing the labeled live chicken CT image data into training data and test data, and dividing them into a training set and a test set in a quantity ratio of 9:1.
[0157] The method for determining fat mass provided in the embodiment of the present invention divides the data into a training set and a test set according to different individuals, and performs subcutaneous fat segmentation on the cross section of the individual to be measured through the attention segmentation model. By establishing a fat prediction model, the subcutaneous fat of the live chicken legs is predicted, which solves the problem of low precision of traditional fat measurement methods, improves the accuracy of fat measurement, and reduces the measurement cost. The fat prediction model in the embodiment of the present invention fully combines the fat detection value measured in breeding, and is based on the fat detection value. Its process is more in line with the actual breeding site needs. During the chicken cultivation and breeding process, the subcutaneous fat of chicken legs is measured to help the chicken breeding industry to select high-quality seeds and improve the efficiency of high-quality chicken breeding in my country.
[0158] The present invention provides a device for determining fat mass, referring to Figure 5 , Figure 5 It is a structural schematic diagram of the device for determining the amount of fat provided by the present invention.
[0159] An embodiment of the present invention provides a device for determining fat mass, comprising:
[0160] An acquisition module 501 is used to acquire a CT image of a target object;
[0161] A segmentation module 502 is used to input the CT image into the attention segmentation model to obtain a first segmented image of the CT image output by the attention segmentation model; the attention segmentation model is obtained by training a pre-constructed first model with a first training sample;
[0162] The fat mass prediction module 503 is used to determine the fat percentage of each segmented image frame and input the fat percentage into the fat prediction model to obtain the fat mass of the target object output by the fat prediction model; the fat prediction model is obtained by training the pre-constructed second model with the second training sample.
[0163] The fat amount determination device provided by the embodiment of the present invention collects a CT image of the target object; inputs the CT image into an attention segmentation model to obtain a segmented image of the CT image output by the attention segmentation model; the attention segmentation model is obtained by training a pre-constructed first model with a first training sample; determines the fat percentage of each frame of the segmented image, and inputs the fat percentage into a fat prediction model to obtain the fat amount of the target object output by the fat prediction model; the fat prediction model is obtained by training a pre-constructed second model with a second training sample. The device performs fat segmentation on the collected CT image through the attention segmentation module, and then predicts the fat amount of the target object through the fat amount prediction module, which solves the problem of low accuracy of traditional fat amount measurement methods, improves measurement efficiency, and reduces measurement costs.
[0164] In one embodiment, the segmentation module 502 includes:
[0165] Obtaining fat pixels in the first segmented image;
[0166] The ratio of the fat pixel points to the total pixel points in the first segmented image is determined, and the ratio is used as the fat percentage of the first segmented image.
[0167] In one embodiment, the segmentation module 502 includes:
[0168] Acquire multiple frames of CT sample images of the target object;
[0169] Preprocessing the CT sample image, and annotating the fat area in the preprocessed CT sample image by pixels, so as to construct a plurality of first training samples;
[0170] A plurality of first training samples are used to train the pre-constructed first model to obtain an attention segmentation model.
[0171] In one embodiment, the segmentation module 502 includes:
[0172] The attention segmentation model includes a channel attention module and a spatial attention module;
[0173] The process of image segmentation of CT images by the attention segmentation model is as follows:
[0174] Based on the channel attention module, the CT image is processed by maximum pooling and average pooling to obtain the first target feature map;
[0175] Inputting the first target feature map into the multi-layer perception network to obtain a second target feature map output by the multi-layer perception network;
[0176] Performing an arithmetic operation on the second target feature map, and processing the second target feature map after the arithmetic operation using an activation function to obtain a channel attention feature map;
[0177] Based on the spatial attention module, the channel attention feature map is processed by maximum pooling and average pooling to obtain the third target feature map;
[0178] splicing the third target feature map, and performing a convolution operation on the spliced third target feature map based on a convolutional network;
[0179] An activation function is used to process the third target feature map after the convolution operation to obtain a spatial attention feature map, and the spatial attention feature map is used as the first segmented image.
[0180] In one embodiment, the segmentation module 502 includes:
[0181] Based on the CT sample image, the target object is reconstructed in three dimensions;
[0182] Segment the three-dimensional reconstructed image to obtain multiple frames of target CT sample images;
[0183] The format of each frame of the target CT sample image is adjusted, so as to perform Gaussian filtering and image enhancement processing on the target CT sample image after the format adjustment.
[0184] In one embodiment, the segmentation module 502 includes:
[0185] Determine a segmentation method for the three-dimensionally reconstructed image;
[0186] The three-dimensional reconstructed image is segmented by a segmentation method to obtain multiple frames of target CT sample images.
[0187] In one embodiment, the fat mass prediction module 503 includes:
[0188] Inputting the CT sample image into the attention segmentation model to obtain a second segmented image of the CT sample image output by the attention segmentation model;
[0189] constructing a plurality of second training samples based on the fat percentage and fat detection value of each frame of the second segmented image;
[0190] The pre-constructed second model is trained using a plurality of second training samples to obtain a fat prediction model.
[0191] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6As shown, the electronic device may include: a processor 601, a communications interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communications interface 602 and the memory 603 communicate with each other via the communication bus 604. The processor 601 may call the logic instructions in the memory 603 to execute the method for determining the amount of fat, the method comprising:
[0192] Acquire a CT image of a target object;
[0193] Inputting the CT image into the attention segmentation model to obtain a segmented image of the CT image output by the attention segmentation model; the attention segmentation model is obtained by training a pre-constructed first model using a first training sample;
[0194] The fat percentage of each segmented image is determined, and the fat percentage is input into a fat prediction model to obtain the fat amount of the target object output by the fat prediction model; the fat prediction model is obtained by training a pre-constructed second model with a second training sample.
[0195] In addition, the logic instructions in the above-mentioned memory 603 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0196] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the fat mass determination method provided by the above methods, the method comprising:
[0197] Acquire a CT image of a target object;
[0198] Inputting the CT image into the attention segmentation model to obtain a segmented image of the CT image output by the attention segmentation model; the attention segmentation model is obtained by training a pre-constructed first model using a first training sample;
[0199] The fat percentage of each segmented image is determined, and the fat percentage is input into a fat prediction model to obtain the fat amount of the target object output by the fat prediction model; the fat prediction model is obtained by training a pre-constructed second model with a second training sample.
[0200] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present invention. Those of ordinary skill in the art may understand and implement them without creative effort.
[0201] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0202] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for determining fat mass, characterized in that: include: Acquire a CT image of a target object; Inputting the CT image into an attention segmentation model to obtain a first segmented image of the CT image output by the attention segmentation model; The attention segmentation model is obtained by training a pre-constructed first model using a first training sample; Determine the fat percentage of the first segmented image, and input the fat percentage into a fat prediction model to obtain the fat amount of the target object output by the fat prediction model; the fat prediction model is obtained by training a pre-constructed second model with a second training sample.
2. The method for determining fat mass according to claim 1, characterized in that: The step of determining the fat percentage of the segmented image comprises: Acquire fat pixels in the first segmented image; A ratio of the fat pixel points to the total pixel points in the first segmented image is determined, and the ratio is used as the fat percentage of the first segmented image.
3. The method for determining fat mass according to claim 1, characterized in that: The attention segmentation model is obtained based on the following steps: Acquiring multiple frames of CT sample images of the target object; Preprocessing the CT sample image, and performing pixel annotation on the fat area in the preprocessed CT sample image to construct a plurality of the first training samples; The pre-constructed first model is trained using a plurality of the first training samples to obtain the attention segmentation model.
4. The method for determining fat mass according to claim 3, characterized in that: The fat prediction model is obtained based on the following steps: Inputting the CT sample image into an attention segmentation model to obtain a second segmented image of the CT sample image output by the attention segmentation model; constructing a plurality of second training samples based on the fat percentage and fat detection value of each frame of the second segmented image; The pre-constructed second model is trained using a plurality of the second training samples to obtain the fat prediction model.
5. The method for determining fat mass according to claim 3, characterized in that: The attention segmentation model includes a channel attention module and a spatial attention module; The process of image segmentation of the CT image by the attention segmentation model is as follows: Based on the channel attention module, performing maximum pooling and average pooling processing on the CT image to obtain a first target feature map; Inputting the first target feature map into a multi-layer perception network to obtain a second target feature map output by the multi-layer perception network; Performing an arithmetic operation on the second target feature map, and processing the second target feature map after the arithmetic operation using an activation function to obtain a channel attention feature map; Based on the spatial attention module, performing maximum pooling and average pooling processing on the channel attention feature map to obtain a third target feature map; Splicing the third target feature map, and performing a convolution operation on the spliced third target feature map based on a convolutional network; The activation function is used to process the third target feature map after the convolution operation to obtain a spatial attention feature map, and the spatial attention feature map is used as the first segmented image.
6. The method for determining fat mass according to claim 3, characterized in that: The preprocessing of the CT sample image includes: Based on the CT sample image, three-dimensionally reconstruct the target object; Segmenting the three-dimensionally reconstructed image to obtain multiple frames of target CT sample images; The format of each frame of the target CT sample image is adjusted to perform Gaussian filtering and image enhancement processing on the target CT sample image after the format adjustment.
7. The method for determining fat mass according to claim 6, characterized in that: The step of segmenting the three-dimensionally reconstructed image to obtain multiple frames of target CT sample images includes: Determine how to segment the image; The segmentation method is used to segment the three-dimensionally reconstructed image to obtain multiple frames of target CT sample images.
8. A device for determining fat mass, characterized in that: include: An acquisition module, used for acquiring a CT image of a target object; A segmentation module, used for inputting the CT image into an attention segmentation model to obtain a first segmented image of the CT image output by the attention segmentation model; The attention segmentation model is obtained by training a pre-constructed first model using a first training sample; The fat mass prediction module is used to determine the fat percentage of the first segmented image and input the fat percentage into a fat prediction model to obtain the fat mass of the target object output by the fat prediction model; the fat prediction model is obtained by training a pre-constructed second model with a second training sample.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for determining the amount of fat as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for determining the amount of fat as claimed in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image three-dimensional tissue segmentation and determination method based on deep neural network
CN112164073A
Method for automatically segmenting abdominal CT visceral fat regions
CN112634285A
Sublingual microcirculation image segmentation method and device, electronic equipment and storage medium
CN112651978A
Pig B ultrasonic image fat content detection method based on deep regression network
CN114998195A
