An abnormal file processing method and device

By constructing the connectivity map collection and feature value analysis, abnormal files in portrait clustering are detected and corrected, the problem of misfiles is solved, and the file accuracy and reliability of the security system are improved.

CN113868458BActive Publication Date: 2025-07-11ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111030846.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-03
Publication Date
2025-07-11
Estimated Expiration
2041-09-03

AI Technical Summary

Technical Problem

In the prior art, misfiles are prone to occur during portrait clustering, and there is a lack of effective detection and processing mechanisms, resulting in insufficient file accuracy and affecting security effects.

Method used

By constructing a collection of connected images of portrait files, abnormal files are detected and corrected based on the spatial distance and characteristic values of the portrait pictures, including partitioning processing, random sampling, kurtosis detection and quality screening, and reasonable file grouping is combined to ensure file accuracy.

Benefits of technology

Quickly and accurately detect and correct abnormal files, improve the accuracy of portrait files, reduce the calculation amount and multi-file rate, and improve the reliability of the security system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113868458B_ABST
    Figure CN113868458B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a method and device for processing abnormal files, which are used to detect and process misfiled files generated by portrait clustering in a timely and accurate manner. The method includes: determining N portrait files according to the portrait clustering result at the current moment, where each portrait file includes one or more portrait pictures, and N is a positive integer; performing the following processing on each of the N portrait files: determining a first connected graph set corresponding to the portrait file according to the spatial distance between the portrait pictures in the portrait file; if the first portrait picture and the second portrait picture in the portrait file are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than a first set threshold, then determining the portrait file as an abnormal file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular, to a method and device for processing abnormal files. Background Art

[0002] With the rapid development of mobile Internet technology, various monitoring devices are widely used in the security field. In order to effectively strengthen the governance of social public security, the security department often uses the method of portrait clustering to construct a time series database of mobile personnel within a certain range, that is, a portrait file. In the actual portrait clustering process, due to the influence of many factors such as bad weather, foreign object occlusion, device damage, and algorithm defects, the resulting portrait file may have misfiling situations. For example, on a certain date, Zhang San was captured by a certain camera in three pictures p1, p3, and p4, and Li Si was captured by the camera in three pictures p2, p5, and p6. Grouping the collected image data according to the captured objects, that is, the portrait clustering process. In an ideal state, there are three pictures p1, p3, and p4 in Zhang San's file, and there are three pictures p2, p5, and p6 in Li Si's file. However, in the actual clustering process, it may be affected by various factors, resulting in the picture p3 of Zhang San appearing in Li Si's file, which is misfiling.

[0003] Therefore, it is of great significance for security personnel to analyze the accuracy of the file in a timely manner and improve the accuracy of the file to prevent and handle social security problems in a timely manner. In the prior art, the method of secondary clustering is used to improve the accuracy of portrait clustering. However, due to the introduction of new errors, misfiling situations will still inevitably occur, and there is a lack of detection and processing mechanisms for misfiling in the prior art. Summary of the Invention

[0004] The embodiments of this application provide a method and device for processing abnormal files, which are used to detect and process misfiling generated by portrait clustering in a timely and accurate manner.

[0005] In a first aspect, the embodiments of this application provide a method for processing abnormal files, and the method includes:

[0006] According to the portrait clustering result at the current moment, determine N portrait files, each portrait file includes one or more portrait pictures, and N is a positive integer; for each portrait file among the N portrait files, perform the following processing: according to the spatial distance between the portrait pictures in the portrait file, determine the first connected graph set corresponding to the portrait file; if the first portrait picture and the second portrait picture in the portrait file are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than the first set threshold, then determine the portrait file as an abnormal file.

[0007] In the above technical solution, since it is possible to judge according to the distribution of the portrait pictures in the portrait file in the connected graph set and whether the spatial distance between the portrait pictures in the portrait file exceeds the first set threshold, therefore, abnormal portrait files can be accurately detected for subsequent corresponding processing of the abnormal portrait files.

[0008] In a possible design, the method further includes: partitioning the portrait file to obtain P portrait sub-files, where P is a positive integer; if the first portrait picture and the second portrait picture in the portrait file are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than the first set threshold, then determining that the portrait file is an abnormal file, including: if the first portrait picture and the second portrait picture in any one of the P portrait sub-files are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than the first set threshold, then determining that the portrait file is an abnormal file.

[0009] In the above technical solution, the portrait file can be partitioned to obtain multiple portrait sub-files, and then each portrait sub-file can be detected separately for abnormality. If a certain portrait sub-file is abnormal, it can be determined that the portrait file where it is located is also abnormal. In this way, the computational complexity of detecting abnormal files can be effectively reduced and the detection efficiency can be improved.

[0010] In a possible design, after partitioning the portrait file, the method further includes: randomly sampling the portrait pictures in the portrait file to balance the number of portrait pictures included in the P portrait sub-files.

