Automatic Unsupervised Texture Recognition Framework Using Anisotropic Diffusion-Based Multi-Scale Analysis and Weight-Connected Graph Clustering

: A novel unsupervised texture classiﬁcation technique is proposed in this research work. The proposed method clusters automatically the textures of an image collection in similarity classes whose number is not a priori known. A nonlinear diffusion-based multi-scale texture analysis approach is introduced ﬁrst. It creates an effective scale-space by using a well-posed anisotropic diffusion ﬁltering model that is proposed and approximated numerically here. A feature extraction process using a bank of circularly symmetric 2D ﬁlters is applied at each scale, then a rotation-invariant texture feature vector is achieved for the current image by combining the feature vectors computed at all these scales. Next, a weighted similarity graph, whose vertices correspond to the texture feature vectors and the weights of its edges are obtained from the distances computed between these vectors, is created. A novel weighted graph clustering technique is then applied to this similarity graph, to determine the texture classes. Numerical simulations and method comparisons illustrating the effectiveness of the described framework are also discussed in this work.


Introduction
The image textures represent sets of primitives, known as texels, in some regular or repeated patterns. Texture analysis is an important and still challenging image analysis field that include various sub-domains, such as texture recognition, segmentation, synthesis and retrieval. It has been applied in some well-known image processing and computer vision domains, such as image and video object detection, recognition and tracking, image and video indexing and retrieval, medical imaging, remote sensing and product quality diagnosis.
The texture recognition may have either a supervised or an unsupervised character, depending on the character of its classification process. Hence, the supervised machine learning algorithms that can be applied to the texture classification task include the minimum distance classifier, K-Nearest Neighbor (K-NN), Artificial Neural Networks (ANN), Support Vector Machines (SVM) and Hidden Markov Models (HMMs) [19].
The unsupervised classification methods include the well-known K-means, hierarchical clustering, Self-Organizing Maps (SOM) and Dynamic Time Warping (DTW) techniques [19]. Additionally, the deep learning models and graph clustering algorithms represent effective unsupervised classification solutions that can be applied successfully to texture recognition [20][21][22].
A graph clustering-based unsupervised texture recognition framework, which can be applied successfully in the texture indexing and retrieval domain, is also proposed in this article. Its feature extraction component is based on a partial differential equation (PDE)-based multi-scale image analysis approach that is more effective than single-scale and Gaussian filter-based multi-scale texture analysis schemes. Thus, the scale-space is created by applying the finite difference-based approximation algorithm that solves numerically the well-posed nonlinear fourth-order anisotropic diffusion model introduced in the following section.
Next, the texture recognition process is described in the third section. A texture feature extraction process is performed at each scale and the final texture descriptor is achieved by concatenating the feature vectors computed at multiple scales. Since these vectors are modeled using a combination of circularly symmetric 2D filters, the final texture feature vector provides a rotation-invariant texture recognition. The second stage of this unsupervised recognition procedure represents a graph clustering-based texture classification process. The graph clustering algorithms have been used successfully in a closely related field, namely texture segmentation [23]. Here, we use the graph theory to develop a novel texture feature vector clustering approach that does not make any prior assumptions on the number of the clusters. Thus, a similarity graph is constructed for the set of image textures to be classified. Its vertices correspond to their feature vectors, while its edges are weighted with some similarity values that are related to the distances between those vectors. Then, a weighted graph connectivity-based clustering technique inspired by the Highly Connected Subgraphs (HCS) clustering algorithm is applied to this similarity graph, in order to detect the texture classes.
Some texture recognition simulations and method comparisons that illustrate the effectiveness of the proposed technique are described in the fourth section. The fifth section is dedicated to the main conclusions of this research work that ends with a section of references.

Nonlinear Anisotropic Diffusion-Based Model for Multi-Scale Analysis
The texture recognition technique proposed here uses a multi-scale image analysis based on nonlinear anisotropic diffusion. The multi-scale and multi-resolution analysis techniques have been used successfully in various image analysis areas, since they provide much better results than the traditional mono-scale approaches.
While many multi-scale texture analysis methods use scale spaces based on 2D Gaussian kernels [24], we create here a more effective scale-space representation by using a nonlinear PDE-based filtering model that combines second-and fourth-order anisotropic diffusions. The proposed fourth-order PDE model is described in the following subsection and its numerical approximation scheme, which is further used in the scale-space creation process, is presented in Section 2.2.

