Image clustering method, apparatus and device
By dynamically adjusting strategy parameters during image clustering, the inaccuracy caused by manually configuring strategy parameters is resolved, enabling accurate clustering in different camera business scenarios.
Patent Information
- Application Number
- CN202111220791.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-20
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2041-10-20
AI Technical Summary
In existing technologies, image clustering requires manual configuration of strategy parameters, which leads to inaccurate clustering results. Furthermore, different camera business scenarios may cause the strategy parameters to be mismatched, affecting the clustering effect.
The clustering results based on the initial policy parameters determine whether the policy parameters need to be redefined. The target policy parameters are then redefined using the training dataset, and the policy parameters are dynamically adjusted to adapt to different business scenarios.
It improves the accuracy and universality of image clustering, avoids errors in clustering results, and adapts to the needs of different business scenarios.
Smart Images

Figure CN113989883B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to an image clustering method, device and equipment. BACKGROUND
[0002] Image clustering refers to identifying multiple images of a user and setting the same label for the multiple images of the same user, which is used as the unique identifier of the user. Through the unique identifier, the multiple images of the user, the attribute data of the user (i.e. data used to represent the attributes of the user, such as gender, age range, etc., which are not limited to the attribute data), the latitude and longitude information of the user, etc. can be known. When the user needs to be managed, the real-time position and walking track of the user can be analyzed through image clustering.
[0003] In order to realize image clustering, a strategy parameter (such as a similarity threshold) needs to be configured in advance, and on this basis, after obtaining an image, the face similarity between the image and the reference image of any user needs to be calculated. If the face similarity is greater than the similarity threshold, the image is clustered as the image of the user, if the face similarity is not greater than the similarity threshold, the image is not clustered as the image of the user, and the face similarity between the image and the reference image of another user is calculated, and so on.
[0004] However, in the above manner, the user needs to manually configure the strategy parameter according to experience, which may not be accurate, resulting in inaccurate clustering results based on the strategy parameter. SUMMARY
[0005] The present application provides an image clustering method, which comprises:
[0006] determining whether the user is a target user based on the classified image of the user and a reference image; wherein if the face similarity between the classified image and the reference image is greater than a first similarity threshold, and the body similarity between the classified image and the reference image is less than a second similarity threshold, it is determined that the user is a target user; wherein the classified image is clustered as the image of the user based on an initial strategy parameter, and the reference image is an image used to cluster the image of the user;
[0007] counting the target quantity of target users in all users;
[0008] determining whether the initial strategy parameter needs to be re-determined based on the target quantity;
[0009] if yes, determining a target strategy parameter by using the acquired training data set; wherein the target strategy parameter is used to replace the initial strategy parameter, so as to cluster based on the target strategy parameter.
[0010] In a possible implementation, the determining whether the user is the target user based on the classified image of the user and the reference image further includes: if a face similarity between the classified image and the reference image is greater than a first similarity threshold, and a body similarity between the classified image and the reference image is not less than a second similarity threshold, determining that the user is not the target user.
[0011] In a possible implementation, before the determining whether the user is the target user based on the classified image of the user and the reference image, the method further includes:
[0012] obtaining a first face feature model and a first body feature model from the classified image;
[0013] obtaining a second face feature model and a second body feature model from the reference image;
[0014] determining a face similarity between the classified image and the reference image based on a similarity between the first face feature model and the second face feature model;
[0015] determining a body similarity between the classified image and the reference image based on a similarity between the first body feature model and the second body feature model.
[0016] In a possible implementation, the training data set includes training data of a plurality of users; for training data of each user, the training data includes a classified image, a reference image and an associated image of the user, the associated image being an image that is not clustered as the user based on the initial strategy parameter and belongs to the user;
[0017] wherein the obtaining manner of the associated image of the user includes:
[0018] for each image in a database, if it is determined that the image is an image belonging to the user, determining the image as the associated image of the user; wherein the database is used to store images that are not successfully clustered.
[0019] In a possible implementation, the determining the image as the associated image of the user if it is determined that the image is an image belonging to the user includes:
[0020] if it is determined that the image is an image belonging to the user, and a face similarity between the image and the reference image of the user is a specified similarity, determining the image as the associated image of the user; or,
[0021] if it is determined that the image is an image belonging to the user, and a face similarity between the image and the classified image of the user is a specified similarity, determining the image as the associated image of the user.
[0022] wherein the specified similarity is less than the first similarity threshold.
[0023] In a possible implementation, the determining the target strategy parameter by using the acquired training data set comprises: retraining the initial strategy parameter by a trained target machine learning model based on training data in the training data set to obtain a target strategy parameter matched with the training data set; and the target machine learning model is a network model for outputting a strategy parameter.
[0024] wherein, when the initial strategy parameter is retrained by the target machine learning model, the classified image and the reference image in the training data are used as forward sample images in the retraining process, and the associated image in the training data is used as a reverse sample image in the retraining process.
[0025] In a possible implementation, after the target strategy parameter is determined by using the acquired training data set, the method further comprises: sending the target strategy parameter to a target camera, so that the target camera replaces the initial strategy parameter with the target strategy parameter, and clusters images collected by the target camera based on the target strategy parameter.
[0026] The present application provides an image clustering device, which comprises:
[0027] The determining module is configured to determine whether the user is a target user based on the classified image of the user and the reference image; wherein if a face similarity between the classified image and the reference image is greater than a first similarity threshold, and a body similarity between the classified image and the reference image is less than a second similarity threshold, it is determined that the user is a target user; wherein the classified image is an image of the user clustered based on an initial strategy parameter, and the reference image is an image used for clustering the image of the user.
[0028] The statistical module is configured to count a target quantity of target users in all users, and determine whether the initial strategy parameter needs to be re-determined based on the target quantity.
[0029] The generating module is configured to, if the initial strategy parameter needs to be re-determined, determine a target strategy parameter by using an acquired training data set; wherein the target strategy parameter is used to replace the initial strategy parameter, so that clustering is performed based on the target strategy parameter.
[0030] The application provides a management device, comprising a processor and a machine readable storage medium, the machine readable storage medium stores machine executable instructions capable of being executed by the processor; wherein the processor is used for executing the machine executable instructions to realize the image clustering method.
[0031] The application provides a machine readable storage medium, the machine readable storage medium stores machine executable instructions capable of being executed by a processor; wherein the processor is used for executing the machine executable instructions to realize the image clustering method.
[0032] From the above technical solutions, in the embodiment of the application, after clustering the images of the user based on the initial policy parameter, it can be judged whether the initial policy parameter needs to be re-determined based on the clustering result of the initial policy parameter, if yes, the target policy parameter can be re-determined, and the images of the user are clustered based on the target policy parameter, so as to dynamically adjust the policy parameter, generate adaptive policy parameter, and improve the accuracy and universality of image clustering, so that the clustering result based on the policy parameter is accurate and reliable, which can effectively avoid the error of the clustering result of the image, can adapt to different business scenarios, and reduce the influence of business scenarios on the image clustering effect. BRIEF DESCRIPTION OF DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the drawings needed in the description of the embodiments of the application or the prior art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the application, and other drawings can also be obtained by those skilled in the art according to these drawings.
[0034] Figure 1 is an application scenario diagram in an embodiment of the application;
[0035] Figure 2 is a flow diagram of the image clustering method in an embodiment of the application;
[0036] Figure 3 is a flow diagram of the image clustering method in an embodiment of the application;
[0037] Figure 4 is a structural diagram of the image clustering device in an embodiment of the application;
[0038] Figure 5 is a hardware structure diagram of the management device in an embodiment of the application. DETAILED DESCRIPTION
[0039] The terminology used in the description of the embodiments herein is for the purpose of describing particular embodiments only and is not intended to be limiting thereof. As used in the description of the embodiments and the claims herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It also will be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0040] It is to be understood that, although the terms first, second, third, etc. can be used herein to describe various information, the information should not be limited to these terms. These terms are only used to differentiate one piece of information from another. For example, a first information can also be termed a second information, similarly, a second information can also be termed a first information without departing from the scope of the present application. Depending on the context, the word "if' can be interpreted to mean "when" or "upon the condition of" or "in response to the determination" that a certain condition is fulfilled.
[0041] Before introducing the technical solutions of the embodiments of the present application, the technical terms related to the present application are introduced:
[0042] Image clustering: refers to identifying multiple images of a user, and setting the same label for multiple images of the same user, which is the unique identifier of the user. Through the unique identifier, the multiple images of the user, the attribute data of the user (i.e. data for representing the attributes of the user, such as gender, age range, etc.), the latitude and longitude information of the user (such as the collection position of the image) and the like are known. When the user needs to be managed, the real-time position and walking track of the user can be analyzed through image clustering.
[0043] Base image: an image obtained through information collection, such as an ID card image, etc. The base image is relatively clear, and when the base image is obtained, the base image already has identity information, and no longer needs to be clustered.
[0044] Image to be clustered: an image collected by a camera. When the image is collected by the camera, the image does not have identity information, and needs to be clustered to know the user to which the image belongs. Therefore, the image is referred to as an image to be clustered, i.e. an image that needs to be clustered.
[0045] After the image to be clustered is clustered, if the user to which the image belongs is known, i.e. the clustering of the image to be clustered is successful, the image to be clustered belongs to a certain user, then the image to be clustered becomes the cover image or the classified image of the user. If the user to which the image belongs cannot be known, i.e. the clustering of the image to be clustered fails, the image to be clustered does not belong to any user, then the image to be clustered is stored in a database, which is used to store images that have not been successfully clustered, indicating that the images in the database have not been successfully clustered.
[0046] Cover image and classified image: after image clustering is performed on the to-be-clustered image, if it is learned that the to-be-clustered image belongs to a user, it is determined whether the feature information of the to-be-clustered image meets a cover adding condition. If the cover adding condition is met, the to-be-clustered image can be used as a cover image of the user. If the cover adding condition is not met, the to-be-clustered image can be used as a classified image of the user.
[0047] For example, the cover adding condition can include a quantity limit condition, a quality limit condition, and a similarity limit condition. On this basis, the number of cover images of the user can be determined. If the number of cover images is not less than an upper limit of the number of cover images, the to-be-clustered image is used as a classified image of the user. If the number of cover images is less than the upper limit of the number of cover images, the image quality of the to-be-clustered image is determined. If the image quality is poor, the to-be-clustered image is used as a classified image of the user. If the image quality is good, the face similarity between the to-be-clustered image and a reference image is determined. If the face similarity is greater than a certain similarity threshold (hereinafter referred to as similarity threshold a), the to-be-clustered image is used as a cover image of the user. If the face similarity is not greater than the similarity threshold a, the to-be-clustered image is used as a classified image of the user.
[0048] Among them, for the quality limit condition, the image quality of the to-be-clustered image needs to be analyzed, which reflects the good or bad of the to-be-clustered image, such as based on the clarity, exposure, color and noise of the to-be-clustered image, the image quality of the to-be-clustered image is analyzed, which can be poor or good, and the way to analyze the image quality of the to-be-clustered image is not limited in the embodiments of the present application.
[0049] Reference image: the bottom library image and the cover image can be collectively referred to as a reference image, which is an image used when clustering the to-be-clustered image, that is, when clustering the to-be-clustered image, the face similarity between the to-be-clustered image and the reference image of the user needs to be determined. If the face similarity is greater than a certain similarity threshold (hereinafter referred to as similarity threshold b), it means that the to-be-clustered image belongs to the user, and if the face similarity is not greater than the similarity threshold b, it means that the to-be-clustered image does not belong to the user.
[0050] It should be noted that the similarity threshold b is less than the similarity threshold a, so that when the face similarity meets the similarity threshold b but does not meet the similarity threshold a, the to-be-clustered image is a classified image, and when the face similarity meets the similarity threshold b and the similarity threshold a, the to-be-clustered image can be a cover image.
[0051] Strategy parameters (also known as people clustering strategy parameters): When performing image clustering on images to be clustered, it is necessary to obtain strategy parameters, and then perform image clustering based on these strategy parameters. For example, the strategy parameters may include a similarity threshold b. Thus, when performing image clustering on images to be clustered, it is necessary to determine whether the facial similarity between the images to be clustered and the reference images is greater than the similarity threshold b.
[0052] Of course, besides the similarity threshold b, this strategy parameter can also include other types of parameters, without restriction. For example, the strategy parameter can also include a quality score threshold. When performing image clustering on the image to be clustered, it is necessary to determine the quality score of the image to be clustered. If the quality score is greater than the quality score threshold, then it will be determined whether the facial similarity between the image to be clustered and the reference image is greater than the similarity threshold b. If the quality score is not greater than the quality score threshold, then image clustering will not be performed on the image to be clustered.
[0053] For ease of description, this application embodiment uses the similarity threshold b as an example to illustrate the strategy parameter. Other types of parameters in the strategy parameter will not be described in this application embodiment.
[0054] See Figure 1 The diagram shown illustrates an application scenario of this application embodiment. The management device 11 can be a personal computer, terminal device, server, backend device, etc., and the type of management device 11 is not limited. Each camera ( Figure 1 (Taking three cameras as an example) These can be analog cameras or digital cameras, etc.
[0055] The management device 11 can acquire policy parameters (for ease of distinction, these policy parameters can be referred to as initial policy parameters), such as initial policy parameters manually configured by the user based on experience. The management device 11 can distribute these initial policy parameters (such as the similarity threshold b) to each camera, such as to camera 12, camera 13, and camera 14. Since the processing flow is the same for each camera, the processing flow of camera 12 will be used as an example in the following embodiments.
[0056] After the camera 12 collects the image to be clustered, the image to be clustered can be clustered based on the initial strategy parameter. For example, the face similarity between the image to be clustered and the reference image of a user is determined. If the face similarity is greater than the similarity threshold b, it means that the image to be clustered belongs to the user. If the face similarity is not greater than the similarity threshold b, it means that the image to be clustered does not belong to the user, and the face similarity between the image to be clustered and the reference image of another user is determined, and so on, until the face similarity between the image to be clustered and the reference image of a user is greater than the similarity threshold b, that is, the clustering of the image to be clustered is successful, or the face similarity between the image to be clustered and the reference image of all users is not greater than the similarity threshold b, that is, the clustering of the image to be clustered fails, and the image to be clustered is stored in a database for storing images that have not been successfully clustered, indicating that the images in the database have not been successfully clustered.
[0057] In the above manner, the initial strategy parameter needs to be manually configured by the user according to experience, which may not be accurate, resulting in inaccurate clustering results based on the initial strategy parameter. For example, when the similarity threshold b is relatively large, assuming that the image to be clustered is an image belonging to a user x, since the face similarity between the image to be clustered and the reference image of the user x is not greater than the similarity threshold b, the image to be clustered cannot be clustered as the image of the user x, that is, an incorrect clustering result is obtained.
[0058] In the above manner, the same initial strategy parameter needs to be sent to multiple cameras, that is, multiple cameras need to use the same initial strategy parameter for image clustering, but the business scenarios of different cameras may be different, such as the camera 12 is deployed in a bank, the camera 13 is deployed in a school, and the camera 14 is deployed on a highway, thereby causing the initial strategy parameter to be unable to match the business scenarios of all cameras.
[0059] For example, when the camera 12 clusters the image to be clustered based on the initial strategy parameter, a correct clustering result can be obtained, that is, the initial strategy parameter matches the business scenario "bank" of the camera 12. However, when the camera 13 clusters the image to be clustered based on the initial strategy parameter, an incorrect clustering result is obtained, that is, the initial strategy parameter does not match the business scenario "school" of the camera 13. When the camera 14 clusters the image to be clustered based on the initial strategy parameter, an incorrect clustering result is obtained, that is, the initial strategy parameter does not match the business scenario "highway" of the camera 14.
[0060] To solve the above problems, the embodiment of the present application proposes an image clustering method. After clustering the images to be clustered based on the initial strategy parameter, it is determined whether the initial strategy parameter needs to be re-determined based on the clustering result of the initial strategy parameter. If yes, the target strategy parameter is re-determined, and the images to be clustered are clustered based on the target strategy parameter, so as to dynamically adjust the initial strategy parameter, generate adaptive target strategy parameter, and improve the accuracy of image clustering.
[0061] For example, the initial strategy parameter includes a similarity threshold b. When the similarity threshold b is relatively large, the clustering result based on the similarity threshold b is not accurate, resulting in a large number of errors in the clustering result. Therefore, it is determined that the initial strategy parameter needs to be re-determined, and the target strategy parameter needs to be re-determined. The similarity threshold included in the target strategy parameter is denoted as similarity threshold c. The similarity threshold c is an accurate and reliable similarity threshold, which can improve the accuracy of image clustering. The similarity threshold c can be greater than the similarity threshold b, or the similarity threshold c can be less than the similarity threshold b.
[0062] For example, the similarity threshold c is appropriate and is an accurate and reliable similarity threshold. Assuming that the images to be clustered are images of a user x, since the face similarity between the images to be clustered and the reference images of the user x is greater than the similarity threshold c, the images to be clustered can be clustered as images of the user x, i.e., a correct clustering result is obtained. In summary, by updating the initial strategy parameter (such as the similarity threshold b) to the target strategy parameter (such as the similarity threshold c), the accuracy of image clustering is improved, the clustering result based on the strategy parameter is accurate and reliable, and errors in the clustering result of images are effectively avoided.
[0063] In the embodiment of the present application, for each camera, the camera can cluster the images to be clustered based on the initial strategy parameter. Based on this, it is determined whether the initial strategy parameter needs to be re-determined based on the clustering result of the initial strategy parameter of the camera. If yes, the target strategy parameter is re-determined for the camera, i.e., the target strategy parameter is only issued to the camera, and will not be issued to other cameras, so that the target strategy parameter is matched with the camera, can adapt to the business scenario of the camera, and reduces the influence of the business scenario on the image clustering effect.
[0064] For example, the initial strategy parameter includes a similarity threshold b. The clustering result based on the similarity threshold b of the camera 12 is relatively accurate, i.e., the number of errors in the clustering result is small. Therefore, it is determined that the initial strategy parameter does not need to be re-determined, and the target strategy parameter does not need to be re-determined for the camera 12.
[0065] The clustering result of the camera 13 based on the similarity threshold b is not accurate, so that the number of errors of the clustering result is large, and thus it can be determined that the initial strategy parameter needs to be re-determined, and the target strategy parameter 1 needs to be re-determined for the camera 13. The similarity threshold included in the target strategy parameter 1 is denoted as a similarity threshold c1, and the similarity threshold c1 is an accurate and reliable similarity threshold. Then, the target strategy parameter 1 only needs to be sent to the camera 13, and the target strategy parameter 1 is not sent to the camera 12 and the camera 14, that is, the target strategy parameter 1 is only adapted to the service scenario of the camera 13.
[0066] The clustering result of the camera 14 based on the similarity threshold b is not accurate, so that the number of errors of the clustering result is large, and thus it can be determined that the initial strategy parameter needs to be re-determined, and the target strategy parameter 2 needs to be re-determined for the camera 14. The similarity threshold included in the target strategy parameter 2 is denoted as a similarity threshold c2, and the similarity threshold c2 is an accurate and reliable similarity threshold. Then, the target strategy parameter 2 only needs to be sent to the camera 14, and the target strategy parameter 2 is not sent to the camera 12 and the camera 13, that is, the target strategy parameter 2 is only adapted to the service scenario of the camera 14.
[0067] In summary, for the target strategy parameter, it is only sent to the matched camera, rather than being sent to multiple cameras at the same time, so that the target strategy parameter can be matched with the service scenario of the camera. For example, the target strategy parameter sent to the camera 12 can be matched with the service scenario "bank" of the camera 12, the target strategy parameter sent to the camera 13 can be matched with the service scenario "school" of the camera 13, and the target strategy parameter sent to the camera 14 can be matched with the service scenario "highway" of the camera 14, so that the target strategy parameter can be matched with the service scenario of the camera.
[0068] The technical solutions of the embodiments of the present application will be described below in combination with specific embodiments.
[0069] In the embodiments of the present application, an image clustering method is provided, which can be applied to a management device. As shown in Figure 2 The method can include the following steps.
[0070] In step 201, it is determined whether a user is a target user based on a classified image of the user and a reference image. For example, the classified image can be an image of the user clustered based on an initial strategy parameter (such as the similarity threshold b), and the reference image can be an image used for clustering the image of the user.
[0071] In a possible implementation, for step 201, if the face similarity between the classified image and the reference image is greater than a first similarity threshold (such as similarity threshold b), and the body similarity between the classified image and the reference image is less than a second similarity threshold (which can be configured according to experience, and is not limited herein), it is determined that the user is the target user; or if the face similarity between the classified image and the reference image is greater than the first similarity threshold, and the body similarity between the classified image and the reference image is not less than the second similarity threshold, it is determined that the user is not the target user.
[0072] For example, the management device can obtain an initial policy parameter (such as similarity threshold b), and send the initial policy parameter to the camera, so that the camera clusters the to-be-clustered images based on the initial policy parameter, such as clustering the to-be-clustered images based on similarity threshold b. After clustering the to-be-clustered images, if it is learned that the to-be-clustered image belongs to a user, the to-be-clustered image is taken as a cover image or a classified image of the user. As can be seen, for each user, the classified image and the cover image of the user can be learned, and since the base library image of the user is known, and the base library image and the cover image are collectively referred to as a reference image, the management device can learn all the classified images and all the reference images of the user.
[0073] When the to-be-clustered images are clustered based on similarity threshold b, it is necessary to determine the face similarity between the to-be-clustered image and the reference image, and if the face similarity is greater than similarity threshold b, the to-be-clustered image will be taken as a cover image or a classified image, but if the face similarity is not greater than similarity threshold b, the to-be-clustered image will not be taken as a cover image or a classified image. As can be seen, for each user, the face similarity between the classified image of the user and the reference image of the user is greater than similarity threshold b, that is, for step 201, the face similarity between the classified image of the user and the reference image of the user can be greater than the first similarity threshold (such as similarity threshold b).
[0074] On this basis, for step 201, one of the classified images of the user can be traversed to determine the body similarity between the classified image and each reference image of the user. If at least one body similarity is less than the second similarity threshold, it is determined that the user is the target user. If all the body similarities are not less than the second similarity threshold, it is determined whether all the classified images of the user have been traversed. If yes, it is determined that the user is not the target user, and if no, another classified image of the user is traversed to determine the body similarity between the classified image and each reference image of the user, and so on, until it is determined that the user is the target user or the user is not the target user.
[0075] In summary, for each user, whether the user is a target user can be determined based on the classified image of the user and the reference image of the user, so that the target user can be found from all users.
[0076] For example, for each user, if the face similarity between the classified image and the reference image is greater than a first similarity threshold, it indicates that the face similarity represents that the classified image belongs to the user. If the body similarity between the classified image and the reference image is less than a second similarity threshold, it indicates that the body similarity represents that the classified image does not belong to the user (i.e. the body similarity is small, and the classified image should not be clustered to the user), in which case, the representation result of the face similarity may be wrong, that is, the clustering result based on the initial strategy parameter (such as the similarity threshold b) is not accurate, and the user can be taken as a target user. The target user is a user whose clustering result of the classified image may be wrong.
[0077] For each user, if the face similarity between the classified image and the reference image is greater than a first similarity threshold, it indicates that the face similarity represents that the classified image belongs to the user. If the body similarity between the classified image and the reference image is not less than a second similarity threshold, it indicates that the body similarity represents that the classified image belongs to the user. In this case, the representation result of the face similarity is accurate, that is, the clustering result based on the initial strategy parameter (such as the similarity threshold b) is accurate, and the user is not a target user.
[0078] In the above embodiment, the face similarity between the classified image and the reference image needs to be determined. For example, the face similarity between the classified image and the reference image can be determined in the following manner: a first face feature model is obtained from the classified image, and a second face feature model is obtained from the reference image, and the manner of obtaining the first face feature model and the second face feature model is not limited. For example, a sub-image of a face region is obtained from the classified image, and the feature model of the sub-image is taken as the first face feature model, and a sub-image of a face region is obtained from the reference image, and the feature model of the sub-image is taken as the second face feature model. Then, the similarity between the first face feature model and the second face feature model is determined, and the manner of determining the similarity is not limited. Then, the face similarity between the classified image and the reference image is determined based on the similarity between the first face feature model and the second face feature model, that is, the similarity between the first face feature model and the second face feature model is taken as the face similarity.
[0079] Exemplarily, for the first face feature model, when modeling the sub-image of the face region in the classified image, the feature information of the face in the sub-image can be extracted according to the deep learning algorithm, including but not limited to the features such as mouth corner, nose, eye, eyebrow, forehead, hair, etc., which can constitute the first face feature model. For example, the first face feature model is a string of binary data describing the sub-image of the face region in the classified image through the deep learning algorithm, which can be represented by a large number of feature points, and the first face feature model is not limited in this regard.
[0080] For the second face feature model, the second face feature model is a string of binary data describing the sub-image of the face region in the reference image through the deep learning algorithm, which can be represented by a large number of feature points, and the second face feature model is not limited in this regard.
[0081] Exemplarily, regarding the similarity between the first face feature model and the second face feature model, the Euclidean distance or the cosine distance algorithm can be used to determine the similarity between the first face feature model and the second face feature model. For example, the Euclidean distance between the first face feature model and the second face feature model is calculated as the similarity. For another example, the cosine distance between the first face feature model and the second face feature model is calculated as the similarity. Of course, the above is only an example of determining the similarity, which is not limited in this regard as long as the similarity can be obtained.
[0082] In the above embodiment, it is necessary to determine the body similarity between the classified image and the reference image. For example, the first body feature model is obtained from the classified image, and the second body feature model is obtained from the reference image, and the obtaining method is not limited in this regard. For example, the sub-image of the body region is obtained from the classified image, and the feature model of the sub-image is taken as the first body feature model. The sub-image of the body region is obtained from the reference image, and the feature model of the sub-image is taken as the second body feature model. Then, the similarity between the first body feature model and the second body feature model is determined. Then, the body similarity between the classified image and the reference image is determined based on the similarity between the first body feature model and the second body feature model, that is, the similarity between the first body feature model and the second body feature model as the body similarity.
[0083] Exemplarily, for the first body feature model, the first body feature model is a string of binary data describing the sub-image of the body region in the classified image through the deep learning algorithm, which can be represented by a large number of feature points, and the first body feature model is not limited in this regard.
[0084] For the second human feature model, the second human feature model is a string of binary data describing a sub-image of a human region in a reference image through a deep learning algorithm, and the second human feature model can be represented by a large number of feature points, and no limitation is made to the second human feature model.
[0085] For example, regarding the similarity between the first human feature model and the second human feature model, an algorithm such as Euclidean distance or cosine distance can be used to determine the similarity between the first human feature model and the second human feature model, and no limitation is made as long as the similarity can be obtained.
[0086] Step 202, count the target quantity of target users in all users.
[0087] In step 201, for each user, it can be known whether the user is a target user, so that the target user can be found from all users. On this basis, for step 202, the number of target users in all users can be counted, and the number of target users is denoted as the target quantity.
[0088] Step 203, determine whether the initial strategy parameter needs to be re-determined based on the target quantity.
[0089] In a possible implementation, a preset quantity threshold can be pre-configured, which can be configured according to experience, and no limitation is made, such as 10, 20, etc. On this basis, if the target quantity is greater than the preset quantity threshold, it is determined that the initial strategy parameter needs to be re-determined, and if the target quantity is not greater than the preset quantity threshold, it is determined that the initial strategy parameter does not need to be re-determined.
[0090] In another possible implementation, a preset proportion threshold can be pre-configured, which can be configured according to experience, and no limitation is made, such as 10%, 20%, etc. On this basis, the target proportion between the target quantity and the total quantity of all users can be calculated first, and if the target proportion is greater than the preset proportion threshold, it is determined that the initial strategy parameter needs to be re-determined, and if the target proportion is not greater than the preset proportion threshold, it is determined that the initial strategy parameter does not need to be re-determined.
[0091] For example, if the initial strategy parameter needs to be re-determined, it means that the clustering result based on the initial strategy parameter is inaccurate, and the strategy parameter needs to be re-determined, and step 204 is executed. If the initial strategy parameter does not need to be re-determined, it means that the clustering result based on the initial strategy parameter is accurate, and the strategy parameter does not need to be re-determined, that is, the initial strategy parameter remains unchanged, and the initial strategy parameter is still used for clustering.
[0092] Step 204, if the initial strategy parameter needs to be re-determined, the target strategy parameter is determined by using the obtained training data set; for example, the target strategy parameter is used to replace the initial strategy parameter, so as to perform clustering based on the target strategy parameter, that is, the target strategy parameter is used to realize image clustering.
[0093] For example, if the initial strategy parameter needs to be re-determined, the strategy parameter needs to be re-determined, and the re-determined strategy parameter is denoted as the target strategy parameter. In order to determine the target strategy parameter, a training data set can be obtained, and the training data set includes training data of multiple users. For the training data of each user, the classified images of the user, the reference images and the associated images of the user are included, and the associated images are images which are not clustered based on the initial strategy parameter and belong to the user. Based on this, the target strategy parameter is re-determined based on the training data set, that is, the target strategy parameter is re-determined based on the training data of multiple users in the training data set.
[0094] In a possible implementation, in order to construct the training data set, the following method can be used:
[0095] Suppose that the training data set needs to be constructed based on the training data of M (M is a positive integer greater than 1) users, for each user in the M users, the classified images and the reference images (such as the bottom library images and the cover images) of the user are obtained, and the classified images and the reference images are used as the training data. For example, all the classified images can be used as the training data, part of the classified images can be used as the training data, all the reference images can be used as the training data, or part of the reference images can be used as the training data.
[0096] For each user, the associated images of the user also need to be obtained, and the images which are not clustered based on the initial strategy parameter are called associated images. For example, the acquisition method of the associated images of the user can include but is not limited to: for each image in the database, if it is determined that the image belongs to the images of the user, the image can be determined as the associated image of the user. For example, the database is used to store the images which are not successfully clustered, that is, the images which are not successfully clustered based on the initial strategy parameter.
[0097] For example, assuming that the image to be clustered t belongs to the user x, referring to the image clustering process of the above embodiment, after the camera captures the image to be clustered t, the face similarity between the image to be clustered t and the reference image of the user x is determined. If the face similarity is greater than the similarity threshold b (i.e. the initial strategy parameter), it is determined that the image to be clustered t belongs to the user x, and the image to be clustered t will be used as the classified image or the cover image of the user x. If the face similarity is not greater than the similarity threshold b, it is determined that the image to be clustered t does not belong to the user x, and after the clustering of the image to be clustered t fails, the image to be clustered t is stored in the database, which is used to store images that have not been successfully clustered.
[0098] On this basis, in step 204, for each image to be clustered in the database, if it is known that the image to be clustered t in the database belongs to the user x, such as the user marking that the image to be clustered t belongs to the user x, then the image to be clustered t in the database can be used as the associated image of the user x.
[0099] In summary, the associated image of the user can be obtained. At this point, the classified image, the reference image and the associated image of the user can be obtained, and the classified image, the reference image and the associated image of the user are combined to form the training data, so as to obtain the training data of the M users, and the training data of the M users are combined to form the training data set.
[0100] For example, in order to obtain the associated image of the user, the following method can also be used: for each image in the database, if it is determined that the image belongs to the user and the face similarity between the image and the reference image of the user is a specified similarity, then the image can be determined as the associated image of the user; or, if it is determined that the image belongs to the user and the face similarity between the image and the classified image of the user is a specified similarity, then the image can be determined as the associated image of the user.
[0101] For example, for each image to be clustered in the database, if it is known that the image to be clustered t in the database belongs to the user x, such as the user marking that the image to be clustered t belongs to the user x, then if the face similarity between the image to be clustered t and the reference image of the user x is a specified similarity, or the face similarity between the image to be clustered t and the classified image of the user x is a specified similarity, the image to be clustered t can be used as the associated image of the user x. However, if the face similarity between the image to be clustered t and the reference image of the user x is not a specified similarity, and the face similarity between the image to be clustered t and the classified image of the user x is not a specified similarity, the image to be clustered t is not used as the associated image of the user x.
[0102] For example, the specified similarity can be less than the first similarity threshold (similarity threshold b). The specified similarity can be a single similarity value, such as 60%, or 50%, or the like. The specified similarity can also be multiple similarity values, such as 60% and 30%. The specified similarity can also be a range of similarity values, such as [40%, 60%]. Of course, the above are only a few examples of the specified similarity, and the specified similarity is not limited in this regard, as long as it is less than the first similarity threshold.
[0103] For example, assuming that the specified similarity is a range of similarity values [40%, 60%], if the face similarity between the image to be clustered t and the reference image (or the classified image) of the user x is within the range of similarity values [40%, 60%], the image to be clustered t can be used as the associated image of the user x.
[0104] In one possible implementation, the target strategy parameter is re-determined based on the training data (such as the classified images, the reference images, and the associated images) of multiple users in a training data set. The following methods can be used:
[0105] Based on the training data in the training data set, the initial strategy parameter is re-trained by a trained target machine learning model to obtain a target strategy parameter that matches the training data set. The target machine learning model is a network model for outputting a strategy parameter. When the target machine learning model re-trains the initial strategy parameter, the classified images and the reference images in the training data are used as forward sample images in the re-training process, and the associated images in the training data are used as reverse sample images in the re-training process.
[0106] For example, before determining the target strategy parameter, a target machine learning model needs to be trained. The target machine learning model can be a network model based on a deep learning algorithm or a network model based on a neural network, and the implementation is not limited in this regard. The training process of the target machine learning model is not limited in this embodiment, as long as the target machine learning model has the function of outputting a strategy parameter.
[0107] The input data of the target machine learning model is multiple images of a user and the similarity between the images. The target machine learning model can re-train the initial strategy parameter based on the images to obtain the target strategy parameter, that is, adjust the initial strategy parameter to obtain an adjusted strategy parameter. The adjustment process is not limited in this regard, and the adjusted strategy parameter is referred to as the target strategy parameter. The output data of the target machine learning model is the target strategy parameter, that is, the target machine learning model can output the target strategy parameter.
[0108] The embodiment does not limit the target machine learning model, as long as the target machine learning model can output the target strategy parameter after the training data in the training data set is input to the target machine learning model.
[0109] Suppose the initial strategy parameter includes the similarity threshold b, and the target machine learning model adjusts the similarity threshold b to obtain the similarity threshold c, that is, the similarity threshold c is the target strategy parameter.
[0110] In a possible implementation, when the target machine learning model re-trains the initial strategy parameter, the classified images and the reference images can be used as the positive sample images, and the associated images can be used as the negative sample images. For example, for the training data of each user, the training data needs to include the positive sample images and the negative sample images, the number of the positive sample images can be K1, and the number of the negative sample images can be K2, K1 and K2 are positive integers, K1 and K2 can be the same, or K1 and K2 can be different. For example, K1 and K2 satisfy a preset proportional relationship, such as K1 is 50%, K2 is 50%, or K1 is 70%, K2 is 30%, or K1 is 30%, K2 is 70%.
[0111] For example, for the user x, the camera collects the to-be-clustered images t1, t2, t3, t4, t5, and t6 of the user x, and suppose t1, t2, and t3 are clustered as the cover images of the user x, but t4, t5, and t6 have poor image effects, and the corresponding similarity is low, which leads to that t4, t5, and t6 are not clustered to the user x.
[0112] In the embodiment, if the user labels t4, t5, and t6 as belonging to the user x, t4, t5, and t6 can be used as the associated images of the user x. On this basis, the similarity of t1, t2, and t3 is relatively high, and t1, t2, and t3 can be used as the positive sample images, and the similarity of t4, t5, and t6 is relatively low, and t4, t5, and t6 can be used as the negative sample images.
[0113] After the initial strategy parameter is adjusted by the positive sample images and the negative sample images, the adjusted target strategy parameter is more accurate, thereby improving the accuracy of the target strategy parameter.
[0114] In a possible implementation, for the training data of each user in the training data set, the training data can further include attribute data of the user, such as gender, age range, and the like, and the content of the attribute data is not limited. After the training data (such as the classified image, the reference image, the associated image, and the attribute data) of each user is input to the target machine learning model, the target machine learning model can retrain the initial strategy parameter based on the training data, and the retraining process is not limited, and the target strategy parameter is obtained, that is, the target strategy parameter can be related to the attribute data.
[0115] In a possible implementation, after the management device determines the target strategy parameter by using the training data set, the management device can further send the target strategy parameter to the target camera, so that the target camera replaces the initial strategy parameter (such as the similarity threshold b) with the target strategy parameter (such as the similarity threshold c), and performs clustering on the image (that is, the image to be clustered) collected by the target camera based on the target strategy parameter.
[0116] When the image to be clustered is clustered based on the similarity threshold c, it is necessary to determine the face similarity between the image to be clustered and the reference image of a user. If the face similarity is greater than the similarity threshold c, the image to be clustered is used as the cover image or the classified image of the user. If the face similarity is not greater than the similarity threshold c, the image to be clustered is not used as the image of the user, and the process is not described again.
[0117] In a possible implementation, after the management device sends the initial strategy parameter to each camera (such as the camera 12, the camera 13, and the camera 14), each camera clusters the image by using the initial strategy parameter. Based on the image clustering result of the camera 12 (such as the cover image, the classified image, and the associated image in the above embodiment, which are images collected by the camera 12), the management device uses steps 201-204 to determine the target strategy parameter of the camera 12, that is, the camera 12 is used as the target camera, and the target strategy parameter of the camera 12 is sent to the camera 12. Based on the image clustering result of the camera 13, the management device uses steps 201-204 to determine the target strategy parameter of the camera 13, that is, the camera 13 is used as the target camera, and the target strategy parameter of the camera 13 is sent to the camera 13, and so on.
[0118] In one example, the execution sequence described above is only an example given for the convenience of description, and in actual application, the execution sequence between steps can also be changed, and the execution sequence is not limited. Moreover, in other embodiments, the steps of the corresponding method can not be executed in the order shown and described in the specification, and the steps included in the method can be more or less than those described in the specification. In addition, a single step described in the specification can be divided into multiple steps in other embodiments; multiple steps described in the specification can also be combined into a single step in other embodiments.
[0119] From the above technical solutions, in the embodiments of the present application, after clustering the images of the users based on the initial strategy parameters, it can be judged whether the initial strategy parameters need to be re-determined based on the clustering results of the initial strategy parameters, if yes, the target strategy parameters can be re-determined, and the images of the users are clustered based on the target strategy parameters, so as to dynamically adjust the strategy parameters, generate adaptive strategy parameters, and improve the accuracy and universality of image clustering, so that the clustering results based on the strategy parameters are accurate and reliable, which can effectively avoid errors in the results of image clustering, adapt to different business scenarios, and reduce the influence of business scenarios on the image clustering effect.
[0120] In the embodiments of the present application, different target strategy parameters can be trained for different business scenarios and attribute data (such as age, gender, etc.), that is, different cameras correspond to different target strategy parameters, so as to adapt to different business scenarios and have universality. The target strategy parameters are trained by selecting positive sample images and negative sample images, so as to improve the accuracy of the target strategy parameters.
[0121] The image clustering method of the embodiments of the present application will be described below in combination with specific embodiments. Referring to FIG. 1, which is a flowchart of the image clustering method in the embodiments of the present application, the method can include the following steps. Figure 3
[0122] Step 301, the management device acquires the initial strategy parameters and sends the initial strategy parameters to the target camera.
[0123] For example, the management device can send the initial strategy parameters to multiple cameras, and since the processing process for each camera is the same, the subsequent processing process for one camera will be taken as an example, and this camera is referred to as a target camera, which is any camera in the multiple cameras.
[0124] Step 302, the target camera clusters the images to be clustered based on the initial strategy parameters.
[0125] For example, after the target camera collects a to-be-clustered image, the target camera can cluster the to-be-clustered image based on the initial strategy parameters, and the clustering process is not limited. In the clustering process, if the clustering of the to-be-clustered image is successful, the to-be-clustered image is classified as a classified image or a cover image of a user, that is, the to-be-clustered image is stored as the classified image or the cover image of the user in the server. If the clustering of the to-be-clustered image fails, the to-be-clustered image is stored in a database (for storing images that are not successfully clustered).
[0126] During the operation of the target camera, the target camera can cluster the to-be-clustered image based on the initial strategy parameters. After the target camera operates for a period of time, it can be determined whether the initial strategy parameters need to be re-determined, that is, whether the subsequent step needs to be determined to determine whether the initial strategy parameters need to be re-determined. If not, the target camera continues to cluster the to-be-clustered image based on the initial strategy parameters, and after the target camera operates for a period of time, it continues to determine whether the initial strategy parameters need to be re-determined, and so on.
[0127] Step 303, for each user, the management device determines whether the user is a target user based on the classified image of the user and the reference image of the user. For example, if the face similarity between the classified image and the reference image is greater than a first similarity threshold, and the body similarity between the classified image and the reference image is less than a second similarity threshold, it is determined that the user is a target user; or if the face similarity between the classified image and the reference image is greater than the first similarity threshold, and the body similarity between the classified image and the reference image is not less than the second similarity threshold, it is determined that the user is not a target user.
[0128] Step 304, the management device counts the target number of target users in all users.
[0129] Step 305, the management device determines whether the initial strategy parameters need to be re-determined based on the target number. If yes, step 306 is performed, and if no, the process ends.
[0130] Step 306, if the initial strategy parameters need to be re-determined, the management device obtains a training data set, and the training data set includes training data of a plurality of users. For training data of each user, the training data can include a classified image, a reference image and an associated image of the user. Of course, the training data can also include other contents, such as attribute data of the user, which is not limited.
[0131] For example, the classified image can be a complete image (also referred to as a classified background image) or a sub-image (i.e., a small image of a face region) of a user face in the classified background image. The reference image can be a complete image (also referred to as a reference background image) or a sub-image (i.e., a small image of a face region) of a user face in the reference background image. The associated image can be a complete image (also referred to as an associated background image) or a sub-image (i.e., a small image of a face region) of a user face in the associated background image.
[0132] In step 307, the management device determines a target strategy parameter based on the training data set.
[0133] In step 308, the management device sends the target strategy parameter to the target camera.
[0134] In step 309, the target camera clusters the image to be clustered based on the target strategy parameter.
[0135] For example, the target camera can replace the initial strategy parameter with the target strategy parameter, i.e., delete the initial strategy parameter, and cluster the image to be clustered based on the target strategy parameter.
[0136] Based on the same application concept as the above method, an image clustering device is provided in the embodiments of the present application, as shown in Figure 4 As shown in the structure schematic diagram of the image clustering device, the device can include:
[0137] The determining module 41 is configured to determine whether the user is a target user based on a classified image of the user and a reference image; wherein if a face similarity between the classified image and the reference image is greater than a first similarity threshold, and a body similarity between the classified image and the reference image is less than a second similarity threshold, it is determined that the user is a target user; the classified image is an image of the user clustered based on an initial strategy parameter, and the reference image is an image used for clustering the image of the user.
[0138] The statistical module 42 is configured to count a target number of target users in all users, and determine whether the initial strategy parameter needs to be re-determined based on the target number.
[0139] The generating module 43 is configured to, if the initial strategy parameter needs to be re-determined, determine a target strategy parameter based on a training data set that has been obtained; wherein the target strategy parameter is used to replace the initial strategy parameter, so as to cluster based on the target strategy parameter.
[0140] In a possible implementation, when determining whether the user is the target user based on the classified image of the user and the reference image, the determining module 41 is further configured to: if a face similarity between the classified image and the reference image is greater than a first similarity threshold, and a body similarity between the classified image and the reference image is not less than a second similarity threshold, determine that the user is not the target user.
[0141] In a possible implementation, before determining whether the user is the target user based on the classified image of the user and the reference image, the determining module 41 is further configured to: acquire a first face feature model and a first body feature model from the classified image; acquire a second face feature model and a second body feature model from the reference image; determine a face similarity between the classified image and the reference image based on a similarity between the first face feature model and the second face feature model; and determine a body similarity between the classified image and the reference image based on a similarity between the first body feature model and the second body feature model.
[0142] In a possible implementation, the training data set includes training data of a plurality of users; for training data of each user, the training data includes a classified image, a reference image and an associated image of the user, the associated image being an image that is not clustered as the user based on the initial strategy parameter and belongs to the user;
[0143] When the generating module 43 acquires the associated image of the user, the generating module 43 is specifically configured to: for each image in a database, if it is determined that the image is an image belonging to the user, determine the image as the associated image of the user; and the database is configured to store images that are not successfully clustered.
[0144] In a possible implementation, when the generating module 43 determines the image as the associated image of the user, the generating module 43 is specifically configured to: if it is determined that the image is an image belonging to the user, and a face similarity between the image and the reference image of the user is a specified similarity, determine the image as the associated image of the user; or if it is determined that the image is an image belonging to the user, and a face similarity between the image and the classified image of the user is the specified similarity, determine the image as the associated image of the user.
[0145] The specified similarity is less than the first similarity threshold.
[0146] In a possible implementation, the generating module 43 is specifically configured to determine the target strategy parameter by using the acquired training data set, and the determination specifically includes: retraining the initial strategy parameter by using a trained target machine learning model based on training data in the training data set, to obtain the target strategy parameter matching the training data set; the target machine learning model is a network model used to output a strategy parameter; and when the target machine learning model re-trains the initial strategy parameter, the classified images and the reference images in the training data are used as forward sample images in the re-training process, and the associated images in the training data are used as reverse sample images in the re-training process.
[0147] In a possible implementation, the image clustering apparatus further includes (not shown in the figure): a sending module configured to send the target strategy parameter to a target camera, so that the target camera replaces the initial strategy parameter with the target strategy parameter, and clusters images collected by the target camera based on the target strategy parameter.
[0148] Based on the same application concept as the above method, an embodiment of the present application provides a management device, as shown in Figure 5 The management device can include a processor 51 and a machine readable storage medium 52, the machine readable storage medium 52 stores machine executable instructions that can be executed by the processor 51; and the processor 51 is configured to execute the machine executable instructions to implement the image clustering method disclosed in the above examples of the present application.
[0149] Based on the same application concept as the above method, an embodiment of the present application further provides a machine readable storage medium, the machine readable storage medium stores a plurality of computer instructions, and the computer instructions can implement the image clustering method disclosed in the above examples of the present application when executed by a processor.
[0150] The machine readable storage medium can be any electronic, magnetic, optical, or other physical storage apparatus, and can contain or store information such as executable instructions, data, and the like. For example, the machine readable storage medium can be a RAM (Random Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (such as a hard disk drive), a solid state disk, any type of storage disk (such as an optical disk, a DVD, etc.), or similar storage medium, or a combination thereof.
[0151] The systems, apparatuses, modules, or units disclosed in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0152] For the convenience of description, the above apparatuses are described in various units according to functions in the description. Of course, the functions of the units can be implemented in one or more software and / or hardware in the implementation of the present application.
[0153] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0154] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce the functions described in the flowcharts and / or block diagrams for implementing the flows and / or blocks in the flowcharts and / or block diagrams. Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The apparatus that implements the functions specified in one or more flows and / or blocks.
[0155] Moreover, these computer program instructions can also be stored in a computer-readable memory capable of directing the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including instruction apparatus, which implements the functions described in the flowcharts and / or block diagrams for implementing the flows and / or blocks in the flowcharts and / or block diagrams. Figure 1 The functions specified in one or more flows and / or blocks Figure 1 The apparatus that implements the functions specified in one or more flows and / or blocks.
[0156] These computer program instructions can also be loaded into computer or other programmable data processing devices, so that a series of operation steps are performed on the computer or other programmable data processing devices to generate computer-implemented processes, thus the instructions executed on the computer or other programmable data processing devices provide processes for implementing the functions specified in the flowcharts Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0157] The above only describes the embodiments of the present application and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the scope of claims of the present application.
Claims
1. An image clustering method characterized by, The management device obtains an initial policy parameter including a first similarity threshold, and distributes the initial policy parameter to each camera; after a camera collects a to-be-clustered image, the to-be-clustered image is clustered based on the initial policy parameter; wherein, in the image clustering process, a face similarity between the to-be-clustered image and a reference image of a user is determined, if the face similarity is greater than the first similarity threshold, it is determined that the to-be-clustered image belongs to the user, if the face similarity is not greater than the first similarity threshold, it is determined that the to-be-clustered image does not belong to the user; wherein, after clustering the to-be-clustered image, if it is determined that the to-be-clustered image belongs to a user, the to-be-clustered image is used as a cover image or a classified image of the user, and a base image of the user is known; the management device obtains all classified images and all reference images of the user; After the to-be-clustered image is clustered based on the initial policy parameter, the method comprises: determining whether the user is a target user based on the classified image and the reference image of the user; wherein, if a face similarity between the classified image and the reference image is greater than a first similarity threshold, and a body similarity between the classified image and the reference image is less than a second similarity threshold, it is determined that the user is a target user; wherein, the classified image is an image clustered for the user based on an initial policy parameter, and the reference image is an image used for clustering the image of the user; wherein, the target user is a user whose clustering result of the classified image may be incorrect; counting a target number of target users in all users; determining whether the initial policy parameter needs to be re-determined based on the target number; if yes, determining a target policy parameter by using the obtained training data set; wherein, the target policy parameter is used to replace the initial policy parameter, so as to cluster based on the target policy parameter.
2. The method of claim 1, wherein, The determination of whether the user is a target user based on the classified image and the reference image of the user further comprises: if the face similarity between the classified image and the reference image is greater than the first similarity threshold, and the body similarity between the classified image and the reference image is not less than the second similarity threshold, it is determined that the user is not a target user.
3. The method according to claim 1 or 2, characterized in that, Before the determination of whether the user is a target user based on the classified image and the reference image of the user, the method further comprises: obtaining a first face feature model and a first body feature model from the classified image; obtaining a second face feature model and a second body feature model from the reference image; determining the face similarity between the classified image and the reference image based on a similarity between the first face feature model and the second face feature model; determining the body similarity between the classified image and the reference image based on a similarity between the first body feature model and the second body feature model.
4. The method of claim 1, wherein, The training data set includes training data of multiple users; for the training data of each user, the training data includes a classified image of the user, a reference image, and an associated image, the associated image being an image that is not clustered based on the initial strategy parameter and belongs to the user; The method includes the following steps: For each image in the database, if it is determined that the image belongs to the user, the image is determined as the associated image of the user; wherein the database is used to store images that are not successfully clustered.
5. The method of claim 4, wherein, If it is determined that the image belongs to the user, and the face similarity between the image and the reference image of the user is a specified similarity, the image is determined as the associated image of the user; or, If it is determined that the image belongs to the user, and the face similarity between the image and the classified image of the user is a specified similarity, the image is determined as the associated image of the user; The specified similarity is less than the first similarity threshold.
6. The method of claim 4 or 5, wherein The method includes the following steps: Based on the training data in the training data set, the initial strategy parameter is retrained by a trained target machine learning model to obtain a target strategy parameter matched with the training data set; The target machine learning model is a network model used to output a strategy parameter; When the target machine learning model re-trains the initial strategy parameter, the classified image and the reference image in the training data are used as positive sample images in the re-training process, and the associated image in the training data is used as a negative sample image in the re-training process. After the target strategy parameter is determined by using the obtained training data set, the method further includes: sending the target strategy parameter to a target camera, so that the target camera replaces the initial strategy parameter with the target strategy parameter, and clusters images collected by the target camera based on the target strategy parameter.
7. The method of claim 1, wherein, The management device obtains an initial strategy parameter, the initial strategy parameter including a first similarity threshold, and sends the initial strategy parameter to each camera; after a camera collects a to-be-clustered image, the camera clusters the to-be-clustered image based on the initial strategy parameter; wherein in the image clustering process, the face similarity between the to-be-clustered image and a reference image of a user is determined, if the face similarity is greater than the first similarity threshold, it is determined that the to-be-clustered image belongs to the user, and if the face similarity is not greater than the first similarity threshold, it is determined that the to-be-clustered image does not belong to the user; wherein after clustering the to-be-clustered image, if it is determined that the to-be-clustered image belongs to a user, the to-be-clustered image is used as a cover image or a classified image of the user, and the bottom library image of the user is known; the management device obtains all classified images and all reference images of the user; 8. An image clustering apparatus characterized by comprising: After clustering images based on initial strategy parameters, the device comprises: A determination module is configured to determine whether a user is a target user based on a classified image of the user and a reference image; wherein if a face similarity between the classified image and the reference image is greater than a first similarity threshold, and a body similarity between the classified image and the reference image is less than a second similarity threshold, it is determined that the user is a target user; wherein the classified image is an image of the user clustered based on initial strategy parameters, and the reference image is an image used to cluster images of the user; wherein the target user is a user whose clustering result of the classified image may be incorrect; A statistics module is configured to count a target number of target users in all users, and determine whether the initial strategy parameters need to be re-determined based on the target number; A generation module is configured to determine target strategy parameters by using the acquired training data set if the initial strategy parameters need to be re-determined; wherein the target strategy parameters are used to replace the initial strategy parameters, so as to cluster based on the target strategy parameters.
9. A management device, characterized by comprising: Comprise: A processor and a machine readable storage medium, the machine readable storage medium stores machine executable instructions capable of being executed by the processor; Wherein the processor is used to execute the machine executable instructions to realize the method of any one of claims 1-7.
10. A machine-readable storage medium, characterized in that, The machine readable storage medium stores machine executable instructions capable of being executed by the processor; wherein the processor is used to execute the machine executable instructions to realize the method of any one of claims 1-7.
Citation Information
Patent Citations
Image archiving method, device and equipment
CN112528078A
Face classification method and device
CN112966136A