File merging method and system, electronic equipment and storage medium

By constructing similar sample arrays in image files and performing two-way similarity verification, the problem of large computing resources and low precision in split file merging is solved, and the recall rate and merging quality of image files are improved.

CN118779291AActive Publication Date: 2024-10-15SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410870811.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-15
Estimated Expiration
2044-06-27

AI Technical Summary

Technical Problem

In the existing technology, the problem of split files caused by clustering algorithms leads to a reduction in the recall rate of picture files, and the split file merging method has large computing resources and low accuracy.

Method used

By obtaining samples from the preset image files, a similar sample array is constructed, a two-way similarity verification method is used to merge the files, and the floating change threshold and the preset configuration coefficient of the inverse relationship are used to determine similar files.

Benefits of technology

It realizes the judgment and merging of similar files with small computing resource requirements, simple calculation and high similarity verification accuracy, significantly improving the recall rate and reducing the file duplication rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779291A_ABST
    Figure CN118779291A_ABST
Patent Text Reader

Abstract

The invention provides an archive merging method and system, electronic equipment and a storage medium. The file merging method comprises the steps of obtaining a first target number of samples in a preset picture file; constructing all samples obtained from the at least two preset picture files into a sample group; determining the similarity between each sample and other samples in the sample group; determining a similar sample array corresponding to each sample based on the similarity; traversing the similar sample array, and if it is determined that at least a second target number of target samples exist in the two preset picture archives, judging that the two preset picture archives are similar archives, and the preset threshold is a floating change threshold and is related to the first target number; and combining similar archives. The method has the advantages of being small in calculation resource requirement, simple in calculation and high in similarity verification precision, and high-precision similar archives can be rapidly judged and merged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image archive processing, and in particular to an archive merging method and system, an electronic device and a storage medium. Background Art

[0002] A picture archive database is a database used to manage and store image data. It contains a large amount of picture data and related information, and is mainly used for applications such as image recognition and analysis.

[0003] At present, clustering technology is generally used to process a large amount of image data, and the image archive data is classified and managed by extracting key information from the images to form corresponding archives (such as face image archives, vehicle image archives, or animal and plant image archives, etc.).

[0004] However, the inventors of the present application discovered that since the clustering algorithm is composed based on the structured information of the image, different photo angles may result in multiple files for the same target object, resulting in split files; and since the clustering algorithm uses a large amount of data, when the image data is processed in batches based on time or space, the problem of split files may also occur.

[0005] Splitting files will reduce the recall rate of image files, thus affecting the subsequent terminal applications of the image file database; and splitting files will also cause redundant file management, bringing management burden to data file management.

[0006] At present, the file merging method for split files generally calculates the similarity based on the pre-trained similarity network model to merge similar split files. However, the inventors found that the file merging method does not perform bidirectional similarity verification on the samples in the split files, and there are problems such as large computing resources and low file merging accuracy. Summary of the invention

[0007] The present application provides a file merging method and system, an electronic device and a storage medium, which are used to solve the problems of large computing resources and low file merging accuracy in the current file merging method of split files.

[0008] According to one aspect of the present application, the present application provides a method for merging archives. The method for merging archives includes: obtaining a first target number of samples in a preset image archive; constructing all samples obtained in at least two preset image archives into a sample group; determining the similarity between each sample and other samples in the sample group; determining the similar sample array corresponding to each sample based on the similarity; traversing the similar sample array, if it is determined that there are at least a second target number of target samples in both preset image archives, then determining that the two preset image archives are similar archives, wherein the similarity between the target sample and the sample in the other preset image archive of the two preset image archives is greater than a preset threshold, the preset threshold is a floating change threshold and is related to the first target number; merging similar archives.

[0009] According to some embodiments of the present application, determining the similar sample array corresponding to each sample based on similarity includes: based on the similarity, selecting a preset number of similar samples that are similar to the sample; constructing a similar sample array based on the preset number of similar samples and the similarity; wherein, in the similar sample array, the preset number of similar samples are arranged in sequence according to the similarity between the similar samples and the samples.

[0010] According to some embodiments of the present application, the preset threshold is inversely proportional to the preset configuration coefficient, and each preset configuration coefficient corresponds to a preset threshold; wherein the value range of the preset configuration coefficient is 1≤α≤K, α is the preset configuration coefficient, α is a positive integer greater than or equal to 1, and K is the first target number; traversing the similar sample array, if it is determined that there are at least a second target number of target samples in both preset image files, then determining that the two preset image files are similar files includes: traversing the similar sample array; determining that there are at least a second target number of target samples in both preset image files, and the similarity between the target sample and the sample in the other preset image file of the two preset image files is greater than the first preset threshold, then determining that the two preset image files are subset similar files corresponding to the first preset threshold; traversing all preset thresholds to obtain at least two subset similar files; taking the union of at least two subset similar files to obtain a similar file.

