A method, apparatus, server, and storage medium for facial image clustering

By optimizing the image acquisition device through region division and centroid comparison, the problems of high time complexity and low accuracy in large-scale face image clustering are solved, achieving efficient and accurate clustering results.

CN114078269BActive Publication Date: 2025-10-28ZHEJIANG UNIVIEW TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010837159.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-19
Publication Date
2025-10-28
Estimated Expiration
2040-08-19

AI Technical Summary

Technical Problem

Existing clustering algorithms suffer from high time complexity and low accuracy in processing large volumes of facial images, making it difficult to guarantee the timeliness of the data and the accuracy of the clustering.

Method used

By dividing the image acquisition device into regions, determining the target region and obtaining the face centroid, comparison is performed only within the target region to reduce the centroid comparison cardinality. Combined with multi-level clustering and centroid migration mechanism, the clustering process is optimized.

Benefits of technology

It improves the accuracy and efficiency of clustering, reduces the cardinality of centroid comparison, makes full use of cluster resources, and enhances the timeliness and accuracy of clustering results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114078269B_ABST
    Figure CN114078269B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, server, and storage medium for face image clustering. The method includes: acquiring a target face image captured by a target image collector; determining the target region where the target image collector is located, and acquiring the centroids of all faces belonging to the target region; wherein, the target region refers to any geographical region obtained after pre-dividing the image collector into regions based on partitioning rules; the face centroids are used to represent the clustered set of face images; comparing the target face image with the centroids of all faces belonging to the target region, and determining the category to which the target face belongs based on the comparison results. This application compares the target face with the face centroids belonging to the target region, which can improve the accuracy of clustering. Moreover, it avoids comparing the target face image with all face centroids during comparison clustering, thus reducing the cardinality of centroid comparison and improving the efficiency of clustering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video surveillance technology, and in particular to a method, apparatus, server, and storage medium for clustering facial images. Background Technology

[0002] With the development of internet and computer technologies, more and more data is being stored on hard drives. Companies with large amounts of user data are also accelerating their efforts to mine and reuse this data. For example, in facial image processing, a large number of facial images need to be labeled to obtain a data set of multiple snapshots of a person corresponding to a label. This data is then used to support the analysis and judgment of large amounts of data, reduce the workload of front-line police officers, and further enhance the intelligence of the public security system.

[0003] Traditional clustering algorithms, a type of unsupervised learning algorithm in the field of machine learning, group data with similar features together. However, general clustering algorithms have high time complexity, resulting in low efficiency for clustering face images. While the BIRTCH (Balanced Iterative Reducing and Clustering Using Hierarchies) algorithm has lower time complexity than general clustering algorithms, its accuracy is lower. Therefore, using traditional clustering algorithms to cluster data makes it difficult to guarantee both data timeliness and clustering accuracy. Summary of the Invention

[0004] This application provides a method, apparatus, server, and storage medium for real-time clustering of facial images to address the accuracy and real-time issues in clustering large volumes of facial data, thereby improving the speed and accuracy of clustering results.

[0005] In a first aspect, embodiments of this application provide a real-time clustering method for face images, including:

[0006] Acquire the target face image captured by the target image acquisition device;

[0007] The target region where the target image acquisition device is located is determined, and the centroids of all faces belonging to the target region are obtained; wherein, the target region refers to any geographical region obtained after the image acquisition device is pre-divided into regions based on the partitioning rules; the face centroids are used to represent the set of face images that have been clustered;

[0008] The target face image is compared with the centroids of all faces belonging to the target region, and the category to which the target face belongs is determined based on the comparison results.

[0009] Secondly, embodiments of this application provide a face image clustering device, comprising:

[0010] The image acquisition module is used to acquire the target face image captured by the target image collector;

[0011] The first location determination and centroid acquisition module is used to determine the target region where the target image collector is located and to acquire the centroids of all faces belonging to the target region; wherein, the target region refers to any geographical region obtained after the image collector is pre-divided into regions based on the division rules; the face centroid is used to represent the set of face images that have been clustered.