[0011] In the above technical solution, by rebalancing the number of portrait pictures included in each portrait sub-file and avoiding uneven distribution of the number of portrait pictures in each portrait sub-file, the computational complexity of detecting each portrait sub-file can be balanced, thereby improving the detection efficiency. In a possible design, after determining that the portrait file is an abnormal file, the method further includes: extracting the eigenvalue corresponding to each of the M portrait pictures included in the portrait file, where M is a positive integer; determining the kurtosis statistic value according to the eigenvalues corresponding to the M portrait pictures; screening out the abnormal pictures among the M portrait pictures according to the eigenvalues corresponding to the M portrait pictures and the kurtosis statistic value; removing the abnormal pictures from the portrait file.

[0012] In the above technical solution, abnormal pictures in abnormal portrait files can be screened out through kurtosis detection, that is, portrait pictures or noise pictures that do not belong to the portrait file. In this way, the correction of abnormal portrait files can be realized and the accuracy of portrait files can be improved.

[0013] In a possible design, the method further includes: for each abnormal picture, if the abnormal picture meets the quality screening requirements, returning the abnormal picture to the data source for re-clustering, or classifying the abnormal picture into a new portrait file; if the abnormal picture does not meet the quality screening requirements, discarding the abnormal picture.

[0014] In a possible design, if the abnormal picture meets the quality screening requirements, the method further includes: determining the number of clustering times experienced by the abnormal picture; if the number of clustering times experienced by the abnormal picture is less than a second set threshold, returning the abnormal picture to the data source for re-clustering; if the number of clustering times experienced by the abnormal picture is greater than or equal to the second set threshold, classifying the abnormal picture into a new first portrait file.

[0015] The above technical solution can push the portrait pictures that are detected as abnormal pictures but can still be used for subsequent processing back to the data source for re-clustering, thereby ensuring the diversity of portrait pictures; and creating independent files for the portrait pictures that are still detected as abnormal pictures after a specified number of clustering times, thereby improving the accuracy of portrait files.

[0016] In a possible design, the method further includes: obtaining K portrait files after abnormal processing within a set time period, where K is a positive integer greater than or equal to N; grouping the portrait pictures included in the K portrait files according to the spatio-temporal information of the portrait pictures to obtain L picture groups, where L is a positive integer; for each picture group, determining the corresponding second connected graph set; if the portrait pictures in the first portrait file and the second portrait file are included in the same connected graph in the second connected graph set, merging the first portrait file and the second portrait file.

[0017] The above technical solution can reduce the multi-file rate caused by file splitting by re-grouping the portrait files, constructing a connected graph set for each group, and merging the portrait files according to the compactness of the distribution of the pictures in the connected graph set.

[0018] In a second aspect, an abnormal file processing device provided by an embodiment of the present application includes:

[0019] A determination module, configured to determine N portrait files according to the portrait clustering result at the current moment, where each portrait file includes one or more portrait pictures, and N is a positive integer; a processing module, configured to perform the following processing on each portrait file in the N portrait files: determine a first connected graph set corresponding to the portrait file according to the spatial distance between the portrait pictures in the portrait file; if a first portrait picture and a second portrait picture in the portrait file are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than a first set threshold, then determine that the first portrait file is an abnormal file.

[0020] In a possible design, the processing module is further specifically configured to: partition the portrait file to obtain P portrait sub-files, where P is a positive integer; if a first portrait picture and a second portrait picture in any portrait sub-file among the P portrait sub-files are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than the first set threshold, then determine that the portrait file is an abnormal file.

[0021] In a possible design, the processing module is further specifically configured to: balance the number of portrait pictures included in the P portrait sub-files by randomly sampling the portrait file.

[0022] In a possible design, the processing module is further specifically configured to: extract the eigenvalue corresponding to each of the M portrait pictures included in the portrait file, where M is a positive integer; determine the kurtosis statistic value according to the eigenvalues corresponding to the M portrait pictures; screen out the abnormal pictures among the M portrait pictures according to the eigenvalues corresponding to the M portrait pictures and the kurtosis statistic value; remove the abnormal pictures from the portrait file.

[0023] In a possible design, the processing module is further specifically configured to: for each abnormal picture, if the abnormal picture meets the quality screening requirements, then return the abnormal picture to the data source for re-clustering, or classify the abnormal picture into a new portrait file; if the abnormal picture does not meet the quality screening requirements, then discard the abnormal picture.

[0024] In a possible design, if the abnormal picture meets the quality screening requirements, the processing module is further specifically configured to: determine the number of clustering times experienced by the abnormal picture; if the number of clustering times experienced by the abnormal picture is less than a second set threshold, then return the abnormal picture to the data source for re-clustering; if the number of clustering times experienced by the abnormal picture is greater than or equal to the second set threshold, then classify the abnormal picture into a new first portrait file.

[0025] In a possible design, the processing module is further specifically configured to: obtain K portrait files after exception handling within a set time period, where K is a positive integer greater than or equal to N; group the portrait pictures included in the K portrait files according to the spatio-temporal information of the portrait pictures to obtain L picture groups, where L is a positive integer; for each picture group, determine a second connected graph set corresponding to the picture group; if the portrait pictures in the first portrait file and the portrait pictures in the second portrait file are included in the same connected graph in the second connected graph set, then merge the first portrait file and the second portrait file.