[0011] According to some embodiments of the present application, after traversing the similar sample array, if there are at least a second target number of target samples in both preset picture files, then the two preset picture files are determined to be similar files, and the file merging method further includes: determining that there is a third preset picture file outside the two preset picture files that is a similar file to any one of the two preset picture files, then determining that the third preset picture file and the two preset picture files are both similar files.

[0012] According to another aspect of the present application, the present application provides a file merging system. The file merging system includes a sample processing module, a similarity calculation module, a similar file processing module and a similar file merging module. The sample processing module obtains a first target number of samples in a preset image file, and constructs all samples obtained in at least two preset image files into a sample group; the similarity calculation module determines the similarity between each sample and other samples in the sample group; the similar file processing module determines the similar sample array corresponding to each sample based on the similarity; and the similar file processing module traverses the similar sample array, and if there are at least a second target number of target samples in both preset image files, the two preset image files are determined to be similar files, wherein the similarity between the target sample and the sample in another preset image file of the two preset image files is greater than a preset threshold, and the preset threshold is a floating change threshold and is related to the first target number; the similar file merging module merges similar files.

[0013] According to some embodiments of the present application, the similarity file processing module selects a preset number of similar samples that are similar to the sample based on the similarity, and constructs a similar sample array based on the preset number of similar samples and the similarity; wherein, in the similar sample array, the preset number of similar samples are arranged in sequence according to the similarity between the similar samples and the samples.

[0014] According to some embodiments of the present application, the preset threshold is inversely proportional to the preset configuration coefficient, and each preset configuration coefficient corresponds to a preset threshold; wherein the value range of the preset configuration coefficient is 1≤α≤K, α is the preset configuration coefficient, α is a positive integer greater than or equal to 1, and K is the first target number; the similarity file processing module traverses the similarity sample array; the similarity file processing module determines that there are at least a second target number of target samples in both preset image files, and the similarity between the target sample and the sample in the other preset image file of the two preset image files is greater than the first preset threshold, then the two preset image files are determined to be subset similarity files corresponding to the first preset threshold; the similarity file processing module traverses all preset thresholds to obtain at least two subset similarity files; the similarity file processing module takes the union of at least two subset similarity files to obtain a similarity file.

[0015] According to some embodiments of the present application, if the similar file processing module determines that there is a third preset image file other than the two preset image files and is a similar file to any one of the two preset image files, then it is determined that the third preset image file and the two preset image files are both similar files.

[0016] According to another aspect of the present application, the present application further provides an electronic device. The electronic device includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors can implement the file merging method described above.

[0017] According to another aspect of the present application, the present application further provides a non-volatile computer-readable storage medium, wherein a computer program is stored on the storage medium, and the computer program can implement the archive merging method as described above.

[0018] The present application extracts a preset number of samples from a preset image file, constructs a similar sample array according to the similarity between the samples, and performs bidirectional similarity verification on at least two preset image files based on the similar sample array through cross-validation, thereby obtaining a similar file.

[0019] This application has the characteristics of small computing resource requirements, simple calculations and high similarity verification accuracy. It can quickly realize high-precision judgment and merging of similar archives to effectively reduce the archive splitting rate, thereby providing effective support for subsequent archive management or product applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. 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.

[0021] Figure 1 A flow chart showing a file merging method according to an embodiment of the present application;

[0022] Figure 2 Another flow chart showing the file merging method according to an embodiment of the present application;

[0023] Figure 3 A comparison diagram of experimental data of an embodiment of the present application is shown;

[0024] Figure 4 Another flow chart showing the file merging method according to an embodiment of the present application;

[0025] Figure 5 A schematic diagram showing the structure of the file merging system according to an embodiment of the present application is shown.

[0026] Description of reference numerals:

[0027] File merging system 1; sample processing module 10; similarity calculation module 20; similar file processing module 30; similar file merging module 40. DETAILED DESCRIPTION

[0028] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0029] The described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of these specific details, or other modes, components, materials, devices, etc. may be adopted. In these cases, known structures, methods, devices, implementations, materials or operations will not be shown or described in detail.

[0030] In addition, the terms "include" and "have" and any variations thereof 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 limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0031] The terms "first", "second" and the like in the specification and claims of this application and the above drawings are used to distinguish different objects rather than to describe a specific order.

[0032] The following is a clear and complete description of the technical solution of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present application.

[0033] According to one aspect of the present application, the present application provides a file merging method. Figure 1 A flow chart showing a file merging method according to an embodiment of the present application; Figure 2 Another flow chart of the file merging method according to an embodiment of the present application is shown.