[0012] The first type determination module is used to compare the target face image with the centroids of all faces belonging to the target region, and determine the category to which the target face belongs based on the comparison results.

[0013] Thirdly, embodiments of this application also provide a server, including:

[0014] One or more processors;

[0015] Storage device for storing one or more programs.

[0016] When one or more programs are executed by one or more processors, the one or more processors implement the face image clustering method as described in any embodiment of this application.

[0017] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the face image clustering method as described in any embodiment of this application.

[0018] In this embodiment, after acquiring the target face image, the target region where the target image collector is located is determined, and the centroids of all faces belonging to the target region are acquired. Then, the target face image is compared with the centroids of all faces in the target region to determine the category to which the target face belongs. Comparing the target face with the centroids of faces belonging to the target region improves the accuracy of clustering. Furthermore, this comparison avoids comparing the target face image with all face centroids, thus reducing the cardinality of the centroid comparison and improving the efficiency of clustering. Attached Figure Description

[0019] Figure 1a This is a flowchart illustrating the face image clustering method according to the first embodiment of this application;

[0020] Figure 1b This is a schematic diagram showing the region division of each image acquisition device according to the first embodiment of this application;

[0021] Figure 2This is a flowchart illustrating the face image clustering method according to the second embodiment of this application;

[0022] Figure 3 This is a logical flowchart of the face image clustering method according to the third embodiment of this application;

[0023] Figure 4 This is a flowchart illustrating the face image clustering method according to the fourth embodiment of this application;

[0024] Figure 5 This is a schematic diagram of the structure of the face image clustering device according to the fifth embodiment of this application;

[0025] Figure 6 This is a schematic diagram of the server structure according to the sixth embodiment of this application. Detailed Implementation

[0026] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present application are shown in the drawings, not all structures.

[0027] Figure 1a This is a flowchart of a face image clustering method provided according to the first embodiment of this application. This embodiment is applicable to situations where real-time face image clustering is required. The method can be executed by a face image clustering device, which can be implemented in software and / or hardware and can be integrated into a server cluster.

[0028] Existing clustering methods suffer from exponentially increasing processing time when dealing with large datasets. Reducing the number of training iterations sacrifices significant accuracy. Furthermore, clustering requires loading all centroid data into memory for comparison, leading to low efficiency. To address these issues, the inventors have creatively proposed the face clustering method described in this application. Since this face image clustering method is applied to a server cluster, storing the full centroid data on each server node in a cluster environment would inevitably waste memory. Additionally, ensuring synchronization of newly added centroids across the cluster is difficult. Therefore, the data is distributed across different server nodes according to fixed rules.

[0029] In one optional implementation, firstly, the image acquisition devices are divided into regions based on partitioning rules. Specifically, each image acquisition device can be divided into regions according to its geographical location information, resulting in at least one geographical region. Each geographical region is then numbered, and the positional relationships between the geographical regions are recorded. For example, see [link to example]. Figure 1bThe diagram illustrates the division of the image acquisition devices into regions, including 25 geographical regions numbered 1001-1025. It should be noted that each geographical region contains at least one image acquisition device, and image acquisition devices within the same geographical region share the region's number.

[0030] Secondly, after dividing the geographical regions, it is necessary to ensure that the number of centroids within each region is relatively equal. In implementation, optionally, for any given geographical region, based on a preset centroid number threshold and the face centroids pre-determined from the face image acquisition records of each image acquisition device within that geographical region, the face centroids belonging to that geographical region are determined, and these face centroids are saved to the cluster's database. The number of face centroids belonging to a single geographical region can be manually configured. The process of determining face centroids based on the face image acquisition records of each image acquisition device within that geographical region includes: clustering the face images included in the acquisition records of each image acquisition device to obtain multiple face centroids. For example, for 100 face images acquired by a single image acquisition device, clustering reveals that these 100 face images belong to 10 people. Therefore, the 100 images are divided into 10 groups, each group corresponding to one face centroid, resulting in 10 face centroids to represent the facial feature information of these 10 people.