[0026] In a third aspect, an embodiment of the present application further provides a computing device, including:

[0027] A memory for storing program instructions;

[0028] A processor for calling the program instructions stored in the memory and executing the methods described in the various possible designs of the first aspect according to the obtained program instructions.

[0029] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, including computer-readable instructions, which when read and executed by a computer, cause the computer to execute the methods described in the various possible designs of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0031] Figure 1 It is a schematic diagram of the system architecture of an abnormal file processing device provided by an embodiment of the present application;

[0032] Figure 2 It is a schematic flowchart of an abnormal file processing method provided by an embodiment of the present application;

[0033] Figure 3 It is a schematic diagram for detecting abnormal files in an embodiment of the present application;

[0034] Figure 4 It is a specific example of a connected graph set in an embodiment of the present application;

[0035] Figure 5 It is a schematic diagram for detecting abnormal pictures in an embodiment of the present application;

[0036] Figure 6Schematic diagram of merging portrait files in the embodiments of the present application;

[0037] Figure 7 Another specific example of the connected graph set in the embodiments of the present application;

[0038] Figure 8 A specific example of the abnormal file processing method provided by the embodiments of the present application;

[0039] Figure 9 Schematic structural diagram of an abnormal file processing device provided by the embodiments of the present application. Detailed implementation manners

[0040] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.

[0041] Figure 1 Exemplarily shows the system architecture of an abnormal file processing device applicable to the embodiments of the present application. As Figure 1 shown, the abnormal file processing device may be a server 100, and the server 100 may include a processor 110, a communication interface 120, and a memory 130.

[0042] Among them, the communication interface 120 is used to communicate with other devices, receive and send information transmitted by other devices, and realize communication.

[0043] The processor 110 is the control center of the server 100, connects various parts of the entire server 100 through various interfaces and lines, and executes various functions of the server 100 and processes data by running or executing software programs or modules stored in the memory 130, and calling data stored in the memory 130. Optionally, the processor 110 may include one or more processing units.

[0044] The memory 130 can be used to store software programs and modules. The processor 110 executes various function applications and data processing by running the software programs and modules stored in the memory 130. The memory 130 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system, application programs required for at least one function, etc.; the data storage area may store data created according to business processing, etc. In addition, the memory 130 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0045] It should be noted that the Figure 1 structure shown above is only an example, and the embodiments of the present application do not limit this.

[0046] Figure 2 Exemplarily, an abnormal file processing method provided by the embodiments of the present application is shown. This process can be executed by an abnormal file processing device, which can be a server or a device in the server (such as a chip, etc.). As Figure 2 shown, the method includes:

[0047] Step 201: Determine N portrait files according to the portrait clustering result at the current moment. Each portrait file includes one or more portrait pictures, and N is a positive integer.

[0048] In the above step, when obtaining the portrait clustering result, a stream computing framework can be used to obtain the portrait clustering result at the current moment in real time. Among them, the stream computing framework can be, but is not limited to, stream computing frameworks such as Spark and Flink. In addition, portrait picture data can be obtained in real time, and the quality of the portrait pictures can be screened, and the portrait pictures with unclear shooting quality can be excluded. Then, in combination with spatio-temporal information, the portrait pictures can be screened, and the portrait pictures with illogical spatio-temporal information can be excluded. For example, in the portrait pictures of a person, there are two portrait pictures taken by monitoring device 1 at 5:15, and there are also two portrait pictures taken by monitoring device 2 3 kilometers away at 5:16. Then, according to the average walking speed, it is easy to judge that at least one of the portrait pictures taken by device 1 and device 2 does not conform to logic. At this time, the portrait pictures with incorrect spatio-temporal information can be selectively excluded or the incorrect spatio-temporal information can be corrected.

[0049] After portrait clustering, the portrait pictures belonging to the same portrait file all have the same file identifier. In this way, the obtained portrait picture data is merged according to the file identifier to obtain N portrait files. In theory, each portrait file includes portrait pictures belonging to the same person, but due to the influence of many factors such as bad weather, foreign object occlusion, device damage, and algorithm defects, the obtained portrait files may have misfiling situations at this time. Therefore, it is necessary to detect and correct the misfiling.

[0050] Step 202: Perform the following processing on each of the above N portrait files:

[0051] Determine the first connected graph set corresponding to the portrait file according to the spatial distance between the portrait pictures in the portrait file. If the first portrait picture and the second portrait picture in the portrait file are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than the first set threshold, then determine that the portrait file is an abnormal file.