A Combined Fourth-Order PDE-Based Filtering Model
We have performed a lot of research in the PDE-based image processing and analysis field in the last decade, developing numerous PDE and variational models for image restoration and inpainting [25], segmentation [26] and compression [27] and video processing [28]. Now, we consider a nonlinear parabolic fourth-order partial differential equation-based model that combines second and fourth order anisotropic diffusions, for the multi-scale texture analysis. It is composed of the next PDE and some boundary conditions: where α, β ∈ [0.5, 1.5), λ ∈ (0, 0.2), Ω ⊆ R 2 is the image domain, the observed image is x 2 +y 2 2σ 2 , represents a 2D Gaussian filter kernel.
Since this compound PDE-based model (1) combines nonlinear second-and fourthorder diffusion-based components, it would enjoy the filtering advantages of both of them. Hence, the second-order PDE-based term assures that the diffusion process is performed along the gradient direction [25], which means the undesired blurring effect is avoided and the essential image features are preserved. The fourth-order diffusion term provides more natural restored images and overcomes the unintended staircasing. The behavior of this system is controlled by varying the α, β coefficient values. Hence, it provides a better deblurring when β is increased and α is decreased, and a better staircase effect removal otherwise.
Additionally, the proposed nonlinear PDE model combines the anisotropic diffusion with a 2D Gaussian filter kernel to achieve a more effective additive Gaussian noise (AWGN) removal, which works properly in noisy conditions too. This fourth-order nonlinear diffusion-based model has a non-variational character, since it cannot be obtained from the minimization of an energy functional. It is also well-posed, since there exists a unique variational, or weak, solution, for it. That solution is computed numerically by using a stable approximation scheme of (1) that converges to it. This discretization algorithm that solves numerically the differential model and is applied in the scale-space creation process is presented in the following subsection.

Finite Difference-Based Numerical Approximation Algorithm
The proposed fourth-order nonlinear diffusion-based filtering model is solved numerically by applying a finite difference-based numerical approximation algorithm [29]. Thus, the space and the time coordinates will be quantized as following: x = ih, y = jh, i ∈ {1, . . . , I}, j ∈ {1, . . . , J} and t = n∆t, n ∈ {0, . . . , N}, where h is the space siz,∆t represents the time step of the considered grid and [Ih × Jh] is the support image's dimension. Thus, the nonlinear fourth-order equation in (1) can be expressed as: The left component in (4) is discretized using the central finite differences [29], as follows: Then, the right term of (4) is approximated. The component αϕ( ∇u ) is approximated as αϕ ∇u i,j , and one also computes Next, the fourth-order diffusion term ∇ 2 ψ( ∆u σ )∇ 2 u is discretized using the finite difference-based Laplacian approximation [29] as: The other Laplacian-based term,βϕ( ∆u ), is approximated as β ∆u i,j . We may consider here the parameter values h = ∆t = 1. Then, by using all the above finite difference-based approximation results, the next explicit iterative numerical approximation algorithm is obtained: The numerical approximation scheme (8) is stable and consistent to the fourth-order anisotropic diffusion-based model (1) and converges in N iterations to its weak solution that represents the filtering output. This numerical procedure that solves the nonlinear PDE-based model has a polynomial time complexity and has been successfully used to create the effective scale-space representation for texture analysis that is detailed in the following section.

Unsupervised Multi-Scale Texture Recognition Technique
The following unsupervised texture recognition task is considered here: the image textures from the set T = {T 1 , . . . , T M } must be grouped automatically in similarity classes whose number is not a priori known, on the basis of their extracted characteristics. Additionally, one supposes there are no isolated textures in this set, which means that for each texture, there is at least another texture from T that is similar to it.
The novel texture recognition framework developed here uses the described anisotropic diffusion-based model and a graph theory-based clustering scheme. Thus, a multi-scale texture feature extraction approach that uses a scale-space created by applying the numerical approximation scheme described in the previous section is proposed first, in the next subsection. Then, an automatic unsupervised texture feature vector classification method that is based on a new graph clustering algorithm is described in Section 3.2.