[0031] For example, targeting Figure 1b In the geographic region numbered 1009, initially, the image acquisition information of the area covered by 1 / 4 of this region (parameters can be configured and adjusted to other proportions) is extracted, and the centroid data corresponding to the capture records of these image acquisition devices are added to region numbered 1009. After adding, the number of centroids in region numbered 1009 is counted and compared with the centroid number threshold X. If it is less than X, the centroid data corresponding to the image acquisition devices covered by the next 1 / 4 area is added. This process is repeated until the number of centroids in region numbered 1009 is greater than X, at which point the centroid data of the next geographic region is divided. After the division is completed, it is persisted to the database for storage.

[0032] It should be noted that, in order to divide the image acquisition devices more reasonably, custom division strategies and manual modification of area division data can be used. Custom division strategies can include dividing areas based on map data and road network information.

[0033] Finally, to ensure that adjacent regions are located on the same server as much as possible, the storage method of regions and their associated data in the cluster is flexibly partitioned based on the actual number of clusters and the region numbers, with regions with adjacent numbers distributed on the same node. Optionally, the number of geographical regions M and the number of server nodes L in the server cluster are used, and the quotient of M and L is used as the number of regions allocated to each server node, thereby determining the server node to which each geographical region belongs. For example, regions 1001-1005 are assigned to server node node1, 1006-1010 to node2, and so on, thus ensuring that the number of regions is evenly distributed across each server node.

[0034] It should be noted that the above allocation operation realizes data clustering, which facilitates the reduction of centroid cardinality during subsequent comparison and clustering.

[0035] In the aforementioned technologies, such as Figure 1a As shown, the face image clustering method specifically includes the following process:

[0036] S101. Obtain the target face image captured by the target image collector.

[0037] The image acquisition device can be a surveillance camera or other electronic device capable of capturing images.

[0038] S102. Determine the target area where the target image acquisition device is located, and obtain the centroid of all faces belonging to the target area.

[0039] The target region refers to any geographical region obtained after the image acquisition device is divided into regions based on the division rules in advance. For example, the target region is the geographical region numbered 1009. In this embodiment of the application, the average feature information after fusing the feature information of multiple face images of the same person is called the face centroid. The face centroid can express the feature information of a person's face. Usually, a person's face images have the same face centroid. Therefore, the face centroid can be used to represent the set of face images that have been clustered.

[0040] Since image collectors within the same region share the region ID obtained from that region, the target region of the image collector can be determined based on the region ID used by the target image collector, thereby obtaining the centroids of all faces belonging to that target region. Because the centroids of faces from each region are stored in the cluster database, the centroids of all faces belonging to the target region can be retrieved from the database and stored in the memory of the target server node to which the target region belongs, according to a preset storage format. It should be noted that loading the face centroid data belonging to the target region into the server memory improves the efficiency of subsequent comparison and clustering. Furthermore, storing the face centroid data in memory according to a preset format further ensures faster determination of comparison results.

[0041] S103. Compare the target face image with the centroids of all faces belonging to the target region, and determine the category of the target face based on the comparison results.

[0042] In one optional implementation, when comparing the target face image with the centroids of all faces belonging to the target region, the similarity between the target face image and the centroids can be calculated. For example, the Euclidean distance or cosine distance between the target face image and the centroids can be calculated. Based on the similarity, it can be determined whether there is a target face centroid that matches the target face image. For example, face centroids with a similarity greater than a preset threshold can be used as target face centroids. If a target face centroid that matches the target face image exists, then the target face image and the target face centroid are determined to belong to the same type. It should be noted that if an image capture device in the target region captures a target face image, it indicates that the target person appears in the target region. Other image capture devices in the target region may have already captured the target person, meaning that there may be a corresponding face centroid in the target region. Therefore, comparing and clustering the face centroids belonging to this region with the target face image can improve the accuracy of clustering.

[0043] In this embodiment, region partitioning is achieved to divide the centroid data into regions. After acquiring the target face image, the target region where the target image acquisition device is located is determined, and the centroids of all faces belonging to the target region are acquired. The target face image is then compared with the centroids of the faces in the target region to determine the category to which the target face belongs. This comparison of the target face with the centroids of faces belonging to the target region not only improves the accuracy of clustering but also avoids comparing the target face image with all face centroids during clustering, thus reducing the cardinality of centroid comparisons, decreasing invalid comparisons, and improving clustering efficiency.

