Image clustering method, terminal device and storage medium based on Manhattan distance
Through the Manhattan distance-based image clustering method, the problem of inaccurate clustering results caused by noise interference in the prior art is solved, and a more accurate and high-precision image clustering effect is achieved.
Patent Information
- Application Number
- CN202210417687.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-20
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2042-04-20
AI Technical Summary
Existing image clustering methods measure the similarity of features through Euclidean distance or cosine distance, and are susceptible to noise interference, resulting in inaccurate clustering results.
Using the image clustering method based on Manhattan distance, the feature image matrix is obtained by preprocessing the clustered image, the Manhattan distance is calculated, the undirected graph is constructed, and input it into the preset learning model to obtain the graph clustering indication matrix, and finally determine the clustering label.
Processing image data through Manhattan distance can effectively reduce noise interference and improve the accuracy and accuracy of clustering results.
Smart Images

Figure CN114821140B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image clustering method based on Manhattan distance, a terminal device and a storage medium. Background Art
[0002] Clustering refers to dividing a collection of physical or abstract objects into multiple classes consisting of similar objects. The clusters generated by clustering are a collection of data objects that are similar to objects in the same cluster and different from objects in other clusters. With the development of computer and network technology, we often need to face a large amount of image data, and often want to cluster image data with the same or similar objects together, such as in applications such as photo album image management. Conventional clustering methods first extract features from the region of interest in the image, and then measure the similarity of features through Euclidean distance or cosine distance to achieve clustering. This type of clustering algorithm is easily affected by noise, resulting in inaccurate clustering results.
[0003] The above contents are only used to assist in understanding the technical solution of the present invention, and do not constitute an admission that the above contents are related technologies. Summary of the invention
[0004] The embodiments of the present invention provide an image clustering method, a terminal device and a storage medium based on Manhattan distance, aiming to solve the technical problem that clustering is achieved by measuring the similarity of features by Euclidean distance or cosine distance, and that such clustering algorithms are easily affected by noise, resulting in inaccurate clustering results.
[0005] An embodiment of the present invention provides an image clustering method based on Manhattan distance, and the image clustering method based on Manhattan distance includes:
[0006] Preprocessing each image to be clustered to obtain a plurality of feature image matrices of each image to be clustered;
[0007] Determining the Manhattan distance of each of the images to be clustered according to a plurality of feature image matrices of each of the images to be clustered;
[0008] Determining an undirected graph of each of the images to be clustered according to the Manhattan distance of each of the images to be clustered;
[0009] Inputting the undirected graph into a first preset learning model to obtain a graph clustering indicator matrix for each of the images to be clustered;
[0010] A clustering label of each of the images to be clustered is determined according to the graph clustering indication matrix of each of the images to be clustered.
[0011] Optionally, the step of determining the Manhattan distance of each of the images to be clustered according to a plurality of feature image matrices of each of the images to be clustered comprises:
[0012] Obtaining the difference between matrix point data in each characteristic image matrix of each of the images to be clustered;
[0013] Determine a probability value when the two matrix point data corresponding to the difference value belong to the same type of data;
[0014] The Manhattan distance of each of the images to be clustered is determined according to the difference value and the probability value corresponding to the matrix point data of each of the feature image matrices.
[0015] Optionally, the step of determining the Manhattan distance of each of the images to be clustered according to the difference value and the probability value corresponding to each of the feature image matrices includes:
[0016] Obtain weight values corresponding to the two matrix point data corresponding to the difference;
[0017] The Manhattan distance of each of the images to be clustered is determined according to the difference value, the probability value and the weight value corresponding to each of the feature image matrices.
[0018] Optionally, the step of determining the Manhattan distance of each of the images to be clustered according to the difference value, the probability value and the weight value corresponding to the matrix point data of each of the feature image matrices includes:
[0019] Determine a product value of the matrix point data according to the difference value, the difference value, the probability value and the weight value corresponding to the matrix point data;
[0020] The sum of the product values of all the matrix point data of each of the feature image matrices is obtained to determine the Manhattan distance of each of the images to be clustered.
[0021] Optionally, after the step of inputting the undirected graph into a first preset learning model to obtain a graph clustering indicator matrix of each of the images to be clustered, the method further includes:
[0022] Inputting the graph clustering indicator matrix into a second preset learning model to optimize the graph clustering indicator matrix;
[0023] The graph clustering indication matrix is updated according to the optimized graph clustering indication matrix.
[0024] Optionally, the second preset learning model determines the degree matrix of the undirected graph, takes the transposed matrix of the graph clustering indicator matrix, and performs modeling based on the degree matrix, the undirected graph, the transposed matrix and the graph clustering indicator matrix.
[0025] Optionally, the step of determining a clustering label corresponding to the image to be clustered according to each of the graph clustering indication matrices includes:
[0026] Determine the probability value of the label type corresponding to each image in each of the graph clustering indicator matrices;
[0027] Get the label type corresponding to the maximum probability value among the probability values of the label type corresponding to each image;
[0028] The clustering label of the image to be clustered is determined according to the label type corresponding to the maximum probability value.
[0029] In addition, to achieve the above-mentioned purpose, the present invention also provides an image clustering device based on Manhattan distance, and the image clustering device based on Manhattan distance includes:
[0030] A preprocessing module, used for preprocessing each image to be clustered to obtain a plurality of feature image matrices of each image to be clustered;
[0031] A first determination module, used for determining the Manhattan distance of each of the images to be clustered according to a plurality of feature image matrices of each of the images to be clustered;
[0032] A second determination module is used to determine an undirected graph of each of the images to be clustered according to the Manhattan distance of each of the objects to be clustered;
[0033] An input module, used for inputting the undirected graph into a first preset learning model to obtain a graph clustering indicator matrix of each of the images to be clustered;
[0034] The third determination module is used to determine the clustering label corresponding to the image to be clustered according to each of the graph clustering indication matrices.
[0035] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal device including: a memory, a processor, and a Manhattan distance-based image clustering program stored in the memory and executable on the processor, wherein the Manhattan distance-based image clustering program implements the steps of the above-mentioned Manhattan distance-based image clustering method when executed by the processor.
[0036] In addition, to achieve the above-mentioned purpose, the present invention also provides a readable storage medium, on which a Manhattan distance-based image clustering program is stored. When the Manhattan distance-based image clustering program is executed by a processor, the steps of the above-mentioned Manhattan distance-based image clustering method are implemented.
[0037] A technical solution of an image clustering method, terminal device and storage medium based on Manhattan distance provided in an embodiment of the present invention obtains multiple feature images of each image to be clustered by preprocessing the image to be clustered, and then determines the Manhattan distance of each image to be clustered according to the multiple feature images of each image to be clustered, and determines the undirected graph of each image to be clustered through the Manhattan distance of each image to be clustered, so as to process outliers and noise in the image to be clustered, so that the obtained undirected graph can better characterize the underlying real cluster structure of the multi-feature image data, so as to improve the quality of the obtained undirected graph, and input the undirected graph into a first preset learning model to obtain a graph clustering indicator matrix of each image to be clustered, and determine the clustering label of each image to be clustered according to the graph clustering indicator matrix of each image to be clustered, so that the clustering label finally obtained is more accurate and the clustering accuracy is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a schematic diagram of the structure of the terminal device involved in each embodiment of the image clustering method based on Manhattan distance of the present invention;
[0039] Figure 2 It is a schematic diagram of the process of the first embodiment of the image clustering method based on Manhattan distance of the present invention;
[0040] Figure 3 are multiple feature image matrices obtained after preprocessing the clustered images;
[0041] Figure 4 is the shape of an undirected graph;
[0042] Figure 5 A schematic diagram of a process for determining Manhattan distance in a first embodiment of the image clustering method based on Manhattan distance of the present invention;
[0043] Figure 6 The overall flow chart for determining the cluster labels of the images to be clustered;
[0044] Figure 7 It is a schematic diagram of the process of the first embodiment of the image clustering method based on Manhattan distance of the present invention;
[0045] Figure 8 A schematic diagram of the module composition of the Manhattan distance-based image clustering device provided by the present invention. DETAILED DESCRIPTION
[0046] In order to better understand the above technical solution, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0047] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0048] Please refer to Figure 1 , Figure 1 The structure diagram of the terminal device involved in each embodiment of the image clustering method based on Manhattan distance of the present invention is shown in FIG. The terminal device involved in the image clustering method based on Manhattan distance of the present invention may include terminal devices such as mobile phones, tablet computers, laptop computers, PDAs, and personal digital assistants (PDAs).
[0049] like Figure 1 As shown, the terminal device may include: a memory 101 and a processor 102. Those skilled in the art will understand that Figure 1 The structural block diagram of the terminal shown does not constitute a limitation on the terminal, and the terminal may include more or fewer components than shown, or combine certain components, or arrange the components differently. The memory 101 stores an operating device and an image clustering program based on Manhattan distance. The processor 102 is the control center of the terminal device, and the processor 102 executes the image clustering program based on Manhattan distance stored in the memory 101 to implement the steps of each embodiment of the image clustering method based on Manhattan distance of the present invention.
[0050] Optionally, the terminal device may further include a display unit 103, which includes a display panel. The display panel may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc., for outputting an interface for displaying a user to browse.
[0051] Optionally, the terminal device may further include a communication unit, which establishes data communication with other terminal devices such as a computer through a network protocol (the data communication may be IP communication or a Bluetooth channel) to achieve data transmission between other terminal devices.
[0052] The embodiment of the present invention provides an embodiment of the image clustering method based on Manhattan distance. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in an order different from that here.
[0053] Based on the structural block diagram of the above terminal device, various embodiments of the image clustering method based on Manhattan distance of the present invention are proposed. Figure 2 , Figure 2 1 is a flow chart of a first embodiment of the image clustering method based on Manhattan distance of the present invention. In this embodiment, the image clustering method based on Manhattan distance includes the following steps:
[0054] Step S10, preprocessing each image to be clustered to obtain a plurality of feature image matrices of each image to be clustered;
[0055] The image to be clustered refers to an image whose clustering label has not been determined. Methods for preprocessing the image to be clustered include but are not limited to performing scale-invariant feature transform (SIFT), Histogram of Oriented Gradient (HOG) and Local Binary Pattern (LBP) feature extraction methods on the image to be clustered.
[0056] Preprocess each image to be clustered to obtain multiple feature image matrices for each image to be clustered. Figure 3 , Figure 3 are multiple feature image matrices obtained after preprocessing the clustered image, where: Represents multiple features of the target object in the image to be clustered, Indicates the number of features. For example, the target object of the image to be clustered may be a face, an animal, a scene, etc.
[0057] Step S20, determining the Manhattan distance of each of the images to be clustered according to a plurality of feature image matrices of each of the images to be clustered;
[0058] Step S30, determining an undirected graph of each of the images to be clustered according to the Manhattan distance of each of the images to be clustered;
[0059] The undirected graph reflects the similarity of the original data of the image to be clustered in the feature space. Please refer to Figure 4 , Figure 4 It is in the shape of an undirected graph. An undirected graph is a matrix with a block structure on the main diagonal, and each block represents a category of the image to be clustered.
[0060] In practical applications, the collected image data often contains noise or outliers, which will affect the accuracy of clustering. By using Manhattan distance to deal with noise and outliers in image data, the undirected graph constructed by Manhattan distance is more robust.
[0061] As an optional implementation, please refer to Figure 5 , Figure 5 The flowchart of determining the Manhattan distance in the first embodiment of the image clustering method based on Manhattan distance of the present invention is shown in FIG. 1 , wherein step S20 includes:
[0062] Step S21, obtaining the difference between the matrix point data in each characteristic image matrix of each of the images to be clustered;
[0063] Step S22, determining a probability value when the two matrix point data corresponding to the difference value belong to the same type of data;
[0064] Step S23, determining the Manhattan distance of each of the images to be clustered according to the difference value and the probability value corresponding to the matrix point data of each of the feature image matrices.
[0065] For example, assuming and Respectively represent The first feature image matrix and data, the difference between the matrix point data in the feature image matrix can be obtained by Determine the probability value when the two matrix point data corresponding to the difference belong to the same type of data, and the probability value is determined by It means that the Manhattan distance of each image to be clustered is determined according to the difference and probability value corresponding to the matrix point data of each feature image matrix, which can be calculated by the following formula:
[0066]
[0067] in, Represents the 1-norm.
[0068] Step S30 determines an undirected graph of each of the images to be clustered according to the Manhattan distance of each of the images to be clustered. The undirected graph can be obtained by calculating the following formula:
[0069]
[0070] in, represents the square of the F norm, Indicates Undirected Graph No. List, represents the transpose of a column vector, It means that the sum of all elements of the row vector is 1. Indicates The feature of Data and The probability that the data belong to the same class is represents the constraints, is a parameter greater than 0, Indicates the total number of images to be clustered.
[0071] Optionally, step S23 includes:
[0072] Obtain weight values corresponding to the two matrix point data corresponding to the difference;
[0073] The Manhattan distance of each of the images to be clustered is determined according to the difference value, the probability value and the weight value corresponding to each of the feature image matrices.
[0074] It should be noted that, since it is possible that the probability of the closest sample is assigned to 1, and the probability of the distance to other samples is assigned to 0, that is, the probability of Xi-Xi is 1, and the probability of Xi-Xj is 0.
[0075] In order to make full use of multiple feature image matrices of the target object, by adding The above expression is optimized as follows, so that it can obtain an undirected graph describing multiple feature image data through adaptive map learning. The specific optimized expression is as follows:
[0076]
[0077] in, It changes with the relationship between Xi and Xj of the Vth feature image matrix, and finally reflects the weight of the feature view corresponding to each feature image matrix on the undirected graph matrix S, that is, the weight value corresponding to the two matrix point data corresponding to the difference is obtained.
[0078] Optionally, the step of determining the Manhattan distance of each of the images to be clustered according to the difference value, the probability value and the weight value corresponding to each of the feature image matrices includes:
[0079] Determine a product value of the matrix point data according to the difference value, the probability value and the weight value corresponding to the matrix point data;
[0080] The sum of the product values of all the matrix point data of each of the feature image matrices is obtained to determine the Manhattan distance of each of the images to be clustered.
[0081] Step S40, inputting the undirected graph into a first preset learning model to obtain a graph clustering indicator matrix for each of the images to be clustered;
[0082] Step S50: determining a clustering label of each of the images to be clustered according to the graph clustering indication matrix of each of the images to be clustered.
[0083] It should be noted that the undirected graph is input into the first preset learning model to obtain the graph clustering indicator matrix of each image to be clustered, that is, based on the obtained undirected graph of each image to be clustered and input into the first preset learning model, the graph clustering indicator matrix of each image to be clustered is calculated.
[0084] Optionally, the first preset learning model may adopt a conventional calculation method of calculating a graph clustering indicator matrix through an undirected graph.
[0085] As an optional implementation, step S50 includes:
[0086] Determine the probability value of the label type corresponding to each to-be-clustered image in each of the graph clustering indication matrices;
[0087] Obtain the label type corresponding to the maximum probability value among the probability values corresponding to the label type of each image to be clustered;
[0088] The clustering label of the image to be clustered is determined according to the label type corresponding to the maximum probability value.
[0089] It should be noted that the purpose of graph clustering indicator matrix learning is to find a probability matrix that reflects the image category. ,in Each row of represents an image to be clustered, and the number of columns corresponds to the number of categories of the image to be clustered, wherein the column where the maximum value of each row is located indicates that the image to be clustered belongs to that category. Exemplarily, the following is a schematic diagram of the graph clustering indicator matrix:
[0090]
[0091] Optionally, after step S40, it includes: inputting the graph clustering indication matrix into a second preset learning model to optimize the graph clustering indication matrix, and updating the graph clustering indication matrix according to the optimized graph clustering indication matrix. The specific implementation of this step can be found in the second embodiment and is not described in detail here.
[0092] Optionally, the above multiple implementations may be combined to form the following optimization model:
[0093]
[0094] in is a parameter greater than 0. The first two items are undirected graph learning. By exploring the Manhattan distance of real data, it can better deal with outliers and noise in clustered images. The third item is the graph clustering indicator matrix F learning, which makes graph learning and graph clustering indicator matrix learning optimize each other, greatly improving the quality of undirected graphs and clustering accuracy.
[0095] For example, reference may be made to Figure 6 , Figure 6 The overall flow chart for determining the clustering labels of the images to be clustered.
[0096] By performing feature extraction on a large number of unlabeled images to be clustered, such as original face images (taking SIFT, HOG and LBP features as examples), a feature image matrix reflecting the original face image can be obtained. , then in each feature image matrix We explore the Manhattan distance between different samples and obtain an undirected graph , the undirected graph reflects the similarity relationship of images in space, and then through the undirected graph A graph clustering indicator matrix reflecting the category of face images can be obtained , and then iteratively optimize the undirected graph and the graph clustering indicator matrix F. Finally, the clustering label of the original face image can be obtained according to the graph clustering indicator matrix F.
[0097] In the technical solution disclosed in the present embodiment, multiple feature image matrices of each image to be clustered are obtained by preprocessing the images to be clustered, and then the Manhattan distance of each image to be clustered is determined according to the multiple feature image matrices of each image to be clustered. The undirected graph of each image to be clustered is determined through the Manhattan distance of each image to be clustered, so as to process outliers and noise in the images to be clustered, so that the obtained undirected graph can better characterize the underlying real cluster structure of the multi-feature image data, so as to improve the quality of the obtained undirected graph, and the undirected graph is input into the first preset learning model to obtain the graph clustering indicator matrix of each image to be clustered, and the clustering label of each image to be clustered is determined according to the graph clustering indicator matrix of each image to be clustered, so that the clustering label finally obtained is more accurate and the clustering accuracy is improved.
[0098] Based on the above first embodiment, a second embodiment of the image clustering method based on Manhattan distance of the present invention is proposed. Please refer to Figure 7 , Figure 7 The figure is a flow chart of the first embodiment of the image clustering method based on Manhattan distance of the present invention. In this embodiment, after step S40, the following steps are included:
[0099] Step S60, inputting the graph clustering indicator matrix into a second preset learning model to optimize the graph clustering indicator matrix;
[0100] Step S70: updating the graph clustering indicator matrix according to the optimized graph clustering indicator matrix.
[0101] Graph clustering indicator matrix learning is to find a probability matrix that reflects the image category ,in Each row represents an image, and the number of columns corresponds to the number of image categories. The column with the maximum value in each row indicates that the image belongs to that category.
[0102] By introducing graph clustering indicator matrix learning, graph learning and graph clustering indicator matrix learning are iteratively optimized to further improve the accuracy of graph clustering. Therefore, the graph clustering indicator matrix learning can be modeled using the optimization problem to obtain the second preset learning model:
[0103] Among them, the second preset learning model is obtained by determining the degree matrix according to the undirected graph, taking the transposed matrix of the graph clustering indicator matrix, and modeling according to the degree matrix, the undirected graph, the transposed matrix and the graph clustering indicator matrix. The specific expression of the second preset learning model is as follows:
[0104]
[0105] in, , Representation Matrix The transpose of represents the trace of the matrix, which is the sum of all the elements on the main diagonal of the matrix. It is called the degree matrix and can be obtained from the undirected graph Calculated. It is a graph clustering indicator matrix. Its number of rows corresponds to the total number of images to be clustered, and the number of columns corresponds to the total number of categories. There is a maximum value in each row, and the column corresponding to the maximum value is the class of the image to be clustered corresponding to the data in that row.
[0106] In the technical solution disclosed in this embodiment, the graph clustering indication matrix is input into a second preset learning model to optimize the graph clustering indication matrix, and then the graph clustering indication matrix is updated according to the optimized graph clustering indication matrix to achieve iterative optimization of the graph clustering indication matrix. The optimized graph clustering indication matrix determines the clustering label of each image to be clustered, which can further improve the accuracy of graph clustering.
[0107] like Figure 8 As shown, Figure 8 The schematic diagram of the module composition of the image clustering device based on Manhattan distance provided by the present invention is as follows:
[0108] A preprocessing module 110 is used to preprocess each image to be clustered to obtain a plurality of feature image matrices of each image to be clustered;
[0109] A first determination module 120, configured to determine the Manhattan distance of each of the images to be clustered according to a plurality of feature image matrices of each of the images to be clustered;
[0110] A second determination module 130, configured to determine an undirected graph of each of the images to be clustered according to the Manhattan distance of each of the objects to be clustered;
[0111] An input module 140, configured to input the undirected graph into a first preset learning model to obtain a graph clustering indicator matrix for each of the images to be clustered;
[0112] The third determination module 150 is used to determine the clustering label corresponding to the to-be-clustered image according to each of the graph clustering indication matrices.
[0113] The specific implementation of the image clustering device based on Manhattan distance of the present invention is basically the same as the above-mentioned embodiments of the image clustering method based on Manhattan distance, and will not be repeated here.
[0114] The present invention also proposes a terminal device, comprising: a memory, a processor, and a Manhattan distance-based image clustering program stored in the memory and executable on the processor, wherein the Manhattan distance-based image clustering program, when executed by the processor of the first terminal, implements the steps of the Manhattan distance-based image clustering method in any of the above-mentioned embodiments.
[0115] The present invention also proposes a readable storage medium, which stores a Manhattan distance-based image clustering program. When the Manhattan distance-based image clustering program is executed by a processor, the steps of the Manhattan distance-based image clustering method described in any of the above embodiments are implemented.
[0116] In the embodiments of the terminal device and the readable storage medium provided by the present invention, all the technical features of the above-mentioned embodiments of the image clustering method based on Manhattan distance are included. The expansion and explanation content of the specification are basically the same as those of the above-mentioned embodiments of the image clustering method based on Manhattan distance, and will not be repeated here.
[0117] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0118] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0119] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0120] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0121] It should be noted that in the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claim. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names.
[0122] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. 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.
[0123] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. An image clustering method based on Manhattan distance, characterized in that: The image clustering method based on Manhattan distance includes: Preprocessing each image to be clustered to obtain a plurality of feature image matrices of each image to be clustered; Determining the Manhattan distance of each of the images to be clustered according to a plurality of feature image matrices of each of the images to be clustered; Determining an undirected graph of each of the images to be clustered according to the Manhattan distance of each of the images to be clustered; Inputting the undirected graph into a first preset learning model to obtain a graph clustering indicator matrix for each of the images to be clustered; Determining a clustering label of each of the images to be clustered according to the graph clustering indication matrix of each of the images to be clustered; The step of determining the Manhattan distance of each of the images to be clustered according to the multiple feature image matrices of each of the images to be clustered comprises: Obtaining the difference between matrix point data in each characteristic image matrix of each of the images to be clustered; Determine a probability value when the two matrix point data corresponding to the difference value belong to the same type of data; Determine the Manhattan distance of each of the images to be clustered according to the difference value and the probability value corresponding to the matrix point data of each of the feature image matrices; The step of determining the Manhattan distance of each of the images to be clustered according to the difference value and the probability value corresponding to each of the feature image matrices comprises: Obtain weight values corresponding to the two matrix point data corresponding to the difference; The Manhattan distance of each of the images to be clustered is determined according to the difference value, the probability value and the weight value corresponding to each of the feature image matrices.
2. The method according to claim 1, characterized in that The step of determining the Manhattan distance of each of the images to be clustered according to the difference value, the probability value and the weight value corresponding to the matrix point data of each of the feature image matrices comprises: Determine a product value of the matrix point data according to the difference value, the difference value, the probability value and the weight value corresponding to the matrix point data; The sum of the product values of all the matrix point data of each of the feature image matrices is obtained to determine the Manhattan distance of each of the images to be clustered.
3. The method according to claim 1, characterized in that After the step of inputting the undirected graph into the first preset learning model to obtain the graph clustering indicator matrix of each of the images to be clustered, the method further includes: Inputting the graph clustering indicator matrix into a second preset learning model to optimize the graph clustering indicator matrix; The graph clustering indication matrix is updated according to the optimized graph clustering indication matrix.
4. The method according to claim 3, characterized in that The second preset learning model is obtained by determining a degree matrix according to the undirected graph, obtaining a transposed matrix of the graph clustering indication matrix, and modeling according to the degree matrix, the undirected graph, the transposed matrix and the graph clustering indication matrix.
5. The method according to claim 1, characterized in that The step of determining the clustering label corresponding to the image to be clustered according to each of the graph clustering indication matrices comprises: Determine the probability value of the label type corresponding to each image in each of the graph clustering indicator matrices; Get the label type corresponding to the maximum probability value among the probability values of the label type corresponding to each image; The clustering label of the image to be clustered is determined according to the label type corresponding to the maximum probability value.
6. An image clustering device based on Manhattan distance, characterized in that: The image clustering device based on Manhattan distance comprises: A preprocessing module, used for preprocessing each image to be clustered to obtain a plurality of feature image matrices of each image to be clustered; A first determination module, used for determining the Manhattan distance of each of the images to be clustered according to a plurality of feature image matrices of each of the images to be clustered; A second determination module, used for determining an undirected graph of each of the images to be clustered according to the Manhattan distance of each of the images to be clustered; An input module, used for inputting the undirected graph into a first preset learning model to obtain a graph clustering indicator matrix of each of the images to be clustered; A third determination module, used to determine a clustering label corresponding to the image to be clustered according to each of the graph clustering indication matrices; The first determination module is also used to obtain the difference between the matrix point data in each characteristic image matrix of each image to be clustered; determine the probability value when the two matrix point data corresponding to the difference belong to the same type of data; determine the Manhattan distance of each image to be clustered according to the difference and the probability value corresponding to the matrix point data of each characteristic image matrix; obtain the weight value corresponding to the two matrix point data corresponding to the difference; determine the Manhattan distance of each image to be clustered according to the difference, the probability value and the weight value corresponding to each characteristic image matrix.
7. A terminal device, characterized in that: include: A memory, a processor, and a Manhattan distance-based image clustering program stored in the memory and executable on the processor, wherein the Manhattan distance-based image clustering program, when executed by the processor, implements the steps of the Manhattan distance-based image clustering method as described in any one of claims 1 to 5.
8. A readable storage medium, characterized in that: An image clustering program based on Manhattan distance is stored thereon, and when the image clustering program based on Manhattan distance is executed by a processor, the steps of the image clustering method based on Manhattan distance described in any one of claims 1-5 are implemented.
Citation Information
Patent Citations
Image clustering method and device, computer equipment and storage medium
CN112749762A
Image clustering method and device, electronic equipment and computer readable storage medium
CN113255714A