[0034] like Figure 1 As shown, the file merging method includes steps S100-S600.

[0035] Exemplarily, the file merging method may be executed by a file merging system.

[0036] According to an example embodiment, in step S100 , the file merging system obtains a first target number of samples in a preset image file.

[0037] For example, the preset image file may be a face file database, a vehicle image file database, or an animal or plant image file database, etc.

[0038] Taking a face archive database as an example, a face archive database only stores a certain number of face images of the same person, and these face images are stored in a structured vector form.

[0039] For example, in step S100, the file merging system extracts K samples from a preset image file. The value of K can be customized according to user needs.

[0040] In step S200 , the file merging system determines all samples obtained from at least two preset image files as a sample group.

[0041] For example, the file merging system extracts K samples from N preset image files in the same way to obtain a sample group S. The sample group S includes N*K samples. The value of N can be customized according to user needs.

[0042] Optionally, the file merging system saves the mapping relationship between the sample and the preset picture file based on a preset saving method.

[0043] For example, the archive merging system saves the mapping relationship between samples and preset image archives based on dictionaries. A dictionary is an unordered data structure used to store key-value pairs, where each key is unique. The underlying implementation of the dictionary is done through a hash table, which allows it to be quickly accessed based on the key value.

[0044] Exemplarily, the file merging system may also save the mapping relationship between the sample and the preset image file through other data saving methods (such as manual data mapping saving, embedded mapping saving or metadata mapping saving, etc.), and this application does not impose any restrictions on this.

[0045] Through the above embodiments, the file merging system can quickly trace which preset image file a sample belongs to through a mapping relationship.

[0046] In step S300 , the archive merging system determines the similarity between each sample and other samples in the sample group.

[0047] For example, the archive merging system traverses and calculates the i-th sample S i The similarity with other N*K-1 samples.

[0048] Exemplarily, the file merging system can calculate the similarity between each sample by cosine similarity. Cosine Similarity refers to measuring the similarity between two vectors by the cosine value of the angle between the two vectors. Since the pictures in the preset picture file are stored in the form of structured vectors, the similarity between each sample can be calculated by cosine Similarity.

[0049] The file merging system may also calculate the similarity between samples by other similarity methods (such as mean square error similarity, distance similarity, structural similarity or hash value similarity, etc.), and this application does not impose any limitation on this.

[0050] In step S400 , the file merging system determines a similar sample array corresponding to each sample based on the similarity.

[0051] For example, based on the similarities between the samples, the archive merging system determines similar samples that are similar to each sample, and constructs a similar sample array M[i] based on the similar samples and the corresponding similarities.

[0052] Alternatively, if Figure 2 As shown, in step S400, the file merging system determines the similar sample array corresponding to each sample based on the similarity and may further include steps S410-S420.

[0053] In step S410 , the file merging system selects a preset number of similar samples that are similar to the sample based on the similarity.

[0054] For example, after determining the similarity between each sample and other samples, the archive merging system can search for the first a similar samples with the highest similarity to the sample through a search tool. For example, the value of a can be customized according to user needs.

[0055] Exemplarily, the search tool includes but is not limited to the Faiss (Facebook AI Similarity Search) tool, and may also be a Sentence-Similarity sentence similarity search tool, a Turnitin Similarity duplicate search tool, a Beyond Compare data comparison search tool, etc., and this application does not impose any restrictions on this.

[0056] In step S420 , the file merging system constructs a similar sample array M[i] according to a preset number of similar samples and similarities.

[0057] In the similar sample array M[i], a preset number of similar samples are arranged in sequence according to the similarity between the similar samples.

[0058] For example, the similar sample array M[i] corresponding to the i-th sample is:

[0059] M[i]=[(X i1 ,Y i1 ),(X i2 ,Y i2 )...(X ia ,Y ia )]

[0060] Among them, X i1 , X i2 , ..., X ia is a similar sample to the i-th sample, Y i1 , Y i2 , ..., Y ia Y is the similarity corresponding to a similar samples similar to the i-th sample. i1 , Y i2 , ..., Y ia They are arranged from large to small.

[0061] Exemplarily, based on the above similar sample array M[i], the similar sample array of all i samples can be expressed as:

[0062] M(i)=M[1+K*(i-1):K*i]

[0063] Through the above embodiments, the present application selects top-a similar samples through the similarity between each sample, and can accurately find similar samples similar to each sample, thereby improving the accuracy of file merging.

[0064] In step S500 , the file merging system traverses the similar sample array, and if it is determined that at least a second target number of target samples exist in both of the two preset image files, the two preset image files are determined to be similar files.