[0052] Exemplarily, as Figure 3 shown, in step 301, the spatial distances between the portrait pictures in the portrait file are calculated pairwise to obtain an adjacency list. The head node of the adjacency list stores the number vi of the portrait picture and other relevant information, and the remaining nodes store the numbers of other portrait pictures adjacent to the portrait picture vi, the spatial distance between the portrait picture vi and other portrait pictures, and other relevant information. In step 302, a plurality of connected graphs are obtained according to the adjacency list to form a first connected graph set. Each vertex in the connected graph represents a portrait picture. Whether there is a directly connected edge between two vertices is determined according to the spatial distance between the portrait pictures stored in the adjacency list and the third set threshold. If the spatial distance between two portrait pictures is less than or equal to the third set threshold, there is an edge directly connecting the two vertices. The third set threshold can be set according to experience. In step 303, it is determined whether the portrait file is an abnormal file according to the distribution of the portrait pictures in the portrait file in the first connected graph set and the spatial distance between the portrait pictures.

[0053] The portrait pictures in the same portrait file can be distributed in different connected graphs in the first connected graph set. If the spatial distance between two portrait pictures that are not in the same connected graph is greater than the first set threshold, it can be determined that the portrait file is an abnormal file. The first set threshold can be set according to experience. It should be noted that the first set threshold is greater than the above-mentioned third set threshold.

[0054] In the above steps, calculating the spatial distance between portrait pictures can be the Manhattan distance calculated according to the L1 distance metric algorithm, or it can also be the cosine distance, Euclidean distance, Hamming distance, etc. This application does not limit. For example, n portrait features of each portrait picture are extracted, such as information on eyes, nose, mouth, ears, facial contour, body shape, etc. According to the feature vectors corresponding to the portrait features, the Manhattan distance between the n portrait features is calculated and used as the spatial distance between the portrait pictures.

[0055] Next, in combination with Figure 4 an example is given to illustrate how to use the connected graph to judge an abnormal file. In Figure 4In the set of connected graphs shown, a circular vertex represents a portrait picture, and the number in the circular vertex is the number of the portrait picture. A solid edge between two circular vertices indicates that the spatial distance between the two portrait pictures is less than or equal to a third set threshold, and a dashed line indicates that the spatial distance between the two portrait pictures is greater than a first set threshold. Assume that portrait pictures 1 - 7 are 7 portrait pictures in the same file. By calculating the spatial distance between these 7 portrait pictures pairwise, the adjacency list of the portrait pictures can be obtained. According to the spatial distance between the portrait pictures stored in the adjacency list and the third set threshold, it is known that there are 5 edges, namely (1, 2), (1, 3), (2, 4), (3, 4), (5, 6), and then three connected graphs G1(1, 2, 3, 4), G2(5, 6), and G3(7) are obtained. By comparing with the first set threshold, it can be seen that the spatial distance between portrait pictures 5 and 7 exceeds the first set threshold. Therefore, it can be determined that this portrait file is an abnormal file.

[0056] In a possible implementation, the abnormal detection of a portrait file may include: first, partitioning the portrait file to obtain P portrait sub - files, and then performing abnormal detection on each of the P portrait sub - files respectively to obtain a judgment on whether the entire portrait file is abnormal, where P is a positive integer, and the portrait sub - file can also be referred to as a portrait file partition or partition. For example, the portrait file can be partitioned according to the spatio - temporal information of the portrait pictures, and the spatio - temporal information here can be the device number and shooting time of the device that took the portrait pictures. If the first portrait picture and the second portrait picture in any one of the P portrait sub - files are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than the first set threshold, then it can be determined that this portrait file is an abnormal file.

[0057] Optionally, after the initial partitioning of the portrait file, through random sampling, the number distribution of the portrait pictures in the portrait file in each portrait sub - file can be known, and then the number of portrait pictures in each portrait sub - file can be balanced to obtain the final P portrait files. For example, the partitions with fewer portrait pictures can be merged into other partitions, or the partitions with more portrait pictures can be split into multiple partitions with balanced picture numbers, so as to balance the computational amount of abnormal detection for each partition and avoid the long - tail phenomenon in the calculation process.

[0058] Furthermore, after determining that the portrait file is an abnormal file, the abnormal pictures in the portrait file can be removed, so as to correct the abnormal file and restore it to a normal portrait file. Among them, the abnormal picture refers to a portrait picture that should not belong to this portrait file, and can also be called a noise picture.

[0059] Exemplarily, such as Figure 5As shown, in step 501, the feature values corresponding to M portrait pictures included in the portrait file are extracted respectively, where M is a positive integer; in step 502, the kurtosis statistical value is determined according to the feature values corresponding to the M portrait pictures; in step 503, according to the feature values corresponding to the M portrait pictures and the kurtosis statistical value, the abnormal pictures among the M portrait pictures are screened out; in step 504, the abnormal pictures are removed from the portrait file.

[0060] Among them, the feature value corresponding to the portrait picture can be a parameter obtained according to the feature data of multiple dimensions of the portrait picture and used to represent the characteristics of the portrait picture as a whole. The feature data of the multiple dimensions can be, for example, information such as the eyes, nose, mouth, ears, facial contour, and body shape of the person in the portrait picture.

[0061] Generally, the feature data of the portrait pictures in the same portrait file conform to the normal distribution in terms of distribution, while the noise data is significantly deviated from the main body. Therefore, the judgment and processing method of normal sample outliers can be used to detect the noise data in the portrait file, that is, the abnormal portrait pictures that are not in this file in the portrait file. In this solution, the kurtosis detection method is exemplarily shown to detect the abnormal portrait pictures in the portrait file.

