A Binary Segmentation Method Based on Label Blocks and Pixel Space Weighting
Through the factor power index classification model of label blocks and pixel space weighting, the problems of low contrast and small samples in OCT images are solved, and more efficient binary segmentation is achieved, improving the accuracy of image segmentation and the recognition of edge structures.
Patent Information
- Application Number
- CN202211206973.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-09-30
AI Technical Summary
The prior art has poor binary segmentation effect when processing low-contrast and small-sample OCT images, making it difficult to accurately segment the target and background.
A factor power exponential classification model based on label blocks and pixel space weighting is adopted to extract features by training the label blocks in the sample, build feature matrix, and calculate the class conditional probability using the pixel space weight function to realize binary segmentation of the image.
The image segmentation accuracy under low contrast and small sample conditions is improved, and higher segmentation performance and accuracy of target edge structure are obtained.
Smart Images

Figure CN115719417B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a binary segmentation method based on label blocks and pixel space weighting, and belongs to the technical field of computer image processing. Background Art
[0002] Binarization is a fundamental technique for analyzing in vivo retinal images using optical coherence tomography (OCT). In recent years, extensive research has focused on quantitative analysis of OCT images, including biomedical image denoising, image reconstruction, and disease segmentation. Binarization methods have been used to segment ROIs in medical images, providing a foundation for image analysis and understanding.
[0003] There are two main types of image segmentation methods: traditional statistics-based models and deep learning methods. Threshold binarization algorithms are widely used for image binarization. The basic idea is to obtain a threshold from a local area or a global image based on a statistical or learning algorithm. OTSU and MinError are typical statistical algorithms for global thresholding. Learning-based thresholding methods can obtain an adaptive threshold for the entire image, which can achieve better image binarization performance. The current existing technology mainly focuses on binary segmentation under normal illumination, and has achieved good image binary segmentation performance to a certain extent. However, there are some limitations in images, such as low intensity and low contrast. Summary of the Invention
[0004] The purpose of the present invention is to provide a binary segmentation method based on label blocks and pixel space weighting, which solves the problems of small samples and low contrast and achieves competitive overall performance.
[0005] To achieve the above-mentioned purpose, the present invention is implemented through the following technical solutions:
[0006] Step 1: Process the original image and divide it into training samples and test samples. Select the target sub-image and background sub-image in the training sample. The size of the sub-image must be larger than the size of the label block. Put the target sub-image and background sub-image of the training sample in different folders respectively.
[0007] Step 2: Feature extraction and construction of label blocks; traverse the folders storing the target sub-image and background sub-image respectively with the label blocks to form a feature matrix, and record the extracted target sub-image feature label block as a, and the extracted background sub-image feature label block as
[0008] Step 3: Use the training samples to train a pixel space weighted factor power exponential classification model, the model is as follows:
[0009]
[0010] in, represents the feature vector of a sub-image, d represents the dimension of the feature vector of each label block, j∈{1,d}; C k represents the number of classes, k = {1, 2}, is the factor power exponential conditional probability function; P(Y=C k ) represents the class prior probability, which is calculated as follows:
[0011]
[0012] in, is the number of samples of the corresponding class, and N represents the number of training sample label blocks;
[0013] The factor power exponential conditional probability formula is as follows:
[0014]
[0015] Where D represents a constant, ^ represents the power exponential operation, λ represents a fine-tunable parameter with a value range of [0,1], and m j Represents the mean value of the pixels of the corresponding dimension of all label blocks, represents the pixel space weight function;
[0016] The spatial weight function formula is as follows:
[0017]
[0018] Where B is a constant, and R(.,r) represents the rth power of the value to be operated;
[0019] Step 4: Label block classification: traverse the image of the test sample according to the size of the label block in the training sample, calculate the probability that each image block traversed by the label block belongs to a certain class, and obtain the output with the maximum probability. Assign a value to each label block. The specific calculation formula is as follows:
[0020]
[0021] If y = a, then the label block is the target; if The label block is the background, and the final binary image is obtained.
[0022] Preferably, the formula for selecting the sub-image is:
[0023] CM(R)=rand((x,y)w,h) (L)
[0024] CM(B)=rand((x,y)w,h)
[0025] Where CM represents the feature sub-image block, CM(R) represents the target sub-image, CM(B) represents the background sub-image, rand represents random, (x, y) represents the coordinates of the upper left corner of the sub-image, w represents the width of the sub-image, h represents the length of the sub-image, and L represents the brightness of the sub-image, L = 1lm / (w*h), where lm represents the brightness unit lumen.
[0026] Preferably, for training samples, features are extracted from sub-images using a label block approach; for test samples, features are extracted using a label block sliding approach across the entire image.
[0027] Preferably, the value of D is 1.5, the value of B is 1.3, and the value of R(.,r) is 5.
[0028] The advantages of the present invention are that: the present invention extracts a large number of samples from each image through the label block, thereby solving the small sample problem, and the present invention obtains the precise edge structure of the target, thereby achieving competitive overall performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0030] Figure 1 Flowchart for the implementation of the present invention.
[0031] Figure 2 This is the true situation and result of all comparison methods of the present invention.
[0032] Figure 3 It is a visual comparison of the LFPS of the present invention and other comparison methods. DETAILED DESCRIPTION
[0033] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making creative efforts are within the scope of protection of the present invention.
[0034] The present invention is described in detail by taking mouse whole eye segmentation as an example.
[0035] set up is the label block set of mouse eyes, Y = {Y1, Y2} is the label set, and N is the number of label blocks of training samples. The training set is T = {(X1, y1), ..., (X i ,y i ),...,(X N ,yN )}, where y i is the i-th label block X i Label.y i is the i-th category, i∈{1,2}. is a feature vector, where d is the dimension of the feature vector for each label block.
[0036] Step 1: Divide the mouse eye image into training samples and test samples, and manually select sub-images of the target and background from the test samples. The formula for selecting sub-images is:
[0037] CM(R)=rand((x,y)w,h) (L)
[0038] CM(B)=rand((x,y)w,h)
[0039] Where CM represents the feature sub-image block, CM(R) represents the target sub-image block, CM(B) represents the background sub-image block, rand represents random, (x, y) represents the coordinates of the upper left corner of the sub-image, w represents the width of the sub-image, h represents the length of the sub-image, and L represents the brightness of the sub-image, L = 1lm / (w*h), where lm represents the brightness unit lumen.
[0040] Place the target sub-image in a folder named ROI and the background sub-image in a folder named BackGround.
[0041] Step 2: Feature extraction and label block construction. Traverse the ROI and BackGround folders using 8*8 (pixel) blocks to form a feature matrix. The extracted ROI feature label block is denoted as 1, and the extracted BackGround feature label block is denoted as 2. For training samples, features are extracted from the sub-image using the label block method. For test samples, features are extracted using an 8*8 (pixel) block sliding across the entire image.
[0042] Step 3: Train a pixel-space-weighted power-exponential classification model. This classification algorithm, a supervised learning algorithm, incorporates a strong independence assumption, assuming that features are independent. Therefore, in this patent, a pixel-space-weighted power-exponential classification method is used to binarize in vivo OCT mouse eye images.
[0043] The classification based on the pixel space weighted factor power index is defined as:
[0044]
[0045] Among them C kis the number of classes, k = {1, 2}. PM() is the factor power exponential class conditional probability function, ω() is the spatial weight function of each pixel in the block. Class prior probability P(Y = C k ) is calculated as follows:
[0046]
[0047] in is the number of samples of the corresponding class. Since any two events are independent, the power exponential class conditional probability based on pixel space weighting can be given as follows:
[0048]
[0049] Where D is a constant, which is set to 1.5 in this invention. ^ represents a power exponential operation. In data distribution analysis, the distribution of image data obeys a factor power exponential distribution. Therefore, this invention adopts a factor power exponential distribution method based on pixel space weighting to calculate the class conditional probability. λ represents a fine-tunable parameter in the range of [0,1]. j Represents the mean value of the pixels of the corresponding dimension of all label blocks, represents the pixel space weight function.
[0050] Since the pixel brightness values of the background and target areas in the image have a certain relationship, in order to suppress the background pixel value and highlight the target pixel, the calculation formula of the pixel space weight is:
[0051]
[0052] Among them, B is a constant with a value of 1.3, and R(.,r) represents the rth power of the value to be operated, with a value of 5.
[0053] Step 4: Label block classification. Traverse the image of the test sample according to the size of the label block in the training sample, calculate the probability that each image block traversed by the label block belongs to a certain class, and obtain the output with the maximum probability. Assign a value to each label block. The specific calculation formula is as follows:
[0054]
[0055] If y=1, the label block is the target; if y=2, the label block is the background, and finally a binary image is obtained.
[0056] In order to verify the outstanding points of the present invention, several methods were selected for comparison, including OTSU, Iteration, MinError, U-Net and resnet34-U-Net (such as Figure 2 and Figure 3 ), Figure 2The results of the method of the present invention and the comparative method are shown. Figure 3 This is the visual effect of local magnification of the present invention and the comparative method. The performance of these methods is also evaluated (Table 1):
[0057] Table 1 Results of different methods on the MEVOCT database
[0058]
[0059] Sensitivity is one of the most widely used statistical indicators, also known as the true positive rate, which calculates the proportion of true positive rates that are correctly segmented into ROIs. Calculated, where TP is the number of true pixels in the ROI and FN is the number of false negatives. Specificity is the selectivity or true negative rate, which measures the proportion of true negatives (i.e., pixels belonging to the background) that are correctly segmented as negative. Specificity is calculated by The Dice Coefficient can measure the number of positive pixels in the ROI while penalizing false positives in the background area. Calculate, where TN is the number of true negative pixels and FN is the number of false negative pixels.
[0060] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A binary segmentation method based on label blocks and pixel space weighting, characterized in that: The following steps are involved: Step 1: Process the original image and divide it into training samples and test samples. Select the target sub-image and background sub-image in the training sample. The size of the sub-image must be larger than the size of the label block. Put the target sub-image and background sub-image of the training sample in different folders respectively. Step 2: Feature extraction and construction of label blocks. Use the label blocks to traverse the folders storing the target sub-image and background sub-image respectively to form a feature matrix. The extracted target sub-image feature label block is recorded as a, and the extracted background sub-image feature label block is recorded as ¬a. Step 3: Use the training samples to train a pixel space weighted factor power exponential classification model, the model is as follows: in, represents the feature vector of a sub-image, d represents the dimension of the feature vector of each label block, ; represents the number of classes, , is the factor power exponential conditional probability function; Represents the class prior probability, which is calculated as follows: in, is the number of samples of the corresponding class, and N represents the number of training sample label blocks; The factor power exponential conditional probability formula is as follows: Where D represents a constant, ^ represents the exponential operation, Represents a fine-tuning parameter with a value range of [0,1]. Represents the mean value of the pixels of the corresponding dimension of all label blocks, represents the pixel space weight function; The spatial weight function formula is as follows: Where B is a constant, and R(.,r) represents the rth power of the value to be operated; Step 4: Label block classification: traverse the image of the test sample according to the size of the label block in the training sample, calculate the probability that each image block traversed by the label block belongs to a certain class, and obtain the output with the maximum probability. Assign a value to each label block. The specific calculation formula is as follows: If y=a, the label block is the target; if y=¬a, the label block is the background, and finally a binary image is obtained.
2. The binary segmentation method based on label blocks and pixel space weighting according to claim 1, characterized in that: The formula for sub-image selection is: Among them, CM represents the feature sub-image block, CM(R) represents the target sub-image, CM(B) represents the background sub-image, rand represents random, (x, y) represents the coordinates of the upper left corner of the sub-image, w represents the width of the sub-image, h represents the length of the sub-image, and L represents the brightness of the sub-image. ,in Indicates the brightness unit lumen.
3. The binary segmentation method based on label blocks and pixel space weighting according to claim 1, characterized in that: For training samples, features are extracted from sub-images using label blocks; For the test samples, the label block is used to slide the entire image to extract features.
4. The binary segmentation method based on label blocks and pixel space weighting according to claim 1, characterized in that: The value of D is 1.5, the value of B is 1.3, and the value of R(.,r) is 5.
Citation Information
Patent Citations
Intelligent steel SLAG detection method and system based on convolutional neural network
AU2020102091A4
Image Semantic Segmentation Method Based on Deep Full Convolutional Network and Conditional Random Field
AU2020103901A4