[0065] The similarity between the target sample and a sample in another preset picture file of the two preset picture files is greater than a preset threshold.

[0066] In step S600 , the file merging system merges similar files.

[0067] For example, the file merging system traverses the similar sample array, and reads the similar samples corresponding to each sample and the similarity corresponding thereto based on the similar sample array.

[0068] The target sample is a sample whose similarity with a sample in another preset image file is greater than a preset threshold.

[0069] For example, given two preset image file ids e and id f If the file merge system determines that the id e There are at least b (the second target number) target samples in id f Find the sample whose similarity with the sample in it is greater than the preset threshold Y, and at the same time the file merging system determines the sample in id f There are at least b target samples in id e Find a sample whose similarity with the sample in it is greater than the preset threshold Y, then the file merging system determines the id e and id f For similar files, similar files will be merged.

[0070] Exemplarily, the value of the second target quantity b can be customized according to user needs.

[0071] According to an example embodiment, the preset threshold value Y is a floating change threshold value related to the first target quantity K.

[0072] For example, the preset threshold value Y is floating and changing, and the preset threshold value Y is related to the first target number K. In the case of different preset threshold values ​​Y, the file merging system can determine similar files corresponding to each preset threshold value Y.

[0073] Figure 3 A comparison chart of experimental data of the embodiments of the present application is shown.

[0074] like Figure 3 As shown, Figure 3 The figure shows the comparison of experimental data after the archive merging method provided by the present application is used and the experimental data without the archive merging.

[0075] For example, a preset data set containing 1.2 million preset image files and 80 million samples is merged. Figure 3 It can be seen that after the file merging process, the recall rate of the preset data set increased by 2.1%, and the file duplication rate decreased by 9.66%. Through the file merging method provided by the present application, the recall rate of the data set after the file merging process can be significantly improved, and the file duplication rate of the data set can be significantly reduced.

[0076] Through the above example embodiments, the present application extracts a preset number of samples from a preset image file, constructs a similar sample array according to the similarity between the samples, and performs bidirectional similarity verification on at least two preset image files based on the similar sample array by cross-validation, thereby obtaining a similar file. The present application has the characteristics of small computing resource requirements, simple calculations, and high similarity verification accuracy, and can quickly realize high-precision judgment and merging of similar files to effectively reduce the file splitting rate, thereby providing effective support for subsequent file management or product applications.

[0077] Optionally, the preset threshold is inversely proportional to the preset configuration coefficient, and each preset configuration coefficient corresponds to a preset threshold. The value range of the preset configuration coefficient is 1≤α≤K, where α is the preset configuration coefficient, α is a positive integer greater than or equal to 1, and K is the first target number.

[0078] For example, the calculation formula of the preset threshold may be Y=β-∈*α. Y is the preset threshold, β is the first hyperparameter, ∈ is the second hyperparameter, α is the preset configuration coefficient, the value range of α is 1≤α≤K, K is the first target number, and α is a positive integer greater than or equal to 1.

[0079] The first hyperparameter β and the second hyperparameter ∈ are hyperparameters that need to be manually set during the machine learning and deep learning model training process, which control the behavior and performance of the model. Exemplarily, the values ​​of the hyperparameters can be customized according to user needs.

[0080] Exemplarily, the default value of the first hyperparameter β may be 0.6, and the default value of the second hyperparameter ∈ may be 0.05.

[0081] Figure 4 Another flow chart of the file merging method according to an embodiment of the present application is shown.

[0082] Alternatively, if Figure 4 As shown, step S500 may further include steps S510-S540.

[0083] In step S510 , the file merging system traverses the similar sample array.

[0084] In step S520, the file merging system determines that both of the two preset image files have at least a second target number of target samples, and the similarity between the target samples and the samples in the other preset image file of the two preset image files is greater than the first preset threshold value Y1, then the two preset image files are determined to be subset similar files corresponding to the first preset threshold value Y1.

[0085] In step S530 , the file merging system traverses all preset thresholds Y to obtain at least two subset similar files.

[0086] In step S540 , the file merging system takes a union of at least two subset similar files to obtain a similar file.

[0087] According to the example embodiment, the file merging system solves a similar file for each preset threshold and records the solution result as a subset similar file. When the file merging system has traversed all the preset thresholds, it merges all the calculated subset similar files to obtain a final similar file.

[0088] For example, if K is set to 6, the value of α is 1, 2, 3, 4, 5, 6. Set the first hyperparameter β to 0.6 and the second hyperparameter ∈ to 0.05.

[0089] Exemplarily, when α=1, Y=0.55. If the file merging system determines that there are at least b samples in two preset image files that have a similarity greater than 0.55 with samples in the other preset image file, the two preset image files are determined to be similar files.