[0062] The steps to detect the abnormal portrait pictures in the portrait file according to the kurtosis detection method are as follows:

[0063] 1) Calculate the kurtosis statistical value b k .

[0064]

[0065] Among them, n is the sample size (i.e., the number of observations), x i is the i-th observation value sorted from small to large, is the sample mean.

[0066] 2) Determine the detection level α (i.e., the strictness of outlier detection, generally taking 5% to 10%), and determine the critical value b’ 1-α (n) according to the critical value table of kurtosis test (see national standard GB / T4883 - 2008).

[0067] 3) When b k > b’ 1-α (n), it is determined that the observation value farthest from the mean is an outlier, otherwise it is determined that no outlier is found.

[0068] Each time the above steps are executed, one outlier can be removed. Repeating the above steps can screen out all the abnormal pictures in the portrait file.

[0069] It should be noted that the above method is only an example of detecting abnormal portrait pictures in the portrait file. Abnormal portrait pictures can also be detected according to other algorithms, and the embodiments of the present application do not limit this.

[0070] Further, for each detected abnormal picture, it can first be determined whether the abnormal picture meets the quality screening requirements. If it meets the quality screening requirements, the abnormal picture can be returned to the data source for re-clustering, or the abnormal picture can be classified into a new portrait file; otherwise, if it does not meet the quality screening requirements, the abnormal picture is discarded.

[0071] Among them, the quality screening of abnormal pictures can refer to: evaluating the quality of portrait pictures according to the three-dimensional pose of the face in the portrait picture (such as yaw angle, pitch angle, and roll angle), and the preset threshold of the deflection angle, where the yaw angle, pitch angle, and roll angle are used to represent the tilt angles of the face in three dimensions. For example, when a monitoring device captures a side face picture of a person, the side face picture can expose most of the portrait features. Therefore, it can be considered that the side face picture meets the quality screening requirements. However, if the monitoring device captures a picture of a person with their head down or a picture of the back of the head, the picture of the person with their head down or the picture of the back of the head does not expose the portrait features or only exposes a small part of the portrait features. Therefore, it can be considered that the picture of the person with their head down or the picture of the back of the head does not meet the quality screening requirements. In this way, by screening the quality of abnormal pictures, portrait pictures with more portrait features can be retained, returned to the data source for re-clustering, and portrait pictures with fewer portrait features can be excluded.

[0072] In the embodiments of the present application, the number of clustering times experienced by each portrait picture can also be recorded. If the abnormal picture meets the quality screening requirements, the subsequent processing operation is determined according to the number of clustering times experienced by the abnormal picture. Exemplarily, if the number of clustering times experienced by the abnormal picture is less than the second set threshold, the abnormal picture is returned to the data source for re-clustering. If the number of clustering times experienced by the abnormal picture is greater than or equal to the second set threshold, the abnormal picture is classified into a new first portrait file, that is, the portrait picture is split from the currently affiliated portrait file and used as a separate portrait file.

[0073] Furthermore, in order to solve the multi-file problem introduced during the file splitting process or the multi-file problem that occurs due to objective reasons during the portrait clustering process, the embodiments of the present application can also merge the obtained multiple portrait files. For example, it can be decided according to the need whether to merge the split portrait files, or to merge the portrait clustering results after removing the abnormal files with the split portrait files; it is also possible to collect multiple batches of portrait files processed as above and then merge them.

[0074] The merging process of the portrait files can be as Figure 6As shown, in step 601, K processed portrait files within a set time period are obtained, where K is a positive integer greater than or equal to N; in step 602, according to the spatio-temporal information of the portrait pictures, the portrait pictures included in the K portrait files are grouped to obtain L picture groups, where L is a positive integer; in step 603, for each picture group, a second connected graph set corresponding to the picture group is determined; in step 604, if the portrait pictures in the first portrait file and the portrait pictures in the second portrait file are included in the same connected graph in the second connected graph set, then the first portrait file and the second portrait file are merged. It should be noted that here the principle of merging portrait files is introduced by taking the first portrait file and the second portrait file as examples. Obviously, in this application, multiple portrait files with portrait pictures located in the same connected graph can also be merged, and this application does not make specific limitations.

[0075] Among them, the spatio-temporal information can be the monitoring device number for taking the portrait picture. Re-grouping the portrait pictures in the K portrait files according to the spatio-temporal information of the portrait pictures means: shuffling the portrait pictures in the K portrait files and dividing the portrait pictures with similar spatio-temporal information into one group as much as possible. Exemplarily, the above steps 603 and 604 can be: First, calculate the spatial distance between each pair of portrait pictures in each picture group, and construct an adjacency list of the spatial distances of the portrait pictures; then, obtain the connected graph according to the adjacency list of the spatial distances of the portrait pictures. Among them, each vertex in the connected graph represents a portrait picture, and whether there is a directly connected edge between two vertices is determined according to the spatial distance between the portrait pictures stored in the adjacency list and the fourth set threshold. If the spatial distance between two portrait pictures is less than or equal to the fourth set threshold, there is an edge directly connecting the two vertices. The fourth set threshold is set according to experience. The fourth set threshold can be equal to the third set threshold or not equal to the third set threshold, and the present invention does not make limitations in this regard. Furthermore, detect the portrait files to which the portrait pictures in each connected graph belong, and merge the different portrait files to which the portrait pictures in the same connected graph belong.

