Target clustering method, target clustering device and computer storage medium
By extracting the high-performance and low-performance features of the target image, calculating weights and adjusting the similarity, dynamically determining the similarity, the poor clustering problem caused by k-value preset in the KNN clustering algorithm is solved, and the clustering effect is improved.
Patent Information
- Application Number
- CN202411166383.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-08-23
AI Technical Summary
When the existing KNN clustering algorithm classifies new input instances, the k value is preset and does not take into account the actual similarity, resulting in the presence of neighbors with lower similarity or the lack of instances with higher similarity, resulting in poor clustering effect.
A target clustering method is proposed, by acquiring the high-performance and low-performance features of the target image, calculating weights, adjusting the similarity, dynamically determining the number of adjacent images, and adjusting the similarity to improve the clustering effect. Specific steps include extracting high-performance and low-performance features, calculating feature similarity and important values, determining weights, sorting similarity, adjusting the similarity of non-adjacent images, and finally clustering.
By dynamically adjusting the similarity and number of adjacent images, the accuracy and effect of target clustering are improved, and the problem of poor clustering in the prior art is solved.
Smart Images

Figure CN118674958B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of target clustering, and in particular to a target clustering method, a target clustering device and a computer storage medium. Background Art
[0002] Clustering is to divide a data set into different classes or clusters according to a specific standard (such as distance), so that the similarity of data objects in the same cluster is as large as possible, and the difference of data objects in different clusters is as large as possible. That is, after clustering, data of the same class is gathered together as much as possible, and data of different classes are separated as much as possible.
[0003] Existing clustering algorithms, such as the KNN (k-Nearest Neighbors) algorithm, find the k instances (i.e., k neighbors) closest to the new input instance in the training data set. If most of these k instances belong to a certain class, the input instance is classified into this class. The k value of the KNN algorithm is preset in advance. For all new input instances, neighbor instance searches are performed using the k value without considering the actual similarity. As a result, there may be instances with low similarity among the k neighbor instances, or there may be a lack of instances with high similarity, resulting in poor clustering results. Summary of the invention
[0004] In order to solve the above technical problems, the present application proposes a target clustering method, a target clustering device and a computer storage medium.
[0005] In order to solve the above technical problems, the present application proposes a target clustering method, which includes:
[0006] Acquire multiple target images;
[0007] Extracting high-performance features and low-performance features of each target image, wherein a feature resolution of the high-performance features is higher than a feature resolution of the low-performance features;
[0008] Obtaining a weight of each target image by using high performance features and / or low performance features of all target images;
[0009] According to the weight of each target image, determine the adjacent images corresponding to the adjacent number;
[0010] Adjusting the similarity between each target image and other images other than adjacent images of each target image;
[0011] All target images after similarity adjustment are clustered to obtain an image set for each target.
[0012] Wherein, the obtaining the weight of each target image by utilizing the high performance features and / or low performance features of all target images includes:
[0013] Obtaining the high-performance feature of each target image and the first feature similarity with the high-performance features of other target images;
[0014] According to the first feature similarity, obtaining a feature importance value of each target image;
[0015] The weight of each target image is determined according to the feature importance value of each target image.
[0016] The feature importance value is the kurtosis and / or skewness of the histogram corresponding to the first feature similarity.
[0017] Wherein, the obtaining the weight of each target image by utilizing the high performance features and / or low performance features of all target images includes:
[0018] Acquire a thermal map of each target image using the high performance features of each target image;
[0019] Obtaining the number of pixels in the thermal map that are above a preset threshold;
[0020] Determine the effective activation value ratio of each target image according to the number of pixels;
[0021] The weight of each target image is determined according to the effective activation value ratio of each target image.
[0022] Wherein, the obtaining the weight of each target image by utilizing the high performance features and / or low performance features of all target images includes:
[0023] Obtaining a second feature similarity between a high-performance feature and a low-performance feature of each target image;
[0024] The weight of each target image is determined according to the second feature similarity of each target image.
[0025] The step of determining the adjacent images corresponding to the adjacent number according to the weight of each target image includes:
[0026] Get the preset number of neighbors;
[0027] Calculate the weight of each target image and the preset number of neighbors to determine the number of neighbors of each target image;
[0028] Sorting the third feature similarities between each target image and other target images to obtain a sorting result;
[0029] The adjacent images corresponding to each target image are determined from the sorting results according to the adjacent number.
[0030] The adjusting the similarity between each target image and other images other than the adjacent images of each target image comprises:
[0031] retaining feature similarities between each target image and adjacent images of each target image;
[0032] The similarity between each target image and other images other than the adjacent images of each target image is modified to a preset value.
[0033] In order to solve the above technical problems, the present application also proposes a target clustering device, which includes an image acquisition module, a feature extraction module, a weight calculation module, an image determination module, a similarity calculation module, and a target clustering module; wherein,
[0034] The image acquisition module is used to acquire multiple target images;
[0035] The feature extraction module is used to extract high-performance features and low-performance features of each target image, wherein the feature resolution of the high-performance features is higher than the feature resolution of the low-performance features;
[0036] The weight calculation module is used to obtain the weight of each target image by using the high performance features and / or low performance features of all target images;
[0037] The image determination module is used to determine the adjacent images corresponding to the adjacent number according to the weight of each target image;
[0038] The similarity calculation module is used to adjust the similarity between each target image and other images other than the adjacent images of each target image;
[0039] The target clustering module is used to cluster all target images after similarity adjustment to obtain an image set of each target.
[0040] To solve the above technical problems, the present application also proposes another target clustering device, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the target clustering method as described above.
[0041] In order to solve the above technical problems, the present application also proposes a computer storage medium, wherein the computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the above target clustering method.
[0042] Compared with the prior art, the beneficial effects of the present application are as follows: the target clustering device obtains multiple target images; extracts high-performance features and low-performance features of each target image, wherein the feature resolution of the high-performance features is higher than the feature resolution of the low-performance features; uses the high-performance features and / or low-performance features of all target images to obtain the weight of each target image; determines the adjacent images corresponding to the adjacent number according to the weight of each target image; adjusts the similarity between each target image and other images other than the adjacent images of each target image; clusters all target images after the similarity is adjusted to obtain an image set of each target. Through the above target clustering method, after the target features are sorted and the similarity is adjusted, the targets are clustered according to the adjusted similarity to improve the target clustering effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0044] Figure 1 It is a flowchart of an embodiment of a target clustering method provided by the present application;
[0045] Figure 2 It is a flow chart of the optimization method of the human body clustering effect of KNN provided in this application;
[0046] Figure 3 yes Figure 1 The specific flow diagram of step S14 of the target clustering method shown;
[0047] Figure 4 It is a structural schematic diagram of an embodiment of a target clustering device provided by the present application;
[0048] Figure 5 is a structural schematic diagram of another embodiment of the target clustering device provided by the present application;
[0049] Figure 6 It is a structural diagram of an embodiment of a computer storage medium provided by the present application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0051] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0052] The general process of clustering in conventional technology:
[0053] 1) Data preparation: feature standardization and dimensionality reduction.
[0054] 2) Feature selection: Select the most effective features from the initial features and store them in a vector.
[0055] 3) Feature extraction: New salient features are formed by transforming the selected features.
[0056] 4) Clustering: Perform similarity measurement based on a certain distance function to obtain clusters.
[0057] 5) Clustering result evaluation: Analyze the clustering results, such as distance error and SSE (the sum of squares due to error).
[0058] Among them, data clustering methods can be mainly divided into partition-based clustering methods (Partition-based Methods), density-based clustering methods (Density-based methods), hierarchical clustering methods (HierarchicalMethods), etc.
[0059] Partition clustering methods require the number of clusters or cluster centers to be specified in advance, and through repeated iterations, the goal of "points within clusters are close enough, and points between clusters are far enough" is finally achieved. Classic partition clustering methods include k-means and its variants k-means++, bi-kmeans, kernel k-means, etc.
[0060] Hierarchical clustering divides the data set into layers of clusters, and the clusters generated in the next layer are based on the results of the previous layer. Hierarchical clustering algorithms are generally divided into two categories:
[0061] Agglomerative hierarchical clustering: also known as bottom-up hierarchical clustering, each object is initially a cluster, and each time the two closest clusters are merged according to certain criteria to generate a new cluster, and so on, until all objects finally belong to one cluster. This article mainly focuses on this type of algorithm.
[0062] Divisive hierarchical clustering: also known as top-down hierarchical clustering, all objects initially belong to one cluster, and each time a cluster is divided into multiple clusters according to certain criteria, and so on, until each object is a cluster.
[0063] Among them, k-nearest neighbor (k-NN) is a basic classification and regression method. It is one of the simplest algorithms in data mining technology, and its core function is to solve supervised classification problems. KNN can quickly and efficiently solve prediction and classification problems based on special data sets, but it does not generate a model, so the accuracy of the algorithm is not highly generalizable.
[0064] The input of the k-nearest neighbor method is the feature vector of the instance, corresponding to the point in the feature space; the output is the category of the instance, which can be multiple categories.
[0065] The three basic elements of the k-nearest neighbor method are: selection of k value, distance measurement and classification decision rules.
[0066] Calculation process:
[0067] 1. Calculate the distance between each sample point in the training sample and the test sample (common distance metrics include Euclidean distance, Mahalanobis distance, etc.).
[0068] 2. Sort all the distance values above.
[0069] 3. Select the first k samples with the smallest distance.
[0070] 4. Vote based on the labels of these k samples to get the final classification category.
[0071] It should be noted that the targets of the target clustering method provided in this application include but are not limited to pedestrians, vehicles, objects, etc. The clustering process of the target clustering method provided in this application is introduced below by taking pedestrian human targets as an example.
[0072] The current human clustering methods have the following problems: 1) Since human appearance is similar with a certain probability (for example, they are both wearing black clothes and black pants, but they are not actually the same person), it is easy for the algorithm to mistake them for the same person. 2) When the quality of human images is poor, it is easy for the algorithm to mistake them for the same person. 3) When a human body is blocked by other objects, it will also affect the similarity between the human body and other human bodies, which will lead to algorithm misjudgment. It should be noted that other target clustering methods will also have the same or similar problems, which are not listed here one by one.
[0073] This application proposes a human body clustering effect optimization method based on KNN. For details, please refer to Figure 1 and Figure 2 , Figure 1 is a flow chart of an embodiment of a target clustering method provided by the present application, Figure 2 It is a flowchart of the optimization method of the human body clustering effect of KNN provided in this application.
[0074] The target clustering method of the present application is applied to a target clustering device, wherein the target clustering device of the present application can be a server, a terminal device, or a system in which a server and a terminal device cooperate with each other. Accordingly, the various parts included in the target clustering device, such as various units, subunits, modules, and submodules, can all be set in the server, can all be set in the terminal device, or can be set in the server and the terminal device respectively.
[0075] Furthermore, the above-mentioned server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules used to provide distributed servers, or it can be implemented as a single software or software module, which is not specifically limited here.
[0076] like Figure 1 As shown, the specific steps are as follows:
[0077] Step S11: Acquire multiple target images.
[0078] In the embodiment of the present application, the target clustering device inputs multiple target images. Taking pedestrians as an example, the target image of the present application can be Figure 2 The advantages of using a human body thumbnail as shown are: increasing the proportion of the target in the image and ensuring that there is only one target in the target image, which can effectively improve the efficiency and accuracy of clustering.
[0079] Step S12: extracting high-performance features and low-performance features of each target image, wherein the feature resolution of the high-performance features is higher than the feature resolution of the low-performance features.
[0080] In an embodiment of the present application, the target clustering device inputs a plurality of human body thumbnails into a high-performance REID (Re-identification) model (backbone: resnet50), and outputs the human body high-performance feature feat_high (feature length: 512) corresponding to each human body thumbnail.
[0081] The target clustering device inputs multiple human thumbnails into a low-performance REID (Re-identification) model (backbone: resnet18), and outputs the low-performance human features feat_low (feature length: 512) corresponding to each human thumbnail.
[0082] Among them, the difference between the high-performance REID model and the low-performance REID model lies in the depth of the backbone network. The high-performance REID model has more network layers than the low-performance REID model, which makes the feature resolution of the high-performance features of the human body higher than that of the low-performance features of the human body.
[0083] It should be noted that in other fields, other types of target images can also use other high-performance feature extraction models to extract target high-performance features, and use other low-performance feature extraction models to extract target low-performance features.
[0084] Step S13: using the high performance features and / or low performance features of all target images to obtain the weight of each target image.
[0085] In an embodiment of the present application, the target clustering device uses the high-performance features of the human body micrograph to obtain the weight of each human body micrograph, or uses the low-performance features of the human body micrograph to obtain the weight of each human body micrograph, or uses the high-performance features and low-performance features of the human body micrograph to obtain the weight of each human body micrograph.
[0086] In a specific embodiment, Figure 2As shown, the target clustering device calculates the feature similarity of the high-performance features of each target image with the high-performance features of other target images, that is, the first feature similarity. The feature similarity can be calculated by the cosine distance of two high-performance features. Then, the target clustering device calculates the statistical histogram Hist corresponding to each high-performance feature, and the feature similarity between the high-performance feature and other high-performance features is recorded in the histogram. Finally, the target clustering device calculates the kurtosis K and skewness S of the histogram to evaluate the feature similarity between the high-performance features corresponding to the histogram and other high-performance features. For example, the kurtosis K represents the deviation of the amplitude of each peak in the histogram from the average value of the feature similarity; and the skewness S represents the absolute value of the difference between the horizontal axis coordinate of the maximum peak in the histogram and the preset horizontal axis center point coordinate.
[0087] Among them, the calculation formula for calculating the kurtosis K of the histogram is as follows:
[0088]
[0089] in, is the mean, is the standard deviation.
[0090] The calculation formula for calculating the skewness S of the histogram is as follows:
[0091]
[0092] in, is the mean, is the standard deviation.
[0093] Therefore, the target clustering device can use the kurtosis K and skewness S of the histogram to calculate the weight W of the high-performance feature and its human body thumbnail, and the calculation formula is as follows:
[0094] W=a1K+a2S
[0095] Wherein, a1 and a2 are preset weighted values respectively, and the sum of the two is 1.
[0096] In a specific embodiment, Figure 2 As shown, the target clustering device calculates the similarity Sim between the high-performance human body feature feat_high and the low-performance human body feature feat_low of each human body thumbnail.
[0097] In a specific embodiment, Figure 2 As shown, the target clustering device calculates the heat map HeatMap output by the high-performance REID model corresponding to each human body small image, and then calculates the proportion P of effective activation values in the heat map respectively.
[0098] The calculation of the effective activation value ratio P includes the following steps:
[0099] 1) First, calculate the heat map HeatMap, that is, output the feature map of the human body through the high-performance REID model ( ), and then add each channel one by one to get the heat map HeatMap ( ).
[0100] 2) Calculate the effective activation value ratio based on the heat map. The number of values in the matrix that are above the threshold T is divided by 49.
[0101] In a specific implementation, the target clustering device calculates the weight W of each human feature based on the kurtosis K, skewness S, similarity Sim, and proportion P of effective activation values of each human figure.
[0102] The above feature weight calculation includes the following steps:
[0103] 1) Stretch the four indicators of kurtosis K, skewness S, similarity Sim, and the proportion of effective activation values P to the range of 0-1, and obtain K0, S0, Sim0, and P0. The stretching calculation method takes kurtosis K as an example, and takes the maximum kurtosis K from N human features max , take the minimum kurtosis K min , where the result of the kurtosis stretching corresponding to the i-th human feature is (K max –K i ) / (K max -K min ).
[0104] 2) Take the weighted sum of K0, S0, Sim0, and P0 to get the weight W. The calculation formula is as follows:
[0105] W=0.25 K0+0.25 S0+0.25 Sim0+0.25 P0
[0106] Step S14: Determine the adjacent images corresponding to the adjacent number according to the weight of each target image.
[0107] In the embodiment of the present application, the target clustering device determines the adjacent images corresponding to the adjacent number according to the weight calculated by each human body thumbnail according to step S13 and the k value determined by the KNN algorithm. Compared with the prior art, the present application dynamically adjusts the adjacent images, i.e., the neighbor images, of each human body thumbnail, and can adapt to the specific situation of the human body thumbnail.
[0108] Specifically, the process of dynamically adjusting the number of adjacent images of each human body thumbnail in this application can be found in Figure 3 , Figure 3 yes Figure 1 The specific flow chart of step S14 of the target clustering method is shown.
[0109] like Figure 3 As shown, the specific steps are as follows:
[0110] Step S141: Obtain a preset number of neighbors.
[0111] In an embodiment of the present application, the target clustering device obtains a preset number of neighbors k according to a KNN algorithm.
[0112] Step S142: Calculate the weight of each target image and the preset number of neighbors to determine the number of neighbors of each target image.
[0113] In the embodiment of the present application, the target clustering device determines the number of neighbors of each human image as k W
[0114] Step S143: sorting the third feature similarities between each target image and other target images to obtain a sorting result.
[0115] Step S144: Determine the adjacent images corresponding to each target image from the sorting results according to the adjacent number.
[0116] In an embodiment of the present application, the target clustering device calculates the feature similarity between each human body thumbnail and all other human body thumbnails, and then sorts all other human body thumbnails according to the rule of feature similarity from large to small, and extracts an adjacent number of human body thumbnails from the sorting results as adjacent human body thumbnails of the target human body thumbnail.
[0117] Step S15: adjusting the similarity between each target image and other images other than the adjacent images of each target image.
[0118] In the embodiment of the present application, the original function of KNN is to adjust the similarity between human features (nodes). For each node feature, only the first K adjacent features (sorted from large to small similarity) are taken to retain their similarity, and the rest are modified to 0.
[0119] This application is based on the fact that each node feature has a weight W, and only the first K W adjacent features (sorted from large to small in similarity) retain their similarity, and the rest are modified to 0.
[0120] Among them, the present application adjusts the similarity between each target image and other images other than the adjacent images of each target image to a preset value, and the preset value can be the value "0" of the above embodiment, or other fixed values, which are not listed here one by one.
[0121] Step S16: clustering all target images after similarity adjustment to obtain an image set of each target.
[0122] In the embodiment of the present application, the target clustering device obtains the human body clustering result through the DBSCAN algorithm according to the KNN result of step S15.
[0123] In an embodiment of the present application, a target clustering device acquires multiple target images; extracts high-performance features and low-performance features of each target image, wherein the feature resolution of the high-performance features is higher than the feature resolution of the low-performance features; uses the high-performance features and / or low-performance features of all target images to acquire the weight of each target image; determines adjacent images corresponding to the adjacent number according to the weight of each target image; adjusts the similarity between each target image and other images other than the adjacent images of each target image; clusters all target images after the similarity adjustment to acquire an image set of each target. Through the above target clustering method, after the target features are sorted and the similarity is adjusted, the targets are clustered according to the adjusted similarity to improve the target clustering effect.
[0124] This application introduces the kurtosis and mean of the histogram to measure the importance of the current human feature (the higher the kurtosis, the more concentrated the similarity of the surrounding features, and the more important the feature; the smaller the absolute value of the skewness, the more important the feature), thereby solving the problem of similar human appearance.
[0125] This application introduces the feature similarity of high-performance and low-performance REID models to measure the reliability of current human features (the REID feature similarity corresponding to the high-performance and low-performance models, the higher the similarity, the higher the quality of the human body thumbnail, regardless of the high-performance or low-performance model, the easier it is to extract features), thereby solving the problem of low quality of human images.
[0126] This application introduces the effective activation ratio in the REID model feature heat map to measure the completeness of the current human body features (the higher the effective activation ratio, the more complete the entire human body image is, the less occlusion there is, and the more complete it is), thereby solving the problem of the human body being obscured by other objects.
[0127] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0128] In order to implement the above target clustering method, this application also proposes a target clustering device, please refer to Figure 4 , Figure 4 It is a structural diagram of an embodiment of a target clustering device provided in the present application.
[0129] The target clustering device 300 of this embodiment includes an image acquisition module 31 , a feature extraction module 32 , a weight calculation module 33 , an image determination module 34 , a similarity calculation module 35 , and a target clustering module 36 .
[0130] Wherein, the image acquisition module 31 is used to acquire multiple target images.
[0131] The feature extraction module 32 is used to extract high-performance features and low-performance features of each target image, wherein the feature resolution of the high-performance features is higher than the feature resolution of the low-performance features.
[0132] The weight calculation module 33 is used to obtain the weight of each target image by using the high performance features and / or low performance features of all target images.
[0133] The image determination module 34 is used to determine adjacent images corresponding to the adjacent number according to the weight of each target image.
[0134] The similarity calculation module 35 is used to adjust the similarity between each target image and other images other than the adjacent images of each target image.
[0135] The target clustering module 36 is used to cluster all target images after similarity adjustment to obtain an image set of each target.
[0136] In order to implement the above target clustering method, this application also proposes another target clustering device, please refer to Figure 5 , Figure 5 It is a structural schematic diagram of another embodiment of the target clustering device provided in the present application.
[0137] The target clustering device 400 of this embodiment includes a processor 41 , a memory 42 , an input / output device 43 , and a bus 44 .
[0138] The processor 41 , the memory 42 , and the input / output device 43 are respectively connected to the bus 44 . The memory 42 stores program data, and the processor 41 is used to execute the program data to implement the target clustering method described in the above embodiment.
[0139] In the embodiment of the present application, the processor 41 may also be referred to as a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip having the ability to process signals. The processor 41 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or the processor 41 may also be any conventional processor, etc.
[0140] This application also provides a computer storage medium, please continue to refer to Figure 6 , Figure 6 It is a structural diagram of an embodiment of a computer storage medium provided in the present application. The computer storage medium 600 stores a computer program 61. When the computer program 61 is executed by a processor, it is used to implement the target clustering method of the above embodiment.
[0141] When the embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0142] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A target clustering method, characterized in that: The target clustering method comprises: Acquire multiple target images; Extracting high-performance features and low-performance features of each target image, wherein a feature resolution of the high-performance features is higher than a feature resolution of the low-performance features; Obtaining a weight of each target image by using high performance features and / or low performance features of all target images; According to the weight of each target image, determine the adjacent images corresponding to the adjacent number; Adjusting the similarity between each target image and other images other than adjacent images of each target image; Cluster all target images after adjusting the similarity to obtain the image set of each target; The step of determining the adjacent images corresponding to the adjacent number according to the weight of each target image includes: Get the preset number of neighbors; Calculate the weight of each target image and the preset number of neighbors to determine the number of neighbors of each target image; Sorting the third feature similarities between each target image and other target images to obtain a sorting result; Determine the adjacent images corresponding to each target image from the sorting result according to the adjacent number; The utilizing the high performance features and / or low performance features of all target images to obtain the weight of each target image includes: Obtaining a first feature similarity between the high-performance feature of each target image and the high-performance features of other target images; and determining a weight of each target image according to the first feature similarity of each target image; And / or, obtaining high-performance features of each target image to obtain a heat map of each target image; determining a weight of each target image according to a proportion of effective activation values of the heat map; And / or, obtaining the second feature similarity between the high-performance feature and the low-performance feature of each target image; and determining the weight of each target image according to the second feature similarity of each target image.
2. The target clustering method according to claim 1, characterized in that: The utilizing the high performance features and / or low performance features of all target images to obtain the weight of each target image includes: Obtaining the high-performance feature of each target image and the first feature similarity with the high-performance features of other target images; According to the first feature similarity, obtaining a feature importance value of each target image; The weight of each target image is determined according to the feature importance value of each target image.
3. The target clustering method according to claim 2, characterized in that: The feature importance value is the kurtosis and / or skewness of the histogram corresponding to the first feature similarity.
4. The target clustering method according to claim 1, characterized in that: The utilizing the high performance features and / or low performance features of all target images to obtain the weight of each target image includes: Acquire a thermal map of each target image using the high performance features of each target image; Obtaining the number of pixels in the thermal map that are above a preset threshold; Determine the effective activation value ratio of each target image according to the number of pixels; The weight of each target image is determined according to the effective activation value ratio of each target image.
5. The target clustering method according to any one of claims 1 to 4, characterized in that: The adjusting the similarity between each target image and other images other than the adjacent images of each target image comprises: retaining feature similarities between each target image and adjacent images of each target image; The similarity between each target image and other images other than the adjacent images of each target image is modified to a preset value.
6. A target clustering device, characterized in that: The target clustering device includes an image acquisition module, a feature extraction module, a weight calculation module, an image determination module, a similarity calculation module, and a target clustering module; wherein, The image acquisition module is used to acquire multiple target images; The feature extraction module is used to extract high-performance features and low-performance features of each target image, wherein the feature resolution of the high-performance features is higher than the feature resolution of the low-performance features; The weight calculation module is used to obtain the weight of each target image by using the high performance features and / or low performance features of all target images; The image determination module is used to determine the adjacent images corresponding to the adjacent number according to the weight of each target image; The similarity calculation module is used to adjust the similarity between each target image and other images other than the adjacent images of each target image; The target clustering module is used to cluster all target images after similarity adjustment to obtain an image set of each target; The image determination module is used to obtain a preset number of neighbors; calculate the weight of each target image and the preset number of neighbors to determine the number of neighbors of each target image; sort the third feature similarities of each target image and other target images to obtain a sorting result; and determine the neighboring images corresponding to each target image from the sorting result according to the number of neighbors; The weight calculation module is used to obtain the first feature similarity between the high-performance feature of each target image and the high-performance features of other target images; determine the weight of each target image according to the first feature similarity of each target image; and / or, obtain the high-performance feature of each target image to obtain the heat map of each target image; determine the weight of each target image according to the proportion of effective activation values of the heat map; and / or, obtain the second feature similarity between the high-performance feature of each target image and the low-performance feature; determine the weight of each target image according to the second feature similarity of each target image.
7. A target clustering device, characterized in that: The target clustering device includes a memory and a processor coupled to the memory; The memory is used to store program data, and the processor is used to execute the program data to implement the target clustering method according to any one of claims 1 to 5.
8. A computer storage medium, characterized in that: The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the target clustering method according to any one of claims 1 to 5.