[0044] Figure 2 This is a flowchart of a face image clustering method according to a second embodiment of this application. This embodiment is an optimization based on the above embodiment. See [link to flowchart]. Figure 2 The method includes:

[0045] S201. Obtain the target face image captured by the target image collector.

[0046] S202. Determine the target area where the target image acquisition device is located, and obtain the centroid of all faces belonging to the target area.

[0047] The target region refers to any geographical region obtained after the image acquisition device is pre-divided according to the division rules; the face centroid is used to represent the set of face images that have been clustered.

[0048] The process of obtaining the centroids of all faces belonging to the target area includes: obtaining the centroids of all faces belonging to the target area or related areas from the database, and storing the centroids in the memory of the target server node to which the target area belongs according to a preset storage format.

[0049] Furthermore, in addition to facial feature data, the face centroid also includes at least structured attribute information; the structured attribute information includes at least one of the following: gender, age group, skin color, and whether glasses are worn. Accordingly, when storing the face centroid in the server node's memory, optionally, the overall data storage uses a key-value pair approach. For example, taking two structured attributes as examples, it is stored in the following format: Map <key1,Map<key2,date> >, where key1 is the first type of structured attribute, such as male or female; key2 is the second type of structured attribute, such as whether or not someone wears glasses; data is the characteristic information stored in the centroid and other necessary information.

[0050] S203. Compare the target face image with the centroids of all faces belonging to the target region.

[0051] To reduce the number of centroids to compare, the acquired facial centroids can be filtered by comparing structured attribute information. Then, the filtered centroid data can be compared. For example, after the target face image is analyzed by the collector, structured attribute information such as gender and whether the person is wearing glasses is extracted. If real-time data analysis indicates that the image is of a woman, comparing only the centroids of those already identified as female will undoubtedly increase the probability of a successful match.

[0052] In specific implementation, the structured attribute information included in the target face image is first obtained; the structured attribute information included in the target face image is compared with the structured attribute information of each face centroid, and face centroids with the same comparison result are selected; the target face image is then compared with the selected face centroids in turn. If a target face centroid that matches the target face image exists, it is determined that the target face image and the target centroid belong to the same type. In this embodiment, the face centroid also includes label data representing the type. After determining the target face centroid that matches the target face image, the label included in the target face centroid is added to the target face image to indicate that the two belong to the same type.

[0053] S204. Determine whether the category of the target face has been determined. If not, proceed with S205-S206.

[0054] S205. Based on the preset area range parameters, determine the associated areas of the target area and obtain the centroid data of all faces belonging to the associated areas.

[0055] The associated region includes geographical areas divided into different levels based on their distance from the target region; the region extent parameter is used to determine the number of levels. For example, see [link to example]. Figure 1b If the target area is geographic region number 1009, based on the distance to region number 1009, geographic regions numbered 1001-1008 can be designated as first-level geographic regions, and regions numbered 1010-1025 as second-level geographic regions. If the value of the region range parameter is equal to 1, then the associated regions of the target area are determined as first-level geographic regions, meaning the associated regions include the eight geographic regions numbered 1001-1008. Furthermore, obtaining the face centroid data of all regions belonging to the associated regions includes: obtaining the face centroid data of each geographic region (i.e., regions numbered 1001-1008) that makes up the associated regions.

[0056] Specifically, the system retrieves the centroids of all faces belonging to the associated region from the database and stores them in the memory of the target server node to which the associated region belongs, according to a preset storage format. Since different geographical regions belong to different server nodes in the cluster during region partitioning, the retrieval of face centroids for each region is performed by the server node to which that region belongs. For example, regions 1001-1005 belong to server node1, and regions 1006-1008 belong to server node2. Therefore, after server node1 obtains the face centroids belonging to regions numbered 1001-1005, it saves the face centroids on server node1 according to a preset storage format, and then server node1 performs comparison according to step S206. Furthermore, if no matching target face centroid is found after comparing the target face image with the face centroids belonging to regions numbered 1001-1005, then server node2 obtains the face centroids belonging to regions numbered 1006-1008, saves the face centroids on server node2 according to a preset storage format, and then server node2 performs comparison according to step S206.