[0076] The following combines Figure 7 to illustrate by example how to merge multiple portrait files using a connected graph. In Figure 7In the connected graph shown, a circular vertex represents a portrait picture, and the number in the circular vertex is the number of the portrait picture. A solid edge between two circular vertices indicates that the spatial distance between the two portrait pictures is less than or equal to the fourth set threshold. Suppose portrait pictures 1 - 7 are 7 portrait pictures grouped according to spatio - temporal information. By calculating the spatial distance between these 7 portrait pictures pairwise, the adjacency list of the portrait pictures can be obtained. According to the spatial distance between the portrait pictures stored in the adjacency list and the fourth set threshold, it is known that there are 6 edges: (1, 3), (2, 3), (2, 4), (5, 6), (5, 7), (6, 7). Furthermore, two connected graphs G1(1, 2, 3, 4) and G2(5, 6, 7) are obtained. By detecting the portrait files to which the 7 portrait pictures belong, it is known that portrait pictures 1 and 2 belong to portrait file A, portrait pictures 3 and 4 belong to portrait file B, portrait pictures 5 and 6 belong to portrait file C, and portrait picture 7 belongs to portrait file D. Portrait pictures 1, 2 and portrait pictures 3, 4 are in the same connected graph G1. Therefore, merge portrait file A where portrait pictures 1 and 2 are located and portrait file B where portrait pictures 3 and 4 are located. Portrait pictures 5, 6 and portrait picture 7 are in the same connected graph G2. Therefore, merge portrait file C where portrait pictures 5 and 6 are located and portrait file D where portrait picture 7 is located.

[0077] To understand the embodiments of the present application more clearly, the abnormal file processing process in the technical solution of the present application will be described in detail below through a specific example. As Figure 8 shown, the process may include:

[0078] Step 801, obtain the portrait clustering result in real - time, and obtain and filter the real - time portrait picture stream.

[0079] Step 801a, collect the portrait clustering result in real - time.

[0080] With the help of the stream computing framework, obtain the portrait clustering result in real - time.

[0081] Step 801b, collect the real - time portrait picture stream and perform data screening.

[0082] Obtain the real - time portrait picture stream. First, perform quality screening on the portrait pictures, and then perform further screening in combination with spatio - temporal information.

[0083] Step 801c, merge and partition the portrait pictures.

[0084] According to the portrait clustering result, merge the portrait picture stream to obtain different portrait files, and partition each portrait file to obtain different portrait sub - files.

[0085] Step 801d, data sampling and re - balancing.

[0086] Sample the portrait pictures in the partition and balance the number of portrait pictures in each partition.

[0087] Step 802: Perform anomaly detection on the portrait sub-files in each partition.

[0088] Step 802a: Number the portrait pictures.

[0089] For the portrait pictures in each portrait sub-file, start indexing from 0.

[0090] Step 802b: Construct an adjacency list.

[0091] Use the L1 metric algorithm to calculate the spatial distance between portrait pictures and construct an adjacency list for each portrait picture.

[0092] Step 802c: Construct a connected graph.

[0093] Based on the adjacency list of portrait pictures, construct a set of connected graphs of portrait pictures.

[0094] Step 802d: Detect abnormal portrait sub-files.

[0095] Based on the preset threshold of spatial distance and the distribution of portrait pictures in the set of connected graphs, determine the abnormal portrait sub-files, and the portrait files where the abnormal portrait sub-files are located are abnormal files.

[0096] Step 802e: Push down the classification of portrait files.

[0097] Identify the status (abnormal or non-abnormal) of the portrait files and push them downstream.

[0098] Step 803: Screen out the abnormal portrait pictures in the abnormal portrait files.

[0099] Step 803a: Extract the detected abnormal portrait files.

[0100] Extract the abnormal portrait files in Step 803 and extract the feature data of the individual portrait pictures in the abnormal portrait files.

[0101] Step 803b: Determine abnormal portrait pictures according to the kurtosis detection method.

[0102] Detect the feature data of the portrait pictures according to the kurtosis detection method and determine the abnormal pictures that do not belong to the current file in the abnormal file.

[0103] Step 803c: Screen and recluster the quality of abnormal portrait pictures.

[0104] Return the abnormal portrait pictures that meet the quality screening requirements to the data source and perform portrait clustering again.

[0105] Step 803d: Detect and split the abnormal portrait pictures.

[0106] If it is still detected as an abnormal portrait picture after multiple portrait clusterings, the abnormal portrait picture is filed independently.

[0107] Step 804: Merge all portrait files in real time.

[0108] Step 804a: Extract all portrait files and regroup them.