Multi-Scale Texture Feature Extraction Approach
The numerical characteristics of each texture T i , where i ∈ {1, . . . , M}, are extracted using an effective multi-scale texture feature extraction technique. First, the proposed approach constructs a proper scale-space representation by applying the nonlinear PDEbased filter (1) on that image texture until various moments of time t, and differencing the successive filtered textures.
Thus, the finite difference-based numerical approximation algorithm (8) is applied on the current texture that becomes the discrete observed image, u 0 = T i . One considers the filtering output achieved by (8) at the iteration moments 4k, where k ∈ {0, . . . , S}, S ≥ 3. Then, the absolute differences between consecutive filtering results are computed and a scale- The image at each scale r ∈ {1, . . . , S} is denoted U r = u 4(r−1) − u 4r and represents the textural component of the PDE-based decomposition of u 4(r−1) . It contains some contours of T i . A feature extraction process is then performed on U r by combining some two-dimension circular filters. These filtering models that we consider for this task are inspired by those using a 2D Gabor function that is modified into a circularly symmetric version [30]. Because of their rotation-invariant character, the circularly symmetric Gabor filters provide a more performant texture analysis than the traditional Gabor filters [30]. Similarly, the frequency response of the considered 2D band-pass circularly symmetric filter is modeled as: where π σ represents the central frequency and the product of the mean and standard deviation, and µσ represents the filter bandwidth [31].
Hence, a bank of Q filters with circular frequency responses provided by (9) is applied to U r . Each of these 2D filters is characterized by a standard deviation value σ = υ q , q ∈ {1, . . . , Q}, where υ > 1. Some proper values for the mean µ and the parameter υ were selected in order to provide optimal texture analysis results. The image at each rth scale, U r , is mean-normalized first and next convolved to each 2D circular filter of that set. The L 2 norm of each filtered image is then computed. Hence, a Q-dimensional feature vector composed of these norm values, V(U r ), is obtained at each scale. Then, the final texture feature vector of the observed image (current texture) is determined by concatenating the feature vectors computed at multiple scales of the scale-space, as follows: The QS-dimensional feature vector given by (10) represents a noise-insensitive invariant texture descriptor. Given the anisotropic diffusion-based denoising model its multi-scale creation is based on, it works properly in both clean and noisy conditions, and, because of the 2D circular filters used in its construction, it describes properly both normal and rotated textures.