[0057] S206. Compare the target face image data with the centroid data of all faces belonging to the associated region, and determine the category to which the target face data belongs based on the comparison results.

[0058] Optionally, the target face image data is compared with the centroid data of all faces belonging to the associated region, similar to the process of comparing the target face image with the centroids of all faces belonging to the target region. Optionally, the structured attribute information included in the target face image is first obtained; the structured attribute information included in the target face image is compared with the structured attribute information of each face centroid, and face centroids with the same comparison result are selected; the target face image is then compared with the selected face centroids in turn.

[0059] In this embodiment, when no face centroid matches the target face image in the target area, the target face image is compared with face centroids in different levels of geographical areas. This achieves real-time comparison and clustering of face images captured by the collector through multi-level clustering, which can improve the accuracy and timeliness of clustering results. At the same time, during the comparison process, face centroids are filtered through the structured attribute information of the image, reducing the cardinality of centroid comparison, improving the efficiency of clustering, and making full use of cluster resources.

[0060] Figure 3 This is a flowchart illustrating the face image clustering method according to the third embodiment of this application. This embodiment is an optimization based on the above embodiment. See [link / reference]. Figure 3 The method includes:

[0061] After starting face image clustering, the initial region where the image acquisition device is located is determined, and the acquired face images are compared with the face centroids of the initial region. It is then determined whether there is a target face centroid that matches the face image, that is, whether the face image hits a target face centroid. If it does, the label data stored in the target face centroid is obtained and returned, that is, the label of the face image is determined. In this embodiment, each label represents a type, that is, images with the same label belong to the same type.

[0062] Furthermore, if the face image does not match a target face centroid, different levels of geographical regions are selected based on the initial region and preset region range parameters. The face image is then compared with the face centroids of different levels of geographical regions in turn. If the target face centroid is matched, the label it contains is returned; otherwise, the judgment continues. If the target face centroid is still not matched after the judgment is completed, a new label is added and saved to the database, which means creating a new category for the collected face image.

[0063] In this embodiment, a multi-level clustering method is used to perform real-time comparison and clustering of face images captured by the collector, which can improve the accuracy of clustering and the timeliness of clustering results.

[0064] Figure 4 This is a flowchart of a face image clustering method according to the fourth embodiment of this application. This embodiment is an optimization based on the above embodiments. See [link to flowchart]. Figure 4 The method includes:

[0065] S401. After a face centroid that matches the target face image exists in the first geographical region, if a target face image is acquired in the second geographical region, and the face centroids belonging to the second geographical region do not match the target face image, then the first acquisition time and the second acquisition time of the target face image acquired in the first geographical region and the second geographical region are determined respectively, and the spatial distance between the first geographical region and the second geographical region is determined.

[0066] S402. If the second acquisition time is later than the first acquisition time, and the spatial distance is greater than a preset threshold, then the centroid of the face matching the target face image is moved from the first geographical region to the second geographical region.

[0067] In normal life, a person's activity range cannot remain fixed in the same geographical area; they may move across regions. Generally, the distance between two areas is quite far. Furthermore, when moving from one area to the next, multiple snapshots are usually taken in the second area. Therefore, relying solely on the comparison and clustering process described in the above embodiment would inevitably result in numerous steps of expanding geographical areas at different levels for comparison and clustering, leading to a large number of unnecessary comparison processes.

[0068] Therefore, the inventors creatively proposed a centroid transfer method. Specifically, if a target face image is acquired in a first geographical region, the comparison process described in the above embodiment determines that a face centroid matching the target face image exists in the first geographical region. Simultaneously, if a target face image is acquired in a second geographical region, and the face centroids belonging to the second geographical region do not match the target face image, then the first acquisition time and the second acquisition time of the target face image acquired in the first and second geographical regions are determined, respectively, and the spatial distance between the first and second geographical regions is determined.