[0090] When α=2, Y=0.5. If the file merging system determines that there are at least b samples in two preset image files that have a similarity greater than 0.5 with samples in the other preset image file, the two preset image files are determined to be similar files.

[0091] When α=3, Y=0.45. If the file merging system determines that there are at least b samples in two preset image files that have a similarity greater than 0.45 with the samples in the other preset image file, the two preset image files are determined to be similar files.

[0092] When α=4, Y=0.4. If the file merging system determines that there are at least b samples in two preset image files that have a similarity greater than 0.4 with samples in the other preset image file, the two preset image files are determined to be similar files.

[0093] When α=5, Y=0.35. If the file merging system determines that there are at least b samples in two preset image files that have a similarity greater than 0.35 with samples in the other preset image file, the two preset image files are determined to be similar files.

[0094] When α=6, Y=0.3. If the file merging system determines that there are at least b samples in two preset image files that have a similarity greater than 0.3 with samples in the other preset image file, the two preset image files are determined to be similar files.

[0095] It can be understood here that, assuming that when there is only one sample in the preset picture file that is highly similar to the sample in another preset picture file, the preset threshold can be set higher; or assuming that there are multiple samples in the preset picture file that are moderately similar to the sample in another preset picture file, the preset threshold can be set slightly lower.

[0096] By setting a floating change threshold, the present application can simultaneously meet the above two assumptions, and can determine all similar files corresponding to multiple different preset threshold conditions, thereby achieving high-precision judgment and merging of similar files to improve the merging quality of similar files.

[0097] Optionally, after step S500, the file merging method may further include: the file merging system determines that there is a third preset image file other than the two preset image files and is a similar file to any one of the two preset image files, then the file merging system determines that the third preset image file and the two preset image files are both similar files.

[0098] For example, the file merging system determines that the id e and id f For similar files, and at the same time the file merging system determines the id e and idj (or id f and idj) are also similar files, the file merging system determines id e ,id f It is also a similar file to idj.

[0099] Through the above-mentioned example embodiments, the present application can perform similarity judgment on multiple similar files, thereby achieving high-precision file merging and effectively reducing the file splitting rate.

[0100] According to another aspect of the present application, the present application provides a file merging system. Figure 5 The schematic diagram of the structure of the file merging system in the embodiment of the present application is shown. Figure 5 As shown, the file merging system 1 includes a sample processing module 10 , a similarity calculation module 20 , a similar file processing module 30 and a similar file merging module 40 .

[0101] According to an exemplary embodiment, the sample processing module 10 obtains a first target number of samples from a preset image file.

[0102] For example, the preset image file may be a face file database, a vehicle image file database, or an animal or plant image file database, etc.

[0103] Taking a face archive database as an example, a face archive database only stores a certain number of face images of the same person, and these face images are stored in a structured vector form.

[0104] Exemplarily, the sample processing module 10 extracts K samples from a preset image file. The value of K can be customized according to user needs.

[0105] The sample processing module 10 determines all samples obtained from at least two preset image files as a sample group.

[0106] For example, the sample processing module 10 extracts K samples from N preset image files in the same way to obtain a sample group S. The sample group S includes N*K samples. The value of N can be customized according to user needs.

[0107] Optionally, the sample processing module 10 saves the mapping relationship between the sample and the preset picture file based on a preset saving method.

[0108] For example, the sample processing module 10 saves the mapping relationship between the sample and the preset image file based on the dictionary. A dictionary is an unordered data structure for storing key-value pairs, where each key is unique. The underlying implementation of the dictionary is completed through a hash table, so that it can be quickly accessed according to the key value.

[0109] Exemplarily, the sample processing module 10 may also save the mapping relationship between the sample and the preset image file through other data saving methods (such as manual data mapping saving, embedded mapping saving or metadata mapping saving, etc.), and the present application does not impose any restrictions on this.

[0110] Through the above embodiments, the file merging system provided by the present application can quickly trace the preset image file to which the sample belongs through the mapping relationship.

[0111] According to an example embodiment, the similarity calculation module 20 determines the similarity between each sample and other samples in the sample group.

[0112] For example, the similarity calculation module 20 traverses and calculates the i-th sample S i The similarity with other N*K-1 samples.

[0113] Exemplarily, the similarity calculation module 20 can calculate the similarity between each sample by cosine similarity. Cosine Similarity refers to measuring the similarity between two vectors by the cosine value of the angle between the two vectors. Since the pictures in the preset picture file are stored in the form of structured vectors, the similarity between each sample can be calculated by cosine Similarity.