[0109] Extract all portrait files in Step 803, and regroup all portrait pictures in the portrait files according to spatio-temporal information.

[0110] Step 804b: Calculate the spatial distance between portrait pictures.

[0111] Calculate the spatial distance between portrait pictures in each group and construct an adjacency list.

[0112] Step 804c: Construct a set of connected graphs where the portrait pictures are located.

[0113] According to the adjacency list, obtain the set of connected graphs where the portrait pictures are located.

[0114] Step 804d: Merge the portrait files of the same connected graph.

[0115] Traverse the set of connected graphs and merge the portrait files in the same connected graph.

[0116] In the embodiment of the present application, first, with the help of graph-related technologies, abnormal portrait files are quickly and accurately screened out, reducing the calculation amount of subsequent abnormal picture detection; then, according to the kurtosis detection method, abnormal pictures in the abnormal portrait files are screened out and removed, improving the accuracy of portrait files in the portrait clustering process; finally, with the help of graph technology again, the split portrait files are merged, reducing the multi-file rate. Through the above steps, it is possible to quickly and accurately detect and correct misfiling in the portrait clustering process, and improve the accuracy of portrait files.

[0117] Based on the same concept, Figure 9 Exemplarily, an abnormal file processing device provided by the embodiment of the present application is shown. The device is used to implement any one of the abnormal file processing methods in the above embodiments.

[0118] As Figure 9 shown, the device 900 includes:

[0119] A determination module 901, configured to determine N portrait files according to the portrait clustering result at the current moment. Each portrait file includes one or more portrait pictures, and N is a positive integer;

[0120] A processing module 902 is configured to perform the following processing on each of the N portrait files: determining a first connected graph set corresponding to the portrait file according to the spatial distance between portrait pictures in the portrait file; if a first portrait picture and a second portrait picture in the portrait file are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than a first set threshold, determining that the first portrait file is an abnormal file.

[0121] In a possible design, the processing module 902 is further specifically configured to: partition the portrait file to obtain P portrait sub-files, where P is a positive integer; if a first portrait picture and a second portrait picture in any one of the P portrait sub-files are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than the first set threshold, determining that the portrait file is an abnormal file.

[0122] In a possible design, the processing module 902 is further specifically configured to: balance the number of portrait pictures included in the P portrait sub-files by randomly sampling the portrait file.

[0123] In a possible design, the processing module 902 is further specifically configured to: extract the eigenvalue corresponding to each of the M portrait pictures included in the portrait file, where M is a positive integer; determine a kurtosis statistic value according to the eigenvalues corresponding to the M portrait pictures; screen out abnormal pictures from the M portrait pictures according to the eigenvalues corresponding to the M portrait pictures and the kurtosis statistic value; and remove the abnormal pictures from the portrait file.

[0124] In a possible design, the processing module 902 is further specifically configured to: for each abnormal picture, if the abnormal picture meets the quality screening requirements, returning the abnormal picture to the data source for re-clustering, or classifying the abnormal picture into a new portrait file; if the abnormal picture does not meet the quality screening requirements, discarding the abnormal picture.

[0125] In a possible design, if the abnormal picture meets the quality screening requirements, the processing module 902 is further specifically configured to: determine the number of clustering times experienced by the abnormal picture; if the number of clustering times experienced by the abnormal picture is less than a second set threshold, returning the abnormal picture to the data source for re-clustering; if the number of clustering times experienced by the abnormal picture is greater than or equal to the second set threshold, classifying the abnormal picture into a new first portrait file.

[0126] In a possible design, the processing module 902 is further specifically configured to: obtain K portrait files that have undergone exception handling within a set time period, where K is a positive integer greater than or equal to N; group the portrait pictures included in the K portrait files according to the spatio-temporal information of the portrait pictures to obtain L picture groups, where L is a positive integer; for each picture group, determine a second connected graph set corresponding to the picture group; if a portrait picture in the first portrait file and a portrait picture in the second portrait file are included in the same connected graph in the second connected graph set, then merge the first portrait file and the second portrait file.

[0127] Based on the same concept, an embodiment of the present application provides a computing device, including:

[0128] A memory for storing program instructions;

[0129] A processor for calling the program instructions stored in the memory and executing the above-mentioned exception file processing method according to the obtained program instructions.

[0130] Based on the same concept, an embodiment of the present application provides a computer-readable storage medium, including computer-readable instructions, which when read and executed by a computer, cause the computer to execute the above-mentioned exception file processing method.

[0131] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of 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 the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for realizing the functions specified in Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0132] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device realizes the functions specified in Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0133] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are executed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions for implementing the functions specified in one process or a plurality of processes and / or blocks Figure 1 one process or a plurality of processes and / or blocks Figure 1 steps of a block or a plurality of blocks.

[0134] Although the preferred embodiments of the present application have been described, additional changes and modifications can be made by those skilled in the art once they learn the basic creative concept. Therefore, the appended claims are intended to be construed to cover the preferred embodiments as well as all changes and modifications falling within the scope of the present application.

[0135] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims

