Meat poultry skeleton measuring method, device, equipment and medium
Through deep learning technology and bone segmentation model, the existing meat and poultry bone measurement methods are solved, and high-precision and efficient meat and poultry bone measurements are achieved.
Patent Information
- Application Number
- CN202311661560.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2025-06-06
AI Technical Summary
The existing methods for measuring bones of meat and poultry are highly error-consuming and labor-intensive, which affects the economic value of poultry.
The meat and poultry bone segmentation method based on deep learning is adopted. By entering the target meat and poultry image to the preset bone segmentation model, the bone feature map is obtained, and the feature map is entered into the preset length measurement model to obtain the target meat and poultry bone measurement results. The method includes downsampling, fusion features, self-attention modules and upsampling processing, improving bone segmentation accuracy and measurement accuracy.
It significantly reduces the measurement error of meat and poultry bones, improves measurement efficiency and accuracy, and enhances the assessment of poultry economic value.
Smart Images

Figure CN120107272A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of poultry production, and in particular to a method, device, equipment and medium for measuring bones of meat poultry. Background Art
[0002] In the traditional meat poultry bone measurement method using calipers, it is necessary to first obtain the carcass of livestock and poultry, and then measure the bones. This not only destroys the integrity of the livestock and poultry carcass, loses good genetic sources, and affects the economic value of poultry, but also causes large errors in the measurement results and is time-consuming and labor-intensive. Summary of the invention
[0003] The present invention provides a method, device, equipment and medium for measuring bones of meat and poultry, which are used to solve the technical problems that the existing methods for measuring bones of meat and poultry have large errors and are time-consuming and labor-intensive.
[0004] In a first aspect, the present invention provides a method for measuring bones of meat poultry, comprising:
[0005] Input a target meat poultry image into a preset bone segmentation model, and obtain a bone feature map output by the preset bone segmentation model;
[0006] Input the bone feature map into a preset length measurement model to obtain a target meat poultry bone measurement result output by the preset length measurement model;
[0007] The preset bone segmentation model is used for:
[0008] Down-sampling the target meat and poultry image to obtain first down-sampling information and second down-sampling information corresponding to each skip connection layer, wherein the first down-sampling information is the same as the second down-sampling information, and the resolution of the first down-sampling information and the resolution of the second down-sampling information are both smaller than the resolution of the target meat and poultry image;
[0009] For each jump connection layer, input the second down-sampling information to the second preset convolutional layer corresponding to the jump connection layer, and obtain the fusion features output by the second preset convolutional layer; input the fusion features to the preset self-attention module, and obtain the features to be spliced output by the preset self-attention module;
[0010] The features to be spliced corresponding to each jump connection layer are up-sampled to obtain the skeleton feature map, and the resolution of the features to be spliced is smaller than the resolution of the skeleton feature map.
[0011] According to the poultry bone measurement method provided by the present invention, the downsampling process of the target poultry image to obtain the first downsampling information and the second downsampling information corresponding to each skip connection layer includes:
[0012] Down-sampling the target meat and poultry image according to a preset level, and obtaining first down-sampling information and second initial information corresponding to each jump connection layer;
[0013] For any skip connection layer, determining a preset number of first preset convolutional layers according to the level of the skip connection layer;
[0014] Processing the second initial information in sequence according to all first preset convolutional layers, obtaining processed second information corresponding to each first preset convolutional layer, fusing all processed second information, and obtaining second down-sampled information corresponding to the topmost layer;
[0015] Traverse all skip connection layers to obtain the second downsampling information corresponding to each skip connection layer.
[0016] According to the poultry bone measurement method provided by the present invention, determining the preset number of the first preset convolutional layer according to the level of the skip connection layer includes:
[0017] Determine the total number of layers of all skip connection layers;
[0018] For the skip connection layer corresponding to the topmost layer, determining the preset number of the first preset convolutional layers as the total number of layers;
[0019] During the downsampling process, each time the downsampling is performed, the number of the first preset convolutional layers corresponding to the skip connection layer where the downsampling is located is reduced until the downsampling is completed.
[0020] According to the poultry bone measurement method provided by the present invention, the upsampling process of the to-be-joined features corresponding to each skip connection layer includes:
[0021] For each upsampling process, the upsampling result of each previous level is spliced with the to-be-spliced feature corresponding to the skip connection layer where the upsampling process is located, to obtain the upsampling result of the current level;
[0022] Traverse all upsampling processes to obtain the bone feature map.
[0023] According to the meat poultry bone measurement method provided by the present invention, the step of inputting the bone feature map into a preset length measurement model and obtaining the target meat poultry bone measurement result output by the preset length measurement model comprises:
[0024] Input the minimum circumscribed matrix corresponding to the target meat poultry bone in the bone feature map to the first layer of the preset length measurement model, process the height of the minimum circumscribed matrix and the preset proportional coefficient according to the first layer of the preset length measurement model, and obtain the initial measurement result output by the first layer of the preset length measurement model;
[0025] Input the initial measurement result into the second layer of the preset length measurement model, process the initial measurement result and the preset correction coefficient according to the second layer of the preset length measurement model, and obtain the target meat poultry bone measurement result output by the second layer of the preset length measurement model.
[0026] According to the poultry bone measurement method provided by the present invention, before inputting the target poultry image into the preset bone segmentation model, the method further includes:
[0027] Acquire all original meat and poultry images corresponding to the target meat and poultry;
[0028] Filtering all target meat and poultry images from all original meat and poultry images according to a preset filtering method;
[0029] The preset filtering method includes mean filtering, median filtering or Gaussian filtering.
[0030] According to the poultry bone measurement method provided by the present invention, after obtaining the target poultry bone measurement result output by the preset length measurement model, the method further includes:
[0031] Traversing all target meat and poultry images, and obtaining the target meat and poultry bone measurement result corresponding to each target meat and poultry image;
[0032] All target meat poultry bone measurement results are averaged to obtain the final meat poultry bone measurement results.
[0033] In a second aspect, a poultry bone measuring device is provided, comprising:
[0034] A first acquisition unit, the first acquisition unit is used to input the target meat poultry image into a preset bone segmentation model, and obtain a bone feature map output by the preset bone segmentation model;
[0035] A second acquisition unit, the second acquisition unit is used to input the bone feature map into a preset length measurement model to obtain the target meat poultry bone measurement result output by the preset length measurement model;
[0036] The preset bone segmentation model is used for:
[0037] Down-sampling the target meat and poultry image to obtain first down-sampling information and second down-sampling information corresponding to each skip connection layer, wherein the first down-sampling information is the same as the second down-sampling information, and the resolution of the first down-sampling information and the resolution of the second down-sampling information are both smaller than the resolution of the target meat and poultry image;
[0038] For each jump connection layer, input the second down-sampling information to the second preset convolutional layer corresponding to the jump connection layer, and obtain the fusion features output by the second preset convolutional layer; input the fusion features to the preset self-attention module, and obtain the features to be spliced output by the preset self-attention module;
[0039] The features to be spliced corresponding to each jump connection layer are up-sampled to obtain the skeleton feature map, and the resolution of the features to be spliced is smaller than the resolution of the skeleton feature map.
[0040] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the meat poultry bone measurement method when executing the program.
[0041] In a fourth aspect, the present invention further 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 measuring bones of meat poultry.
[0042] The present invention provides a meat poultry bone measurement method, device, equipment and medium, which obtains a bone feature map by inputting a target meat poultry image into a preset bone segmentation model; inputs the bone feature map into a preset length measurement model to obtain a target meat poultry bone measurement result; the preset bone segmentation model is used to: downsample the target meat poultry image to obtain first downsampling information and second downsampling information corresponding to each jump connection layer, the first downsampling information is the same as the second downsampling information, and the resolution of the first downsampling information and the resolution of the second downsampling information are both smaller than the resolution of the target meat poultry image; for each jump connection layer, input the second downsampling information to the second preset convolutional layer corresponding to the jump connection layer to obtain the fused features output by the second preset convolutional layer; input the fused features to a preset self-attention module to obtain the features to be spliced output by the preset self-attention module; upsample the features to be spliced corresponding to each jump connection layer to obtain the bone feature map, and the resolution of the features to be spliced is smaller than the resolution of the bone feature map. The present invention improves the segmentation accuracy of the model by presetting the self-attention module, improves the segmentation accuracy of each layer of feature maps by using the skip connection layer, and finally greatly improves the segmentation accuracy of the output result, thereby reducing the measurement error of meat poultry bones. 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 This is one of the flow charts of the meat poultry bone measurement method provided by the present invention;
[0045] Figure 2 is a schematic diagram of a process for obtaining first downsampling information and second downsampling information provided by the present invention;
[0046] Figure 3 It is a schematic diagram of a process for obtaining the measurement results of target meat poultry bones provided by the present invention;
[0047] Figure 4 This is the second flow chart of the meat poultry bone measurement method provided by the present invention;
[0048] Figure 5 It is a structural schematic diagram of the meat poultry bone measuring device 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] With the development of artificial intelligence, the traditional caliper method of measuring meat poultry bones obviously cannot meet the needs of breeding. In order to accurately measure the length of meat poultry bones and screen out breeding chicken varieties with excellent bone genes, the present invention applies artificial intelligence technology to the measurement of chicken bone length. In order to automatically segment meat poultry bones and accurately measure the bone length, the present invention proposes a study on the segmentation and automatic length measurement of meat poultry bones based on electronic computed tomography (CT) images using deep learning technology.
[0052] Since the convolutional neural network model (U-Net) has a small receptive field, long-range dependence is limited, but its positioning ability is good. Usually, the region of interest is extracted from the input image according to the positioning information, and then segmentation prediction is realized in the region of interest to form a two-stage segmentation model. Since the two-stage semantic segmentation model repeatedly extracts the features of the low-level feature map, a large number of model parameters are added, which consumes training time. In order to solve the above technical problems, the present invention improves the U-shaped structure based on the convolutional neural network model U-Net++, proposes a self-attention convolutional neural network model with deep supervision (Attention U-Net++), and uses CT images of living chickens to realize bone segmentation and automatic length measurement. Figure 1 This is one of the flow charts of the meat poultry bone measurement method provided by the present invention, and the meat poultry bone measurement method comprises:
[0053] Step 101: input a target meat poultry image into a preset bone segmentation model, and obtain a bone feature map output by the preset bone segmentation model.
[0054] In step 101, the meat poultry can be broilers, ducks, geese or other poultry. The preset bone segmentation model is a self-attention convolutional neural network model determined by a model framework of meat poultry bone segmentation based on CT images. The preset bone segmentation model includes a U-shaped structure, an attention module and deep supervision. Considering that the self-attention convolutional neural network model of the present application has redesigned the jump connection layer on the basis of U-Net++, the segmentation accuracy of the coarse-grained feature map of the decoding layer is improved. The present invention introduces a self-attention module in the jump connection layer, which can better capture the position information of the target in the feature map of the encoding layer, replaces the extraction of the region of interest, and uses deep supervision in the expansion path to improve the segmentation accuracy of the bone.
[0055] After inputting the target meat and poultry image into a preset bone segmentation model, the present invention processes the target meat and poultry image based on U-shaped structure downsampling to obtain first downsampling information and second downsampling information corresponding to each jump connection layer, wherein the first downsampling information is the same as the second downsampling information, and the resolution of the first downsampling information and the resolution of the second downsampling information are both smaller than the resolution of the target meat and poultry image. In the present invention, the number of levels of the jump connection layer can be pre-set according to the pyramid features, and in the encoding process of each downsampling, the information to be downsampled of the next jump connection layer and the required feature information of the current jump connection layer are segmented until all downsampling is completed according to the number of levels.
[0056] Optionally, for each jump connection layer, the second downsampling information is input to the second preset convolutional layer corresponding to the jump connection layer to obtain the fused features output by the second preset convolutional layer; the fused features are input to the preset self-attention module to obtain the features to be spliced output by the preset self-attention module. The present invention is different from the conventional U-shaped structure in the prior art. After the last convolutional layer in each layer of jump connection, the second preset convolutional layer is used to fuse multiple feature maps obtained by the previous convolutional layer. The second preset convolutional layer can be a 1*1 convolutional layer. The fused feature map is then input to the preset self-attention module to obtain a feature map in which the target area is prominent and the background area is suppressed.
[0057] Optionally, the upsampling process processes the feature map obtained by each previous decoding layer and the to-be-joined features corresponding to each skip connection layer to obtain the skeleton feature map, including:
[0058] For each upsampling process, the upsampling result of each previous level is spliced with the to-be-spliced feature corresponding to the skip connection layer where the upsampling process is located, to obtain the upsampling result of the current level;
[0059] Traverse all upsampling processes to obtain the bone feature map.
[0060] Optionally, the features to be spliced corresponding to each jump connection layer are upsampled to obtain the bone feature map output by the preset bone segmentation model, and the present invention splices it with the upsampled feature map of the higher layer at the end of the jump connection to make up for the detailed information of the coarse-grained features in the decoding layer. The calculation formula of each decoding layer is as follows.
[0061]
[0062]
[0063] In formula (1) and formula (2), α i represents the attention coefficient of the skip connection layer of the i-th layer, A(·) represents the feature map calculated by the preset self-attention module, H(·) represents the convolution operation of the activation function, [] represents the concatenation operation of the feature map, U(·) represents the upsampling convolution operation, and D(x ij ) represents the decoding layer of the jth convolutional block in the i-th layer, and · represents multiplication.
[0064] Optionally, the present invention uses a deep supervision processing method on each image, which can make the feature map of the middle layer have semantic discriminability, which enables the attention modules of different layers to have the corresponding ability to affect the foreground content of a large range of images. At the same time, for the decoding layer of the U-shaped structure in the present invention, if the feature map of the lower layer can reduce the loss value, the final feature map can also be optimized with upsampling. If the number of levels of the jump connection layer in the present invention is 4 layers, the loss function of each decoding layer can be assigned coefficients, for example, set to 0.1, 0.2, 0.3 and 0.4 from bottom to top.
[0065] Step 102: input the bone feature map into a preset length measurement model to obtain a target meat poultry bone measurement result output by the preset length measurement model.
[0066] In step 102, after obtaining the bone feature map output by the preset bone segmentation model, the present invention calculates the minimum circumscribed matrix of the target meat poultry bone in the bone feature map. In order to obtain the length value of the bone, the present invention optionally uses the minimum circumscribed matrix for the segmentation tensor after 1*1 convolution when reducing the number of channels of the feature map to the expected number of classes to obtain the most appropriate bone length in the pixel-level dimension, and then performs linear relationship processing on the pixel length and actual length of the bone to obtain the actual length of the bone in the slice, that is, obtains the measurement result of the target meat poultry bone output by the preset length measurement model.
[0067] The present invention provides a meat poultry bone measurement method, which comprises the following steps: inputting a target meat poultry image into a preset bone segmentation model to obtain a bone feature map output by the preset bone segmentation model; inputting the bone feature map into a preset length measurement model to obtain a target meat poultry bone measurement result output by the preset length measurement model; the preset bone segmentation model of the present invention is used to: downsample the target meat poultry image to obtain first downsampling information and second downsampling information corresponding to each jump connection layer, wherein the first downsampling information is the same as the second downsampling information, and the resolution of the first downsampling information and the resolution of the second downsampling information are both smaller than the resolution of the target meat poultry image; for each jump connection layer, inputting the second downsampling information into a second preset convolutional layer corresponding to the jump connection layer to obtain a fused feature output by the second preset convolutional layer; inputting the fused feature into a preset self-attention module to obtain a feature to be spliced output by the preset self-attention module; and upsampling the feature to be spliced corresponding to each jump connection layer and a feature map obtained by a previous decoding layer to obtain the bone feature map. The present invention improves the segmentation accuracy of the model by presetting the self-attention module, improves the segmentation accuracy of each layer of feature maps by using the skip connection layer and deep supervision, and finally greatly improves the segmentation accuracy of the output result, thereby reducing the measurement error of meat poultry bones.
[0068] Figure 2 It is a flow chart of obtaining the first down-sampling information and the second down-sampling information provided by the present invention, wherein the down-sampling processes the target meat and poultry image to obtain the first down-sampling information and the second down-sampling information corresponding to each jump connection layer, including:
[0069] Step 201: downsample the target meat and poultry image according to a preset level to obtain first downsampled information and second initial information corresponding to each skip connection layer.
[0070] In step 201, the present invention first determines the total number of layers of all jump connection layers. For example, if the total number of layers is 4, the jump connection layers in the present application include a first jump connection layer, a second jump connection layer, a third jump connection layer, and a fourth jump connection layer, wherein the jump connection layer corresponding to the top layer is set to be the first jump connection layer, and the second jump connection layer, the third jump connection layer, and the fourth jump connection layer are respectively set below.
[0071] For the jump connection layer corresponding to the top layer, the preset number of the first preset convolutional layers is determined to be the total number of layers, and for the jump connection layer corresponding to the top layer, the preset number of the first preset convolutional layers is determined to be 4, that is, 4 first preset convolutional layers are set in the first jump connection layer, and the first preset convolutional layer can optionally be 2 3*3 convolutional layers. In the downsampling process, each time downsampling is performed, the number of the first preset convolutional layers corresponding to the jump connection layer where the downsampling is located is reduced until the downsampling is completed.
[0072] Step 202: For any skip connection layer, determine a preset number of first preset convolutional layers according to the level of the skip connection layer.
[0073] Optionally, for the second jump connection layer, the preset number of first preset convolutional layers corresponding to the second jump connection layer is determined to be 3; for the third jump connection layer, the preset number of first preset convolutional layers corresponding to the third jump connection layer is determined to be 2; for the fourth jump connection layer, the preset number of first preset convolutional layers corresponding to the fourth jump connection layer is determined to be 1.
[0074] Step 203: Process the second initial information in sequence according to all first preset convolutional layers, obtain the processed second information corresponding to each first preset convolutional layer, fuse all the processed second information, and obtain the second down-sampling information corresponding to the topmost layer.
[0075] In step 203, for the jump connection layer corresponding to the top layer, the preset number of the first preset convolutional layers is determined to be the total number of layers, and the preset number of the first preset convolutional layers is determined to be 4, namely, the first preset convolutional layer 1, the first preset convolutional layer 2, the first preset convolutional layer 3 and the first preset convolutional layer 4, respectively, the second initial information is input to the first preset convolutional layer 1, the first intermediate value output by the first preset convolutional layer 1 is obtained, the first intermediate value is input to the first preset convolutional layer 2, the second intermediate value output by the first preset convolutional layer 2 is obtained, the second intermediate value is input to the first preset convolutional layer 3, the third intermediate value output by the first preset convolutional layer 3 is obtained, the third intermediate value is input to the first preset convolutional layer 4, and the fourth intermediate value output by the first preset convolutional layer 4 is obtained.
[0076] Among them, the first intermediate value, the second intermediate value, the third intermediate value and the fourth intermediate value are all processed second information, and the first intermediate value, the second intermediate value, the third intermediate value and the fourth intermediate value are fused to obtain the second down-sampling information corresponding to the top layer.
[0077] Step 204: traverse all skip connection layers to obtain the second down-sampling information corresponding to each skip connection layer.
[0078] In step 204, for the second jump connection layer, the third jump connection layer and the fourth jump connection layer, the second initial information is processed in sequence according to all the first preset convolutional layers of the corresponding jump connection layers, the processed second information corresponding to each first preset convolutional layer is obtained, all the processed second information is fused, and the second down-sampling information corresponding to each jump connection layer is obtained.
[0079] Figure 3 The present invention provides a flow chart of obtaining the target meat poultry bone measurement result, wherein the bone feature map is input to a preset length measurement model, and the target meat poultry bone measurement result output by the preset length measurement model is obtained, including:
[0080] Step 301: input the minimum circumscribed matrix corresponding to the target meat poultry bone in the bone feature map to the first layer of the preset length measurement model, process the height of the minimum circumscribed matrix and the preset proportional coefficient according to the first layer of the preset length measurement model, and obtain the initial measurement result output by the first layer of the preset length measurement model.
[0081] In step 301, the present invention can preset a linear relationship between the pixel length and the actual length of the bone in the slice, perform linear fitting between the sample pixel length and the sample actual length, thereby determining the fitting coefficient and constructing the linear relationship.
[0082] Optionally, the target meat poultry image in the present invention is CT image data. In the bone feature map output by the last layer of the self-attention convolutional neural network model, the minimum circumscribed matrix of the bone is calculated to obtain the length of the meat poultry bone in the input image, thereby achieving end-to-end bone segmentation measurement.
[0083] Specifically, the linear relationship between the pixel length and the actual length of the bone in the slice is shown in formula (3):
[0084] Len1=(a / b)*h (3)
[0085] In formula (3), Len1 is the initial measurement result, and the preset proportional coefficient is a / b, where a represents the actual length of the bone, b represents the pixel value length of the bone, and h represents the pixel height of the minimum external matrix obtained.
[0086] Step 302: input the initial measurement result into the second layer of the preset length measurement model, process the initial measurement result and the preset correction coefficient according to the second layer of the preset length measurement model, and obtain the target meat poultry bone measurement result output by the second layer of the preset length measurement model.
[0087] In step 302, the initial measurement result and the preset correction coefficient are processed according to the second layer of the preset length measurement model to obtain the target meat poultry bone measurement result output by the second layer of the preset length measurement model, which can be referred to the following formula:
[0088] Len2=Len1+c (4)
[0089] In formula (4), Len2 is the target poultry bone measurement result, Len1 is the initial measurement result, and c is the correction coefficient.
[0090] Figure 4 This is a second flow chart of the poultry bone measurement method provided by the present invention. Before inputting the target poultry image into the preset bone segmentation model, the method further includes:
[0091] Acquire all original meat and poultry images corresponding to the target meat and poultry;
[0092] Filtering all target meat and poultry images from all original meat and poultry images according to a preset filtering method;
[0093] The preset filtering method includes mean filtering, median filtering or Gaussian filtering.
[0094] Optionally, the present invention obtains all original meat and poultry images corresponding to the target meat and poultry based on electronic computed tomography (CT), and then pre-processes all the original meat and poultry images. After data cleaning, screening and other operations, all target meat and poultry images are screened out from all the original meat and poultry images according to a preset filtering method. The preset filtering method includes mean filtering, median filtering or Gaussian filtering. The mean filtering is to replace the value of the positive center point of the current filter kernel by the average value of the filter kernel, the median filtering is to replace the value of the positive center point of the current filter kernel by the middle value of the filter kernel, and the Gaussian filtering is to perform weighted sum of all pixels in the filter kernel and their corresponding weights, and then divide by the total weight for normalization, and the result is used as the value of the center pixel. The present invention can also use an image denoising algorithm such as bilateral filtering to filter out all target meat and poultry images from all original meat and poultry images.
[0095] Optionally, after obtaining the target meat poultry bone measurement result output by the preset length measurement model, the method further includes:
[0096] Step 401: traverse all target meat and poultry images to obtain the target meat and poultry bone measurement result corresponding to each target meat and poultry image.
[0097] In step 401, the present invention traverses all target meat and poultry images, executes steps 101 to 102, and then obtains the target meat and poultry bone measurement result corresponding to each target meat and poultry image.
[0098] Step 402: average all target poultry bone measurement results to obtain final poultry bone measurement results.
[0099] In step 402, the present invention calculates the minimum circumscribed matrix of the bones in the feature map output by the bone segmentation module, finds the average value of the bone length in the target meat and poultry image of all slices in the CT image, and obtains the final meat and poultry bone measurement result.
[0100] Optionally, since one CT image data can obtain multiple slices, and the length of the bones in each slice is different, in order to obtain the optimal bone length, the present invention takes the average of the bone lengths in all available slices of a CT, and finally obtains the actual length of the bone. Therefore, the present invention can not only obtain the bone segmentation result of the target meat poultry, but also obtain the bone length and width indicators of the target meat poultry.
[0101] The present invention uses a deep learning-based bone segmentation method to realize automatic bone length measurement of meat poultry. Based on the self-attention module, the present invention highlights the significant features that are useful for specific tasks while suppressing irrelevant background information. The self-attention module is embedded in the convolutional neural network model U-Net++, and the skip connection layer of the convolutional neural network model is redesigned. A self-attention convolutional neural network model with deep supervision is proposed, which improves the segmentation accuracy of the model and completes bone segmentation in one stage.
[0102] Optionally, since the segmentation result of the preset skeleton segmentation model is output by the top decoder of the expansion path, and the feature map of the top output is obtained by upsampling step by step from bottom to top in the expansion path, the feature map of the top decoder is related to the feature map of each layer in the expansion path, and the segmentation accuracy of each layer of the feature map is improved, the segmentation accuracy of the output result is inevitably improved. Based on this, the present invention redesigns the deep supervision of the preset skeleton segmentation model, adds deep supervision to the expansion path of the preset skeleton segmentation model, and the measurement standard (Intersection over Union, IoU) is improved compared to adding deep supervision to the jump connection layer of the top layer of the preset skeleton segmentation model.
[0103] Figure 5 It is a structural schematic diagram of the meat poultry bone measurement device provided by the present invention. The meat poultry bone measurement device includes a first acquisition unit 1. The first acquisition unit 1 is used to input the target meat poultry image into a preset bone segmentation model to obtain the bone feature map output by the preset bone segmentation model. The working principle of the first acquisition unit 1 can refer to the aforementioned step 101 and will not be repeated here.
[0104] The meat poultry bone measurement device also includes a second acquisition unit 2, which is used to input the bone feature map into a preset length measurement model to obtain the target meat poultry bone measurement result output by the preset length measurement model. The working principle of the second acquisition unit 2 can refer to the aforementioned step 102 and will not be repeated here.
[0105] The preset bone segmentation model is used for:
[0106] Down-sampling the target meat and poultry image to obtain first down-sampling information and second down-sampling information corresponding to each skip connection layer, wherein the first down-sampling information is the same as the second down-sampling information, and the resolution of the first down-sampling information and the resolution of the second down-sampling information are both smaller than the resolution of the target meat and poultry image;
[0107] For each jump connection layer, input the second down-sampling information to the second preset convolutional layer corresponding to the jump connection layer, and obtain the fusion features output by the second preset convolutional layer; input the fusion features to the preset self-attention module, and obtain the features to be spliced output by the preset self-attention module;
[0108] The features to be spliced corresponding to each jump connection layer are up-sampled to obtain the skeleton feature map, and the resolution of the features to be spliced is smaller than the resolution of the skeleton feature map.
[0109] The present invention provides a meat poultry bone measurement device, which obtains a bone feature map by inputting a target meat poultry image into a preset bone segmentation model; and obtains a target meat poultry bone measurement result by inputting the bone feature map into a preset length measurement model; the preset bone segmentation model is used to: downsample the target meat poultry image to obtain first downsampling information and second downsampling information corresponding to each jump connection layer, wherein the first downsampling information is the same as the second downsampling information, and the resolution of the first downsampling information and the resolution of the second downsampling information are both smaller than the resolution of the target meat poultry image; for each jump connection layer, the second downsampling information is input to a second preset convolutional layer corresponding to the jump connection layer to obtain a fusion feature output by the second preset convolutional layer; the fusion feature is input to a preset self-attention module to obtain a to-be-joined feature output by the preset self-attention module; and upsample the to-be-joined feature corresponding to each jump connection layer to obtain the bone feature map, wherein the resolution of the to-be-joined feature is smaller than the resolution of the bone feature map. The present invention improves the segmentation accuracy of the model by presetting the self-attention module, improves the segmentation accuracy of each layer of feature maps by using the skip connection layer, and finally greatly improves the segmentation accuracy of the output result, thereby reducing the measurement error of meat poultry bones.
[0110] Figure 6 Schematic diagram of the structure of the electronic device provided by the present invention. Figure 6As shown, the electronic device may include: a processor (processor) 610, a communication interface (Communications Interface) 620, a memory (memory) 630 and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call the logic instructions in the memory 630 to execute the meat poultry bone measurement method, which includes: inputting the target meat poultry image into a preset bone segmentation model to obtain a bone feature map output by the preset bone segmentation model; inputting the bone feature map into a preset length measurement model to obtain the target meat poultry bone measurement result output by the preset length measurement model; the preset bone segmentation model is used to: downsample the target meat poultry image to obtain the first downsampling information and the second downsampling information corresponding to each jump connection layer, the first downsampling information is the same as the second downsampling information, and the resolution of the first downsampling information and the resolution of the second downsampling information are both less than the resolution of the target meat poultry image; for each jump connection layer, input the second downsampling information to the second preset convolutional layer corresponding to the jump connection layer to obtain the fused features output by the second preset convolutional layer; input the fused features to the preset self-attention module to obtain the features to be spliced output by the preset self-attention module; upsample the features to be spliced corresponding to each jump connection layer to obtain the bone feature map, and the resolution of the features to be spliced is less than the resolution of the bone feature map.
[0111] In addition, the logic instructions in the above-mentioned memory 630 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, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for 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 and other media that can store program codes.
[0112] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute a meat poultry bone measurement method provided by the above-mentioned methods, which method includes: inputting the target meat poultry image into a preset bone segmentation model to obtain a bone feature map output by the preset bone segmentation model; inputting the bone feature map into a preset length measurement model to obtain the target meat poultry bone measurement result output by the preset length measurement model; the preset bone segmentation model is used to: downsample the target meat poultry image to obtain the first downsample corresponding to each jump connection layer The invention relates to a method for preparing a skeleton feature map of the present invention, wherein the first downsampling information and the second downsampling information are the same, and the resolution of the first downsampling information and the resolution of the second downsampling information are both smaller than the resolution of the target meat and poultry image; for each jump connection layer, the second downsampling information is input to the second preset convolutional layer corresponding to the jump connection layer to obtain the fusion features output by the second preset convolutional layer; the fusion features are input to the preset self-attention module to obtain the features to be spliced output by the preset self-attention module; the features to be spliced corresponding to each jump connection layer are up-sampled to obtain the skeleton feature map, and the resolution of the features to be spliced is smaller than the resolution of the skeleton feature map.
[0113] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the meat poultry bone measurement method provided by the above-mentioned methods, the method comprising: inputting a target meat poultry image into a preset bone segmentation model, and obtaining a bone feature map output by the preset bone segmentation model; inputting the bone feature map into a preset length measurement model, and obtaining a target meat poultry bone measurement result output by the preset length measurement model; the preset bone segmentation model is used to: downsample the target meat poultry image, and obtain the first downsampling information and the second downsampling information corresponding to each jump connection layer, and the The first down-sampling information is the same as the second down-sampling information, and the resolution of the first down-sampling information and the resolution of the second down-sampling information are both smaller than the resolution of the target meat and poultry image; for each jump connection layer, the second down-sampling information is input to the second preset convolutional layer corresponding to the jump connection layer to obtain the fused features output by the second preset convolutional layer; the fused features are input to the preset self-attention module to obtain the features to be spliced output by the preset self-attention module; the features to be spliced corresponding to each jump connection layer are up-sampled to obtain the bone feature map, and the resolution of the features to be spliced is smaller than the resolution of the bone feature map.
[0114] 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 scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0115] 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.
[0116] 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 measuring bones of meat poultry, It is characterized in that include: Input a target meat poultry image into a preset bone segmentation model, and obtain a bone feature map output by the preset bone segmentation model; Input the bone feature map into a preset length measurement model to obtain a target meat poultry bone measurement result output by the preset length measurement model; The preset bone segmentation model is used for: Down-sampling the target meat and poultry image to obtain first down-sampling information and second down-sampling information corresponding to each skip connection layer, wherein the first down-sampling information is the same as the second down-sampling information, and the resolution of the first down-sampling information and the resolution of the second down-sampling information are both smaller than the resolution of the target meat and poultry image; For each jump connection layer, input the second down-sampling information to the second preset convolutional layer corresponding to the jump connection layer, and obtain the fusion features output by the second preset convolutional layer; input the fusion features to the preset self-attention module, and obtain the features to be spliced output by the preset self-attention module; The features to be spliced corresponding to each jump connection layer are up-sampled to obtain the skeleton feature map, and the resolution of the features to be spliced is smaller than the resolution of the skeleton feature map.
2. The method for measuring bones of poultry according to claim 1, It is characterized in that The down-sampling process of the target meat and poultry image to obtain first down-sampling information and second down-sampling information corresponding to each skip connection layer includes: Down-sampling the target meat and poultry image according to a preset level, and obtaining first down-sampling information and second initial information corresponding to each jump connection layer; For any skip connection layer, determining a preset number of first preset convolutional layers according to the level of the skip connection layer; Processing the second initial information in sequence according to all first preset convolutional layers, obtaining processed second information corresponding to each first preset convolutional layer, fusing all processed second information, and obtaining second down-sampled information corresponding to the topmost layer; Traverse all skip connection layers to obtain the second downsampling information corresponding to each skip connection layer.
3. The method for measuring bones of poultry according to claim 2, It is characterized in that The step of determining the preset number of first preset convolutional layers according to the level of the skip connection layer includes: Determine the total number of layers of all skip connection layers; For the skip connection layer corresponding to the topmost layer, determining the preset number of the first preset convolutional layers as the total number of layers; During the downsampling process, each time the downsampling is performed, the number of the first preset convolutional layers corresponding to the skip connection layer where the downsampling is located is reduced until the downsampling is completed.
4. The method for measuring bones of poultry according to claim 2, It is characterized in that The upsampling process of the to-be-joined features corresponding to each jump connection layer includes: For each upsampling process, the upsampling result of each previous level is spliced with the to-be-spliced feature corresponding to the skip connection layer where the upsampling process is located, to obtain the upsampling result of the current level; Traverse all upsampling processes to obtain the bone feature map.
5. The method for measuring bones of poultry according to claim 1, It is characterized in that The step of inputting the bone feature map into a preset length measurement model and obtaining the target meat poultry bone measurement result output by the preset length measurement model comprises: Input the minimum circumscribed matrix corresponding to the target meat poultry bone in the bone feature map to the first layer of the preset length measurement model, process the height of the minimum circumscribed matrix and the preset proportional coefficient according to the first layer of the preset length measurement model, and obtain the initial measurement result output by the first layer of the preset length measurement model; Input the initial measurement result into the second layer of the preset length measurement model, process the initial measurement result and the preset correction coefficient according to the second layer of the preset length measurement model, and obtain the target meat poultry bone measurement result output by the second layer of the preset length measurement model.
6. The method for measuring bones of poultry according to claim 1, It is characterized in that Before inputting the target meat and poultry image into the preset bone segmentation model, the method further includes: Acquire all original meat and poultry images corresponding to the target meat and poultry; Filtering all target meat and poultry images from all original meat and poultry images according to a preset filtering method; The preset filtering method includes mean filtering, median filtering or Gaussian filtering.
7. The method for measuring bones of meat poultry according to claim 6, It is characterized in that After obtaining the target meat poultry bone measurement result output by the preset length measurement model, the method further includes: Traversing all target meat and poultry images, and obtaining the target meat and poultry bone measurement result corresponding to each target meat and poultry image; All target meat poultry bone measurement results are averaged to obtain the final meat poultry bone measurement results.
8. A bone measuring device for meat and poultry, It is characterized in that include: A first acquisition unit, the first acquisition unit is used to input the target meat poultry image into a preset bone segmentation model, and obtain a bone feature map output by the preset bone segmentation model; A second acquisition unit, the second acquisition unit is used to input the bone feature map into a preset length measurement model to obtain the target meat poultry bone measurement result output by the preset length measurement model; The preset bone segmentation model is used for: Down-sampling the target meat and poultry image to obtain first down-sampling information and second down-sampling information corresponding to each skip connection layer, wherein the first down-sampling information is the same as the second down-sampling information, and the resolution of the first down-sampling information and the resolution of the second down-sampling information are both smaller than the resolution of the target meat and poultry image; For each jump connection layer, input the second down-sampling information to the second preset convolutional layer corresponding to the jump connection layer, and obtain the fusion features output by the second preset convolutional layer; input the fusion features to the preset self-attention module, and obtain the features to be spliced output by the preset self-attention module; The features to be spliced corresponding to each jump connection layer are up-sampled to obtain the skeleton feature map, and the resolution of the features to be spliced is smaller than the resolution of the skeleton feature map.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the meat poultry bone measurement method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the meat poultry bone measurement method according to any one of claims 1 to 7 is implemented.