[0069] If the second acquisition time is later than the first acquisition time, meaning the target person corresponding to the face image has moved from the first geographical region to the second geographical region after a certain period of time, centroid migration may be necessary. Furthermore, because centroid data migration may involve data communication between server nodes, excessive frequency could affect cluster stability. Therefore, to ensure cluster stability, the spatial distance between the two regions needs to be calculated. Centroid data migration is only performed if the distance exceeds a preset threshold; that is, the centroid of the face matching the target face image is migrated from the first geographical region to the second geographical region.

[0070] In this embodiment, the centroid data divided according to the region is dynamically changed based on both time and space dimensions to reduce unnecessary centroid comparisons and improve the label hit rate.

[0071] Figure 5 This is a schematic diagram of a face image clustering device according to the fifth embodiment of this application. This embodiment is applicable to any situation requiring face image clustering. See also... Figure 5 The device includes:

[0072] Image acquisition module 501 is used to acquire the target face image captured by the target image collector;

[0073] The first location determination and centroid acquisition module 502 is used to determine the target area where the target image collector is located and acquire the centroids of all faces belonging to the target area; wherein, the target area refers to any geographical area obtained after the image collector is pre-divided into regions based on the division rules; the face centroid is used to represent the set of face images that have been clustered.

[0074] The first type determination module 503 is used to compare the target face image with the centroids of all faces belonging to the target region, and determine the category to which the target face belongs based on the comparison results.

[0075] Optionally, based on the above embodiments, the device further includes:

[0076] The second position determination and centroid acquisition module is used to determine the associated region of the target region and acquire all face centroid data belonging to the associated region if the category of the target face cannot be determined based on the face centroid of the target region.

[0077] The second type determination module is used to compare the target face image data with the centroid data of all faces belonging to the associated region, and determine the category to which the target face data belongs based on the comparison results.

[0078] Based on the above embodiments, optionally, the associated region includes geographical regions divided into different levels according to their distance from the target region; the region range parameter is used to determine the number of levels.

[0079] Optionally, based on the above embodiments, the device further includes a region division module, used for:

[0080] Based on the geographical location information of each image acquisition device, the image acquisition devices are divided into regions to obtain at least one geographical region, and the positional relationship between each geographical region is recorded; wherein, each geographical region includes at least one image acquisition device.

[0081] Based on the above embodiments, optionally, the region division module is also used for:

[0082] For any given geographic region, based on a preset centroid number threshold and the face centroids determined in advance according to the face image acquisition records of each image acquisition device in that geographic region, the face centroids belonging to that geographic region are determined and saved to the cluster's database.

[0083] Based on the number of geographical regions and the number of server nodes in the server cluster, determine the server nodes belonging to each geographical region.

[0084] Based on the above embodiments, optionally, the first / second position determination and centroid acquisition module further includes an acquisition unit, which is used for:

[0085] Retrieve the centroids of all faces belonging to the target region or related regions from the database, and save the centroids of all faces in the memory of the target server node to which the target region or related region belongs, according to the preset storage format.

[0086] Based on the above embodiments, optionally, the face centroid includes at least structured attribute information; wherein, the structured attribute information includes at least one of the following: gender, age group, skin color, and whether glasses are worn;

[0087] Correspondingly, the first type determination module is also used for:

[0088] Obtain the structured attribute information contained in the target face image;

[0089] The structured attribute information included in the target face image is compared with the structured attribute information of each face centroid, and the face centroids with the same comparison result are selected.

[0090] The target face image is compared sequentially with the centroids of the selected faces.

[0091] Optionally, based on the above embodiments, the device further includes a centroid migration module, used for:

[0092] After a face centroid that matches the target face image exists in the first geographic region, if a target face image is acquired in the second geographic region and the face centroids in the second geographic region do not match the target face image, then the first acquisition time and the second acquisition time of the target face image acquired in the first geographic region and the second geographic region are determined respectively, and the spatial distance between the first geographic region and the second geographic region is determined.

[0093] If the second acquisition time is later than the first acquisition time, and the spatial distance is greater than a preset threshold, then the centroid of the face matching the target face image will be migrated from the first geographical region to the second geographical region.