1. A method for processing abnormal files, characterized in that, Including: Determine N portrait files according to the portrait clustering result at the current moment. Each portrait file includes one or more portrait pictures, and N is a positive integer; Perform the following processing for each of the N portrait files: Determine a first connected graph set corresponding to the portrait file according to the spatial distance between the portrait pictures in the portrait file; If the first portrait picture and the second portrait picture in the portrait file are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than a first set threshold, then determine that the portrait file is an abnormal file; The determining the first connected graph set corresponding to the portrait file according to the spatial distance between the portrait pictures in the portrait file includes: Calculate the spatial distance between every two portrait pictures in the portrait file to obtain an adjacency list; the head node of the adjacency list stores the number and other relevant information of the portrait picture, and the remaining nodes store the numbers of other portrait pictures adjacent to this portrait picture, the spatial distance between this portrait picture and other portrait pictures, and other relevant information; Obtain multiple connected graphs according to the adjacency list to form a first connected graph set; wherein, each vertex in the connected graph represents a portrait picture, and if the spatial distance between two portrait pictures is less than or equal to a third set threshold, there is an edge directly connecting the two vertices.

2. The method according to claim 1, characterized in that, The method further includes: Partition the portrait file to obtain P portrait sub-files, and P is a positive integer; If the first portrait picture and the second portrait picture in the portrait file are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than a first set threshold, then determining that the portrait file is an abnormal file includes: If the first portrait picture and the second portrait picture in any one of the P portrait sub-files are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than the first set threshold, then determine that the portrait file is an abnormal file.

3. The method according to claim 2, wherein After partitioning the portrait file, the method further includes: Balance the number of portrait pictures included in the P portrait sub-files by randomly sampling the portrait pictures in the portrait file.

4. The method according to claim 1, wherein After determining that the portrait file is an abnormal file, the method further includes: Extract the eigenvalue corresponding to each of the M portrait pictures included in the portrait file, and M is a positive integer; Determine the kurtosis statistic value according to the eigenvalues corresponding to the M portrait pictures; Screen out abnormal pictures among the M portrait pictures according to the eigenvalues corresponding to the M portrait pictures and the kurtosis statistic value; Remove the abnormal pictures from the portrait file.

5. The method according to claim 4, wherein The method further includes: For each abnormal picture, if the abnormal picture meets the quality screening requirements, then return the abnormal picture to the data source for re-clustering, or classify the abnormal picture into a new portrait file; If the abnormal image does not meet the quality screening requirements, discard the abnormal image.

6. The method according to claim 5, characterized in that, If the abnormal image meets the quality screening requirements, the method further includes: Determine the number of clustering times experienced by the abnormal image; If the number of clustering times experienced by the abnormal image is less than the second set threshold, return the abnormal image to the data source for re-clustering; If the number of clustering times experienced by the abnormal image is greater than or equal to the second set threshold, classify the abnormal image into a new portrait file.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Obtain K portrait files after abnormal processing within a set time period, where K is a positive integer greater than or equal to N; According to the spatio-temporal information of the portrait pictures, group the portrait pictures included in the K portrait files to obtain L picture groups, where L is a positive integer; For each picture group, determine the corresponding second connected graph set of the picture group; If the portrait pictures in the first portrait file and the second portrait file are included in the same connected graph in the second connected graph set, merge the first portrait file and the second portrait file.

8. An abnormal file processing device, characterized in that, Includes: A determination module, configured to determine N first portrait files according to the portrait clustering result at the current moment, where each first portrait file includes one or more portrait pictures, and N is a positive integer; A processing module, configured to perform the following processing on each of the N first portrait files: determine the first connected graph set corresponding to the first portrait file according to the spatial distance between the portrait pictures in the first portrait file; if the first portrait picture and the second portrait picture in the first portrait file are in different connected graphs in the first connected graph set, and the spatial distance between the first portrait picture and the second portrait picture is greater than the first set threshold, determine that the first portrait file is an abnormal file; The processing module is further configured to calculate the spatial distance between every two portrait pictures in the portrait file to obtain an adjacency list; the head node of the adjacency list stores the number and other relevant information of the portrait picture, and the remaining nodes store the numbers of other portrait pictures adjacent to this portrait picture and the spatial distance and other relevant information between this portrait picture and other portrait pictures; Obtain a plurality of connected graphs according to the adjacency list to form a first connected graph set; wherein, each vertex in the connected graph represents a portrait picture, and if the spatial distance between two portrait pictures is less than or equal to the third set threshold, there is an edge directly connecting the two vertices.

9. A computing device, characterized in that, Includes: A memory, configured to store program instructions; A processor, configured to call the program instructions stored in the memory and execute the method according to any one of claims 1 to 7 according to the obtained program instructions.

10. A computer-readable storage medium, characterized in that, Includes computer-readable instructions, and when a computer reads and executes the computer-readable instructions, the computer is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Personnel identity attribute determination method and device and electronic equipment

    CN111221991A

  • Regional passenger flow statistical method, system and device based on face clustering and medium

    CN113052079A