Image clustering method, electronic device and computer readable storage medium
By clustering the images, combining the historical clustering collection library and undirected graph construction and merging processing, the problem of low image clustering accuracy is solved, and a more efficient image clustering effect is achieved.
Patent Information
- Application Number
- CN202411726024.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In the prior art, when clustering large data images, different images of the same object are easily divided into different domains, resulting in low clustering accuracy.
By performing image clustering processing on at least two images acquired, multiple initial image sets are obtained; a historical cluster set matching the target objects of each image are determined from the historical clustering collection library; an undirected graph is constructed, based on the undirected graph The initial image set is grouped and merged to obtain the target image set.
The accuracy of image clustering is improved, and the global level merge processing is performed by referring to the set marking of the historical clustering set to which the target object belongs, thereby avoiding the occurrence of multi-set phenomenon.
Smart Images

Figure CN119229154B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image clustering method, an electronic device and a computer-readable storage medium. Background Art
[0002] Image clustering refers to the classification of collected images according to certain rules and standards. For large-scale image clustering, the collected images are usually divided into multiple domains and image clustering is performed in each domain. However, the above method easily causes different images of the same object to be divided into different domains, and then different images of the same object are clustered into different sets, that is, the multi-set phenomenon occurs, resulting in low clustering accuracy. Summary of the invention
[0003] The main technical problem solved by the present application is to provide an image clustering method, an electronic device and a computer-readable storage medium, which can improve the accuracy of image clustering.
[0004] To solve the above technical problems, the present application provides an image clustering method, which includes: performing image clustering processing on at least two acquired images to obtain multiple initial image sets; determining a historical clustering set that matches a target object of each image from an acquired historical clustering set library; constructing an undirected graph based on a historical set label set formed by historical set labels of each initial image set and a historical clustering set that matches the target object in the initial image set; and performing set merging processing on each initial image set based on the undirected graph to obtain a target image set.
[0005] In one embodiment, the step of performing set merging processing on each initial image set based on the undirected graph to obtain a target image set includes: segmenting the undirected graph according to the attribute information of each vertex in the undirected graph to obtain at least one subgraph; merging the initial image sets in each subgraph to obtain the target image set.
[0006] In one embodiment, the attribute information includes connected components, and the step of segmenting the undirected graph according to the attribute information of each vertex in the undirected graph to obtain at least one subgraph includes: calculating the connected components of each vertex in the undirected graph; and determining the area where the vertices of the same connected components in the undirected graph are located as the subgraph.
[0007] In one embodiment, the step of merging the initial image sets in each sub-image to obtain the target image set includes: aggregating the images in the initial image sets corresponding to the sub-images to obtain the aggregated image sets corresponding to the sub-images; and deduplicating the images in the aggregated image sets to obtain the target image set.
[0008] In one embodiment, the step of constructing an undirected graph based on a historical set tag set formed by each initial image set and a historical set tag of a historical clustering set matching a target object in the initial image set includes: traversing each historical set tag set to determine the association relationship between the initial image sets; determining the association relationship as an undirected edge; taking each initial image set as a vertex; and constructing the undirected graph based on the undirected edges and the vertices.
[0009] In one embodiment, the step of determining the association relationship between the initial image sets includes: determining whether the currently traversed first historical set mark set and other second historical set mark sets have the same historical set mark; if so, determining that the initial image set corresponding to the first historical set mark set and the initial image set corresponding to the second historical set mark set have an association relationship.
[0010] In one embodiment, the step of determining a historical cluster set that matches the target object of each image from the acquired historical cluster set library includes: matching the image with each historical image in the historical cluster set library to obtain a matching result; in response to the matching result representing a match, determining the historical cluster set where the corresponding historical image is located as the historical cluster set that matches the target object in the image.
[0011] In one embodiment, the step of performing image clustering processing on at least two acquired images to obtain multiple initial image sets includes: performing feature extraction processing on each image to obtain object features of each image; and performing clustering processing on each image according to the object features of each image to obtain multiple initial image sets.
[0012] In order to solve the above technical problems, the present application provides an electronic device, including a memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the above image clustering method.
[0013] In order to solve the above technical problems, the present application provides a computer-readable storage medium including program data stored therein, and the program data is used to implement the above image clustering method when executed by a processor.
[0014] The above scheme performs image clustering processing on at least two acquired images to obtain multiple initial image sets; determines the historical clustering set matching the target object of each image from the acquired historical clustering set library; constructs an undirected graph based on the historical set label set formed by the historical set labels of each initial image set and the historical clustering set matching the target object in the initial image set; and performs set merging processing on each initial image set based on the undirected graph to obtain the target image set. On the one hand, when determining the target image set based on the initial image set obtained by the current clustering, referring to the set label of the historical clustering set to which the target object in each image belongs can improve the clustering accuracy of the target image set; on the other hand, performing set merging processing based on the undirected graph constructed from each initial image set and the historical set label set can realize the merging processing of the initial image set from a global level based on the undirected graph, which can improve the clustering accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which:
[0016] Figure 1 It is a flowchart of an exemplary embodiment of an image clustering method shown in the present application;
[0017] Figure 2 yes Figure 1 A flow chart of an exemplary embodiment of step S130 in the image clustering method is shown;
[0018] Figure 3 It is a schematic diagram of the effect of an undirected graph based on an image clustering method shown in this application;
[0019] Figure 4 yes Figure 1 A flow chart of an exemplary embodiment of step S140 in the image clustering method is shown;
[0020] Figure 5 is a block diagram of an image clustering device shown in an exemplary embodiment of the present application;
[0021] Figure 6 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application;
[0022] Figure 7 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0023] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It will be appreciated that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some but not all structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the art without making creative work are within the scope of protection of the present application.
[0024] For details, please refer to Figure 1 , Figure 1 It is a flowchart of an exemplary embodiment of the image clustering method shown in the present application.
[0025] The execution subject of the image clustering method may be a terminal device or a server or other processing device, wherein the terminal device may be a user equipment (UE), a computer, a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The execution subject of the image clustering method may also be an image clustering device. In some possible implementations, the image clustering method may be implemented by a processor calling computer-readable instructions stored in a memory.
[0026] In the embodiment of the present application, the image clustering device is used as the execution subject for description. Specifically, the image clustering method of this embodiment includes the following steps:
[0027] Step S110: performing image clustering processing on the at least two acquired images to obtain a plurality of initial image sets.
[0028] The initial image set includes images after preliminary clustering.
[0029] As an example, the image clustering device can perform feature extraction processing on the acquired images to obtain the object features in each image, and perform clustering processing on each image according to the object features of each image to obtain multiple initial image sets. For example, clustering is performed according to the object features of r images to obtain m initial image sets ProfileSet={profile1,profile2, ..., profilem}, where m≤r. As another example, the image clustering device can also divide the images into multiple domains according to the preset spatiotemporal rules, and perform image clustering processing on the images in each domain. Among them, the preset spatiotemporal rules can be image division according to the acquisition location, for example, the images collected in the A city area are determined to the domain corresponding to the A city, and the images collected in the B city area are determined to the domain corresponding to the B city. The preset spatiotemporal rules can also be image division according to the acquisition time, for example, the images collected by device a at 9 o'clock-12 o'clock are determined to one domain, and the images collected by device a at 1 o'clock-8 o'clock are determined to another domain. It should be noted that the image clustering method can be K-means clustering, hierarchical clustering, spectral clustering, etc.
[0030] Step S120 , determining a historical cluster set matching the target object of each image from the acquired historical cluster set library.
[0031] The historical cluster collection library includes historical cluster collections, and the historical cluster collections include historical images.
[0032] The target object is also the main identifiable object in the image. For example, there are objects 1, 2, and 3 in the image. The image clustering device of the embodiment of the present application can determine that object 3 is the target object in the image by performing object recognition processing on the acquired image.
[0033] The image clustering device determines the historical clustering set that matches the target object in each image from the acquired historical clustering set library. It can be understood that the image clustering device determines from the historical images in the historical clustering set library whether there is a historical object that is the same object as the target object in the currently acquired image. If so, the historical clustering set where the corresponding historical image is located is determined as the historical clustering set that matches the target object in the image. Specifically, the image clustering device matches the image with each historical image in the historical clustering set library to obtain a matching result. In response to the matching result indicating a match, the historical clustering set where the corresponding historical image is located is determined as the historical clustering set that matches the target object in the image.
[0034] Taking into account the situation that a historical object in a historical clustering set may exist in multiple historical clustering sets, in order to improve the accuracy of image clustering, the embodiment of the present application can also count the number of historical images that match the current image, that is, the number of matches represented by the statistical matching results. In response to the number of matches being greater than a preset value, the historical clustering set where the corresponding matching multiple historical images are located is determined as the historical clustering set that matches the target object in the image.
[0035] Step S130 , constructing an undirected graph according to each initial image set and a historical set tag set formed by historical set tags of a historical cluster set matching the target object in the initial image set.
[0036] The historical set tag set includes the historical set tags of the historical cluster sets that match the target object in the initial image set, and the historical set tags are used to clearly obtain the historical cluster sets of the image. The historical set tags can be symbols or numerical values. For example, the historical set tag of the image including the target object c is 1, and the historical set tag of the image including the target object c is 2. It should be noted that the specific numerical value or symbol can be preset and is not limited here.
[0037] For images, images representing different target objects have different set tags, and images with the same set tag represent that the corresponding multiple images are the same target object. It should be further explained that, for the method of determining the historical set tag, as an example, the image clustering device can match the target object in the image with the historical objects of the historical images in the historical clustering set library to determine the historical set tag of the corresponding image. Specifically, the image clustering device matches the image with each historical image in the historical clustering set library to obtain a matching result, and in response to the matching result representing a match, the historical cluster set where the corresponding historical image is located is determined as the historical cluster set that matches the target object in the image, and the historical set tag corresponding to the historical cluster set that matches the target object in the image is determined as the historical set tag of the corresponding image. As another example, the image clustering device can also determine the historical set tag of the corresponding image through different systems. Specifically, different systems correspond to different historical cluster sets. For example, system 1 corresponds to historical cluster set 1, and system 2 corresponds to historical cluster set 2. There are differences between historical cluster set 1 and historical cluster set 2. System 1 matches the acquired image with the historical images in historical cluster set 1 to obtain a matching result. In response to the matching result indicating a match, the historical cluster set where the corresponding historical image is located is determined as the historical cluster set that matches the target object in the image, and the historical set tag corresponding to the historical cluster set that matches the target object in the image is determined as the historical set tag of the corresponding image. System 2 matches the acquired image with the historical images in historical cluster set 2 to obtain a matching result. In response to the matching result indicating a match, the historical cluster set where the corresponding historical image is located is determined as the historical cluster set that matches the target object in the image, and the historical set tag corresponding to the historical cluster set that matches the target object in the image is determined as the historical set tag of the corresponding image.
[0038] An undirected graph consists of vertices and undirected edges connecting two vertices.
[0039] The image clustering device constructs an undirected graph based on the historical set tag set formed by the historical set tags of each initial image set and the historical cluster set matching the target object in the initial image set. As an example, the image clustering device can construct an undirected graph based on the historical set tag set formed by the historical set tags of each initial image set and the historical cluster set matching the target object in the initial image set using a drawing tool. The drawing tool can be the matplotlib library in Python, the JFreeChart library in Java, or D3.js in JavaScript. As another example, the image clustering device can also construct an undirected graph based on each initial image set and the historical set tag set corresponding to the initial image set using a graph computing tool in a distributed environment. The distributed environment can be Spark.
[0040] Step S140 , performing set merging processing on each initial image set based on the undirected graph to obtain a target image set.
[0041] As an example, the image clustering device can use a distributed computing model to perform a set merging process on the initial image set in the undirected graph. As another example, the image clustering device can calculate the minimum growth tree of the undirected graph, and determine the area where the minimum growth number is located as a subgraph, and then merge the initial image set according to the inter-class difference between each subgraph to obtain the target image set. Specifically, two subgraphs whose inter-class difference is less than or equal to the difference threshold are merged, and the initial image sets in the merged two subgraphs are merged.
[0042] It can be seen that the image clustering method of the embodiment of the present application performs image clustering processing on at least two acquired images to obtain multiple initial image sets; determines the historical clustering set matching the target object of each image from the acquired historical clustering set library; constructs an undirected graph based on the historical set label set formed by the historical set labels of each initial image set and the historical clustering set matching the target object in the initial image set; performs set merging processing on each initial image set based on the undirected graph to obtain the target image set. On the one hand, when determining the target image set based on the initial image set obtained by the current clustering, referring to the set label of the historical clustering set to which the target object in each image belongs can improve the clustering accuracy of the target image set; on the other hand, performing set merging processing based on the undirected graph constructed from each initial image set and the historical set label set corresponding to the initial image set can improve the clustering accuracy.
[0043] Based on the above examples, please continue to refer to Figure 2 , Figure 2 yes Figure 1 The flowchart of an exemplary embodiment of step S130 in the image clustering method is shown. Specifically, the process of step S130 constructing an undirected graph based on the historical set tag set formed by the historical set tags of each initial image set and the historical cluster set matched by the target object in the initial image set also includes the following steps:
[0044] Step S210, traversing each historical set tag set to determine the association relationship between each initial image set.
[0045] The historical set tag set includes historical set tags corresponding to each initial image set, that is, historical set tags of historical cluster sets matching the target object in the initial image set.
[0046] The image clustering device of the embodiment of the present application uses a graph computing tool in a distributed environment to construct an undirected graph. Specifically, the image clustering device determines the data structure used to construct the undirected graph. Among them, the data structure includes vertices represented by an elastic distributed data set RDD and undirected edges represented by an elastic distributed data set RDD, the vertex RDD is a set of key-value pairs of vertex attributes, and the undirected edge RDD is a set of three tuples of two vertices and edge attributes. It should be noted that the edge attribute is also the association relationship in the embodiment of the present application, and the vertex is also the initial image set in the embodiment of the present application. For the determination of the undirected edge, the image clustering device traverses each historical set tag set to determine the association relationship between each initial image set. Exemplarily, the image clustering device uses the currently traversed historical set tag set as the first historical set tag set, and uses other historical set tag sets as the second historical set tag set, and then determines whether the first historical set tag set and the second historical set tag set have the same historical set tag, and if so, it is determined that the initial image set corresponding to the first historical set tag set and the initial image set corresponding to the second historical set tag set have an association relationship.
[0047] For example, the historical collection label set LabelSet={label1, label2} corresponding to the initial image set profile1, the historical collection label set LabelSet={label2, label3} corresponding to the initial image set profile2, the historical collection label set LabelSet={label3} corresponding to the initial image set profile3, the historical collection label set LabelSet={label1} corresponding to the initial image set profile4, the historical collection label set LabelSet={label4} corresponding to the initial image set profile5, and the historical collection label set LabelSet={label4} corresponding to the initial image set profile6.When traversing the historical set label set corresponding to the initial image set profile1, it can be determined that the historical set label set LabelSet={label2, label3} corresponding to the initial image set profile2 and the historical set label set LabelSet={label1} corresponding to the initial image set profile4 have the same historical set label as the historical set label set corresponding to the initial image set profile1. Specifically, the historical set label set LabelSet={label1, label2} corresponding to the initial image set profile1 and the historical set label set LabelSet={label2, label3} corresponding to the initial image set profile2 have the same historical set label label2, and the historical set label set LabelSet={label1, label2} corresponding to the initial image set profile1 and the historical set label set LabelSet={label1} corresponding to the initial image set profile4 have the same historical set label label1, thereby determining that the initial image set profile1 is associated with the initial image set profile2 and the initial image set profile4 respectively; when traversing the historical set label set corresponding to the initial image set profile2, it can be determined that the historical set label set LabelSet={label2, label3} corresponding to the initial image set profile1 label3}, the historical collection label set LabelSet={label1, label2} corresponding to the initial image set profile3 has the same historical collection label as the historical collection label set LabelSet={label3} corresponding to the initial image set profile2. Specifically, the historical collection label set LabelSet={label2, label3} corresponding to the initial image set profile2 has the same historical collection label label2 as the historical collection label set LabelSet={label1, label2} corresponding to the initial image set profile1, and the historical collection label set LabelSet={label2, label3} corresponding to the initial image set profile2 has the same historical collection label label3 as the historical collection label set LabelSet={label3} corresponding to the initial image set profile3. The historical collection label set LabelSet={label3} corresponding to the initial image set profile3 has the same historical collection label label3 as the historical collection label set LabelSet={label2, label3} corresponding to the initial image set profile2.The historical set label set LabelSet={label1} corresponding to the initial image set profile4 and the historical set label set LabelSet={label1, label2} corresponding to the initial image set profile1 have the same historical set label label1. The historical set label set LabelSet={label4} corresponding to the initial image set profile5 and the historical set label set LabelSet={label4} corresponding to the initial image set profile6 have the same historical set label label4. It can be seen that the initial image set profile1 and the initial image set profile2 are associated, the initial image set profile2 and the initial image set profile3 are associated, the initial image set profile1 and the initial image set profile4 are associated, and the initial image set profile5 and the initial image set profile6 are associated.
[0048] Step S220: determine the association relationship as an undirected edge.
[0049] Continuing with the example in step S210, the image clustering device establishes a connection between the initial image set profile1 and the initial image set profile2, and obtains an undirected edge between the initial image set profile1 and the initial image set profile2; establishes a connection between the initial image set profile2 and the initial image set profile3, and obtains an undirected edge between the initial image set profile2 and the initial image set profile3; establishes a connection between the initial image set profile1 and the initial image set profile4, and obtains an undirected edge between the initial image set profile1 and the initial image set profile4; establishes a connection between the initial image set profile5 and the initial image set profile6, and obtains an undirected edge between the initial image set profile5 and the initial image set profile6.
[0050] Step S230: taking each initial image set as a vertex.
[0051] The image clustering device uses the initial image set as the vertices of constructing an undirected graph, that is, the structural data.
[0052] Step S240, constructing an undirected graph based on the undirected edges and vertices.
[0053] The image clustering device constructs an undirected graph based on undirected edges and vertices. Exemplarily, the image clustering device may input the undirected edges and vertices into the GraphX library to construct an undirected graph, thereby obtaining an undirected graph. It should be noted that the Graph.fromEdges or Graph.fromEdgeTuples method provided by the GraphX library may be used to construct an undirected graph.
[0054] Details can be participated Figure 3 , Figure 3 is an undirected graph constructed according to the example in step S210, including undirected graph vertices formed by initial image sets profile1, profile2, profile3, profile4, profile5, and profile6, and undirected edges between initial image sets profile1 and profile2, undirected edges between initial image sets profile2 and profile3, undirected edges between initial image sets profile1 and profile4, and undirected edges between initial image sets profile5 and profile6.
[0055] It can be seen that the image clustering method of the embodiment of the present application determines the association relationship between each initial image set by traversing each historical set tag set; determines the association relationship as an undirected edge; uses each initial image set as a vertex; and constructs an undirected graph based on the undirected edges and vertices. In this way, a more comprehensive undirected graph is constructed, and the distributed environment Spark is used in the process of undirected graph construction, which can improve the efficiency of undirected graph construction.
[0056] Based on the above examples, please continue to refer to Figure 4 , Figure 4 yes Figure 1 The flowchart of an exemplary embodiment of step S140 in the image clustering method is shown. Specifically, step S140 performs set merging processing on each initial image set based on an undirected graph, and the process of obtaining the target image set also includes the following steps:
[0057] Step S410, segmenting the undirected graph according to the attribute information of each vertex in the undirected graph to obtain at least one subgraph.
[0058] The attribute information can be the degree of the vertex, that is, the number of edges connected to each vertex, or the connected components of each vertex, that is, the connection between vertices in an undirected graph. It should be noted that the connected component refers to the maximal connected subgraph of an undirected graph. For a non-connected undirected graph, it can have multiple connected components.
[0059] As an example, the image clustering device may partition the undirected graph according to the connected components of each vertex in the undirected graph to obtain at least one subgraph. Specifically, the image clustering device calculates the connected components of each vertex in the undirected graph, and determines the area where the vertices with the same connected components in the undirected graph are located as the subgraph. It should be noted that the image clustering device of the embodiment of the present application may calculate the connected components of each vertex by using depth-first search, breadth-first search, union-find algorithm, etc. It should be further noted that for large amounts of data, the image clustering device may also use the connectedComponents method provided by the distributed environment SaprkGraphX library to calculate the connected components of the vertices in the undirected graph, and then the connected components of the vertices may be viewed by calling the vertices method on the Graph object through Saprk or using the collect method. Please refer to Figure 3 , Figure 3 The initial image set {profilei, i=1, 2, 3, 4} in has the same connected components, and the initial image set {profilei, i=5, 6} has the same connected components.
[0060] Step S420: merging the initial image sets in each sub-image to obtain a target image set.
[0061] The target image set refers to the image set obtained by merging the initial image set.
[0062] After determining the connected components of each vertex, the image clustering device merges the initial image sets corresponding to the connected components representing the same target object to obtain the target image set. Specifically, the image clustering device aggregates the images in each initial image set of the subgraph to obtain the aggregated image set corresponding to the subgraph; and deduplicates the images in the aggregated image set to obtain the target image set.
[0063] It can be seen that the image clustering method of the embodiment of the present application divides the undirected graph according to the attribute information of each vertex in the undirected graph to obtain at least one subgraph; and merges the initial image sets in each subgraph to obtain the target image set. On the one hand, by dividing the undirected graph according to the attribute information of each vertex in the undirected graph, it is possible to obtain accurately divided subgraphs, and then when merging based on the initial image sets in the subgraphs, the clustering accuracy of the target image set is improved. On the other hand, by merging sets through undirected graphs, there is no need to pay attention to the change of set labels and the order of set merging, and in the process of set merging, sets are merged according to connected components, avoiding the problem of data inconsistency in the process of set merging.
[0064] Figure 5 FIG. 1 is a block diagram of an image clustering device shown in an exemplary embodiment of the present application. Figure 5As shown, the exemplary image clustering device 500 includes: an acquisition module 510, a matching module 520, a construction module 530 and a merging module 540. Specifically:
[0065] The acquisition module 510 is used to perform image clustering processing on the at least two acquired images to obtain multiple initial image sets.
[0066] The matching module 520 is used to determine the historical clustering set that matches the target object of each image from the acquired historical clustering set library.
[0067] The construction module 530 is used to construct an undirected graph according to each initial image set and a historical set tag set formed by historical set tags of a historical cluster set matching a target object in the initial image set.
[0068] The merging module 540 is used to perform set merging processing on each initial image set based on an undirected graph to obtain a target image set.
[0069] In this exemplary image clustering device, image clustering processing is performed on at least two acquired images to obtain multiple initial image sets; a historical cluster set matching the target object of each image is determined from the acquired historical cluster set library; an undirected graph is constructed based on the historical set label set formed by the historical set labels of each initial image set and the historical cluster set matching the target object in the initial image set; and a set merging processing is performed on each initial image set based on the undirected graph to obtain a target image set. On the one hand, when determining the target image set based on the initial image set obtained by the current clustering, the set label of the historical cluster set to which the target object in each image belongs is referred to, so that the clustering accuracy of the target image set can be improved; on the other hand, the set merging processing is performed based on the undirected graph constructed based on each initial image set and the historical set label set corresponding to the initial image set, so that the merging processing of the initial image set from a global level is realized according to the undirected graph, which can improve the clustering accuracy.
[0070] The functions of each module can be found in the embodiment based on the image clustering method, which will not be described in detail here.
[0071] In order to implement the image clustering method in the above embodiment, the present application proposes another electronic device. Figure 6 , Figure 6 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application.
[0072] The electronic device 600 includes a memory 601 and a processor 602 , wherein the memory 601 and the processor 602 are coupled.
[0073] The memory 601 is used to store program data, and the processor 602 is used to execute the program data to implement the image-based clustering method of the above embodiment.
[0074] In this embodiment, the processor 602 may also be referred to as a CPU (Central Processing Unit). The processor 602 may be an integrated circuit chip having signal processing capabilities. The processor 602 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor 602 may also be any conventional processor, etc.
[0075] The present application also provides a computer-readable storage medium, such as Figure 7 As shown, the computer-readable storage medium 700 is used to store program data 701. When the program data 701 is executed by the processor, it is used to implement the image-based clustering method in the method embodiment of the present application.
[0076] The method involved in the embodiment of the image clustering method of the present application, when implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a device, such as a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0077] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An image clustering method, characterized in that: The method comprises: Performing image clustering processing on at least two acquired images to obtain multiple initial image sets; Determine a historical clustering set matching the target object of each image from the acquired historical clustering set library; Constructing an undirected graph according to each initial image set and a historical set label set formed by historical set labels of a historical cluster set matching a target object in the initial image set; Based on the undirected graph, each initial image set is subjected to set merging processing to obtain a target image set.
2. The image clustering method according to claim 1, characterized in that: The step of performing set merging processing on each initial image set based on the undirected graph to obtain a target image set comprises: Segment the undirected graph according to the attribute information of each vertex in the undirected graph to obtain at least one subgraph; The initial image sets in each sub-image are merged to obtain the target image set.
3. The image clustering method according to claim 2, characterized in that: The attribute information includes connected components, and the step of segmenting the undirected graph according to the attribute information of each vertex in the undirected graph to obtain at least one subgraph includes: Calculate the connected components of each vertex in the undirected graph; The region where the vertices of the same connected components in the undirected graph are located is determined as the subgraph.
4. The image clustering method according to claim 2, characterized in that: The step of merging the initial image sets in each sub-image to obtain the target image set comprises: Aggregating the images in the initial image set corresponding to the sub-image to obtain a summarized image set corresponding to the sub-image; The images in the summary image set are deduplicated to obtain the target image set.
5. The image clustering method according to claim 1, characterized in that: The step of constructing an undirected graph based on each initial image set and a historical set tag set formed by historical set tags of a historical cluster set matching a target object in the initial image set comprises: Traversing each historical set tag set to determine the association relationship between the initial image sets; Determine the association relationship as an undirected edge; Each initial image set is taken as a vertex; The undirected graph is constructed based on the undirected edges and the vertices.
6. The image clustering method according to claim 5, characterized in that: The step of determining the association relationship between the initial image sets comprises: Determine whether the currently traversed first history set mark set and other second history set mark sets have the same history set mark; If so, it is determined that there is an association relationship between the initial image set corresponding to the first historical collection mark set and the initial image set corresponding to the second historical collection mark set.
7. The image clustering method according to claim 1, characterized in that: The step of determining the historical cluster set matching the target object of each image from the acquired historical cluster set library comprises: Matching the image with each historical image in the historical clustering set library to obtain a matching result; In response to the matching result indicating a match, the historical cluster set in which the corresponding historical image is located is determined as the historical cluster set that matches the target object in the image.
8. The image clustering method according to claim 1, characterized in that: The step of performing image clustering processing on the at least two acquired images to obtain a plurality of initial image sets comprises: Perform feature extraction processing on each image to obtain object features of each image; Clustering is performed on each image according to the object features of each image to obtain a plurality of initial image sets.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: include: Program data is stored, and when the program data is executed by a processor, it is used to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Image clustering method and device
CN112949710A
Image classification method and device, equipment and storage medium
CN114926677A