Graph Clustering-Based Automatic Texture Feature Vector Classification Technique
The invariant texture feature vector set determined in the previous subsection, {V(T 1 ), . . . , V(T M )}, has to be clustered automatically into an unknown number of similarity classes. We have performed some research in the unsupervised machine learning domain. Several effective unsupervised classification techniques have been introduced in our past works [32,33]. They could be applied in this texture feature vector clustering case, but here we propose a more performant automatic unsupervised feature vector classification algorithm that uses the graph theory [34], to solve this task.
The graph theory has been successfully applied in the data clustering domain, since the similarity could be expressed easily by a graph. Clustering with graphs means considering the entire clustering problem as a graph, whose vertices represent the entities to be classified, and the weights of its edges are related to the distances between those entities. A graph clustering algorithm separates the sparsely connected dense subgraphs from each other. The entities within a cluster are connected to each other but have no connection to those outside the cluster.
The graph clustering techniques have been successfully applied in some important domains, such as image segmentation, content-based image retrieval, computer vision, network routing and analysis of social networks. The texture segmentation field, which is closely related to the texture recognition area, has been approached successfully using graph-based clustering algorithms [23]. Here, we consider such a graph clustering solution for unsupervised texture recognition.
Thus, the proposed technique creates a similarity-weighted graph for our texture feature vector set, first. Then, a graph connectivity-based clustering algorithm is proposed and applied to the undirected weighted graph.
Therefore, let us consider G = (V, E), an undirected graph whose vertex set V contains M vertices, or nodes, corresponding to the textures T i , or their V(T i ) feature vectors, and E ⊆ V × V represents its set of undirected linking edges. Then, these edges are weighted with some node similarity values.
The similarity of two vertices of V is inversely proportional to the value of the distance between the feature vectors corresponding to them. Therefore, one computes all the distances between the texture feature vectors and defines the following weighting function for G: w : where d represent the Euclidian distance, but some other metrics could be applied here as well. By assigning these w ij weights to E, one obtains a fully connected similarity-weighted graph G, since any two nodes of the vertex set V are linked by a weighted edge in its structure. Since the texture feature vectors computed by (10) represent powerful texture descriptors, the distances between feature vectors of textures from the same similarity class have much lower values than the distances between feature vectors of textures belonging to different classes. Obviously, that means the weights corresponding to nodes of the same cluster are much higher than the weights of the edges linking nodes of different graph clusters. Therefore, we have: ∀i, j ∈ {1, . . . , M} : min where C (i) returns the index of the similarity class (cluster) where the texture T i should be inserted. Next, a weighted graph partitioning process will be performed on G. Thus, we propose a novel connectivity-based clustering technique adapted for undirected weighted graphs, which is inspired by the Highly Connected Subgraphs (HCS) clustering algorithm [34].
The HCS method searches for highly connected subgraphs, by using the minimum cut of the graph. Hence, it checks if the graph G is highly connected, which means its total edge connectivity (minimum number of edges whose deletion from a graph disconnects it) satisfies the property k(G) > |V| 2 , where |V| represents the cardinal of the vertex set. If so, the algorithm returns that graph, otherwise it partitions the graph into two subgraphs, by using its minimum cut, then applies recursively on them.
The weighted graph clustering algorithm proposed for our partitioning task does not search for highly connected graphs in the classical sense, since G is even fully connected. It will search for highly weight-connected graphs, a term that we define here. While a highly connected graph has very few missing edges, a highly weight-connected graph should be characterized by very few low-weight edges, preferably none. Given the graph weight property given by (12) and the definition of T, we may introduce an even stronger condition for this type of graph, which says that the lowest weight of an edge cannot be much lower than the highest weight of an edge of that graph. Hence, we may define a highly weightconnected graph as a weighted fully connected graph having the property: where κ ∈ (0.5, 1] represents a properly selected threshold that must be exceeded by the ratio between the minimum and maximum values of the weighted adjacency matrix of G. Therefore, the proposed algorithm returns G as clustering output if the graph satisfies the property (12). Otherwise, it divides G into the subgraphs G 1 and G 2 , by applying the minimum cut of this weighted graph.
While the HCS-based clustering approach determines the minimum cut as the minimum set of edges without which the graph will become disconnected, our weight-based graph clustering algorithm computes the minimum cut of G as the minimum sum of weights of edges that when removed from G, divides it into two subgraphs. The minimum cut of this weighted graph is determined by applying the Max-Flow/Min-Cut Theorem that states that the amount of the maximum flow through any network from a given source to a given sink is equal to the weight of the minimum cut. Therefore, one could find the minimum cut of the graph by calculating the network's maximum flow, using the Ford-Fulkerson (FFA) algorithm [44].
Next, this weighted graph clustering procedure is executed recursively on G 1 and G 2 . Thus, it determines all the subgraphs of the similarity graph G that satisfy the condition (13). These highly weight-connected subgraphs determine the similarity clusters of the vertex set, V. Each time such a subgraph is detected by the recursive scheme, all its vertices are labeled with its index. For example, the vertices v 1 , . . . , v p ⊆ V of the ith detected subgraph are labeled as C(v 1 ) = . . . = C v p := i. The detected graph node clusters represent the unsupervised texture classification, since the vertices of each cluster represent similar textures, or closed feature vectors. The final texture recognition result can be expressed as {C (1) The weight-connected graph-based texture clustering technique proposed here outperforms other unsupervised classification approaches that can be applied to texture analysis, such as the K-means model, SOM and the hierarchical agglomerative or divisive clustering algorithms [18]. Its main advantage over them is that it does not require any prior knowledge about the optimal number of texture clusters.
A simple unsupervised weighted graph-based texture classification example is described in Figure 1. The seven texture images to be recognized are displayed in the numbered nodes of a weighted graph. The graph does not satisfy (13), so the proposed clustering approach disconnects it by detecting the minimum cut that is represented by the red edges and has a maximum flow (sum of red weights) of 0.0298. The subgraph composed of nodes 5 and 7 is highly weight-connected, so it represents the first cluster. The other subgraph is not, so it is divided by the next minimum cut, marked by blue edges and having a maximum flow of 0.0204. The obtained subgraphs, composed of nodes {1, 3, 4} and {2, 6}, are highly weight-connected, so they represent the second and the third similarity clusters. The cluster number is displayed in red, blue or purple inside each vertex. Hence, three clusters are obtained and the texture classification result is [2 3 2 3 1 3 1].

Discussion
The automatic graph clustering-based unsupervised texture recognition technique proposed here was tested successfully on thousands of images from various texture databases. Some important and voluminous texture collections, such as the Kylberg database [45] and the Brodatz album [46], were used in our texture recognition experiments.
These texture recognition tests were conducted on an Intel (R) Core (TM) i7-6700HQ CPU 2.60 GHz processor on 64 bits that operated Windows 10. We determined empirically the parameters of the proposed framework that provide optimal recognition output, applying the trial and error method. Those optimal parameter values are the following: the number of scales S = 4, the number of circular filters Q = 6, the mean µ = 1.4, υ = 1.2 and the graph-related threshold κ = 0.66.
The experiments were performed on numerous textures, rotated at various orientations, from the mentioned databases. Thus, we considered 16 texture classes from each database, which are displayed in Figure 2  Various forms of the texture set T were created using these texture datasets. A large texture set, characterized by a high |T| = M value, would lead to a high execution time, because of the high computational complexity of the proposed framework. Hence, most of our experiments used testing sets with the number of textures M < 100 and containing images of various orientations and from various texture categories of the mentioned databases.
The described method properly classifies textures rotated by any angle, because of its rotation-invariant multi-scale texture feature extraction approach. It achieves a high texture recognition rate, its effectiveness being assessed by using several performance metrics, such as precision, recall, F1 score and accuracy [47]. Our technique obtains high values of these measures that are adapted for pairs of data points, since it produces very few misclassifications representing false positives and negatives.
Method comparisons were also performed. This texture recognition framework outperforms many existing mono-and multi-scale unsupervised recognition techniques, such as those using texture features based on image moments [2], LBP [4], GLCM [3], circular 2D Gabor filters [30] and Gabor Wavelet Transforms [16] in combination with K-means, SOM or hierarchical clustering schemes, in both clean and noisy conditions. Both the nonlinear anisotropic diffusion-based multi-scale texture feature extraction approach and the weighted graph-based texture clustering solution proposed here provide better results than other texture analysis and classification methods, as shown by the performance metrics values displayed in Table 1. The proposed approach achieves higher precision, recall, F1 and accuracy scores than the methods using the mentioned features with K-means or hierarchical agglomerative clustering schemes. We also calculated and included in this table the performance measure values obtained by the PDE-based multi-scale texture feature extraction proposed here in combination with the two clustering algorithms, in order to assess our feature extraction and graph clustering techniques. As it results from Table 1, the two combinations achieve performance metric values that are somewhat lower than those of the described recognition framework, but higher than those of the other texture analysis models. That means our multi-scale feature extraction technique provides better texture descriptors than moment-based, LBP-based, GLCM-based and multi-scale circularly symmetric 2D Gabor filter-based featuring methods.
The moment-based method tested here uses sequences of nine invariant area moments as feature vectors; the LBP-based approach uses a number of neighbors of eight and radius values from 1 to 5; the GLCM-based scheme uses eight offsets; and the circularly symmetric Gabor filters use center frequencies F, taking values from 2 to 8. Only the multi-scale 2D Gabor Wavelet-based feature extraction approach gets slightly better values than our featuring scheme when applied with those clustering models.
The values from that table also mean that the weighted graph-based texture clustering technique proposed here represents a better unsupervised texture classification solution than K-means and hierarchical agglomerative clustering schemes. Unlike our fully automatic graph clustering algorithm, those clustering models (and many others also) require knowledge of the number of texture classes, so they need some cluster validity indexes in order to become automatic.
Thus, the two main components of this texture recognition framework operate together very well. Its multi-scale circular filter-based feature extractor produces powerful texture descriptors that determine dense texture clusters, which can be separated successfully by its weighted graph-based unsupervised classifier that was specially created for this type of cluster.

Conclusions
The novel automatic unsupervised rotation-invariant texture recognition technique introduced in this work brings together several important research domains, such as image processing and analysis, partial differential equations, numerical analysis and graph theory. It also brings some original contributions in both stages of the recognition process.
Thus, the feature extraction component of the recognition framework is based on a new multi-scale texture analysis approach that is an important contribution of our research. It uses a fast-converging finite difference-based numerical approximation algorithm proposed by us that is consistent with a novel well-posed PDE-based model combining second-and fourth-order anisotropic diffusions and 2D Gaussian filter kernels, to create the scale-space representation. A new 2D circular filter-based texture feature extraction solution is applied at each scale, determining strong rotation-invariant feature vectors.
The unsupervised texture classification is performed by applying a novel graph clustering technique that is another contribution of this work. The automatic texture clustering approach, proposed here, which uses a fully connected weighted similarity graph corresponding to the texture feature vector set, determines the optimal texture clusters without a priori knowledge about their number.
Additionally, the proposed texture recognition framework achieves high values of the performance metrics and outperforms many other unsupervised texture recognition techniques. Unfortunately, our technique may require higher execution times than other recognition methods, because of the higher time complexity of its multi-scale texture feature extraction process.
We may try to further improve it by transforming the multi-scale texture analysis part into a multi-resolution analysis approach. Our recognition method can be applied successfully in other image analysis and computer vision domains, such as texture indexing and retrieval, where the cluster-based texture indexes could be obtained using this method, texture segmentation and image and video object detection. Further applications and improvements of the proposed texture recognition framework will represent the focus of our future research.
Funding: This research received no external funding.

Conflicts of Interest:
The author declares no conflict of interest.