[0114] The similarity calculation module 20 may also calculate the similarity between samples by other similarity methods (such as mean square error similarity, distance similarity, structural similarity or hash value similarity, etc.), and the present application does not impose any limitation on this.

[0115] According to an exemplary embodiment, the similarity profile processing module 30 determines a similar sample array corresponding to each sample based on the similarity.

[0116] For example, based on the similarities between the samples, the similarity file processing module 30 determines similar samples similar to each sample, and constructs a similar sample array M[i] according to the similar samples and the corresponding similarities.

[0117] Optionally, the similarity file processing module 30 selects a preset number of similar samples that are similar to the sample based on the similarity.

[0118] For example, after determining the similarity between each sample and other samples, the similarity file processing module 30 can search for the first a similar samples with the highest similarity to the sample through a search tool. For example, the value of a can be customized according to user needs.

[0119] Exemplarily, the search tool includes but is not limited to the Faiss (Facebook AI Similarity Search) tool, and may also be a Sentence-Similarity sentence similarity search tool, a Turnitin Similarity duplicate search tool, a Beyond Compare data comparison search tool, etc., and this application does not impose any restrictions on this.

[0120] The similarity file processing module 30 constructs a similarity sample array M[i] according to a preset number of similar samples and similarities.

[0121] In the similar sample array M[i], a preset number of similar samples are arranged in sequence according to the similarity between the similar samples.

[0122] For example, the similar sample array M[i] corresponding to the i-th sample is:

[0123] M[i]=[(X i1 ,Y i1 ),(X i2 ,Y i2 )...(X ia ,Y ia )]

[0124] Among them, X i1 , X i2 , ..., X ia is a similar sample to the i-th sample, Yi1 , Y i2 , ..., Y ia Y is the similarity corresponding to a similar samples similar to the i-th sample. i1 , Y i2 , ..., Y ia They are arranged from large to small.

[0125] Exemplarily, based on the above similar sample array M[i], the similar sample array of all i samples can be expressed as:

[0126] M(i)=M[1+K*(i-1):K*i]

[0127] Through the above embodiments, the present application selects top-a similar samples through the similarity between each sample, and can accurately find similar samples similar to each sample, thereby improving the accuracy of file merging.

[0128] According to an exemplary embodiment, the similar file processing module 30 traverses the similar sample array, and if there are at least a second target number of target samples in the two preset picture files, the two preset picture files are determined to be similar files.

[0129] The similarity between the target sample and a sample in another preset picture file of the two preset picture files is greater than a preset threshold.

[0130] The similar file merging module 40 merges similar files.

[0131] For example, the similarity file processing module 30 traverses the similarity sample array, and reads the similar samples corresponding to each sample and the similarity corresponding thereto based on the similarity sample array.

[0132] The target sample is a sample whose similarity with a sample in another preset image file is greater than a preset threshold.

[0133] For example, given two preset image file ids e and id f If the similarity file processing module 30 determines that the id e There are at least b (the second target number) target samples in id f Find the sample whose similarity with the sample in it is greater than the preset threshold value Y, and at the same time the similarity file processing module 30 determines the sample in id f There are at least b target samples in id e If a sample with a similarity greater than a preset threshold Y is found in the similarity file processing module 30, the similarity file processing module 30 determines the id e and id f For similar files, similar files will be merged.

[0134] Exemplarily, the value of the second target quantity b can be customized according to user needs.

[0135] According to an example embodiment, the preset threshold value Y is a floating change threshold value related to the first target quantity K.

[0136] For example, the preset threshold value Y is floating and changing, and the preset threshold value Y is related to the first target number K. In the case of different preset threshold values ​​Y, the similarity profile processing module 30 can determine similarity profiles corresponding to each preset threshold value Y.

[0137] Through the above example embodiments, the present application extracts a preset number of samples from a preset image file, constructs a similar sample array according to the similarity between the samples, and performs bidirectional similarity verification on at least two preset image files based on the similar sample array by cross-validation, thereby obtaining a similar file. The present application has the characteristics of small computing resource requirements, simple calculations, and high similarity verification accuracy, and can quickly realize high-precision judgment and merging of similar files to effectively reduce the file splitting rate, thereby providing effective support for subsequent file management or product applications.

[0138] Optionally, the preset threshold is inversely proportional to the preset configuration coefficient, and each preset configuration coefficient corresponds to a preset threshold. The value range of the preset configuration coefficient is 1≤α≤K, where α is the preset configuration coefficient, α is a positive integer greater than or equal to 1, and K is the first target number.

[0139] For example, the calculation formula of the preset threshold may be Y=β-∈*α. Y is the preset threshold, β is the first hyperparameter, ∈ is the second hyperparameter, α is the preset configuration coefficient, the value range of α is 1≤α≤K, K is the first target number, and α is a positive integer greater than or equal to 1.