[0094] The face image clustering device provided in this application embodiment can execute the face image clustering method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of executing the method.

[0095] Figure 6 This is a schematic diagram of a server structure according to the sixth embodiment of this application. The face image clustering method of this application embodiment is applied to a server cluster, which includes multiple server nodes, and the structure of each server node is as follows. Figure 6The server includes one or more processors 602 and memory 601; the processors 602 in the server can be one or more. Figure 6 Taking a processor 602 as an example; memory 601 is used to store one or more programs; the one or more programs are executed by the one or more processors 602, causing the one or more processors 602 to implement the secure communication method as described in any one of the embodiments of this application.

[0096] The server may also include an input device 603 and an output device 604.

[0097] The processor 602, memory 601, input device 603, and output device 604 in the server can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.

[0098] The storage device 601 in the server serves as a computer-readable storage medium, which can be used to store one or more programs. These programs can be software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the application control method provided in this embodiment. The processor 602 executes various server functions and data processing by running the software programs, instructions, and modules stored in the storage device 601, thereby implementing the secure communication method described in the above embodiment.

[0099] Storage device 601 may include a stored program area and a stored data area, wherein the stored program area may store the operating system and applications required for at least one function; the stored data area may store data created based on server usage, etc. Furthermore, memory 601 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, memory 601 may further include memory remotely located relative to processor 602, and these remote memories may be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0100] Input device 603 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the server. Output device 604 may include display devices such as a display screen.

[0101] Furthermore, when one or more programs included in the aforementioned server are executed by one or more processors 602, the programs perform the following operations:

[0102] Acquire the target face image captured by the target image acquisition device;

[0103] The target region where the target image acquisition device is located is determined, and the centroids of all faces belonging to the target region are obtained; wherein, the target region refers to any geographical region obtained after the image acquisition device is pre-divided into regions based on the partitioning rules; the face centroids are used to represent the set of face images that have been clustered;

[0104] The target face image is compared with the centroids of all faces belonging to the target region, and the category to which the target face belongs is determined based on the comparison results.

[0105] Of course, those skilled in the art will understand that when one or more programs included in the above-mentioned server are executed by one or more processors 602, the programs can also perform related operations in the application control method provided in any embodiment of this application.

[0106] One embodiment of this application provides a computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to perform a secure communication method, the method comprising:

[0107] Acquire the target face image captured by the target image acquisition device;

[0108] The target region where the target image acquisition device is located is determined, and the centroids of all faces belonging to the target region are obtained; wherein, the target region refers to any geographical region obtained after the image acquisition device is pre-divided into regions based on the partitioning rules; the face centroids are used to represent the set of face images that have been clustered;

[0109] The target face image is compared with the centroids of all faces belonging to the target region, and the category to which the target face belongs is determined based on the comparison results.

[0110] Optionally, when executed by a processor, the program can also be used to perform the methods provided in any embodiment of this application.

[0111] The computer storage medium in this application embodiment can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be—but is not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable CD-ROM, optical storage device, magnetic storage device, or any suitable combination thereof. The computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0112] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit programs for use by or in connection with an instruction execution system, apparatus, or device.

[0113] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, radio frequency (RF), etc., or any suitable combination thereof.

[0114] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network (e.g., including local area networks (LANs) or wide area networks (WANs)), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0115] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the appended claims.

Claims

