An image recognition method based on scale co-occurrence local binary patterns
By constructing cross-scale symbiotic pairs in Gaussian scale space and LBP symbiotic space, and applying the rotation consistency strategy to generate CS-CoLBP feature vectors, the problem of robustness of existing LBP features under scale and rotation transformations is solved, and the Highly accurate image classification.
Patent Information
- Application Number
- CN202210214683.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-07
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-03-07
AI Technical Summary
When existing LBP-based image features face scale transformation and rotation transformation, the feature dimension increases and the rotation robustness is poor, making it difficult to effectively classify images.
Cross-scale symbiotic pairs are constructed based on Gaussian scale space and LBP symbiotic space, and these symbiotic pairs are adjusted through the rotation consistency strategy to generate CS-CoLBP feature vectors with scale robustness and rotation robustness.
Effective classification of images is achieved under lower feature dimensions, improving classification accuracy, especially maintaining good performance in the face of scale and rotation transformations, with an accuracy of 98.5% on the test set.
Smart Images

Figure CN114663663B
Abstract
Description
Technical Field
[0001] The invention relates to an image recognition method based on scale co-occurrence local binary patterns, and belongs to the technical fields of digital image processing, computer vision, etc. Background Art
[0002] Image classification is one of the most basic tasks in computer vision. It is an image processing method that uses the intrinsic characteristics reflected by the image to divide different images into corresponding categories. Since an image contains a lot of information, it is difficult to easily extract useful information from the image. Therefore, the extraction of image visual features has become an increasingly important research topic. According to the different properties of the image, image feature extraction can be divided into five categories: texture feature extraction, color feature extraction, shape feature extraction, and spatial relationship feature extraction. Compared with other image features, texture features are a kind of visual clues that can reflect homogeneous phenomena in the image. It takes into account the macroscopic distribution properties and microscopic irregular structures of the image. Researchers have summarized the texture feature extraction methods and divided them into statistical methods, geometric methods, structural methods, signal processing methods, and model methods. Since the other four methods have the disadvantages of high computational complexity, slow speed, and limited application scenarios, statistical methods have gradually become the mainstream texture feature extraction methods.
[0003] In 1996, Ojala et al. proposed a typical statistical texture feature LBP, which reflects the local texture structure of an image by thresholding the image intensity of neighboring pixels and central pixels. Due to the effectiveness and simplicity of LBP features, researchers have proposed many LBP-based features, which have also shown good performance in image classification tasks. However, the existing LBP-based features still have the following problems: (1) When facing scale transformation, most features sacrifice feature dimensions to improve the scale robustness of features, resulting in an exponential increase in feature dimensions; (2) For images that have undergone rotation transformation, the feature's ability to describe the image will be greatly reduced, and it does not have good rotation robustness. Summary of the invention
[0004] In view of the above problems, the purpose of the present invention is to solve the problems existing in the existing LBP-based features. The image recognition method based on scale co-occurrence local binary pattern proposed by the present invention is an effective method with scale robustness and rotation robustness proposed based on LBP. This method basically solves the problems existing in the previous LBP-based features and can effectively classify images at a lower feature dimension.
[0005] In order to achieve the above-mentioned purpose, the technical solution adopted by the present invention is: an image recognition method based on scale co-occurrence local binary patterns, which mainly lies in the construction of cross-scale co-occurrence pairs and the adjustment strategy of cross-scale co-occurrence pairs, including the following steps:
[0006] (1) Convert a color image into a grayscale image;
[0007] (2) For an input image, a Gaussian scale space L(x, y, z) is generated. The complementary information between images of different scales in the Gaussian scale space can provide both detail information and structural information of the object. In the Gaussian scale space L(x, y, z), an LBP symbiosis space E(x, y, z) is constructed to extract stable structural information during the scale transformation process. Then, cross-scale symbiosis pairs are used in the LBP symbiosis space to represent these stable structural information.
[0008] (3) Using the cross-scale co-occurrence pairs obtained in step (2), a rotation consistency strategy (RCA) is used to adjust the directions of these cross-scale co-occurrence pairs so that they can maintain good image classification performance even under rotation;
[0009] (4) The two-dimensional distribution of these adjusted cross-scale co-occurrence pairs forms the final feature vector, namely CS-CoLBP.
[0010] Furthermore, the conversion process of the color image in step (1) is performed according to the ratio of R:G:B=0.299:0.587:0.114.
[0011] Furthermore, the generation of the Gaussian scale space in step (2) includes the following steps:
[0012] Use the Gaussian function G(x,y,σ z ) Deconvolve an input image I(x,y) to generate a Gaussian scale space L(x,y,z). The size of each scale image in the Gaussian space is the same as the size of the input image;
[0013]
[0014]
[0015] Where x∈[1,M], y∈[1,N], M×N is the size of the image I(x,y), Z is the total number of scaled images in the Gaussian scale space, is the scale factor, and z represents the scale image in the Gaussian scale space.
[0016] Furthermore, the construction of the LBP symbiotic space in step (2) specifically includes the following steps:
[0017] In the generated Gaussian scale space L(x, y, z), an LBP symbiosis space E(x, y, z) can be further generated, which can be used to extract important information retained by an image during the scale transformation process.
[0018]
[0019] Among them, S and R represent the number of sampling points and sampling radius of the LBP circular neighborhood, respectively. Represents the rotation-invariant uniform mode of LBP. Represents the uniform mode of LBP. Since the input image has retained enough content, the improved LBP rotation-invariant uniform mode is selected. To extract the corresponding LBP feature map E z=1 (x,y,z)∈[0,S+1], the purpose is to achieve rotation invariance while obtaining a feature with lower dimension. z∈[2,Z] (x,y,z), uniform mode using modified LBP To extract the corresponding LBP feature map, the purpose is to allow a more comprehensive LBP mode to represent more stable information in these images.
[0020] Furthermore, the construction of the cross-scale symbiotic pairs in step (2) specifically includes the following steps:
[0021] In order to use the co-occurring pattern pairs to represent stable structural information, for the pattern P i , it can be fixed in the first layer of the LBP feature map, namely E z=1 (x,y,z). For mode P i ′, instead of fixing it, it is selected through corresponding strategies, so it will be in the second layer and above of the LBP feature map, that is, E z∈[2,Z] (x,y,z). Combined with mode P i and mode P i ′, we can get a cross-scale symbiotic pair. This construction strategy can also extract the correlation information between images of different scales. Secondly, this cross-scale symbiotic pair can remain relatively stable for images subjected to various transformations or attacks.
[0022] Furthermore, the maximum local difference value in the three-dimensional local rectangular window in the Gaussian scale space is selected as the mode P i ′, for an image, by sliding this three-dimensional rectangular window, many cross-scale co-occurrence pairs can be obtained according to the pattern P i The position (x i ,y i ,1),Mode P i The position of ′ is as follows:
[0023]
[0024] Among them, the size of the window w is w x × y × z , w x and w y is set to 3, w z is set to Z-1, (x i ,y i ) is w x × y The center of δ represents the mode P i ′ corresponds to the LBP feature map, L(x i ,y i ,z) is the zth layer in the Gaussian scale space, L(x i ,y i ,z-1) is the z-1th layer in the Gaussian scale space.
[0025] Furthermore, the generation of the rotation consistency adjustment strategy in step (3) includes:
[0026] For mode P i , g 1 ,g 2 ,...,g S is the pixel value in the LBP circular neighborhood with radius R. If we let pixel g n As the starting pixel, the corresponding candidate distribution formed in the clockwise direction is g n {g n ,g n+1 ,...,g S ,g 1 ,...,g n-1}, therefore, the total distribution G containing all candidate distributions Pi can be expressed as {g n ,g n+1 ,...,g S ,g 1 ,...,g n-1}, use g n The starting pixel g n The descending label l is used to specify the candidate distribution of each pixel in the image, so that the LBP mode can be kept uniform in both the original image and the rotated image. The corresponding index of the candidate distribution is recorded in RCA:
[0027] RCA(P i )={n|sort(g n )=l}
[0028] Where n,l∈[1,S], l is the starting pixel g n Descending labels. sort(g n ) is a function used to obtain the corresponding candidate distribution g n Medium n The descending labels of , the adjusted cross-scale co-occurrence pairs are as follows:
[0029] CS-Co=(P i (x i ,y i ,1),T(P i ′(x i ′,y i ′,δ),RCA))) cs
[0030] where T(·) is a function that uses the RCA candidate distribution to obtain P i ’Adjusted LBP mode.
[0031] Furthermore, the generation of the feature vector CS-CoLBP in step (4) specifically includes the following steps:
[0032] After obtaining all cross-scale co-occurrence pairs, by traversing and counting their occurrence times in the entire image, a combined two-dimensional LBP feature histogram CS-CoLBP can be obtained:
[0033]
[0034] Where λ(·) is a function defined as follows:
[0035]
[0036] Where ru∈[1,S+2],u∈[1,S(S-1)+3]. S is the number of sampling points in the LBP circular neighborhood, CS-Co is the cross-scale co-occurrence pair, and E is the LBP co-occurrence space. Therefore, the feature dimension of CS-CoLBP is 10×59=590, which is converted into a row vector of 1×590=590.
[0037] The advantages and beneficial effects of the above scheme of the present invention are as follows:
[0038] The present invention uses digital image processing, computer vision and other technologies to achieve image classification tasks. The present invention is a grayscale image recognition method, which can obtain the corresponding feature vector by inputting a grayscale image. The present invention has the following advantages:
[0039] (1) Use MATLAB platform for training and testing, which is simple and easy to use;
[0040] (2) The present invention proposes an LBP symbiosis space to further analyze the image, which fully captures some tiny details and some larger contour information in the image;
[0041] (3) The cross-scale symbiotic pair construction form proposed in the present invention (i.e., the cross-scale symbiotic pair construction and the cross-scale symbiotic pair adjustment strategy) is relatively novel. The symbiotic pair is no longer confined to an ordinary plane, but is placed in a three-dimensional space. The three-dimensional space has specific meaning and contains more information than the original image.
[0042] (4) Compared with the current method, the rotational consistency coding strategy proposed in the present invention is simpler to calculate and consumes less computing resources;
[0043] (5) This method achieved a high classification accuracy of about 98.5% on the test set, that is, out of 405 test images, the category labels of 399 images were predicted correctly;
[0044] (6) In real life, images are easily taken by people at different distances or viewing angles. This method with good scale robustness and rotation robustness can assist related image recognition tasks, such as face recognition, etc., and has certain practical significance. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is the overall system flow chart provided by the present invention;
[0046] Figure 2 It is the process of constructing cross-scale symbiotic pairs in the present invention;
[0047] Figure 3 This is the process of adjusting the rotation consistency in the present invention. DETAILED DESCRIPTION
[0048] The following will describe the technical solutions in the embodiments of the present invention in detail in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention.
[0049] The technical solution of the present invention is described in detail below with reference to the accompanying drawings:
[0050] System flow chart as follows Figure 1 As shown, an image recognition method based on scale co-occurrence local binary patterns includes the following steps:
[0051] Step 1: Collect commonly used texture image datasets. Check whether the collected texture images are classified according to the image category labels, and crop all images in the dataset to the same size.
[0052] Step 2: Use the texture image dataset in step 1 as the input image. Since this method only extracts features of grayscale images, if the image is a color image, it needs to be converted into a grayscale image.
[0053] Step 3: If Figure 2 As shown in the figure, for an original grayscale image, a group of images are first obtained through different convolution kernels, which constitute a Gaussian scale space. Based on the Gaussian scale space, the proposed LBP symbiosis space is generated in the form of difference to obtain a cross-scale symbiosis pair with scale invariance.
[0054] 1) Using Gaussian function G(x,y,σ z ) deconvolutes an input image I(x,y) to generate a Gaussian scale space L(x,y,z). The size of each scale image in the Gaussian space is the same as the input image.
[0055]
[0056]
[0057] Where x∈[1,M], y∈[1,N], M×N is the size of the image I(x,y), and Z is the total number of scaled images in the Gaussian scale space. is the scale factor. z represents the scale image in the Gaussian scale space.
[0058] 2) In the Gaussian scale space L(x, y, z), an LBP symbiosis space E(x, y, z) can be generated by difference to extract important information in the scale transformation process.
[0059]
[0060] Among them, S and R represent the number of sampling points and the sampling radius of the LBP circular neighborhood, respectively. Represents the rotation-invariant uniform mode of LBP. Represents the uniform mode of LBP. Since the input image has retained enough content, the improved LBP rotation-invariant uniform mode is selected. To obtain the LBP feature map E z=1 (x,y,z)∈[0,S+1], the purpose is to achieve rotation invariance and obtain a feature with lower dimension. z∈[2,Z] (x,y,z), uniform mode using modified LBP To obtain the LBP feature map, the purpose is to allow more LBP modes to represent more stable structural information in the scale image.
[0061] 3) In order to use the symbiotic pattern pair to represent stable structural information, for the pattern P i , it can be fixed in the first layer of the LBP feature map, namely E z=1 (x,y,z). For mode P i ′, instead of fixing it, it is selected through corresponding strategies, so it will be in the second layer and above of the LBP feature map, that is, E z∈[2,Z] (x,y,z). Combined with mode P i and mode P i ′, we can get a cross-scale symbiotic pair. This construction strategy can also extract the correlation information between images of different scales. Secondly, this cross-scale symbiotic pair can remain relatively stable to images subjected to various transformations or attacks. Therefore, the maximum local difference value in the three-dimensional local rectangular window in the Gaussian scale space can be selected as the pattern P i ′. For an image, by sliding this three-dimensional rectangular window, many cross-scale co-occurrence pairs can be obtained. i The position (x i ,y i ,1),Mode P i The position of ′ is as follows:
[0062]
[0063] Among them, the size of the window w is w x × y × z , w x and w y is set to 3, w z is set to Z-1. (x i ,y i ) is w x × y δ represents the center of the mode P i ′ corresponds to the LBP feature map. L(x i ,y i ,z) is the zth layer in the Gaussian scale space, L(x i ,y i ,z-1) is the z-1th layer in the Gaussian scale space. In addition, in order to capture enough structural information, two cross-scale co-occurrence pairs are generated from the LBP co-occurrence space. Figure 2 As shown, the maximum positive difference value 6 and the maximum negative difference value -4 in the three-dimensional rectangular window are selected as mode P i ′.
[0064] Step 4: Propose a rotation consistency adjustment strategy, such as Figure 3 As shown, through the starting pixel g in the neighborhood distribution nThe descending labels l of the scale-invariant cross-scale symbiotic pairs are adjusted by the mode P i ′, and obtain the cross-scale symbiotic pairs with scale invariance and rotation invariance.
[0065] 1) For mode P i , g 1 ,g 2 ,...,g S is the pixel value in the LBP circular neighborhood with radius R. If we let pixel g n As the starting pixel, the corresponding candidate distribution formed in the clockwise direction is g n {g n ,g n+1 ,...,g S ,g 1 ,...,g n-1}. Therefore, the total distribution G containing all candidate distributions Pi can be expressed as {g n ,g n+1 ,...,g S ,g 1 ,...,g n-1}.
[0066] 2) When selecting the candidate distribution, we must ensure that the same LBP pattern in the original image and the rotated image corresponds to the same candidate distribution. n The starting pixel g n The descending label l of is used to specify the candidate distribution of each pixel in the image, so that the LBP mode can be kept consistent in both the original image and the rotated image. At the same time, the corresponding index of the candidate distribution is recorded in RCA:
[0067] RCA(P i )={n|sort(g n )=l}
[0068] Where n,l∈[1,S], l is the starting pixel g n Descending labels. sort(g n ) is a function used to obtain the corresponding candidate distribution g n Medium n The adjusted cross-scale co-occurrence pairs are as follows:
[0069] CS-Co=(P i (x i ,y i ,1),T(P i ′(x i ′,y i ′,δ),RCA))) cs
[0070] where T(·) is a function that uses the RCA candidate distribution to obtain P i ’Adjusted LBP mode.
[0071] Step 5: Count these adjusted cross-scale co-occurrence pairs to obtain the feature vector of the final image, namely CS-CoLBP.
[0072] After obtaining all cross-scale co-occurrence pairs, by traversing and counting their occurrence times in the entire image, a combined two-dimensional LBP feature histogram CS-CoLBP can be obtained:
[0073]
[0074] Where λ(·) is a function defined as follows:
[0075]
[0076] where ru∈[1,S+2],u∈[1,S(S-1)+3]. S is the number of sampling points in the LBP circular neighborhood, CS-Co is the cross-scale co-occurrence pair, and E is the LBP co-occurrence space. Therefore, the feature dimension of CS-CoLBP is 10×59×2=1180, which is converted into a row vector of 1×1180=1180.
[0077] Step 6: Divide the images in the dataset into a training set and a test set, send the CS-CoLBP feature vectors and corresponding category labels obtained in the training set into the SVM classifier for training, and then send the CS-CoLBP feature vectors in the test set into the trained SVM classifier for prediction to obtain the predicted category label.
[0078] The selection of the data set and the division of the training set and the test set, the selected database is called KTH-TIPS texture database. The data set contains the textures of ten objects, i.e., ten categories, and contains a total of 810 images, with 81 images for each object. For the division of the training set and the test set, each category of images in the data set is divided according to a 1:1 ratio, with the first half used for training and the second half used for testing.
[0079] In order to verify the effect of the present invention, the following experiments were carried out:
[0080] The verification experiment was carried out on a computer with an Intel i5 processor, 16GB memory, and the programming language was MATLAB 2017b.
[0081] Experimental methods:
[0082] In this experiment, we selected the KTH-TIPS texture image dataset for related experiments. 50% of each type of image in the dataset was used as the training set, and the remaining 50% of each type of image was used as the test set to obtain the final classification accuracy.
[0083] Step 1: Divide the KTH-TIPS texture dataset into 10 categories according to their respective texture categories. Each category is placed in a folder.
[0084] Step 2: Use MATLAB2017b to run the program, input the CS-CoLBP feature vector and corresponding label of the training set into the SVM classifier, and after 100 iterations of training, the trained classifier model is obtained.
[0085] Step 3: Input the CS-CoLBP feature vectors and corresponding labels in the test set into the trained classifier model, and calculate the final classification accuracy based on the evaluation indicators.
[0086] Evaluation indicators of experimental results:
[0087] The experimental results use classification accuracy as the evaluation indicator, which calculates the ratio of the number of correctly predicted test images in the test set to the number of all images in the test set.
[0088] Experimental results:
[0089] In this experiment, the selected dataset is the KTH-TIPS texture dataset, which contains 810 images divided into 10 categories. The accuracy of the 100 averaged results obtained by using the scale co-occurrence local binary pattern image recognition method proposed in the present invention is 98.52%.
[0090] The above embodiments should be understood to be only used to illustrate the present invention and not to limit the protection scope of the present invention. After reading the contents of the present invention, technicians can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.
Claims
1. An image recognition method based on scale co-occurrence local binary patterns, characterized in that: The following steps are involved: (1) Convert a color image into a grayscale image; (2) For an input image, a Gaussian scale space L(x, y, z) is generated. The complementary information between images of different scales in the Gaussian scale space can provide both detail information and structural information of the object. In the Gaussian scale space L(x, y, z), an LBP symbiosis space E(x, y, z) is constructed to extract stable structural information during the scale transformation process. Then, cross-scale symbiosis pairs are used in the LBP symbiosis space to represent these stable structural information. The generation of Gaussian scale space includes the following steps: Use the Gaussian function G(x,y,σ z ) deconvolutes an input image I(x,y) to generate a Gaussian scale space L(x,y,z), where the size of each scale image in the Gaussian space is the same as the size of the input image; Where x∈[1,M], y∈[1,N], M×N is the size of the image I(x,y), Z is the total number of scaled images in the Gaussian scale space, is the scale factor, z represents the scale image in the Gaussian scale space; The construction of LBP symbiotic space specifically includes the following steps: In the generated Gaussian scale space L(x,y,z), a LBP symbiosis space E(x,y,z) is further generated. Among them, S and R represent the number of sampling points and sampling radius of the LBP circular neighborhood, respectively. represents the rotation-invariant uniform mode of LBP, represents the uniform pattern of LBP; The construction of cross-scale symbiotic pairs includes the following steps: For mode P i , fix it in the first layer of the LBP feature map, namely E z=1 (x,y,z), for mode P i ′, instead of fixing it, it is selected through corresponding strategies, so it will be in the second layer and above of the LBP feature map, that is, E z∈[2,Z] (x,y,z); combined mode P i and mode P i ′, we get a cross-scale symbiotic pair; The maximum local difference value in the three-dimensional local rectangular window in the Gaussian scale space is selected as the mode P i ′, for an image, by sliding this three-dimensional rectangular window, many cross-scale co-occurrence pairs are obtained according to the pattern P i The position (x i ,y i ,1),Mode P i The position of ′ is as follows: Among them, the size of the window w is w x × y × z , w x and w y is set to 3, w z is set to Z-1, (x i ,y i ) is w x × y The center of δ represents the mode P i ′ corresponds to the LBP feature map, L(x i ,y i ,z) is the zth layer in the Gaussian scale space, L(x i ,y i ,z-1) is the z-1th layer in the Gaussian scale space; (3) Using the cross-scale co-occurrence pairs obtained in step (2), a rotation consistency strategy is used to adjust the directions of these cross-scale co-occurrence pairs so that they can maintain good image classification performance even under rotation; The generation of the rotational consistency adjustment strategy includes: For mode P i ,g1,g2,...,g S is the pixel value in the LBP circular neighborhood with radius R. If we let pixel g n As the starting pixel, the corresponding candidate distribution formed in the clockwise direction is g n {g n ,g n+1 ,...,g S ,g1,...,g n-1 }, so the total distribution containing all candidate distributions It is represented as {g n ,g n+1 ,...,g S ,g1,...,g n-1 }, use g n The starting pixel g n The descending label l is used to specify the candidate distribution of each pixel in the image, so that the LBP mode can be kept uniform in both the original image and the rotated image. The corresponding index of the candidate distribution is recorded in RCA: RCA(P i )={n|sort(g n )=l} where n,l∈[1,S], sort(g n ) is a function used to obtain the corresponding candidate distribution g n Medium n The descending labels of , the adjusted cross-scale co-occurrence pairs are as follows: CS-Co=(P i (x i ,y i ,1),T(P i ′(x i ′,y i ′,δ),RCA))) cs where T(·) is a function that uses the RCA candidate distribution to obtain P i 'Adjusted LBP mode; (4) The two-dimensional distribution of these adjusted cross-scale co-occurrence pairs forms the final feature vector, namely CS-CoLBP; The generation of the feature vector CS-CoLBP specifically includes the following steps: After obtaining all cross-scale co-occurrence pairs, we traverse and count their occurrence times in the entire image to obtain a combined two-dimensional LBP feature histogram CS-CoLBP: Where λ(·) is a function defined as follows: where ru∈[1,S+2],u∈[1,S(S-1)+3], S is the number of sampling points in the LBP circular neighborhood, CS-Co is the cross-scale symbiotic pair, and E is the LBP symbiotic space.
2. The image recognition method based on scale co-occurrence local binary patterns according to claim 1, characterized in that: The conversion process of the color image in step (1) is performed according to the ratio of R:G:B=0.299:0.587:0.114.