[0140] The first hyperparameter β and the second hyperparameter ∈ are hyperparameters that need to be manually set during the machine learning and deep learning model training process, which control the behavior and performance of the model. Exemplarily, the values ​​of the hyperparameters can be customized according to user needs.

[0141] Exemplarily, the default value of the first hyperparameter β may be 0.6, and the default value of the second hyperparameter ∈ may be 0.05.

[0142] Optionally, the similarity profile processing module 30 traverses the similarity sample array.

[0143] The similarity file processing module 30 determines that both of the two preset image files have at least a second target number of target samples, and the similarity between the target samples and the samples in the other preset image file of the two preset image files is greater than the first preset threshold value Y1, then the two preset image files are determined to be subset similarity files corresponding to the first preset threshold value Y1.

[0144] The similarity profile processing module 30 traverses all preset thresholds Y to obtain at least two subset similarity profiles.

[0145] The similar file processing module 30 obtains a union of at least two subset similar files to obtain a similar file.

[0146] According to the exemplary embodiment, the similarity profile processing module 30 solves a similarity profile for each preset threshold and records the solution result as a subset similarity profile. After the similarity profile processing module 30 has traversed all preset thresholds, all calculated subset similarity profiles are merged to obtain a final similarity profile.

[0147] For example, if K is set to 6, the value of α is 1, 2, 3, 4, 5, 6. Set the first hyperparameter β to 0.6 and the second hyperparameter ∈ to 0.05.

[0148] For example, when α=1, Y=0.55. If the similarity file processing module 30 determines that there are at least b samples in the two preset picture files that have a similarity greater than 0.55 with the samples in the other preset picture file, the two preset picture files are determined to be similar files.

[0149] When α=2, Y=0.5. If the similarity file processing module 30 determines that there are at least b samples in two preset picture files that have a similarity greater than 0.5 with the samples in the other preset picture file, the two preset picture files are determined to be similar files.

[0150] When α=3, Y=0.45. If the similarity file processing module 30 determines that there are at least b samples in the two preset picture files that have a similarity greater than 0.45 with the samples in the other preset picture file, the two preset picture files are determined to be similar files.

[0151] When α=4, Y=0.4. If the similarity file processing module 30 determines that there are at least b samples in the two preset picture files that have a similarity greater than 0.4 with the samples in the other preset picture file, the two preset picture files are determined to be similar files.

[0152] When α=5, Y=0.35. If the similarity file processing module 30 determines that there are at least b samples in the two preset picture files that have a similarity greater than 0.35 with the samples in the other preset picture file, the two preset picture files are determined to be similar files.

[0153] When α=6, Y=0.3. If the similarity file processing module 30 determines that there are at least b samples in the two preset picture files that have a similarity greater than 0.3 with the samples in the other preset picture file, the two preset picture files are determined to be similar files.

[0154] It can be understood here that, assuming that when there is only one sample in the preset picture file that is highly similar to the sample in another preset picture file, the preset threshold can be set higher; or assuming that there are multiple samples in the preset picture file that are moderately similar to the sample in another preset picture file, the preset threshold can be set slightly lower.

[0155] By setting a floating change threshold, the present application can simultaneously meet the above two assumptions, and can determine all similar files corresponding to multiple different preset threshold conditions, thereby achieving high-precision judgment and merging of similar files to improve the merging quality of similar files.

[0156] Optionally, if the similar file processing module 30 determines that there is a third preset picture file other than the two preset picture files and is similar to any one of the two preset picture files, then the similar file processing module 30 determines that the third preset picture file and both preset picture files are similar files.

[0157] For example, the similar file processing module 30 determines that id e and id f is a similar file, and at the same time the similar file processing module 30 determines that id e and idj (or id f and idj) are also similar files, then the similar file processing module 30 determines that id e ,id f It is also a similar file to idj.

[0158] Through the above-mentioned example embodiments, the present application can perform similarity judgment on multiple similar files, thereby achieving high-precision file merging and effectively reducing the file splitting rate.

[0159] According to another aspect of the present invention, an electronic device is provided, which includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors can implement the file merging method described above.

[0160] According to another aspect of the present invention, a non-volatile computer-readable storage medium is provided, wherein a computer program is stored on the storage medium, and the computer program can implement the archive merging method described above.

