Pig skeleton segmentation method based on semi-supervised multi-scale diffusion model
By adopting a semi-supervised multi-scale diffusion model in pig bone segmentation, combining preprocessing, feature extraction, semi-supervised learning and diffusion model, the problems of low bone segmentation accuracy and relying on full-supervised learning in the existing technology are solved, and a high-precision and low-cost bone segmentation effect is achieved.
Patent Information
- Application Number
- CN202411865987.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art is difficult to provide high-precision segmentation when processing complex skeletal structures, and data set construction and model training rely on fully supervised learning, which increases costs and limits model performance.
The pig bone segmentation method based on the semi-supervised multi-scale diffusion model is adopted to achieve bone segmentation through preprocessing, context perception and multi-scale feature extraction, semi-supervised learning and pseudo-label generation, diffusion model and adaptive noise injection mechanism.
It significantly improves the accuracy of pig bone segmentation, reduces missegment and missegment segmentation, reduces labor costs, improves the robustness and generalization capabilities of the model, is more adaptable, and can handle complex bone structures.
Smart Images

Figure CN119942105A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pig bone segmentation, and in particular to a pig bone segmentation method based on a semi-supervised multi-scale diffusion model. Background Art
[0002] Accurately analyzing the bone structure of animals is very important for their breeding, because the bone morphology of animals is closely related to their function and reproduction. Traditionally, the invasive method of slaughtering pigs to analyze the bone structure is accurate, but it consumes a lot of manpower, material and financial resources and is inefficient. In recent years, computer imaging technology has made significant progress and can accurately calculate the body composition and overall bone structure of livestock. In this study, computed tomography (CT) technology combined with deep learning models was used to segment and analyze livestock bones in a non-invasive manner. This method has important application value in the segmentation and breeding of livestock bone structure. Recently, diffusion models have shown great potential in the field of computer vision and have been widely used in many fields such as image segmentation, anomaly detection, object detection, etc. Nowadays, there are many image segmentation methods, such as segmentation methods based on threshold, edge detection, clustering, morphology and fuzzy technology. Based on these traditional methods, deep learning-based methods can better handle complex image segmentation tasks with their powerful feature learning and representation capabilities, and show broad application prospects and advantages in fields such as medical image processing. This paper combines deep learning with medical imaging technology to learn to automatically segment the various bone parts of pigs through a small amount of labeled samples and study the bone strength of each bone part.
[0003] Chinese patent application No. 202122236614.8 discloses a vertical cutting device for pig carcasses. The technology includes a partition frame under the pig carcass conveyor line, and lifting equipment is arranged on both sides of the partition frame. The cutting device is connected to the lifting device through a feeding module above the lifting device; when the pig carcass moves to the partition frame along the conveyor line, the height of the lifting device is adjusted and the feeding module drives the cutting device to complete the three-section cutting of the pig carcass by horizontal movement. The device enables the pig carcass to be cut into three sections while it is in a suspended state, that is, during the conveying process of the pig carcass conveyor line. The cutting process eliminates the process of placing the pig carcass from the conveyor chain to the horizontal conveyor belt in the traditional cutting method, which saves time and improves the efficiency of the three-section cutting of pork; and during the cutting process, there is no need to manually adjust the position of the pig carcass on the horizontal conveyor belt, which eliminates the need for personnel during the cutting process and saves costs. This patent mainly focuses on the physical cutting of pig carcasses. Although it improves the segmentation efficiency, it cannot achieve accurate analysis of image data, cannot handle complex bone structures or provide fine segmentation results. It also requires the installation of partition racks, lifting equipment and cutting devices under the pig carcass conveyor line, which takes up a lot of space, has high requirements for the layout of the production line, and has high initial investment and maintenance costs. This system only achieves the physical cutting problem of pig carcasses, is difficult to handle complex bone structures, and cannot provide high-precision segmentation.
[0004] Chinese patent application number CN202011139480.1 discloses a bone segmentation method and system based on deep learning, which includes: building a medical image database, obtaining a medical image data set, and manually marking different types of bone areas; dividing the data set into a training set and a test set; converting the unlabeled medical image data into a picture of a first format and saving it, and converting the labeled medical image data into a picture of a second format and saving it; establishing a segmentation neural network model; training the segmentation neural network model using the training set, testing it using the test set, and segmenting it using the trained segmentation neural network model. The patent uses a traditional segmentation neural network model. Although it can complete the bone segmentation task, it may show certain limitations when dealing with complex noise or poor image quality. It is completely dependent on a large amount of manually labeled data. The construction of the data set and the training of the model are highly dependent on fully supervised learning, which not only increases the cost of data labeling, but also limits the performance of the model when the labeled data is insufficient. And it may perform poorly when dealing with bone structures with large scale differences, and the segmentation accuracy may be limited. Although it has certain segmentation capabilities, it has certain limitations in terms of data set construction costs, multi-scale processing, noise processing, etc.
[0005] To this end, a pig bone segmentation method based on a semi-supervised multi-scale diffusion model was proposed. Summary of the invention
[0006] The purpose of the present invention is to provide a pig bone segmentation method based on a semi-supervised multi-scale diffusion model to solve the problem that the above-mentioned background technology has certain limitations in terms of data set construction cost, multi-scale processing, noise processing, and difficulty in processing complex bone structures, and cannot provide high-precision segmentation.
[0007] To achieve the above object, the present invention provides the following technical solution: a pig bone segmentation method based on a semi-supervised multi-scale diffusion model, characterized in that it comprises the following steps;
[0008] S1: preprocessing pig CT image data;
[0009] S2: extract the preprocessed data using context-aware and multi-scale feature extraction mechanisms;
[0010] S3: Use semi-supervised learning and pseudo-label generation strategies to classify and evaluate the extracted data;
[0011] S4: Based on multi-scale feature extraction, the diffusion model is combined and an adaptive noise injection mechanism is introduced to process the data;
[0012] S5: The segmentation results of pig bones are obtained by adopting a multi-module linkage bone segmentation strategy.
[0013] Preferably, the specific steps of preprocessing the pig CT image data in S1 are as follows:
[0014] S11: Healthy Duroc boars were used as experimental specimens and anesthetized by intramuscular injection;
[0015] S12: The experimental sample was placed in a prone position and scanned using a CT scanner. The image matrix size was 512×512, the scanning direction was axial, and the thickness of each slice was 3.00 mm.
[0016] S13: All generated CT images are calibrated according to Hounsfield units in DICOM;
[0017] S14: When using medical image processing software, first use the contour drawing tool to accurately outline the general outline of the bone. Then the software will automatically refine the drawn edges to make them more accurate, enable the region growing algorithm, select the appropriate seed point, and expand outward from this point to fill in the area with similar features to the seed point. Finally, perform manual correction to achieve effective marking of 2D slices.
[0018] Preferably, the specific steps of extracting the preprocessed data using the context-aware and multi-scale feature extraction mechanism in S2 are as follows:
[0019] S21. Use three different sizes of convolution kernels to capture the multi-scale features of pig bones. The three different sizes of convolution kernels are: 1x1 convolution kernel, 3x3 normal convolution kernel and 3x3 dilated convolution kernel;
[0020] S22, context-aware feature extraction region Ω (p) It is a circular area with a perception radius of r and a pixel point p as the center in the input image of 512×512 pixels. The formula is as follows:
[0021] Ω (p) ={(x,y)Distance(P,Q)<r}
[0022] Where r represents the context perception radius, (x, y) is the coordinate of any pixel point M in the circular perception area,
[0023] Distance(P,Q) is the distance between the center pixels P(x1,y1) and Q(x2,y2):
[0024]
[0025] In the perception area Ω (p) In the above figure, not all pixels contribute equally to the feature extraction of the central pixel p. Therefore, a weighting mechanism based on distance, directionality, local gradient and frequency domain feature weight terms is introduced. The weighted contribution of each pixel to the central pixel p is expressed as:
[0026]
[0027] The distance weight term is controlled by the distance function, expressed as:
[0028]
[0029] Among them, the hyperparameter α controls the decay speed. When the α value is larger, the weight of pixels farther away is smaller;
[0030] The directional weight is measured by the angle difference and is defined as:
[0031]
[0032] The weighting term is: exp(-β·Δθ(P,Q)) where the hyperparameter β controls the influence of the directional weight. When the β value is large, the influence of the directional change angle difference between pixels on the weight will be more obvious.
[0033] The local gradient represents the change in the feature at pixel Q(x2,y2), which is defined as the gradient of the feature map F at Q:
[0034]
[0035] The gradient weight term is: Among them, the hyperparameter γ controls the influence of local gradient on weighting. When the value of γ is large, the contribution of pixels with drastic feature changes is reduced.
[0036] In the context-aware region Ω (p) In the frequency domain, the fast Fourier transform (FFT) is used to obtain the frequency domain features, where Re(F Q ) is the real part of the frequency domain representation, Im(F Q ) is the imaginary part of the frequency domain, i is the imaginary number representation For the frequency domain characteristic F of the Q point Q It can be obtained by FFT and is defined as:
[0037] F Q =Re(F Q )+i·Im(F Q )
[0038] For pixel Q, its frequency domain amplitude |F Q | represents the energy intensity of the pixel in the frequency domain, which is defined as:
[0039]
[0040] In the perception area Ω (p) The average feature in the mid-frequency domain is calculated as:
[0041]
[0042] The frequency domain F(Q) at point Q is defined as:
[0043]
[0044] The frequency domain weighting term is: exp(-δ·F(Q)), where the hyperparameter δ controls the impact of frequency features on weights. When δ is large, the impact of frequency domain feature differences on weights is more significant, resulting in a decrease in the contribution of pixels with large frequency differences to the central pixel. When δ is small, it means that the impact of frequency domain feature differences on weights is reduced, and the frequency features of more pixels will be taken into account, thereby enhancing the extraction of contextual information.
[0045] In the context-aware region, F(P,Q) represents the feature value of the image at Q points with point p as the center, and the context feature F of the central pixel p is calculated. context (x), forming an enhanced feature map:
[0046] F context (x) = ∑ M∈Ω(P) ω(P,Q)·F(P,Q)
[0047] By introducing an adaptive weighting mechanism, the model can more flexibly combine local and global context information, thereby improving the ability of feature expression;
[0048] S23: Multi-scale feature fusion, the feature maps extracted by the above three different convolution kernels and the feature maps after context-aware enhancement are spliced to generate a feature map containing multi-scale information. The formula is as follows:
[0049] F fused (x) = concat(F 1×1 (x),F 3×3 (x),F dilated-3×3 (x),F context (x))
[0050] S34: Nonlinear activation and feature enhancement: Use the ReLU activation function to perform nonlinear transformation on the fused feature map to improve the expressiveness of the feature map and enhance the model's ability to recognize complex bone structures.
[0051] S35: Transfer of feature extraction results: passing the processed multi-scale feature map to the diffusion model as the basic input for subsequent bone segmentation.
[0052] Preferably, the specific steps of using semi-supervised learning and pseudo-label generation strategy to classify and evaluate the extracted data in S3 are as follows:
[0053] S31: Initial training of weak classifiers: using a small amount of labeled data to train an initial weak classifier, performing basic classification operations on input samples, and providing preliminary prediction results;
[0054] S32: Generate pseudo labels for unlabeled data, use the weak classifier obtained by the above training to predict the unlabeled unlabeled data, and generate pseudo labels for some unlabeled samples according to the prediction results;
[0055] S33: Iterative training of the classifier. Use all current labeled samples, including the initial labeled data and samples expanded by pseudo labels, to retrain the classifier. With the continuous iteration of training, the performance of the classifier gradually improves. In each round of iteration, check whether the preset stop condition is met. If the stop condition is met, enter the model evaluation step, otherwise continue to generate pseudo labels and train the unlabeled data;
[0056] S34: Evaluate the final trained classifier on the test set.
[0057] Preferably, in S4, based on the multi-scale feature extraction, the diffusion model is combined and an adaptive noise injection mechanism is introduced, and the specific steps of processing the data are as follows:
[0058] S41: The forward process of the diffusion model optimizes the noise injection by dynamically adjusting the noise injection intensity. The noise image sequence generated by the diffusion model represents {x0,x1...x r}, the forward propagation process q is expressed as:
[0059]
[0060] Among them, α t (x0) is a dynamic noise parameter. Based on the local features of image x0, it is adjusted to an adaptive noise injection mechanism related to the image content. The edge information of the bone is extracted through the Sobe1 operator gradient operation of the image, and the edge weight map E(x0) is generated. The local complexity is calculated, and the complexity of the area where each pixel in the image is located is measured through multi-scale feature extraction. According to the edge weight map E(x0) and the local complexity map, the noise injection intensity α is dynamically adjusted t (x0);
[0061] First, use the Sobe1 operator to calculate the gradient map of the input image:
[0062]
[0063] Then calculate the edge weight map E(x0) and normalize the gradient map so that the gradient value falls between 0 and 1:
[0064]
[0065] The local complexity graph represents the standard deviation of the gradient change within the local window, and the formula is defined as:
[0066] C local (x0) = std(G(x0))
[0067] For the threshold T G When the local complexity exceeds a certain threshold, the noise injection is reduced; when it is below the threshold, the noise injection is increased. t (x0) is dynamically adjusted by the initial strength, edge weight map E(x0) and adjustment coefficients λ1,λ2:
[0068] α(x0)=α0·σ(1-λ1·E(x0)-λ2·C local (x0))
[0069] The sigmoid function σ(Z) is used to smoothly adjust the noise injection to ensure that the intensity of the noise injection changes gradually. λ1 and λ2 are used to adjust the edge weight E(x0) and the local complexity C respectively. local (x0) is the coefficient that affects the noise injection intensity, λ1 is used to adjust the noise in the edge area, and λ2 is used to adjust the noise in the local complex area. The median and standard deviation are calculated based on the gradient value distribution, and the adjustment coefficients λ1 and λ2 are selected to determine the gradient threshold T G
[0070] T G =med(G(x0))+λ1·std(E(x0))+λ2·std(C local (x0))
[0071] According to the generated α(x0), noise of different intensities is injected into each pixel. For the edge area of the bone, the noise injection is reduced to retain the details; for the relatively smooth or background area, the noise injection is increased to enhance the denoising effect. The formula is as follows:
[0072] When G(x0)>T G When the noise injection is reduced, that is, α is reduced t (x0)
[0073] When G(x0)≤T G When the noise injection is increased, that is, α is increased t (x0)
[0074] When λ1 is large, it means that the edge weight E(x0) has a greater impact on noise injection. Since the weight E(x0) in the edge area is usually higher (because the gradient in the edge area is large), the value of λ1·E(x0) in the formula will also become larger, resulting in α t (x0) decreases, and when λ2 is larger, its influence on the noise injection intensity increases, especially in complex areas, because C local (x0) is usually high, and the λ2·std(C local The value of (x0)) will increase with the increase of λ2, thereby reducing the intensity of noise injection α t (x0);
[0075] The introduction of an adaptive noise injection mechanism can improve the denoising effect while retaining the skeleton information. It is suitable for complex structure processing in skeleton segmentation tasks and can improve the accuracy and refinement of segmentation.
[0076] S42: The target of the reverse diffusion process. In the reverse diffusion process, the mean μ θ (x t ,t) is an autoregressive model, the current prediction depends not only on x t, but also depends on the previously predicted x t-1 :
[0077] μ θ (x t ,t)=f θ (x t ,x t-1 ,t)=
[0078] Then given a completely noisy image x T In the case of a series of steps to gradually remove the noise, and finally restore the original image x0, this process can be expressed as:
[0079] p θ (x t-1 x t )=N(x t-1 :μ θ (x t ,t),Σ θ (x t ,t))
[0080] where μ θ and Σ θ is the mean and variance learned by the model parameters θ. At each time step t, the diffusion model is based on the current noise image x t Estimate the previous time step x t-1 The distribution of x is sampled from it. This process of step-by-step denoising is repeated T times, and the noise is gradually removed in multiple time steps until x T Estimated to x0, each step of denoising is done in the conditional probability distribution p θ (x t-1 x t ) is sampled and the original image is reconstructed. In each denoising process, the model will t Evaluate and use the conditional probability distribution p θ (x t-1 |x t ) for sampling, which means that the model must not only estimate the pixel distribution of the image, but also make full use of the information estimated from the previous time step to generate the image of the previous time step through conditional sampling. In the process of reverse diffusion, as the t value gradually decreases, the influence of noise is gradually weakened, and the model is getting closer and closer to a clear image without noise. This step-by-step denoising process is iterated in multiple time steps to ensure that the original image is finally restored from the noise.
[0081] S43: U-Net used as noise predictor G θ , used to extract the noisy image x t and prediction noise ∈ at time step t θ (xt ,t)
[0082] G θ :(x t ,t)→∈ θ (x t ,t)
[0083] U-Net is trained by calculating the cross entropy between injected noise and predicted noise. Through the above process, the model can effectively remove noise from the image and restore high-quality bone images, thereby achieving accurate pig bone segmentation.
[0084] Preferably, the specific process of obtaining the segmentation result of the pig bones by adopting the multi-module linkage bone segmentation strategy in S5 is: a complete segmentation link is formed through the linkage and collaboration between data preprocessing, multi-scale feature extraction, semi-supervised learning, denoising diffusion probability model and bone segmentation.
[0085] Compared with the prior art, the present invention has the following beneficial effects:
[0086] By adopting multi-scale feature extraction and multi-scale attention mechanism, the accuracy of pig bone segmentation is significantly improved. Compared with traditional technologies, it can more effectively capture bone features of different scales, thereby reducing the phenomenon of mis-segmentation and missed segmentation, and also greatly reducing labor costs. The present invention combines semi-supervised learning and diffusion models to improve the robustness of the model when processing a small amount of labeled data and a large amount of unlabeled data. By optimizing iterative training and pseudo-label generation strategies, the generalization ability of the model is significantly improved. In practical applications, the classifier of the present invention shows higher accuracy and stability, and has obvious advantages over the prior art. Compared with existing methods, it performs better in the case of insufficient labeled data, has stronger adaptability, can handle various complex bone structures, and the generated bone probability map performs well in the segmentation tasks of different bone structures. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] Figure 1 A schematic diagram of the data set of the present invention;
[0088] Figure 2 It is a schematic diagram of the network structure flow of the present invention;
[0089] Figure 3 This is a schematic diagram of the network structure of the semi-supervised multi-scale diffusion model of the present invention;
[0090] Figure 4 The segmentation result diagram is shown. DETAILED DESCRIPTION
[0091] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0092] See also Figures 1 to 4 The present invention provides a technical solution for a pig bone segmentation method based on a semi-supervised multi-scale diffusion model:
[0093] A pig bone segmentation method based on a semi-supervised multi-scale diffusion model is characterized by comprising the following steps:
[0094] S1: Preprocess pig CT image data to improve image quality and model robustness and adapt to CT images of different resolutions;
[0095] S2: The preprocessed data is extracted using a context-aware and multi-scale feature extraction mechanism, which can capture the key features of complex bone structures and improve segmentation accuracy;
[0096] S3: Use semi-supervised learning and pseudo-label generation strategies to classify and evaluate the extracted data, realizing the effective combination of semi-supervised learning and pseudo-label generation. In the pseudo-label generation process, pseudo-labels are selected based on the performance of the model on unlabeled data. This can better control the quality of pseudo-labels, reduce the interference of noise labels, and improve the training effect and generalization ability of the model;
[0097] S4: Based on multi-scale feature extraction, the diffusion model is combined and an adaptive noise injection mechanism is introduced to process the data. The bone edge information is restored through gradual denoising to make the segmentation result more accurate.
[0098] S5: The segmentation results of pig bones are obtained by adopting a multi-module linkage bone segmentation strategy. Through the linkage and collaboration of multiple modules such as data preprocessing, multi-scale feature extraction, semi-supervised learning, denoising diffusion probability model and bone segmentation, a complete segmentation link is formed. Finally, the segmentation results of pig bones are obtained;
[0099] First, multi-scale features are extracted from the input medical image. By using convolution kernels of different sizes and a multi-scale attention mechanism, the model is able to capture the details and overall morphology of the pig bone structure at different scales. The generated multi-scale feature map is constructed by a convolutional network and retains rich bone information. Based on the diffusion model, the probability map of the bone is generated using the extracted multi-scale feature map. The probability map represents the probability distribution of each pixel belonging to the bone. Combining multi-scale features and the diffusion process, the model is able to accurately distinguish between bone and non-bone areas in a complex background. According to the generated probability map, the threshold segmentation technique is applied to identify high-probability bone areas, and finally an accurate bone segmentation result is obtained. In the threshold segmentation process, the threshold can be dynamically adjusted according to the complexity of different bone structures to improve the accuracy and robustness of the segmentation. The segmentation results undergo a series of post-processing steps, including denoising, morphological operations, and edge correction, to further improve the accuracy and consistency of the segmentation results. Through these post-processing steps, artifacts and noise in the segmentation can be effectively reduced, and the clarity of the bone boundary can be enhanced.
[0100] As an embodiment of the present invention, Figures 1 to 4 As shown, the specific steps of preprocessing the pig CT image data in S1 are as follows:
[0101] S11: Healthy Duroc boars were used as experimental specimens and anesthetized by intramuscular injection;
[0102] S12: The experimental sample was placed in a prone position and scanned using a CT scanner. The image matrix size was 512×512, the scanning direction was axial, and the thickness of each slice was 3.00 mm.
[0103] S13: All generated CT images are calibrated according to Hounsfield units in DICOM format. DICOM format is a standard format file generated by medical imaging equipment, containing rich images and their metadata;
[0104] S14: When using medical image processing software (use the medical image processing software 3DSlicer to open these DICOM files. In 3DSlicer, mark the 2D slices one by one in the transverse plane. This not only allows the target area on each slice to be accurately marked, but also allows a complete 3D structure to be formed by continuously marking multiple slices), first use the contour drawing tool to accurately outline the general outline of the bone, then the software will automatically refine the drawn edges to make them more accurate, enable the region growing algorithm, select a suitable seed point, and expand outward from this point to fill the area with similar features to the seed point, and finally perform manual correction to achieve effective marking of the 2D slices;
[0105] The specific steps of extracting the preprocessed data using the context-aware and multi-scale feature extraction mechanism in S2 are as follows:
[0106] S21. Use three different sizes of convolution kernels to capture the multi-scale features of pig bones. The three different sizes of convolution kernels are: 1x1 convolution kernel, 3x3 ordinary convolution kernel and 3x3 dilated convolution kernel. In the multi-scale feature extraction process, convolution kernels of different sizes are used to perform multi-scale convolution and up-down perception feature extraction operations on the preprocessed CT image to capture features of different scales in the image. Each scale of convolution operation can extract different structural details of the bone, ensuring that the model can recognize complex bone morphology. Given an input image I, extract features through multi-scale convolution. Assume f k (I) represents the feature map extracted using a convolution operation with a convolution kernel size of k×k, then the multi-scale feature extraction can be expressed as:
[0107] F multi-scale =[f3(I),f5(I),f7(I),f context (I)]
[0108] Where [,] represents the concatenation operation of features, f3(I) represents the features extracted by the convolution operation of image I using a 3×3 convolution kernel; f5(I) represents the features extracted by the convolution operation of image I using a 5×5 convolution kernel;
[0109] f7(I) represents the features extracted by convolution operation on image I using 7×7 convolution kernel; f context (I) represents the features extracted by the context-aware feature extraction mechanism;
[0110] S22, context-aware feature extraction region Ω (p) It is a circular area with a perception radius of r and a pixel point p as the center in the input image of 512×512 pixels. The formula is as follows:
[0111] Ω (p) ={(x,y)Distance(P,Q)<r}
[0112] Where r represents the context perception radius, (x, y) is the coordinate of any pixel point M in the circular perception area,
[0113] Distance(P,Q) is the distance between the center pixels P(x1,y1) and Q(x2,y2):
[0114]
[0115] In the perception area Ω (p)In the above figure, not all pixels contribute equally to the feature extraction of the central pixel p. Therefore, a weighting mechanism based on distance, directionality, local gradient and frequency domain feature weight terms is introduced. The weighted contribution of each pixel to the central pixel p is expressed as:
[0116]
[0117] The distance weight term is controlled by the distance function, expressed as:
[0118]
[0119] Among them, the hyperparameter α controls the decay speed. When the α value is larger, the weight of pixels farther away is smaller;
[0120] The directional weight is measured by the angle difference and is defined as:
[0121]
[0122] The weighting term is: exp(-β·Δθ(P,Q)) where the hyperparameter β controls the influence of the directional weight. When the β value is large, the influence of the directional change angle difference between pixels on the weight will be more obvious.
[0123] The local gradient represents the change in the feature at pixel Q(x2,y2), which is defined as the gradient of the feature map F at Q:
[0124]
[0125] The gradient weight term is: Among them, the hyperparameter γ controls the influence of local gradient on weighting. When the value of γ is large, the contribution of pixels with drastic feature changes is reduced.
[0126] In the context-aware region Ω (p) In the frequency domain, the fast Fourier transform (FFT) is used to obtain the frequency domain features, where Re(F Q ) is the real part of the frequency domain representation, Im(F Q ) is the imaginary part of the frequency domain, i is the imaginary number representation For the frequency domain characteristic F of the Q point Q It can be obtained by FFT and is defined as:
[0127] F Q =Re(F Q )+i·Im(F Q )
[0128] For pixel Q, its frequency domain amplitude F Q | represents the energy intensity of the pixel in the frequency domain, which is defined as:
[0129]
[0130] In the perception area Ω (p) The average feature in the mid-frequency domain is calculated as:
[0131]
[0132] The frequency domain F(Q) at point Q is defined as:
[0133]
[0134] The frequency domain weighting term is: exp(-δ·F(Q)), where the hyperparameter δ controls the impact of frequency features on weights. When δ is large, the impact of frequency domain feature differences on weights is more significant, resulting in a decrease in the contribution of pixels with large frequency differences to the central pixel. When δ is small, it means that the impact of frequency domain feature differences on weights is reduced, and the frequency features of more pixels will be taken into account, thereby enhancing the extraction of contextual information.
[0135] In the context-aware region, F(P,Q) represents the feature value of the image at Q points with point p as the center, and the context feature F of the central pixel p is calculated. context (x), forming an enhanced feature map:
[0136] F context (x) = Σ M∈Ω(P) ω(P,Q)·F(P,Q)
[0137] In the process of extracting up and down perception features, the perception area Ω with a perception radius r is defined with the pixel point P(x1,y1) as the center. (p) , perceive the context information in the area. In the perception area, different pixels contribute differently to the central pixel. For this reason, an adaptive weighting mechanism based on distance, directionality, local gradient, and frequency domain is introduced. The final context feature f context (I) is obtained by weighted summation in the upper and lower perception areas, F multi-scale is the final multi-scale feature map. Finally, the features of each scale are fused to generate a multi-scale feature map to provide skeleton information for the subsequent denoising diffusion model. The final output is obtained by applying the weight ω to the spliced feature map and multiplying it pixel by pixel with the original feature map and then adding them together:
[0138] x out =x+ω·x′
[0139] Among them, ω·x′ represents the weighting of the concatenated feature map, which is then added with the original input x to achieve adaptive fusion of features. By introducing the adaptive weighting mechanism, the model can more flexibly combine local and global context information, thereby improving the ability of feature expression;
[0140] S23: Multi-scale feature fusion, the feature maps extracted by the above three different convolution kernels and the feature maps after context-aware enhancement are spliced to generate a feature map containing multi-scale information. The formula is as follows:
[0141] F fused (x) = concat(F 1×1 (x),F 3×3 (x),F dilated-3×3 (x),F context (x))
[0142] S24: Nonlinear activation and feature enhancement: Use the ReLU activation function to perform nonlinear transformation on the fused feature map to improve the expressiveness of the feature map and enhance the model's ability to recognize complex bone structures.
[0143] S25: Transfer of feature extraction results, transferring the processed multi-scale feature map to the diffusion model as the basic input for subsequent bone segmentation;
[0144] The specific steps of using the semi-supervised learning strategy in S3 to classify and evaluate the extracted data are as follows:
[0145] S31: Initial training of weak classifiers: using a small amount of labeled data to train an initial weak classifier, performing basic classification operations on input samples, and providing preliminary prediction results;
[0146] S32: Generate pseudo labels for unlabeled data, use the weak classifier obtained by the above training to predict the unlabeled unlabeled data, and generate pseudo labels for some unlabeled samples according to the prediction results;
[0147] S33: Iterative training of the classifier. Use all current labeled samples, including the initial labeled data and samples expanded by pseudo labels, to retrain the classifier. With the continuous iteration of training, the performance of the classifier gradually improves. In each round of iteration, check whether the preset stop condition is met. If the stop condition is met, enter the model evaluation step, otherwise continue to generate pseudo labels and train the unlabeled data;
[0148] S34: Evaluate the final trained classifier on the test set. Evaluation indicators may include accuracy, precision, recall, F1 value, etc. Through evaluation, determine the performance of the model, and perform further optimization and adjustment as needed;
[0149] First, a preliminary classifier is trained using a small amount of labeled data; then the classifier is used to predict the unlabeled data, and some of the prediction results are added to the samples as pseudo labels; then all the current labeled samples (including real labels and pseudo labels) are used to train the classifier; if the stopping condition is met, an evaluation is performed, otherwise the classifier continues to be used to predict the unlabeled data and generate new pseudo labels; finally, the model performance is evaluated on the test set.
[0150] The labeled dataset is: Among them, x i is the input image, y i is the corresponding label, and N1 is the number of labeled data.
[0151] First, use the labeled data to train the initial weak classifier to minimize the supervised loss function L sup , the formula is as follows;
[0152]
[0153] Among them, CE is the cross entropy loss function, f(x i ) is the model's response to input x i Then in the pseudo-label generation phase, the unlabeled data Make predictions and generate pseudo labels At the same time, select pseudo-label samples with high confidence Where N u ′ is the number of pseudo-label samples selected.
[0154] In the iterative training of the classifier, select the joint training dataset, combining the labeled data and the pseudo-labeled data:
[0155]
[0156] In each round of training, the joint loss function L is optimized joint , where λ is a weight hyperparameter that balances supervised and unsupervised losses, then:
[0157] L joint =L sup +λL unsup
[0158] in
[0159] Finally, check whether the stopping condition is met, such as the preset training round T or the performance indicator P reaches a certain threshold P th ;IfItheration≥TorP≥P th ,stoptraining
[0160] If the stop condition is not met, continue to use pseudo label generation and training;
[0161] In S4, based on multi-scale feature extraction, a diffusion model is combined and an adaptive noise injection mechanism is introduced. The specific steps for processing data are as follows:
[0162] S41: The forward process of the diffusion model optimizes the noise injection by dynamically adjusting the noise injection intensity. The noise image sequence generated by the diffusion model represents {x0,x1...x r}, the forward propagation process q is expressed as:
[0163]
[0164] Where N represents the normal distribution, α t (x0) is the dynamic noise parameter, (1-a t (x0))I represents the dynamic covariance matrix of the noise, which represents the intensity of the noise. Based on the local features of the image x0, it is adjusted to an adaptive noise injection mechanism related to the image content. The edge information of the bone is extracted through the gradient operation of the Sobe1 operator of the image, and the edge weight map E(x0) is generated. The local complexity is calculated, and the complexity of the area where each pixel in the image is located is measured through multi-scale feature extraction. According to the edge weight map E(x0) and the local complexity map, the noise injection intensity α is dynamically adjusted. t (x0);
[0165] First, use the Sobe1 operator to calculate the gradient map of the input image:
[0166]
[0167] Then calculate the edge weight map E(x0) and normalize the gradient map so that the gradient value falls between 0 and 1:
[0168]
[0169] The local complexity graph represents the standard deviation of the gradient change within the local window, and the formula is defined as:
[0170] C local (x0) = std(G(x0))
[0171] For the threshold T G When the local complexity exceeds a certain threshold, the noise injection is reduced; when it is below the threshold, the noise injection is increased. t (x0) is dynamically adjusted by the initial strength, edge weight map E(x0) and adjustment coefficients λ1,λ2:
[0172] α(x0)=α0·σ(1-λ1·E(x0)-λ2·C local (x0))
[0173] The sigmoid function σ(Z) is used to smoothly adjust the noise injection to ensure that the intensity of the noise injection changes gradually. λ1 and λ2 are used to adjust the edge weight E(x0) and the local complexity C respectively. local (x0) is the coefficient that affects the noise injection intensity, λ1 is used to adjust the noise in the edge area, and λ2 is used to adjust the noise in the local complex area. The median and standard deviation are calculated based on the gradient value distribution, and the adjustment coefficients λ1 and λ2 are selected to determine the gradient threshold T G ;
[0174] T G =med(G(x0))+λ1·std(E(x0))+λ2·std(C local (x0))
[0175] According to the generated α(x0), noise of different intensities is injected into each pixel. For the edge area of the bone, the noise injection is reduced to retain the details; for the relatively smooth or background area, the noise injection is increased to enhance the denoising effect. The formula is as follows:
[0176] When G(x0)>T G When the noise injection is reduced, that is, α is reduced t (x0)
[0177] When G(x0)≤T G When the noise injection is increased, that is, α is increased t (x0)
[0178] When λ1 is large, it means that the edge weight E(x0) has a greater impact on noise injection. Since the weight E(x0) in the edge area is usually higher (because the gradient in the edge area is large), the value of λ1·E(x0) in the formula will also become larger, resulting in α t (x0) decreases, and when λ2 is larger, its influence on the noise injection intensity increases, especially in complex areas, because C local (x0) is usually high, and the λ2·std(C local The value of (x0)) will increase with the increase of λ2, thereby reducing the intensity of noise injection α t (x0);
[0179] The introduction of an adaptive noise injection mechanism can improve the denoising effect while retaining the skeleton information. It is suitable for complex structure processing in skeleton segmentation tasks and can improve the accuracy and refinement of segmentation.
[0180] S42: The target of the reverse diffusion process. In the reverse diffusion process, the mean μθ (x t ,t) is an autoregressive model, the current prediction depends not only on x t , but also depends on the previously predicted x t-1 :
[0181] μ θ (x t ,t)=f θ (x t ,x t-1 ,t)=
[0182] Then given a completely noisy image x T In the case of a series of steps to gradually remove the noise, and finally restore the original image x0, this process can be expressed as:
[0183] p θ (x t-1 x t )=N(x t-1 :μ θ (x t ,t),Σ θ (x t ,t))
[0184] where μ θ and Σ θ is the mean and variance learned by the model parameters θ. At each time step t, the diffusion model is based on the current noise image x t Estimate the previous time step x t-1 The distribution of x is sampled from it. This process of step-by-step denoising is repeated T times, and the noise is gradually removed in multiple time steps until x T Estimated to x0, each step of denoising is done in the conditional probability distribution p θ (x t-1 x t ) is sampled and the original image is reconstructed. In each denoising process, the model will t Evaluate and use the conditional probability distribution p θ (x t-1 |x t ) for sampling, which means that the model must not only estimate the pixel distribution of the image, but also make full use of the information estimated from the previous time step to generate the image of the previous time step through conditional sampling. In the process of reverse diffusion, as the t value gradually decreases, the influence of noise is gradually weakened, and the model is getting closer and closer to a clear image without noise. This step-by-step denoising process is iterated in multiple time steps to ensure that the original image is finally restored from the noise.
[0185] S43: U-Net used as noise predictor Gθ , used to extract the noisy image x t and prediction noise ∈ at time step t θ (x t ,t)
[0186] G θ :(x t ,t)→∈ θ (x t ,t)
[0187] U-Net is trained by calculating the cross entropy between injected noise and predicted noise. Through the above process, the model can effectively remove noise from the image and restore high-quality bone images, thereby achieving accurate pig bone segmentation;
[0188] The specific process of obtaining the segmentation result of pig bones by adopting the multi-module linkage bone segmentation strategy in the described S5 is as follows: through data preprocessing, multi-scale feature extraction, semi-supervised learning, denoising diffusion probability model and linkage cooperation between bone segmentation, a complete segmentation link is formed, and by combining multi-scale feature extraction and diffusion probability model, the accuracy can be improved in the segmentation process of bones, and multi-scale feature extraction can capture the local and global features of pig bones at different scales, ensuring that key information is obtained at different scales, thereby improving the integrity and detail retention of the segmentation results, and the diffusion probability model can reduce the noise and artifact interference in the image through the process of gradual denoising, especially when the boundary of pig bones is blurred or unclear, the model can continue to maintain high segmentation accuracy and stability. Through semi-supervised learning, a small amount of labeled data and a large amount of unlabeled data can be effectively utilized, and the learning ability of the model can be further enhanced, so that it can also achieve efficient training when the labeled data is limited. This method not only performs well on the training data set, but also shows excellent segmentation effect on the test data set, indicating that the model has a strong generalization ability, can adapt to the characteristics of different data sets, and continuously achieves high-precision segmentation results.
[0189] As an embodiment of the present invention, a semi-supervised learning strategy combines a small amount of labeled data with a large amount of unlabeled data for training, thereby improving the model's utilization of unlabeled data. The specific steps include: first, using a small amount of labeled data to train a preliminary weak classifier, using the trained weak classifier to predict the unlabeled data and generate pseudo labels. The labeled data and pseudo labels are combined to perform iterative training of the model.
[0190] The loss function uses the binary cross-entropy loss function (BinaryCross-EntropyLoss) to quantify the classification performance of the model at each pixel level. The formula is as follows:
[0191] First, the predicted value pi Transformed into probability value σ(p i ),Right now:
[0192]
[0193] Calculate the binary cross entropy loss:
[0194] BCE(y i ,σ(p i ))=y i ·log(σ(p i ))+(1-y i )·log(1-σ(p i ))
[0195] Take the average of all samples:
[0196]
[0197] Finally, the loss function can be written as:
[0198]
[0199] Where N is the number of samples, y i is the true label of the i-th sample, p i is the predicted value of the i-th sample, σ(p i ) is the result of the ith sample prediction value passing through the sigmoid function.
[0200] In the denoising diffusion probability model, the specific implementation process includes steps such as initializing the diffusion model, diffusion process, model training and optimization, output generation, and model evaluation.
[0201] In the initialization of the diffusion model, select the appropriate diffusion model architecture. The model parameters and network structure should be set and initialized according to the task requirements. During initialization, the model's loss function, optimizer, and training hyperparameters need to be defined.
[0202] It should be noted that:
[0203] Figure 4In the figure, the images are numbered by letters (a)-(e). (a) The image shows a CT cross-sectional image of a pig, with bones segmented from the throat and surrounding tissues; (b) The image shows the chest area of a pig, where the structure of the lungs and sternum can be seen, and the image shows the corresponding segmentation results, separating and marking the lungs and bone parts; (c) The image is a CT image of a cross-sectional abdominal cavity, showing the abdominal organs and muscle tissue of the pig, showing the segmentation results, and extracting the abdominal organs and fat tissue; (d) The image is a CT scan of the pelvic area of a pig, including the pelvis and surrounding tissues, and the bone parts are segmented from the blurred muscle groups; (e) The image shows another cross-section of the chest and abdominal cavity, where some structures of the abdomen and spine can be seen, and smaller cross-sections of the spine and ribs are segmented.
[0204] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A pig bone segmentation method based on a semi-supervised multi-scale diffusion model, characterized in that: The steps include: S1: preprocessing pig CT image data; S2: extract the preprocessed data using context-aware and multi-scale feature extraction mechanisms; S3: Use semi-supervised learning and pseudo-label generation strategies to classify and evaluate the extracted data; S4: Based on multi-scale feature extraction, the diffusion model is combined and an adaptive noise injection mechanism is introduced to process the data; S5: The segmentation results of pig bones are obtained by adopting a multi-module linkage bone segmentation strategy.
2. The pig bone segmentation method based on the semi-supervised multi-scale diffusion model according to claim 1 is characterized in that: The specific steps of preprocessing the pig CT image data in S1 are as follows: S11: Healthy Duroc boars were used as experimental specimens and anesthetized by intramuscular injection; S12: The experimental sample was placed in a prone position and scanned using a CT scanner. The image matrix size was 512×512, the scanning direction was axial, and the thickness of each slice was 3.00 mm. S13: All generated CT images are calibrated according to Hounsfield units in DICOM; S14: When using medical image processing software, first use the contour drawing tool to accurately outline the general outline of the bone. Then the software will automatically refine the drawn edges to make them more accurate, enable the region growing algorithm, select the appropriate seed point, and expand outward from this point to fill in the area with similar features to the seed point. Finally, perform manual correction to achieve effective marking of 2D slices.
3. The pig bone segmentation method based on a semi-supervised multi-scale diffusion model according to claim 1, characterized in that: The specific steps of extracting the preprocessed data using the context-aware and multi-scale feature extraction mechanism in S2 are as follows: S21. Use three different sizes of convolution kernels to capture the multi-scale features of pig bones. The three different sizes of convolution kernels are: 1x1 convolution kernel, 3x3 normal convolution kernel and 3x3 dilated convolution kernel; S22, context-aware feature extraction region Ω (p) It is a circular area with a perception radius of r and a pixel point p as the center in the input image of 512×512 pixels. The formula is as follows: Ω (p) ={(x,y)Distance(P,Q)<r} Where r represents the context perception radius, (x, y) is the coordinate of any pixel point M in the circular perception area, Distance(P,Q) is the distance between the center pixels P(x1,y1) and Q(x2,y2): In the perception area Ω (p) In the above figure, not all pixels contribute equally to the feature extraction of the central pixel p. Therefore, a weighting mechanism based on distance, directionality, local gradient and frequency domain feature weight terms is introduced. The weighted contribution of each pixel to the central pixel p is expressed as: The distance weight term is controlled by the distance function, expressed as: Among them, the hyperparameter α controls the decay speed. When the α value is larger, the weight of pixels farther away is smaller; The directional weight is measured by the angle difference and is defined as: The weighting term is: exp(-β·Δθ(P,Q)) where the hyperparameter β controls the influence of the directional weight. When the β value is large, the influence of the directional change angle difference between pixels on the weight will be more obvious. The local gradient represents the change in the feature at pixel Q(x2,y2), which is defined as the gradient of the feature map F at Q: The gradient weighting term is: exp(-γ·▽F(Q)) where the hyperparameter γ controls the effect of local gradients on weighting. When the value of γ is large, the contribution of pixels with drastic feature changes is reduced. In the context-aware region Ω (p) In the frequency domain, the fast Fourier transform (FFT) is used to obtain the frequency domain features, where Re(F Q ) is the real part of the frequency domain representation, Im(F Q ) is the imaginary part of the frequency domain, i is the imaginary number representation For the frequency domain characteristic F of the Q point Q It can be obtained by FFT and is defined as: F Q =Re(F Q )+i·Im(F Q ) For pixel Q, its frequency domain amplitude F Q | represents the energy intensity of the pixel in the frequency domain, which is defined as: In the perception area Ω (p) The average feature in the mid-frequency domain is calculated as: The frequency domain F(Q) at point Q is defined as: The frequency domain weighting term is: exp(-δ·F(Q)), where the hyperparameter δ controls the impact of frequency features on weights. When δ is large, the impact of frequency domain feature differences on weights is more significant, resulting in a decrease in the contribution of pixels with large frequency differences to the central pixel. When δ is small, it means that the impact of frequency domain feature differences on weights is reduced, and the frequency features of more pixels will be taken into account, thereby enhancing the extraction of contextual information. In the context-aware region, F(P,Q) represents the feature value of the image at Q points with point p as the center, and the context feature F of the central pixel p is calculated. context (x), forming an enhanced feature map: F context (x)=∑ M∈Ω(P) ω(P,Q)·F(P,Q) By introducing an adaptive weighting mechanism, the model can more flexibly combine local and global context information, thereby improving the ability of feature expression; S23: Multi-scale feature fusion, the feature maps extracted by the above three different convolution kernels and the feature maps after context-aware enhancement are spliced to generate a feature map containing multi-scale information. The formula is as follows: F fused (x)=concat(F 1×1 (x),F 3×3 (x),F dilated-3×3 (x),F context (x)) S34: Nonlinear activation and feature enhancement: Use the ReLU activation function to perform nonlinear transformation on the fused feature map to improve the expressiveness of the feature map and enhance the model's ability to recognize complex bone structures. S35: Transfer of feature extraction results: passing the processed multi-scale feature map to the diffusion model as the basic input for subsequent bone segmentation.
4. The pig bone segmentation method based on a semi-supervised multi-scale diffusion model according to claim 1, characterized in that: The specific steps of using semi-supervised learning and pseudo-label generation strategy in S3 to classify and evaluate the extracted data are as follows: S31: Initial training of weak classifiers: using a small amount of labeled data to train an initial weak classifier, performing basic classification operations on input samples, and providing preliminary prediction results; S32: Generate pseudo labels for unlabeled data, use the weak classifier obtained by the above training to predict the unlabeled unlabeled data, and generate pseudo labels for some unlabeled samples according to the prediction results; S33: Iterative training of the classifier. Use all current labeled samples, including the initial labeled data and samples expanded by pseudo labels, to retrain the classifier. With the continuous iteration of training, the performance of the classifier gradually improves. In each round of iteration, check whether the preset stop condition is met. If the stop condition is met, enter the model evaluation step, otherwise continue to generate pseudo labels and train the unlabeled data; S34: Evaluate the final trained classifier on the test set.
5. The pig bone segmentation method based on a semi-supervised multi-scale diffusion model according to claim 1, characterized in that: In S4, based on multi-scale feature extraction, a diffusion model is combined and an adaptive noise injection mechanism is introduced. The specific steps for processing data are as follows: S41: The forward process of the diffusion model optimizes the noise injection by dynamically adjusting the noise injection intensity. The noise image sequence generated by the diffusion model represents {x0,x1...x r }, the forward propagation process q is expressed as: Among them, α t (x0) is a dynamic noise parameter. Based on the local features of image x0, it is adjusted to an adaptive noise injection mechanism related to the image content. The edge information of the bone is extracted through the Sobe1 operator gradient operation of the image, and the edge weight map E(x0) is generated. The local complexity is calculated, and the complexity of the area where each pixel in the image is located is measured through multi-scale feature extraction. According to the edge weight map E(x0) and the local complexity map, the noise injection intensity α is dynamically adjusted t (x0); First, use the Sobe1 operator to calculate the gradient map of the input image: Then calculate the edge weight map E(x0) and normalize the gradient map so that the gradient value falls between 0 and 1: The local complexity graph represents the standard deviation of the gradient change within the local window, and the formula is defined as: C local (x0)=std(G(x0)) For the threshold T G When the local complexity exceeds a certain threshold, the noise injection is reduced; when it is below the threshold, the noise injection is increased. t (x0) is dynamically adjusted by the initial strength, edge weight map E(x0) and adjustment coefficients λ1,λ2: α(x0)=α0·σ(1-λ1·E(x0)-λ2·C local (x0)) The sigmoid function σ(Z) is used to smoothly adjust the noise injection to ensure that the intensity of the noise injection changes gradually. λ1 and λ2 are used to adjust the edge weight E(x0) and the local complexity C respectively. local (x0) is the coefficient that affects the noise injection intensity, λ1 is used to adjust the noise in the edge area, and λ2 is used to adjust the noise in the local complex area. The median and standard deviation are calculated based on the gradient value distribution, and the adjustment coefficients λ1 and λ2 are selected to determine the gradient threshold T G T G =med(G(x0))+λ1·std(E(x0))+λ2·std(C local (x0)) According to the generated α(x0), noise of different intensities is injected into each pixel. For the edge area of the bone, the noise injection is reduced to retain the details; for the relatively smooth or background area, the noise injection is increased to enhance the denoising effect. The formula is as follows: When G(x0)>T G When the noise injection is reduced, that is, α is reduced t (x0) When G(x0)≤T G When the noise injection is increased, that is, α is increased t (x0) When λ1 is large, it means that the edge weight E(x0) has a greater impact on noise injection. Since the weight E(x0) in the edge area is usually higher (because the gradient in the edge area is large), the value of λ1·E(x0) in the formula will also become larger, resulting in α t (x0) decreases, and when λ2 is larger, its influence on the noise injection intensity increases, especially in complex areas, because C local (x0) is usually high, and the λ2·std(C local The value of (x0)) will increase with the increase of λ2, thereby reducing the intensity of noise injection α t (x0); The introduction of an adaptive noise injection mechanism can improve the denoising effect while retaining the skeleton information. It is suitable for complex structure processing in skeleton segmentation tasks and can improve the accuracy and fineness of segmentation. S42: The target of the reverse diffusion process. In the reverse diffusion process, the mean μ θ (x t ,t) is an autoregressive model, the current prediction depends not only on x t , but also depends on the previously predicted x t-1 : μ θ (x t ,t)=f θ (x t ,x t-1 ,t)= Then given a completely noisy image x T In the case of a series of steps to gradually remove the noise, and finally restore the original image x0, this process can be expressed as: p θ (x t-1 x t )=N(x t-1 :μ θ (x t ,t),Σ θ (x t ,t)) where μ θ and Σ θ is the mean and variance learned by the model parameters θ. At each time step t, the diffusion model is based on the current noise image x t Estimate the previous time step x t-1 The distribution of x is sampled from it. This process of step-by-step denoising is repeated T times, and the noise is gradually removed in multiple time steps until x T Estimated to x0, each step of denoising is done in the conditional probability distribution p θ (x t-1 x t ) is sampled and the original image is reconstructed. In each denoising process, the model will t Evaluate and use the conditional probability distribution p θ (x t-1 |x t ) for sampling, which means that the model must not only estimate the pixel distribution of the image, but also make full use of the information estimated from the previous time step to generate the image of the previous time step through conditional sampling. In the process of reverse diffusion, as the t value gradually decreases, the influence of noise is gradually weakened, and the model is getting closer and closer to a clear image without noise. This step-by-step denoising process is iterated in multiple time steps to ensure that the original image is finally restored from the noise. S43: U-Net used as noise predictor G θ , used to extract the noisy image x t and prediction noise ∈ at time step t θ (x t ,t) G θ :(x t ,t)→∈ θ (x t ,t) U-Net is trained by calculating the cross entropy between injected noise and predicted noise. Through the above process, the model can effectively remove noise from the image and restore high-quality bone images, thereby achieving accurate pig bone segmentation.
6. The pig bone segmentation method based on a semi-supervised multi-scale diffusion model according to claim 1, characterized in that: The specific process of obtaining the pig bone segmentation result by adopting the multi-module linkage bone segmentation strategy in S5 is as follows: a complete segmentation link is formed through the linkage and collaboration among data preprocessing, multi-scale feature extraction, semi-supervised learning, denoising diffusion probability model and bone segmentation.
Citation Information
Patent Citations
Deep learning-based skeleton segmentation method and system
CN114170128A
Vertical splitting device for pig carcass
CN215873266U
Cited By
Low-label pig CT image segmentation method based on multi-task self-supervised learning
CN121437893A