1. A method for clustering facial images, characterized in that, Applied to a server cluster, the method includes: Acquire the target face image captured by the target image acquisition device; The target region where the target image acquisition device is located is determined, and the centroids of all faces belonging to the target region are obtained; wherein, the target region refers to any geographical region obtained after the image acquisition device is pre-divided into regions based on the partitioning rules; the face centroids are used to represent the set of face images that have been clustered; The target face image is compared with the centroids of all faces belonging to the target region, and the category of the target face is determined based on the comparison results. The method further includes: After a face centroid that matches the target face image exists in the first geographic region, if a target face image is acquired in the second geographic region, and the face centroids belonging to the second geographic region do not match the target face image, then the first acquisition time and the second acquisition time of the target face image acquired in the first geographic region and the second geographic region are determined respectively, and the spatial distance between the first geographic region and the second geographic region is determined. If the second acquisition time is later than the first acquisition time, and the spatial distance is greater than a preset threshold, then the centroid of the face matching the target face image will be moved from the first geographical region to the second geographical region. If the category of the target face cannot be determined based on the face centroid of the target area, then the associated regions of the target area are determined according to the preset region range parameters, and all face centroid data belonging to the associated regions are obtained; the associated regions include geographical regions divided into different levels according to their distance from the target area; the region range parameters are used to determine the number of levels; The target face image data is compared with the centroid data of all faces belonging to the associated region, and the category to which the target face data belongs is determined based on the comparison results.

2. The method according to claim 1, characterized in that, The process of pre-dividing the image acquisition device into regions based on partitioning rules includes: Based on the geographical location information of each image acquisition device, the image acquisition devices are divided into regions to obtain at least one geographical region, and the positional relationship between each geographical region is recorded; wherein, each geographical region includes at least one image acquisition device.

3. The method according to claim 2, characterized in that, After obtaining at least one geographic region, the method further includes: For any given geographic region, based on a preset centroid number threshold and the face centroids determined in advance according to the face image acquisition records of each image acquisition device in that geographic region, the face centroids belonging to that geographic region are determined and saved to the cluster's database. Based on the number of geographical regions and the number of server nodes in the server cluster, determine the server nodes belonging to each geographical region.

4. The method according to claim 3, characterized in that, The process of obtaining the centroids of all faces belonging to the target region or related regions includes: Retrieve the centroids of all faces belonging to the target region or related regions from the database, and save the face centroids in the memory of the target server node to which the target region or related region belongs, according to a preset storage format.

5. The method according to any one of claims 1-4, characterized in that, The facial centroid includes at least structured attribute information; wherein the structured attribute information includes at least one of the following: gender, age group, skin color, and whether glasses are worn; Accordingly, the target face image is compared with the centroids of all faces belonging to the target region, including: Obtain the structured attribute information contained in the target face image; The structured attribute information included in the target face image is compared with the structured attribute information of each face centroid, and the face centroids with the same comparison result are selected. The target face image is compared sequentially with the centroids of the selected faces.

6. A face image clustering device, characterized in that, include: The image acquisition module is used to acquire the target face image captured by the target image collector; The first location determination and centroid acquisition module is used to determine the target area where the target image collector is located and acquire the centroids of all faces belonging to the target area; wherein, the target area refers to any geographical area obtained after the image collector is pre-divided into regions based on the division rules; the face centroids are used to represent the clustered set of face images; the face centroids also include label data representing the type; The first type determination module is used to compare the target face image with the centroids of all faces belonging to the target region, and determine the category of the target face based on the comparison results. The device further includes a centroid migration module for: After a face centroid that matches the target face image exists in the first geographic region, if a target face image is acquired in the second geographic region, and the face centroids belonging to the second geographic region do not match the target face image, then the first acquisition time and the second acquisition time of the target face image acquired in the first geographic region and the second geographic region are determined respectively, and the spatial distance between the first geographic region and the second geographic region is determined. If the second acquisition time is later than the first acquisition time, and the spatial distance is greater than a preset threshold, then the centroid of the face matching the target face image will be moved from the first geographical region to the second geographical region. The device further includes: The second location determination and centroid acquisition module is used to determine the associated region of the target region and acquire all face centroid data belonging to the associated region if the category of the target face cannot be determined based on the face centroid of the target region. The associated region includes geographical regions divided into different levels according to their distance from the target region. The region range parameter is used to determine the number of levels. The second type determination module is used to compare the target face image data with the centroid data of all faces belonging to the associated region, and determine the category to which the target face data belongs based on the comparison results.

7. A server, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the face image clustering method as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the face image clustering method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Information processing method and apparatus, electronic device, and storage medium

    CN109543566A

  • Face recognition method, device and equipment

    CN110348274A

  • Face image clustering method, system, product and medium

    CN110516586A