[0161] Finally, it should be noted that the above is only a preferred embodiment of the present application and is not intended to limit the present application. Although the present application is described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions of the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A file merging method, characterized in that: include: Acquire a first target number of samples in a preset image file; constructing all samples obtained from at least two of the preset image archives into a sample group; Determining the similarity between each of the samples and other samples in the sample group; Determine a similar sample array corresponding to each of the samples based on the similarity; Traversing the similar sample array, if it is determined that at least a second target number of target samples exist in both of the two preset picture files, then determining that the two preset picture files are similar files, wherein the similarity between the target sample and a sample in the other preset picture file of the two preset picture files is greater than a preset threshold, and the preset threshold is a floating change threshold and is related to the first target number; The similar profiles are merged.

2. The file merging method according to claim 1, characterized in that: Determining the similar sample array corresponding to each sample based on the similarity comprises: Based on the similarity, selecting a preset number of similar samples that are similar to the sample; Constructing the similar sample array according to the preset number of similar samples and the similarity; Wherein, in the similar sample array, the preset number of similar samples are arranged in sequence according to the similarity between the similar samples and the sample.

3. The file merging method according to claim 1, characterized in that: The preset threshold value is inversely proportional to the preset configuration coefficient, and each of the preset configuration coefficients corresponds to a preset threshold value; The value range of the preset configuration coefficient is 1≤α≤K, α is the preset configuration coefficient, α is a positive integer greater than or equal to 1, and K is the first target quantity; The traversing the similar sample array, if it is determined that at least a second target number of target samples exist in both of the two preset image files, then determining that the two preset image files are similar files includes: Traversing the similar sample array; Determining that both of the two preset picture files have at least a second target number of target samples, and the similarity between the target samples and the samples in the other preset picture file of the two preset picture files is greater than a first preset threshold, then determining that the two preset picture files are subset similarity files corresponding to the first preset threshold; Traversing all the preset thresholds to obtain at least two subset similarity profiles; A union is taken for the at least two subset similarity profiles to obtain the similarity profile.

4. The file merging method according to claim 1, characterized in that: After traversing the similar sample array and determining that the two preset image files are similar files if at least the second target number of target samples exists in the two preset image files, the file merging method further includes: If it is determined that there is a third preset picture file other than the two preset picture files and is a similar file to any one of the two preset picture files, then it is determined that the third preset picture file and the two preset picture files are both similar files.

5. A file merging system, characterized in that: include: A sample processing module, which obtains a first target number of samples from a preset picture archive, and constructs all samples obtained from at least two of the preset picture archives into a sample group; A similarity calculation module, determining the similarity between each of the samples and other samples in the sample group; A similarity file processing module determines a similar sample array corresponding to each of the samples based on the similarity; and the similar file processing module traverses the similar sample array, and if there are at least a second target number of target samples in both of the two preset picture files, the two preset picture files are determined to be similar files, wherein the similarity between the target sample and the sample in the other preset picture file of the two preset picture files is greater than a preset threshold, and the preset threshold is a floating change threshold and is related to the first target number; A similar file merging module is used to merge the similar files.

6. The file merging system according to claim 5, characterized in that: The similarity file processing module selects a preset number of similar samples similar to the sample based on the similarity, and constructs the similar sample array according to the preset number of similar samples and the similarity; Wherein, in the similar sample array, the preset number of similar samples are arranged in sequence according to the similarity between the similar samples and the sample.

7. The file merging system according to claim 5, characterized in that: The preset threshold value is inversely proportional to the preset configuration coefficient, and each of the preset configuration coefficients corresponds to a preset threshold value; The value range of the preset configuration coefficient is 1≤α≤K, α is the preset configuration coefficient, α is a positive integer greater than or equal to 1, and K is the first target quantity; The similarity file processing module traverses the similarity sample array; The similarity file processing module determines that both of the two preset picture files have at least a second target number of target samples, and the similarity between the target sample and a sample in the other preset picture file of the two preset picture files is greater than a first preset threshold, then determines that the two preset picture files are subset similarity files corresponding to the first preset threshold; The similarity profile processing module traverses all the preset thresholds to obtain at least two subset similarity profiles; The similarity file processing module takes a union of the at least two subset similarity files to obtain the similarity file.

8. The file merging system according to claim 5, characterized in that: If the similar file processing module determines that there is a third preset picture file other than the two preset picture files and is a similar file to any one of the two preset picture files, then it is determined that the third preset picture file and the two preset picture files are both similar files.

9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the file merging method as described in any one of claims 1-4.

10. A non-volatile computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program implements the file merging method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Method and device for determining similarity of samples dynamically

    CN103714049A

  • Dynamic face clustering method, device and equipment and storage medium

    CN111242040A

  • Picture clustering method and device, electronic equipment and storage medium

    CN111414949A

  • Document image recognition device and method

    CN113033360A

  • Image file inspection method, device and equipment and computer storage medium

    CN114154007A