Complete average difference energy mode for texture image classification
Through the complete uniform energy mode, the problems of uneven feature distribution and light noise sensitivity in CLBP are solved, and the accuracy and robustness of texture image classification are improved. It is suitable for industrial surface defect detection, medical image analysis and other fields.
Patent Information
- Application Number
- CN202510476249.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-08-08
AI Technical Summary
In the existing CLBP method, the central mode uses only 1-bit representation to cause serious uneven feature distribution, limiting texture classification performance, and being sensitive to lighting changes and noise, making it difficult to effectively process complex texture images.
The complete mean difference energy mode is adopted, and local difference information is obtained through ring neighborhood sampling, combined with local symbols, amplitude and center modes, dynamic thresholds are designed using local grid mean, de-average processing is performed, and a 2-bit joint coding strategy is introduced, and multiple sub-modes are fused to generate more differentiated and discriminant features.
It improves the accuracy and robustness of texture image classification, enhances the adaptability to complex textures, reduces the computational complexity, and is suitable for real-time processing of resource-constrained devices.
Smart Images

Figure CN120451628A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer vision, and in particular relates to the technical field of texture image classification. Background Art
[0002] Texture image classification is an important research area in computer vision and image processing. Early methods were mainly based on statistics and transform domain analysis, such as gray-level co-occurrence matrix (GLCM), Gabor filter, and wavelet transform. These methods represent texture patterns by extracting statistical features or frequency domain information from images, but they are computationally complex and lack robustness to illumination changes.
[0003] Since the beginning of the 21st century, Local Binary Pattern (LBP) has become a landmark method in texture analysis. LBP converts local texture into a binary code by comparing the relationship between a pixel and its neighboring pixels, and characterizes texture features through statistical histograms. LBP's advantages include computational simplicity, rotation invariance, and robustness to illumination variations. Therefore, it has been widely used in various computer vision tasks, such as face recognition, material classification, and medical image analysis. Over the past few decades, Local Binary Pattern (LBP) and its variants have achieved remarkable success in texture image classification. However, traditional LBP algorithms still have some significant flaws. For example, LBP only considers the grayscale difference between the central pixel and its neighboring pixels, ignoring richer local information, such as global relationships and gradient information between pixels. While LBP is robust to illumination variations, it is still susceptible to noise, significantly degrading classification performance, especially in complex natural scenes. Furthermore, LBP's binary pattern only reflects simple local structures and lacks the ability to express higher-level texture information.
[0004] To overcome the shortcomings of traditional LBP, researchers have proposed a series of improved methods, the most representative of which is the Complete Local Binary Pattern (CLBP). CLBP adds three sub-patterns to LBP: sign pattern, amplitude pattern, and center pattern. These patterns are then fused through feature union or concatenation, thereby enhancing the expressive power of texture features. Since then, improved algorithms based on CLBP have been proposed, such as CLBC, which enhances the statistical power of local binary patterns and improves classification accuracy; MRELBP, which uses median filtering to reduce the impact of noise and improve robustness; and CRMCLBP, which enhances the recognition of complex textures through cross-regional feature fusion.
[0005] Although CLBP and its variants have improved texture classification performance to a certain extent, the central mode of CLBP is represented by only 1-bit, which makes the feature distribution seriously unbalanced and greatly limits the texture classification performance. This is a problem that technicians in this field have always been eager to solve, but they have never been able to obtain an effective technical means to solve it. Summary of the Invention
[0006] In view of the shortcomings of the existing CLBP technology, the present invention proposes the following scheme to further optimize the texture classification performance of CLBP:
[0007] A complete mean difference energy model for texture image classification, the complete mean difference energy model comprising the following steps:
[0008] S1, normalize the input texture image I to obtain the standardized texture image I o Steps;
[0009] S2, a step of performing annular neighborhood sampling with each pixel in the standardized texture image as the center to obtain local difference information;
[0010] S3, a step of obtaining a local symbol pattern CMDEP_S and a local amplitude pattern CMDEP_M based on the local difference information;
[0011] S4, normalize the texture image I o Divide into local grids, and use the mean of the local grids as the standardized texture image I o The threshold of the binary encoding of the pixel gray value is used to obtain the mean TH of the i-th local grid i , according to the mean TH of the i-th local grid i Get the entire normalized texture image I o The threshold value TH of the local grid c , according to the threshold TH of the local grid c For the normalized texture image I o The step of performing binary encoding on the pixels to obtain the local center pattern CMDEP_C;
[0012] S5. Standardized texture image I o Step E of removing the mean and obtaining the energy image I ;
[0013] S6, according to the energy image E I , obtain the local area threshold TH E Steps;
[0014] S7, according to the local area threshold TH E , the steps of obtaining the local mean difference energy pattern CMDEP_E;
[0015] S8, a step of jointly encoding the local center pattern CMDEP_C and the local mean difference energy pattern CMDEP_E into a 2-bit binary pattern using a sub-pattern recoding strategy to obtain a local center difference energy pattern CMDEP_CE;
[0016] S9, a step of fusing the local symbol pattern CMDEP_S, the local amplitude pattern CMDEP_M and the local center difference energy pattern CMDEP_CE in a feature union manner to obtain a complete mean difference energy pattern CMDEP_S / M / CE;
[0017] S10, a step of obtaining a feature vector according to the complete mean difference energy pattern, using the feature vector as a texture feature, inputting the feature vector into a nearest neighbor classifier, and obtaining a texture classification result.
[0018] Furthermore, the standardization method described in S1 is:
[0019]
[0020] Wherein, mean(I) is the mean function of the texture image I, std(I) is the standard deviation function of the texture image I, M is the scaling factor, and N is the translation factor.
[0021] Furthermore, the method for obtaining the local symbol pattern CMDEP_S and the local amplitude pattern CMDEP_M in S3 is:
[0022] In the normalized image I o In the center pixel g c Perform ring neighborhood sampling to obtain ring neighborhood pixel point g p , then the local difference information is:
[0023] g p -g c ,
[0024] Based on the local difference information, the local difference symbol s is obtained:
[0025] s(g p -g c ),
[0026] For s(g p -g c ) performs binary encoding to obtain a local symbol pattern CMDEP_S;
[0027] Based on the local difference information, the local difference amplitude m is obtained p :
[0028] m p =|g p -gc |,
[0029] To m p Perform binary encoding to obtain the local amplitude pattern CMDEP_M.
[0030] Furthermore, the method for obtaining the local center mode CMDEP_C in S4 is:
[0031] Normalize the texture image I o Divide into 4×4 local grids, and use the mean of all local grids as the entire standardized texture image I o The threshold of binary coding of pixel gray value, let the length and width of the i-th local grid be represented by H i and W i , then the mean TH of the i-th local grid i for:
[0032]
[0033] Among them, g h,w is the grayscale value of the pixel at the coordinate (h, w) in the i-th local area;
[0034] According to the mean TH of the i-th local grid i Get the entire normalized texture image I o The threshold value TH of the local grid c :
[0035]
[0036] According to the threshold TH of the local grid c For the normalized texture image I o The pixels are binary-encoded to obtain the local center pattern CMDEP_C:
[0037] CMDEP_C=t(g c ,TH c ).
[0038] Furthermore, the method for obtaining the local mean difference energy pattern CMDEP_E in S7 is:
[0039] For the normalized texture image I o Perform a de-averaging operation to obtain a de-averaged texture image I′, and obtain an energy image E according to the energy of the de-averaged texture image I′. I :
[0040] E I =(I′) 2 ,
[0041] Get the energy image E IThe corresponding local area threshold TH E :
[0042]
[0043] Among them, e h,w is the pixel energy at coordinate (h,w);
[0044] According to the local area threshold TH E Energy image E I Perform binary encoding to obtain the local mean difference energy mode CMDEP_E:
[0045] CMDEP_E=t(e E ,TH E ),
[0046] Among them, e E is the square of each pixel in the demeaned texture image I′.
[0047] Furthermore, the method for obtaining the local center difference energy mode CMDEP_CE in S8 is:
[0048] For each central pixel g c , and get two binary codes respectively, according to the weight 2 0 and 2 1 Weight CMDEP_C and CMDEP_E respectively to obtain the local center difference energy mode CMDEP_CE:
[0049] CMDEP_CE=2 0 ×CMDEP_C+2 1 ×CMDEP_E.
[0050] Based on the same inventive concept, the present invention also proposes a complete mean difference energy model device for texture image classification, the device comprising:
[0051] Used to normalize the input texture image I to obtain the normalized texture image I o Modules;
[0052] A module for sampling a circular neighborhood centered on each pixel in a normalized texture image to obtain local difference information;
[0053] A module for obtaining a local sign pattern CMDEP_S and a local amplitude pattern CMDEP_M based on local difference information;
[0054] Used to normalize the texture image I o Divide into local grids, and use the mean of the local grids as the standardized texture image I oThe threshold of the binary encoding of the pixel gray value is used to obtain the mean TH of the i-th local grid i , according to the mean TH of the i-th local grid i Get the entire normalized texture image I o The threshold value TH of the local grid c , according to the threshold TH of the local grid c For the normalized texture image I o The pixels are binary-encoded to obtain the module of the local center pattern CMDEP_C;
[0055] For normalizing texture images I o Remove the mean and obtain the energy image module E I ;
[0056] For the energy image E I , obtain the local area threshold TH E Modules;
[0057] According to the local area threshold TH E , a module for obtaining the local mean difference energy pattern CMDEP_E;
[0058] A module for jointly encoding the local center pattern CMDEP_C and the local mean difference energy pattern CMDEP_E into a 2-bit binary pattern using a sub-pattern re-encoding strategy to obtain a local center difference energy pattern CMDEP_CE;
[0059] A module for fusing the local symbol pattern CMDEP_S, the local amplitude pattern CMDEP_M and the local center difference energy pattern CMDEP_CE in a feature union manner to obtain a complete mean difference energy pattern CMDEP_S / M / CE;
[0060] A module for obtaining a feature vector based on the complete mean difference energy pattern, using the feature vector as a texture feature, inputting it into a nearest neighbor classifier, and obtaining a texture classification result.
[0061] Based on the same inventive concept, the present invention also proposes a computer storage medium for storing a computer program. When the computer program is read by a computer, the computer executes the complete mean difference energy model described in any one of the present inventions.
[0062] Based on the same inventive concept, the present invention also proposes a computer, including a processor and a storage medium. When the processor reads the computer program stored in the storage medium, the computer executes the complete mean difference energy model described in any one of the present inventions.
[0063] Based on the same inventive concept, the present invention also proposes a computer program product, which, as a computer program, implements the complete mean difference energy pattern described in any one of the present inventions when the computer program is read.
[0064] Compared with the prior art, the present invention has the following beneficial effects:
[0065] 1. The present invention innovatively adopts a 2-bit joint coding strategy to re-encode the original 1-bit local center pattern and local mean difference energy pattern, successfully overcoming the problems of singleness and uneven feature distribution in feature fusion of the traditional CLBP method. Traditional CLBP and its variant methods are usually based on a 1-bit coding mode. This method cannot effectively handle the fusion of multi-dimensional features, resulting in a skewed distribution of feature values in dimensions, which makes it difficult to meet the high-precision requirements in practical applications. In order to meet this challenge, the core innovation of the present invention is to re-encode multiple 1-bit features to form a new 2-bit feature pattern. Through in-depth analysis of the limitations of traditional methods, the inventor team proposed a new idea for feature fusion through a re-coding strategy, so that the encoded features are not only expanded in quantity, but also significantly improved in expression ability. The new 2-bit coding structure combines the local center difference energy pattern with the local mean difference energy pattern to generate a more differentiated, discriminative and balanced feature set, thereby enhancing the accuracy and robustness of texture image classification. Unlike traditional methods that simply fuse 1-bit features, this invention incorporates a re-encoding step during the feature fusion process. This allows the generated features to not only reflect texture details but also effectively improve feature balance and discernibility, thereby addressing the shortcomings of traditional methods in terms of feature balance and expression accuracy. Through this innovative encoding method, the present invention provides a new technical approach that can better adapt to the complex and ever-changing task of texture image classification, reflecting the creative efforts of the inventors' team in the algorithm design process.
[0066] 2. This invention addresses the sensitivity of traditional texture descriptors to illumination and noise by introducing demeaning processing for standardized texture images, enhancing model robustness and adaptability to complex texture images. Existing algorithms experience significant performance fluctuations when processing images with complex textures or limited quality, such as natural and medical images, making it difficult to maintain stable recognition accuracy. This invention utilizes the local energy mean as a comparison reference, effectively suppressing high-frequency noise and non-structural interference, making texture structure information more stable and reliable.
[0067] 3. This invention designs a dynamic threshold for the center pixel based on the grayscale mean of the local grid area, solving the problem of one-sided pattern expression under the traditional fixed center pixel reference and enhancing the ability to perceive local contextual structure. Traditional LBP methods use the center pixel as a fixed reference without considering its relative grayscale position within the region, resulting in insufficient grasp of overall texture trends. This invention dynamically adjusts the center reference value and incorporates local brightness distribution information, making the encoding results more regionally consistent and discriminative.
[0068] 4. The present invention integrates three types of sub-features: sign pattern, amplitude pattern, and center difference energy pattern, solving the problem of incomplete information in a single descriptor and improving classification diversity and comprehensive discrimination performance. Traditional LBP and its improved methods often rely on a single angle to construct feature vectors, which is prone to feature confusion between highly similar categories. The present invention jointly encodes the sign change direction, pixel difference amplitude, and regional energy characteristics, fully exploiting multidimensional texture difference information, giving the classifier stronger discrimination capabilities when processing similar texture categories.
[0069] 5. The complete mean difference energy model proposed in the present invention strikes a good balance between feature expression accuracy and computational complexity, solves the problem that high-dimensional features easily cause computational burden, and has the practical advantage of being suitable for actual engineering application scenarios. Although some existing improved CLBP methods can improve classification results, the computational cost is significantly increased, which is not conducive to model deployment. The present invention compresses information redundancy through low-dimensional joint coding, ensuring operational efficiency while maintaining high accuracy, and is convenient for deployment and use in embedded systems or real-time texture recognition scenarios.
[0070] The complete mean difference energy model described in this paper is suitable for feature extraction and classification of texture images and has a wide range of applications. It can be applied to various industries, including industrial surface defect detection, medical image analysis, remote sensing image classification, agricultural crop disease spot identification, fabric or material texture analysis, digital image forensics, and content retrieval.
[0071] The complete mean difference energy pattern described in the present invention has the characteristics of high stability and high recognition rate, and is particularly suitable for image processing scenarios under complex backgrounds, multi-scale structures or interference conditions.
[0072] In addition, since the method of the complete mean difference energy mode of the present invention has low computational complexity and concise coding, it is suitable for resource-constrained edge computing devices or embedded systems to achieve rapid classification and real-time processing of images. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 is a flow chart of a complete mean difference energy model for texture image classification according to embodiment seven;
[0074] Figure 2 is a schematic diagram of the local area threshold value described in the seventh embodiment;
[0075] Figure 3 is a schematic diagram of a complete mean difference energy mode algorithm according to an embodiment;
[0076] Figure 4 is the classification accuracy of CMDEP at different sampling resolutions under different test subsets described in the implementation method;
[0077] Figure 5 3. It is a comparison of the classification accuracy of CMDEP, LBP and CLBP under different test subsets described in the implementation method. Implementation Method
[0078] 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.
[0079] Implementation Method 1
[0080] A complete mean difference energy model for texture image classification, the complete mean difference energy model comprising the following steps:
[0081] S1, a step of performing standardization processing on the input texture image to obtain a standardized texture image;
[0082] S2, a step of performing annular neighborhood sampling with each pixel in the standardized texture image as the center to obtain local difference information;
[0083] S3, a step of obtaining a local symbol pattern CMDEP_S and a local amplitude pattern CMDEP_M based on the local difference information;
[0084] S4, dividing the standardized texture image into local grids, calculating the regional threshold of each local grid, and using the mean of the regional thresholds as the threshold for binary encoding of the grayscale values of pixels in the standardized texture image to obtain a local center pattern CMDEP_C;
[0085] S5, removing the mean of the standardized texture image to obtain an energy image after removing the mean;
[0086] S6, a step of obtaining a local region threshold value according to the energy image after removing the mean value;
[0087] S7, a step of obtaining a local mean difference energy mode CMDEP_E according to the local area threshold;
[0088] S8, a step of jointly encoding the local center pattern CMDEP_C and the local mean difference energy pattern CMDEP_E into a 2-bit binary pattern using a sub-pattern recoding strategy to obtain a local center difference energy pattern CMDEP_CE;
[0089] S9, a step of fusing the local symbol pattern CMDEP_S, the local amplitude pattern CMDEP_M and the local center difference energy pattern CMDEP_CE in a feature union manner to obtain a complete mean difference energy pattern CMDEP_S / M / CE;
[0090] S10, a step of obtaining a feature vector according to the complete mean difference energy pattern, using the feature vector as a texture feature, inputting the feature vector into a nearest neighbor classifier, and obtaining a texture classification result.
[0091] This implementation systematically constructs a complete mean difference energy model through standardization, local difference analysis, energy mapping, and multi-sub-mode fusion, improving the accuracy and generalization of texture image classification. This method has a clear hierarchical structure and integrates local and global texture features, effectively adapting to image differences in different scenarios and enhancing the ability to represent complex texture distributions.
[0092] Implementation Method 2
[0093] This embodiment further limits the first embodiment. Furthermore, the method of standardization processing in S1 is:
[0094]
[0095] Where I0 is the normalized texture image, mean(I) is the mean function, std(I) is the standard deviation function, M is the scaling factor, and N is the translation factor.
[0096] This embodiment solves the problem of large differences in grayscale distribution of original images that affect the consistency of feature extraction by introducing a standardized processing formula, so that the image has a unified grayscale scale before feature extraction, enhancing the comparability of features and the adaptability of the model to different images.
[0097] Implementation Method 3
[0098] This embodiment further limits the first embodiment. Furthermore, the method for obtaining the local symbol pattern CMDEP_S and the local amplitude pattern CMDEP_M in S3 is:
[0099] In the normalized image I o In the center pixel g c Perform ring neighborhood sampling to obtain ring neighborhood pixel point g p , then the local difference information is:
[0100] g p -g c ,
[0101] Based on the local difference information, the local difference symbol s is obtained:
[0102] s(g p -g c ),
[0103] For s(g p -g c ) performs binary encoding to obtain a local symbol pattern CMDEP_S;
[0104] Based on the local difference information, the local difference amplitude m is obtained p :
[0105] m p =|g p -g c |,
[0106] To m p Perform binary encoding to obtain the local amplitude pattern CMDEP_M.
[0107] This implementation enhances the expressive power of texture features in the two dimensions of directionality and change intensity by extracting local symbol information and difference amplitude information respectively, effectively improving the model's ability to identify different texture categories and solving the information loss problem caused by traditional single-directional encoding.
[0108] Implementation Method 4
[0109] This embodiment further limits the first embodiment. Furthermore, the method for obtaining the local center pattern CMDEP_C in S4 is:
[0110] Normalize the texture image I o Divide into 4×4 local grids, and use the mean value of the local area threshold of the grid division as the threshold of the binary encoding of the grayscale value of the entire standardized texture image pixel. Let the length and width of the i-th local area be represented by H i and W i , then the local mean TH of the i-th local area i for:
[0111]
[0112] Among them, g h,w is the grayscale value of the pixel at the coordinate (t, w) in the i-th local area;
[0113] According to the local mean TH of the i-th local area iGet the local area threshold TH of the entire normalized texture image c :
[0114]
[0115] According to the local area threshold TH of the entire image c Perform binary encoding on the pixels of the standardized texture image to obtain the local center pattern CMDEP_C:
[0116] CMCEP_C=t(g c ,TH c ).
[0117] This embodiment improves the local center pattern's perception of regional grayscale structure by constructing a dynamic center threshold based on the local mean of the grid, solves the problem of one-sided coding caused by a fixed center reference, thereby obtaining more representative center feature information and improving the discriminability of the pattern.
[0118] Implementation Method Five
[0119] This embodiment further limits the first embodiment. Furthermore, the method for obtaining the local mean difference energy pattern CMDEP_E in S8 is:
[0120] For the normalized texture image I o Perform the mean removal operation and obtain the energy image E according to the energy of the mean texture image I′ I :
[0121] E I =(I′) 2 ,
[0122] Get the energy image E I The corresponding local area threshold TH E :
[0123]
[0124] Among them, e h,w is the pixel energy at coordinate (h,w);
[0125] According to the local area threshold TH E Energy image E I Perform binary encoding to obtain the local mean difference energy mode CMDEP_E:
[0126] CMDEP_E=t(e E ,TH E ),
[0127] Among them, e E is the square of each pixel in the image after removing the mean.
[0128] This embodiment constructs a local mean difference energy pattern that is robust to illumination changes and image noise through energy image and regional threshold extraction, enhances the expression effect of image structure energy, and effectively improves the model's ability to capture energy distribution differences in texture features.
[0129] Implementation Method 6
[0130] This embodiment further limits the first embodiment. Furthermore, the method for obtaining the local center difference energy pattern CMDEP_CE in S8 is:
[0131] For each central pixel g c , and get two binary codes respectively, according to the weight 2 0 and 2 1 Weight CMDEP_C and CMDEP_E respectively to obtain the local center difference energy mode CMDEP_CE:
[0132] CMDEP_CE=2 0 ×CMDEP_C+2 1 ×CMDEP_E.
[0133] This embodiment constructs a 2-bit central difference energy pattern containing both structural and energy information by jointly encoding the local central pattern and the mean difference energy pattern, thereby improving the compactness and discriminability of feature expression, solving the problems of insufficient single-mode information and high redundancy, and is suitable for efficient classification tasks.
[0134] Implementation Method Seven
[0135] This embodiment integrates the technical solutions described in the aforementioned multiple embodiments, combines the actual situation, and further verifies and explains the technical effects of the present invention through specific examples.
[0136] This paper proposes a complete mean difference energy model CMDEP_S / M / CE for texture image classification:
[0137] Firstly, based on the local sign pattern CMDEP_S and local amplitude pattern CMDEP_M of CLBP, a local center pattern CMDEP_C is proposed using the local region threshold.
[0138] Secondly, in order to improve the diversity of local texture information, the present invention also uses the corresponding local area threshold to extract the local mean difference energy pattern CMDEP_E of the pixel;
[0139] Furthermore, in order to solve the problem of serious imbalance of traditional CLBP feature dimensions, the present invention uses a sub-pattern recoding strategy to jointly encode the local center pattern CMDEP_C and the local mean difference energy pattern CMDEP_E into a 2-bit binary pattern, namely the local center difference energy pattern CMDEP_CE, to obtain a sub-feature with a feature dimension of 4;
[0140] Finally, in order to obtain a complete texture feature expression, the present invention fuses the local sign pattern CMDEP_S, the local amplitude pattern CMDEP_M and the local center difference energy pattern CMDEP_CE by feature union to obtain the final feature vector - the complete mean difference energy pattern CMDEP_S / M / CE, to comprehensively improve the texture representation ability of the feature vector.
[0141] This paper designs a new local mean difference energy pattern (CMDEP_E) and uses a sub-pattern recoding strategy to recode it with the local center difference energy pattern (CMDEP_CE) to obtain the local center difference energy pattern (CMDEP_CE). The introduction of the local center difference energy pattern (CMDEP_CE) addresses the severe imbalance in sub-feature dimensions of CLBP and its variants to a certain extent, enriches the expression of diverse local texture information, further enhances the feature representation power of texture description, and thus improves the classification performance of texture images.
[0142] like Figure 1 As shown, a complete mean difference energy model for texture image classification includes the following steps:
[0143] Step 1: normalize the input texture image to obtain a standardized texture image;
[0144] Step 2: Perform circular neighborhood sampling with each pixel in the standardized texture image as the center to obtain local difference information;
[0145] Step 3: Based on the local difference information, obtain the local symbol pattern CMDEP_S and the local amplitude pattern CMDEP_M;
[0146] Step 4: Divide the normalized texture image into local grids, calculate the regional threshold of each local grid, use the mean of the regional thresholds as the threshold for binary encoding of the grayscale values of the normalized texture image pixels, and obtain the local center pattern CMDEP_C;
[0147] Step 5: Remove the mean of the normalized texture image to obtain the energy image after removing the mean;
[0148] Step 6: Obtaining a local region threshold value based on the energy image after removing the mean value;
[0149] Step 7: Obtaining a local mean difference energy mode CMDEP_E according to the local area threshold;
[0150] Step 8: Using a sub-pattern recoding strategy, the local center pattern CMDEP_C and the local mean difference energy pattern CMDEP_E are jointly encoded into a 2-bit binary pattern to obtain a local center difference energy pattern CMDEP_CE;
[0151] Step nine: fuse the local symbol pattern CMDEP_S, the local amplitude pattern CMDEP_M and the local center difference energy pattern CMDEP_CE by means of feature union to obtain a complete mean difference energy pattern CMDEP_S / M / CE;
[0152] Step 10: Obtain a feature vector based on the complete mean difference energy pattern, use the feature vector as a texture feature, input it into a nearest neighbor classifier, and obtain a texture classification result.
[0153] Furthermore, the method for normalizing the input texture image in step 1 is as follows: let the original texture image of the input system be represented as I, then the normalized texture image I o The calculation formula is as follows:
[0154]
[0155] Among them, I o is a standardized texture image, mean(I) is the mean function, std(I) is the standard deviation function, M is the scaling factor, and N is the translation factor. In this embodiment, the scaling factor is 20 and the translation factor is 128px.
[0156] Furthermore, the method for obtaining local difference information in step 2 is: assuming the standardized texture image I o The center pixel in is denoted as g c , for the standardized texture image I o Perform ring neighborhood sampling to obtain ring neighborhood pixel point g p , where p is the total number of neighborhood sampling points, p = 0, ..., P-1.
[0157] Then the local difference information can be expressed as
[0158] g p -g c
[0159] Furthermore, the method for obtaining the local symbol pattern CMDEP_S and the local amplitude pattern CMDEP_M in step 3 is: based on the local difference information, obtain the local difference symbol m s :
[0160] m s=s(g p -g c )
[0161] Where s(x) is the sign function, defined as
[0162] The present invention performs the local difference symbol m s Binary encoding can be used to obtain the first sub-mode of the complete mean difference energy mode CMDEP_S / M / CE - the local symbol mode CMDEP_S, which is specifically defined as follows:
[0163]
[0164] Wherein, riu2 indicates that the rotation-invariant uniform pattern is adopted for the local difference symbol, and U(g) indicates the number of times the cyclic bit position 0 / 1 or 1 / 0 changes in the binary pattern.
[0165] Based on the local difference information, the local difference amplitude m is obtained p :
[0166] m p =|g p -g c |,
[0167] The present invention is to determine the local difference amplitude m p Binary encoding can be performed to obtain the second sub-mode of the complete mean difference energy mode CMDEP_S / M / CE - the local amplitude mode CMDEP_M, which is specifically defined as follows:
[0168]
[0169] Among them, t(x,c) is the threshold function for binary encoding, defined as c is the total number of m in the entire image p The mean of .
[0170] Furthermore, in step 4, the normalized texture image is divided into local grids, the regional threshold of each local grid is calculated, and the mean of the regional thresholds is used as the threshold for binary encoding of the grayscale values of the normalized texture image pixels. The method for obtaining the local center pattern CMDEP_C is as follows:
[0171] like Figure 2 As shown, this embodiment takes 4×4 local grid division as an example, divides the standardized texture image into 16 local regions, and uses the average value of the threshold of the local region divided by the grid as the threshold of the binary encoding of the pixel grayscale value of the entire standardized texture image. Let the length and width of the i-th local region be represented by H i and Wi, where i = 1, 2, ... 16, then the local mean TH of the i-th local area ifor:
[0172]
[0173] Among them, g h,w is the grayscale value of the pixel at the coordinate (h, w) in the i-th local area;
[0174] According to the local mean TH of the i-th local area i , obtain the local area threshold TH of the entire standardized texture image c :
[0175]
[0176] Using the local area threshold TH of the entire normalized texture image c , binary encode the grayscale values of the standardized texture image pixels to obtain the local center pattern CMDEP_C, which is specifically defined as follows:
[0177] CMDEP_C=t(g c ,TH c )
[0178] Furthermore, in step 5, the normalized texture image I o The method for removing the mean and obtaining the energy image I′ after removing the mean is:
[0179] I′=I o -mean(I o )
[0180] And calculate the energy of the mean texture image I′ to obtain the energy image E I , specifically defined as follows:
[0181] E I =(I′) 2
[0182] Furthermore, in step 6, the method for obtaining the local area threshold value based on the energy image after de-averaging is:
[0183] Get the energy image E I The corresponding local area threshold TH E , specifically defined as follows:
[0184]
[0185] Among them, e h,w is the pixel energy at coordinate (h,w).
[0186] Furthermore, in step seven, the method for obtaining the local mean difference energy mode CMDEP_E according to the local area threshold is:
[0187] Using the above energy image E I The corresponding local area threshold TH E , for the energy image E I Perform binary encoding to obtain the local mean difference energy mode CMDEP_E, which is specifically defined as follows:
[0188] CMDEP_E=t(e E ,TH E )
[0189] Among them, e E is the square of each pixel in the image after removing the mean.
[0190] Furthermore, in step eight, the local center pattern CMDEP_C and the local mean difference energy pattern CMDEP_E are jointly encoded into a 2-bit binary pattern using a sub-pattern re-encoding strategy. The method for obtaining the local center difference energy pattern CMDEP_CE is as follows: for each center pixel g c , and get two binary codes respectively, according to the weight 2 0 and 2 1 By weighting CMDEP_C and CMDEP_E respectively, we can obtain the third sub-mode of the complete mean difference energy mode - the local center difference energy mode CMDEP_CE, which is specifically defined as follows:
[0191] CMDEP_CE=2 0 ×CMDEP_C+2 1 ×CMDEP_E
[0192] Furthermore, in step nine, the method of fusing the local symbol pattern CMDEP_S, the local amplitude pattern CMDEP_M and the local center difference energy pattern CMDEP_CE by means of feature union to obtain the complete mean difference energy pattern CMDEP_S / M / CE is as follows:
[0193] like Figure 3 As shown, first, in the local sampling stage, a circular neighborhood with a fixed radius is defined. Samples are uniformly sampled from the center pixel toward the surrounding pixels at a certain angular step size to obtain the position and grayscale value information of a series of neighborhood pixels. The position of each sampling point can be determined by converting polar coordinates into Cartesian coordinates to ensure uniform sampling in all directions within the neighborhood. This process typically involves preprocessing the image, such as filtering to reduce noise, and then constructing the corresponding local neighborhood at each pixel.
[0194] In the generation of local symbol patterns, the core technology is to calculate the difference between each neighborhood sampling point and the center pixel, and encode it according to the symbol information. In specific implementation, for each sampling point, the difference between its grayscale value and the grayscale value of the center pixel is calculated. If the difference is greater than or equal to zero, it is assigned a value of 1, otherwise it is assigned a value of 0. This operation can be achieved by comparing the function point by point and forming a binary string of fixed length. The binary string can be performed by bit operation or directly stored as a binary vector for subsequent fast matching and comparison. Some improved methods may divide the difference into multiple levels, making it a multi-base encoding, so as to more finely characterize the directional differences of local grayscale changes, thereby improving the recognition and robustness of the descriptor.
[0195] The technique for constructing local amplitude patterns focuses on measuring the absolute value of the difference between each sampling point and the central pixel within a neighborhood. The basic steps of the algorithm are: first, the grayscale difference between each sampling point and the central pixel within the neighborhood is calculated and its absolute value is taken. Next, these absolute values are discretized according to a predefined threshold or quantization interval to form a fixed-step amplitude feature. The quantization process can use either uniform or non-uniform quantization schemes to adapt to the grayscale distribution characteristics of different images. After quantization, the resulting local amplitude pattern can be further processed using histogram statistics to form a feature vector that describes the local intensity variation. This method exploits the sensitivity of the absolute difference measurement and can more accurately reflect the amplitude characteristics of grayscale variations in a local area.
[0196] The key to constructing a local center difference energy model lies in statistically processing the energy of the differences between each sampling point and the central pixel in a local neighborhood. In practice, the difference between each sampling point and the central pixel is first calculated (measured using either absolute or squared values). The differences are then accumulated or averaged across all sampling points in the neighborhood. Accumulation typically captures the magnitude of overall changes within a local region, while averaging smooths out the influence of individual outliers. Some implementations incorporate weighting coefficients to adjust the distance between the sampling point and the central pixel or other features, ensuring that pixels closer to the center have a larger share in the energy calculation. Ultimately, this statistical method yields the local center difference energy as a single value or vector, representing the "energy" of the overall grayscale change within the local region.
[0197] After completing the independent calculations of the three local patterns mentioned above, technically, this information needs to be fused to form a complete mean difference energy pattern. There are several strategies for implementing the feature fusion stage: the most direct approach is to concatenate the result vectors of the local sign pattern, local amplitude pattern, and local center difference energy pattern to form a high-dimensional joint feature vector; another approach is to fuse the three patterns according to predetermined weights through weighted summation to form a single numerical representation or low-dimensional feature description; a more complex approach is to use feature selection or dimensionality reduction techniques (such as principal component analysis and linear discriminant analysis) to process the fused high-dimensional vector to extract the most discriminative combined features. The selection of the fusion method is generally determined by the needs of the subsequent application and the actual effect of the classification and recognition tasks, but this description only discusses the technical means and does not involve the issue of effect optimization.
[0198] Throughout the algorithm, efficient computation of each part of the data is required. Common techniques include vectorized operations, matrix operations, and parallel computing accelerated by GPUs. Bit encoding of symbolic patterns can be quickly processed with the help of bit manipulation instructions. Absolute value and square calculations are usually supported by dedicated hardware instructions, enabling high-speed calculation of local amplitudes and central difference energies. In the feature fusion stage, the final descriptor can be efficiently constructed through array concatenation, matrix multiplication, and other methods. To ensure the robustness of the algorithm in practical applications, multi-scale, rotation-invariant, or illumination-invariant processing strategies are often designed. These strategies are reflected in the sampling and quantization processes to ensure reliable capture and expression of local features.
[0199] Furthermore, the overall implementation of the algorithm requires consideration of edge effect processing, noise suppression, and normalization. For image edges, since neighborhood sampling may be insufficient, boundary issues can be addressed through methods such as mirroring or zero padding. Noise suppression can be achieved through smoothing filtering before local sampling. Normalization ensures that the resulting feature vectors have a uniform scale across different images, facilitating subsequent comparison and matching.
[0200] The entire process, from local sampling, difference calculation, sign encoding, amplitude quantization, energy statistics, to feature fusion, employs explicit mathematical calculations and data processing techniques at every step. Data transfer and processing between these steps requires a strict sequence and structured implementation, typically expressed in code as nested function calls or modular programming. This technique allows local texture features to be rigorously expressed in digital form, effectively integrating features across dimensions like sign, amplitude, and energy to form a complete mean difference energy description, providing a high-quality feature foundation for subsequent processing.
[0201] Furthermore, in step 10, a feature vector is obtained based on the complete mean difference energy pattern, and the feature vector is used as a texture feature and input into a K-Nearest Neighbor (KNN) classifier to obtain a texture classification result as follows:
[0202] The nearest neighbor classifier is used as the classifier of the texture classification system, and the chi-square distance is used to calculate the difference between the training sample and the test sample. The feature histograms of the training sample and the test sample are H Train and H Test , then the chi-square distance between the feature vector histogram of the test image and the feature vector histogram of the training sample is as follows:
[0203]
[0204] Where M is the total number of feature vector histogram boxes, and the subscript i represents the i-th box of the corresponding histogram.
[0205] A series of validation experiments were conducted on the Outex texture dataset. The Outex dataset contains a large number of surface textures and specifies a series of rigorous test samples and validation subsets of training samples to evaluate the illumination invariance and rotation invariance of the texture classification algorithm. The present invention selects two test subsets, Outex_TC10 and Outex_TC12, for experimental evaluation. Among them, Outex_TC10 is used to test the rotation invariance of the texture descriptor, and Outex_TC12 (including Outex_TC12_000 and Outex_TC12_001) is used to test the illumination and rotation invariance. The specific participation is shown in Table 1:
[0206] Table 1 Outex dataset parameters
[0207]
[0208] In the above table, θ1 = {5°, 10°, 15°, 30°, 45°, 60°, 75°, 90°};
[0209] θ2={0°,5°,10°,15°,30°,45°,60°,75°,90°};
[0210] Under Matlab R2023a simulation conditions, the method described in the present invention was simulated at TC10 and TC12. This embodiment uses TC10, TC12_000, and TC12_001 to test the texture classification performance of the complete mean difference energy pattern proposed in the present invention. All classifications use the nearest neighbor classifier, and the classification accuracy of the final algorithm is calculated as follows:
[0211]
[0212] like Figure 4 As shown, the blue histogram represents the classification results of the complete mean difference energy mode on TC10, and the orange and gray histograms represent the classification results of the algorithm of the present invention on TC12_000 and TC12_001 respectively. Figure 4 As can be seen from the figure, on TC10, the method described in this invention achieved the best classification accuracy of 99.71% when the neighborhood sampling resolution was (R, P) = (3, 24). Furthermore, on TC12_000, the method described in this invention also achieved the best classification accuracy of 98.22% when the neighborhood sampling resolution was (R, P) = (3, 24). On TC12_001, the method described in this invention achieved the best classification accuracy at both (R, P) = (3, 16) and (3, 24). However, it is worth noting that as the number of neighborhood sampling points increases, the feature dimension of the method described in this invention also increases; therefore, in practical applications, sufficient accuracy should be selected based on the specific device performance.
[0213] Under the simulation conditions of MatlabR2023a, the classification performance comparison experiment of the basic methods (LBP and CLBP) of the method described in this invention and the advanced texture descriptors in the industry is as follows:
[0214] In order to comprehensively compare the classification performance of the method described in the present invention with the classic LBP and CLBP algorithms, Figure 5 The classification results of the method described in the present invention are compared with those of the LBP and CLBP algorithms under different texture test subsets.
[0215] from Figure 5 It can be clearly seen that the method of the present invention achieved the best classification accuracy on all three test subsets, and was significantly better than the LBP and CLBP algorithms used in the comparison. In addition, compared with the LBP algorithm, the method of the present invention achieved the greatest performance improvement on TC12_001, with a classification accuracy 16.95% higher than that of the LBP algorithm. In addition, on this test subset, the method of the present invention was 4.38% higher than CLBP. Through the above comparison, it can be found that the classification results of the method of the present invention on different texture test subsets are significantly better than those of LBP and CLBP, which once again proves that the method of the present invention has outstanding texture classification performance.
[0216] Table 2 compares the performance of the method described in this paper with leading texture descriptors in the industry, using classification results from three different test subsets of the Outex dataset. As can be seen from the table, CMDEP outperforms the other compared methods in texture classification. This demonstrates that CMDEP offers superior illumination and rotation invariance compared to the other compared methods.
[0217] Table 2 Comparison of classification results (%) of the method described in the present invention and the advanced texture descriptors in the industry
[0218]
[0219] In summary, the method described in the present invention is a method that can effectively alleviate the serious imbalance problem of feature dimensions of CLBP and its variants, and can improve the ability of texture descriptors to handle complex changes such as illumination and rotation, thereby ensuring the superior classification performance of the texture classification system.
[0220] The technical solution provided by the present invention is further described in detail through the above specific embodiments in order to highlight the advantages and benefits of the technical solution provided by the present invention. However, the above specific embodiments are not intended to limit the present invention. Any reasonable modification and improvement of the present invention, combination of embodiments and equivalent replacement, etc. based on the spirit and principles of the present invention should be included in the scope of protection of the present invention.
[0221] Those skilled in the art will understand that the above description is only a preferred embodiment of the present invention, and the features described in the various embodiments and / or claims of the present disclosure may be combined or coupled in various ways, even if such a combination or coupling is not explicitly described in the present disclosure. It is 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 may still modify the technical solutions described in the aforementioned embodiments or make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.
[0222] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic inventive concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention. Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, the present invention is intended to include such changes and modifications as fall within the scope of the claims and their equivalents.
Claims
1. A complete mean difference energy model for texture image classification, characterized in that: The complete mean difference energy mode comprises the following steps: S1, normalize the input texture image I to obtain the standardized texture image I o Steps; S2, a step of performing annular neighborhood sampling with each pixel in the standardized texture image as the center to obtain local difference information; S3, a step of obtaining a local symbol pattern CMDEP_S and a local amplitude pattern CMDEP_M based on the local difference information; S4, normalize the texture image I o Divide into local grids, and use the mean of the local grids as the standardized texture image I o The threshold of the binary encoding of the pixel gray value is used to obtain the mean TH of the i-th local grid i , according to the mean TH of the i-th local grid i Get the entire normalized texture image I o The threshold value TH of the local grid c , according to the threshold TH of the local grid c For the normalized texture image I o The step of performing binary encoding on the pixels to obtain the local center pattern CMDEP_C; S5. Standardized texture image I o Step E of removing the mean and obtaining the energy image I ; S6, according to the energy image E I , obtain the local area threshold TH E Steps; S7, according to the local area threshold TH E , the steps of obtaining the local mean difference energy pattern CMDEP_E; S8, a step of jointly encoding the local center pattern CMDEP_C and the local mean difference energy pattern CMDEP_E into a 2-bit binary pattern using a sub-pattern recoding strategy to obtain a local center difference energy pattern CMDEP_CE; S9, a step of fusing the local symbol pattern CMDEP_S, the local amplitude pattern CMDEP_M and the local center difference energy pattern CMDEP_CE in a feature union manner to obtain a complete mean difference energy pattern CMDEP_S / M / CE; S10, a step of obtaining a feature vector according to the complete mean difference energy pattern CMDEP_S / M / CE, using the feature vector as a texture feature, inputting the feature vector into a nearest neighbor classifier, and obtaining a texture classification result.
2. The complete mean difference energy mode according to claim 1, characterized in that: The method of standardization described in S1 is: Wherein, mean(I) is the mean function of the texture image I, std(I) is the standard deviation function of the texture image I, M is the scaling factor, and N is the translation factor.
3. The complete mean difference energy mode according to claim 1, characterized in that: The method for obtaining the local symbol pattern CMDEP_S and the local amplitude pattern CMDEP_M described in S3 is: In the normalized texture image I o For the center pixel g c Perform ring neighborhood sampling to obtain ring neighborhood pixel point g p , then the local difference information is: g p -g c , Based on the local difference information, the local difference symbol s is obtained: s(g p -g c ), For s(g p -g c ) performs binary encoding to obtain a local symbol pattern CMDEP_S; Based on the local difference information, the local difference amplitude m is obtained p : m p =|g p -g c |, To m p Perform binary encoding to obtain the local amplitude pattern CMDEP_M.
4. The complete mean difference energy mode according to claim 1, characterized in that: The method for obtaining the local center mode CMDEP_C described in S4 is: Normalize the texture image I o Divide into 4×4 local grids, and use the mean of all local grids as the entire standardized texture image I o The threshold of binary coding of pixel gray value, let the length and width of the i-th local grid be represented by H i and W i , then the mean TH of the i-th local grid i for: Among them, g h,w is the grayscale value of the pixel at the coordinate (h, w) in the i-th local area; According to the mean TH of the i-th local grid i Get the entire normalized texture image I o The threshold value TH of the local grid c : According to the threshold TH of the local grid c For the normalized texture image I o The pixels are binary-encoded to obtain the local center pattern CMDEP_C: CMDEP_C=t(g c ,TH c )。 5. The complete mean difference energy mode according to claim 1, characterized in that: The method for obtaining the local mean difference energy mode CMDEP_E described in S7 is: For the normalized texture image I o Perform a de-averaging operation to obtain a de-averaged texture image I′, and obtain an energy image E according to the energy of the de-averaged texture image I′. I : E I =(I′) 2 , Get the energy image E I The corresponding local area threshold TH E : Among them, e h,w is the pixel energy at coordinate (h,w); According to the local area threshold TH E Energy image E I Perform binary encoding to obtain the local mean difference energy mode CMDEP_E: CMDEP_E=t(e E ,TH E ), Among them, e E is the square of each pixel in the demeaned texture image I′.
6. The complete mean difference energy mode according to claim 1, characterized in that: The method for obtaining the local center difference energy mode CMDEP_CE in S8 is: For each central pixel g c , and get two binary codes respectively, according to the weight 2 0 and 2 1 Weight CMDEP_C and CMDEP_E respectively to obtain the local center difference energy mode CMDEP_CE: CMDEP_CE=2 0 ×CMDEP_C+2 1 ×CMDEP_E。 7. A complete mean difference energy model device for texture image classification, characterized in that: The device comprises: Used to normalize the input texture image I to obtain the normalized texture image I o Modules; A module for sampling a circular neighborhood centered on each pixel in a normalized texture image to obtain local difference information; A module for obtaining a local sign pattern CMDEP_S and a local amplitude pattern CMDEP_M based on local difference information; Used to normalize the texture image I o Divide into local grids, and use the mean of the local grids as the standardized texture image I o The threshold of the binary encoding of the pixel gray value is used to obtain the mean TH of the i-th local grid i , according to the mean TH of the i-th local grid i Get the entire normalized texture image I o The threshold value TH of the local grid c , according to the threshold TH of the local grid c For the normalized texture image I o The pixels are binary-encoded to obtain the module of the local center pattern CMDEP_C; For normalizing texture images I o Remove the mean and obtain the energy image module E I ; For the energy image E I , obtain the local area threshold TH E Modules; According to the local area threshold TH E , a module for obtaining the local mean difference energy pattern CMDEP_E; A module for jointly encoding the local center pattern CMDEP_C and the local mean difference energy pattern CMDEP_E into a 2-bit binary pattern using a sub-pattern re-encoding strategy to obtain a local center difference energy pattern CMDEP_CE; A module for fusing the local symbol pattern CMDEP_S, the local amplitude pattern CMDEP_M and the local center difference energy pattern CMDEP_CE in a feature union manner to obtain a complete mean difference energy pattern CMDEP_S / M / CE; A module for obtaining a feature vector based on the complete mean difference energy pattern, using the feature vector as a texture feature, inputting it into a nearest neighbor classifier, and obtaining a texture classification result.
8. A computer storage medium for storing a computer program, characterized in that When the computer program is read by a computer, the computer executes the steps according to any one of claims 1 to 6.
9. A computer comprising a processor and a storage medium, characterized in that When the processor reads the computer program stored in the storage medium, the computer executes the steps according to any one of claims 1 to 6.
10. A computer program product, being a computer program, characterized in that When the computer program is read, the steps described in any one of claims 1 to 6 are implemented.