Image deduplication method, deduplication device, electronic device and readable storage medium

Through multi-dimensional comparison and comprehensive similarity calculation, the problem of poor single-dimensional deduplication effect in the existing technology is solved, a more efficient image deduplication effect is achieved, and the performance of target recognition tasks is improved.

CN118379606BActive Publication Date: 2024-09-27STREAMAP TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410832783.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-27
Estimated Expiration
2044-06-26

AI Technical Summary

Technical Problem

The existing technology only relies on single-dimensional comparison in the image deduplication process, resulting in poor deduplication effect. In particular, the images of the same target collected from different angles are very different, which affects the execution effect of the target recognition task.

Method used

By filtering the deduplicated images containing the target from the target information dimension, find the image that matches the new image, and calculate the comprehensive similarity based on the target and background. If it is less than the preset threshold, the new image is determined to be a deduplicated image, improving multi-dimensional comparison. Deduplication effect.

Benefits of technology

It effectively improves the accuracy and efficiency of image deduplication, reduces the amount of calculation, and improves the execution effect of target recognition tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118379606B
    Figure CN118379606B
Patent Text Reader

Abstract

The present application discloses an image deduplication method, an image deduplication device, an electronic device and a computer-readable storage medium. The deduplication method first searches for a third image from a second image based on the target information of the first image, and performs different operations for different search results to comprehensively improve the image deduplication effect. When the third image is found, the two image pairs of the first image and the third image are respectively subjected to different degrees of feature extraction based on a dual-branch twin network, and then the similarities of the first image and the third image at the target and target background levels are respectively calculated based on the feature extraction results. The comprehensive similarity between the first image and the third image is determined by the similarity of the two levels. Based on the comprehensive similarity, images containing repeated or similar targets can be accurately identified, and a better deduplication effect can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and in particular relates to an image deduplication method, an image deduplication device, an electronic device, and a computer-readable storage medium. Background Art

[0002] In the process of target recognition based on image processing, a large number of images containing targets are usually collected, either as training samples or to perform classification tasks. However, with the upgrading of equipment and acquisition technology, there are more and more images containing similar or identical targets, which not only easily reduces data quality, but also may occupy a large amount of computing resources. In serious cases, it may affect the performance of other tasks based on target recognition.

[0003] Current deduplication methods often rely on a single-dimensional comparison, such as using only timestamps or location information. However, for the same target at the same time and location, the images obtained by capturing images from different angles will also be different. Therefore, a single-dimensional deduplication method has the problem of poor deduplication effect. Summary of the invention

[0004] The present application provides an image deduplication method, an image deduplication device, an electronic device and a computer-readable storage medium, which can effectively improve the deduplication effect of an image containing a target.

[0005] In a first aspect, the present application provides a method for deduplication of an image, comprising:

[0006] Searching for a third image from at least one second image according to target information of the first image; the first image is a new image containing the target, the second image is an image containing the target and having been deduplicated; the third image is the second image matching the target information;

[0007] If the third image is not found, determining the first image as a new second image;

[0008] When at least one third image is found, for each third image, a comprehensive similarity between the third image and the first image is calculated based on the target and target background in the third image and the first image;

[0009] When each comprehensive similarity is less than a preset similarity threshold, the first image is determined as a new second image.

[0010] In a second aspect, the present application provides an image deduplication device, comprising:

[0011] A search module, used for searching a third image from at least one second image according to target information of a first image; the first image is a new image containing a target, the second image is an image containing a target and having been deduplicated; the third image is a second image matching the target information;

[0012] A first determining module, configured to determine the first image as a new second image when the third image is not found;

[0013] a calculation module, configured to calculate, for each third image, a comprehensive similarity between the third image and the first image based on the target and the target background in the third image and the first image, when at least one third image is found;

[0014] The second determining module is configured to determine the first image as a new second image when each comprehensive similarity is less than a preset similarity threshold.

[0015] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of the first aspect when executing the computer program.

[0016] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method of the first aspect are implemented.

[0017] In a fifth aspect, the present application provides a computer program product, which includes a computer program. When the computer program is executed by one or more processors, it implements the steps of the method of the first aspect.

[0018] Compared with the prior art, the present application has the following beneficial effects: the target information of the new image (first image) containing the target is first filtered from the dimension of the target information to find the second image matching the target information, that is, the third image. It can be understood that the number of third images can represent the size of the deduplication range. If the third image is not found, it means that there is no image in the second image that is the same or similar to the first image, and the first image can be stored as a new second image. If the third image is found, it can be determined whether each third image is the same or similar to the first image to perform deduplication. Specifically, in order to accurately determine whether each third image is the same or similar to the first image, the comprehensive similarity between the two images can be calculated based on the target and the target background in each of the two images. When the first image is not the same or similar to all the third images, that is, all the calculated comprehensive similarities are less than the similarity threshold, the first image is stored as a new second image, and a better deduplication effect can be obtained. In other words, the deduplication method can compare new and old images of possible identical or similar targets from multiple dimensions to effectively improve the deduplication effect.

[0019] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. 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 embodiments or the description of the prior art 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 paying any creative work.

[0021] Figure 1 It is a flowchart of the image deduplication method provided in an embodiment of the present application;

[0022] Figure 2 It is a schematic diagram of the structure of a double-branch twin network provided in an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of the structure of another double-branch twin network provided in an embodiment of the present application;

[0024] Figure 4 It is a schematic diagram of the structure of the CSPIR Layer provided in the embodiment of the present application;

[0025] Figure 5 It is a schematic diagram of the structure of the IR Block provided in the embodiment of the present application;

[0026] Figure 6It is a flowchart of a method for deduplicating event images of road risks provided in an embodiment of the present application;

[0027] Figure 7 is a schematic diagram of the structure of an image deduplication device provided in an embodiment of the present application;

[0028] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0030] In the related art, current deduplication methods often rely on a single-dimensional comparison, such as using only timestamps or location information. However, even if the same target is photographed from different angles, the resulting images will be different. Therefore, this single-dimensional deduplication method has the problem of poor deduplication effect.

[0031] In order to solve this problem, the present application proposes an image deduplication method, which can effectively improve the deduplication effect of the image containing the target through multi-dimensional comparison. The deduplication method proposed in the present application will be described below through specific embodiments.

[0032] The image deduplication method provided in the embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.

[0033] In order to illustrate the technical solution proposed in this application, each embodiment will be described below with an electronic device as the execution subject.

[0034] Figure 1 A schematic flow chart of a method for deduplicating an image provided by the present application is shown, and the method for deduplicating an image includes:

[0035] Step 110: Whether the electronic device can find a third image from at least one second image according to the target information of the first image.

[0036] In order to use the images containing the target for model training or related data analysis, targeted collection and storage can be performed. For example, for images containing road risk events, after collection, they can be stored in the corresponding storage space, such as in the corresponding risk event database, for subsequent risk analysis and decision making.

[0037] Thanks to the upgrade of image acquisition equipment and image acquisition technology, as time goes by, there will be more and more images in the database. Among the massive images, only some images may be similar or identical to the new image containing the target, that is, the first image. Based on this, in order to reduce the amount of calculation for deduplication, for the new first image containing the target, the electronic device can first determine its target information, such as the location information of the target and the target category, so as to determine the deduplication range from the massive images through the target information.

[0038] For example, for a newly identified first image containing a road risk event, its event information may include the latitude and longitude of the place where the event occurred and the event category (such as a garbage exposure event or an illegal parking event). The images within the deduplication range determined based on the event information may include all second images containing garbage exposure events within a radius of 100 meters with the latitude and longitude as the center. Thus, the first image is compared one by one with the images within the deduplication range to achieve the deduplication effect.

[0039] Obviously, compared with directly comparing the first image with each image in the database one by one to remove duplicates, the amount of calculation is greatly reduced and the deduplication efficiency is higher by performing targeted deduplication processing by defining the deduplication range.

[0040] For the second image within the deduplication range, it can be recorded as the third image for the convenience of distinction.

[0041] It can be understood that the images in the database are gradually accumulated. In order to ensure the comprehensiveness of deduplication, all images stored in the database are deduplicated images.

[0042] When there is no image in the database, there is no need for deduplication. In this case, the first image containing the target that is identified can be stored in the database. After that, the database includes at least one image containing the target and deduplicated, namely the second image. For the first image, there is a need for deduplication. Based on this, each time the electronic device identifies a first image, it can first determine whether there is a deduplication range from each second image based on the target information of the first image, that is, determine whether the third image can be found from each second image.

[0043] Step 120: When the electronic device fails to find the third image, it determines the first image as a new second image.

[0044] If there is no third image satisfying the filtering requirement in the second image, there is no deduplication range for the first image, that is, there is no deduplication requirement. At this time, the electronic device can directly use the first image as a new second image and store it directly.

[0045] Step 130: When at least one third image is found, for each third image, the electronic device calculates a comprehensive similarity between the third image and the first image based on the target and target background in the third image and the first image.

[0046] Step 140: When each comprehensive similarity is less than a preset similarity threshold, the electronic device determines the first image as a new second image.

[0047] Step 150: When any comprehensive similarity is greater than or equal to a preset similarity threshold, the electronic device deletes the first image.

[0048] However, if there is a third image in the second image that meets the filtering requirements, the first image has a deduplication range, that is, there is a deduplication requirement. At this time, in order to ensure the effectiveness of deduplication, the electronic device can compare the first image with each third image to determine whether there is an image similar or identical to the first image in the deduplication range.

[0049] In order to improve the accuracy of deduplication, the electronic device can compare the comprehensive similarity between each third image and the first image from two levels of the target and the target background in the image, so as to accurately evaluate whether the two images are the same or similar through the comprehensive similarity.

[0050] In order to accurately measure whether two images are similar, after calculating the comprehensive similarity between each two images, the electronic device can compare the comprehensive similarity with a preset similarity threshold, thereby accurately determining whether the two images are similar.

[0051] The first image needs to be compared with each third image one by one within the deduplication range, and whether to retain the first image is determined based on the final comparison result. One comparison result is that at least one comprehensive similarity is equal to or greater than the preset similarity threshold, that is, there is at least one third image in the third image that is identical or similar to the first image; in this case, the electronic device can delete the first image. Another comparison result is that all comprehensive similarities are less than the preset similarity threshold, that is, there is no third image in the third image that is identical or similar to the first image. In this case, the electronic device can determine the first image as a new second image and store it.

[0052] In this embodiment, the electronic device first determines the deduplication range from the second image according to the target information of the target in the first image to reduce the amount of calculation for deduplication and implement targeted deduplication in part of the second image. If the deduplication range is not determined, it means that the first image does not need to be deduplicated, and the electronic device can directly determine the first image as a new second image and store it; but if the deduplication range is determined, the electronic device can compare the first image with each third image within the deduplication range one by one, that is, calculate the comprehensive similarity between each third image and the first image one by one. The comprehensive similarity is calculated from two levels: the target contained in the image and the target background where the target is located, and can accurately characterize the similarity between each third image and the first image. By comparing each comprehensive similarity with a preset similarity threshold, the electronic device can determine whether each third image is the same or similar to the first image. When each comprehensive similarity is less than the preset similarity threshold, it means that there is no image that is the same or similar to the first image within the deduplication range, and the first image can be stored as a new second image; when any comprehensive similarity is greater than or equal to the preset similarity threshold, it means that there is an image that is the same or similar to the first image within the deduplication range, and the first image can be deleted. This deduplication method can compare and deduplicate new and old images of potentially identical or similar targets from multiple dimensions to effectively improve the deduplication effect.

[0053] In some embodiments, in order to accurately calculate the comprehensive similarity, step 120 specifically includes:

[0054] Step A1: The electronic device calculates a first sub-similarity between a third image and the first image based on the first image pair.

[0055] In order to determine the similarity between the first image and the third image from the target level, the electronic device may calculate the corresponding similarity for the targets contained in the two images. The similarity is a component of the comprehensive similarity and may be recorded as a first sub-similarity.

[0056] Specifically, in order to calculate the first sub-similarity for the target contained in the two images, the electronic device may use the image blocks corresponding to the target in the two images as an image pair (recorded as a first image pair), that is, the first image pair includes the image block corresponding to the target in the first image and the image block corresponding to the target in the third image. Then, the first sub-similarity between the first image and the third image is calculated through the first image pair.

[0057] Among them, the image block corresponding to the target in the image can be obtained through target recognition and cutout technology. The specific method is not the focus of this application and is not limited in this application.

[0058] Step A2: The electronic device calculates a second sub-similarity between the third image and the first image based on the second image pair.

[0059] Similarly, in order to determine the similarity between the first image and the third image from the target background level, the electronic device can calculate the corresponding similarity for the target background contained in the two images. This similarity is a component of the comprehensive similarity and can be recorded as the second sub-similarity.

[0060] Specifically, in order to calculate the second sub-similarity for the target background included in the two images, the electronic device may treat the two images as an image pair (recorded as a second image pair), that is, the second image pair includes the first image and the third image. Then, the second sub-similarity between the first image and the third image is calculated through the first image pair.

[0061] Step A3: The electronic device performs weighted summation of the first sub-similarity and the second sub-similarity to obtain a comprehensive similarity.

[0062] After calculating the two sub-similarity, the electronic device can determine the corresponding weight according to the contribution of the two layers to the similarity of the two images, that is, weight the two sub-similarity and sum them to obtain the comprehensive similarity. The weight of the first sub-similarity is greater than the weight of the second sub-similarity, so as to ensure that the objects contained in the same or similar two images are consistent.

[0063] In the present application, the electronic device calculates two sub-similarity between two images based on the target and target background levels respectively, and then weights and sums the two sub-similarity, which can accurately characterize the similarity between the two images, thereby helping to improve the accuracy of deduplication.

[0064] In some embodiments, in order to accurately and efficiently calculate the first sub-similarity, step A1 specifically includes:

[0065] Step A11: The electronic device performs three-stage shallow feature extraction operations on each image block in the first image pair to obtain a first feature image pair.

[0066] Compared with the entire target environment, the target is smaller and is mainly identified through detailed features, focusing on low-dimensional features such as color and shape. Based on this, when the electronic device performs a feature extraction operation on each image block in the first image pair, it can perform a three-stage shallow feature extraction operation to obtain a first feature image pair, thereby accurately representing the two targets through detailed features.

[0067] Through shallow feature extraction operations, electronic devices can compress high-dimensional image data into a low-dimensional feature space, thereby reducing computational and storage requirements.

[0068] Step A12: The electronic device calculates a first feature difference based on the first feature image pair, and calculates a first sub-similarity based on the first feature difference.

[0069] The feature difference can capture the subtle differences between two image blocks, thereby accurately measuring the similarity between the two image blocks. On this basis, the electronic device can perform a difference between the two feature images in the first feature image pair to obtain a first feature difference, and then calculate the first sub-similarity between the two image blocks through the first feature difference to accurately determine whether the two targets are the same or similar.

[0070] In some embodiments, in order to accurately and efficiently calculate the second sub-similarity, step A2 specifically includes:

[0071] Step A211: The electronic device performs five-stage deep feature extraction operations on each image in the second image pair to obtain a second feature image pair.

[0072] The target environment is mainly represented by the feature of multi-semantic information, which is an abstract high-dimensional feature that requires contextual semantic enrichment of the surrounding environment. Based on this, when the electronic device performs a feature extraction operation on each image block in the first image pair, it can perform a five-stage deep feature extraction operation to obtain a second feature image pair, thereby accurately representing the two target environments through global features.

[0073] Step A212: The electronic device calculates a second feature difference based on the second feature image pair, and calculates a second sub-similarity based on the second feature difference.

[0074] Similar to the calculation of the first sub-similarity, the electronic device can subtract the two feature images in the second feature image pair to obtain a second feature difference; the electronic device calculates the first sub-similarity between the two image blocks through the second feature difference, and can accurately determine whether the two target environments are the same or similar.

[0075] In some embodiments, step A2 specifically includes:

[0076] Step A221: The electronic device performs a three-stage shallow feature extraction operation on each image in the second image pair to obtain a third feature image pair.

[0077] Step A222: The electronic device performs two-stage deep feature extraction on the third feature image pair to obtain a fourth feature image pair.

[0078] Step A223: The electronic device calculates a third feature difference based on the fourth feature image pair, and calculates a second sub-similarity based on the third feature difference.

[0079] This embodiment is similar to the embodiment corresponding to the aforementioned steps A211 and A212, except that in the first three stages, whether performing shallow feature extraction operations on the first image pair or the second image pair, the same network can be used, that is, parameter sharing is achieved, and the feature extraction effect, as well as the stability and consistency of feature extraction are enhanced. Based on this, for the second image pair, the electronic device obtains a feature image pair as the third feature image pair after three stages of shallow feature extraction, and then performs a two-stage deep feature extraction operation on the third feature image pair to obtain a fourth feature image pair, and then obtains a third feature difference based on the fourth feature pair, so as to calculate the second sub-similarity based on the third feature difference.

[0080] In some embodiments, when the third image is found, different degrees of feature extraction can be performed on the two image pairs of the first image and the third image based on a dual-branch twin network, and then the similarities of the first image and the third image at the target and target background levels are calculated based on the feature extraction results. The comprehensive similarity between the first image and the third image is determined by the similarities at the two levels. Based on the comprehensive similarity, images containing repeated or similar targets can be accurately identified, thereby obtaining a better deduplication effect.

[0081] In some embodiments, the structure of the feature extraction network in each stage is the same, and the feature extraction network can be recorded as CSPIR Layer. Figure 2 and Figure 3 Two network structures of dual-branch twin networks at each stage based on CSPIR Layer are shown respectively, among which, Figure 2 The first three stages of the two-branch twin network in do not share parameters. Figure 3 The first three stages of the two-branch Siamese network in share parameters.

[0082] In some embodiments, the CSPIR Layer includes a first CBS module, a second CBS module, a third CBS module, a cross-stage reverse residual module and a splicing module; the first CBS module is connected to the second CBS module, the second CBS module is respectively connected to the third CBS module and the cross-stage reverse residual module, and the third CBS module and the cross-stage reverse residual module are both connected to the splicing module; the cross-stage reverse residual module includes n reverse residual blocks with a cross-stage partial connection structure.

[0083] At each stage, for each first input image input to the CSPIR Layer, the electronic device may perform the following steps through the modules of the CSPIR Layer:

[0084] Step C1: The electronic device performs basic feature extraction on a first input image through a first CBS module to obtain a first basic feature image.

[0085] Step C2: The electronic device expands the channels of the basic feature image through the second CBS module to obtain a second basic feature map.

[0086] Step C3: The electronic device adjusts the channel of the second basic feature map through the third CBS module to obtain a third basic feature map.

[0087] Step C4: The electronic device performs a comprehensive feature extraction operation on the second basic feature map through a cross-stage reverse residual module to obtain a comprehensive feature map.

[0088] Step C5: The electronic device performs a feature stitching operation on the third basic feature map and the comprehensive feature map through a stitching module to obtain a feature extraction result corresponding to the first input image.

[0089] The structure of CSPIR Layer can be found in Figure 4 , the electronic device reduces the size of the feature map by half through the first CBS module (ConvBNSILU, k3, s2, c) with a convolution kernel size of 3x3 and a stride of 2 to obtain the first basic feature image; then the channel dimension is expanded through the second CBS module (ConvBNSILU, k1, s1, 2c) with a convolution kernel size of 1x1, that is, the c channel is expanded to the 2c channel to obtain the second basic feature map; then the second basic feature map is split into two parts, and the left side is adjusted through the third CBS module (ConvBNSILU, k1, s1, c) with a convolution kernel size of 1x1 to adjust the 2c channel to the c channel; on the right side, a comprehensive feature extraction operation is performed on the second basic feature map through a cross-stage reverse residual module to obtain a comprehensive feature map; finally, the electronic device performs a feature splicing operation on the third basic feature map and the comprehensive feature map through a splicing module (Concat) to obtain the feature extraction result corresponding to the first input image.

[0090] Among them, the cross-stage inverted residual module is n inverted residual blocks (IR Block) with a cross-stage partial connection (CSP) structure.

[0091] The design of CSPIR Layer effectively reduces the number of model parameters and FLOPS by dividing the feature image map of the base layer into two parts and merging them using a cross-stage hierarchy. The CSP structure allows gradient information to propagate on different network paths, which can increase the difference in gradient information by switching the splicing and conversion steps, thereby effectively improving the learning ability of the network.

[0092] In some embodiments, see Figure 5, IR Block includes a depthwise convolution (DWC) submodule (DWConvBNSILU, k3, s1, 2c in the figure), an SE attention submodule, and a pointwise convolution (PWC) submodule (PWConvBNSILU, k1, s1, c in the figure) based on an inverse residual structure connection. For each second input image input to the IR Block, the electronic device may perform the following steps:

[0093] Step D1: The electronic device performs a deep convolution operation on the second input image through a deep convolution submodule to obtain a deep convolution feature image.

[0094] Step D2: The electronic device performs feature fusion on the deep convolution feature map after the expansion channel through the SE attention submodule to obtain a fused feature map.

[0095] Step D3: The electronic device performs a point convolution operation on the spliced ​​feature map through a point convolution submodule to obtain a feature extraction result corresponding to the second input image; the spliced ​​feature map is obtained by splicing the deep convolution feature map after the expansion channel and the fusion feature map.

[0096] In this embodiment, the structural design of IR Block is lightweight, and the computational complexity can be reduced through deep convolution. The SE attention mechanism automatically adjusts the weights of the feature map channels, and the point convolution realizes cross-channel information fusion to improve the feature expression ability. The inverse residual structure extracts features in high-dimensional space and retains input information through residual connections, further improving the training stability. This structural design can provide fast inference speed while maintaining high accuracy.

[0097] In some embodiments, when the target is a road risk event, the flowchart of the image deduplication method provided in this embodiment can be found in Figure 6 .

[0098] For newly identified event images of road risks, the electronic device can determine the deduplication range from the database based on the geographic information, longitude and latitude information, and classification information of the event, and deduplication processing of the new event image can be achieved by traversing each event image within the deduplication range.

[0099] Specifically, the electronic device can take a target event image from the deduplication range, perform event recognition and cutout processing on it and the new event image, and obtain an event image block pair and an initial image pair (target event image and new event image). The two image pairs are input into the two-branch twin network for processing to determine whether the target event image and the new event image are the same or similar, that is, to obtain a duplication judgment result; then a new target event image is determined from the duplication range, and the above operation is repeated to obtain a duplication judgment result between the new target event image and the new event image.

[0100] It can be understood that the traversal process is a repetitive process until each event image within the deduplication range is traversed, that is, the similarity calculation and judgment process is processed for each event image to obtain the duplication judgment result between each event image and the new event image. Finally, it is determined whether to retain the new event image or delete the new event image based on the duplication judgment result.

[0101] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0102] Corresponding to the image deduplication method of the above embodiment, Figure 7 A structural block diagram of an image deduplication device 7 provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0103] Reference Figure 7 , the image deduplication device 7 comprises:

[0104] A search module 71 is used to search for a third image from at least one second image according to target information of a first image; the first image is a new image containing a target, the second image is an image containing a target and having been deduplicated; the third image is a second image matching the target information;

[0105] A first determining module 72, configured to determine the first image as a new second image when the third image is not found;

[0106] A calculation module 73, configured to calculate, for each third image, a comprehensive similarity between the third image and the first image based on the target and the target background in the third image and the first image, when at least one third image is found;

[0107] The second determination module 74 is configured to determine the first image as a new second image when each comprehensive similarity is less than a preset similarity threshold.

[0108] Optionally, the calculation module 73 may include:

[0109] A first calculation unit is used to calculate a first sub-similarity between the third image and the first image based on the first image pair; the first image pair includes an image block corresponding to the target of the first image and an image block corresponding to the target of the third image;

[0110] A second calculation unit, configured to calculate a second sub-similarity between a third image and the first image based on a second image pair; the second image pair comprising the first image and the third image;

[0111] The third calculation unit is used to perform weighted summation on the first sub-similarity and the second sub-similarity to obtain a comprehensive similarity.

[0112] Optionally, the first computing unit is specifically configured to:

[0113] Performing three-stage shallow feature extraction operations on each image block in the first image pair respectively to obtain a first feature image pair;

[0114] A first feature difference is calculated based on the first feature image pair, and a first sub-similarity is calculated based on the first feature difference.

[0115] Optionally, the second computing unit is specifically configured to:

[0116] Performing five-stage deep feature extraction operations on each image in the second image pair to obtain a second feature image pair;

[0117] A second feature difference is calculated based on the second feature image pair, and a second sub-similarity is calculated based on the second feature difference.

[0118] Optionally, the second computing unit is specifically configured to:

[0119] Performing a three-stage shallow feature extraction operation on each image in the second image pair to obtain a third feature image pair;

[0120] performing two-stage deep feature extraction on the third feature image pair to obtain a fourth feature image pair;

[0121] A third feature difference is calculated based on the fourth feature image pair, and a second sub-similarity is calculated based on the third feature difference.

[0122] Optionally, the structure of the feature extraction network of each stage is the same, and the feature extraction network includes a first CBS module, a second CBS module, a third CBS module, a cross-stage reverse residual module and a splicing module; the first CBS module is connected to the second CBS module, the second CBS module is respectively connected to the third CBS module and the cross-stage reverse residual module, and the third CBS module and the cross-stage reverse residual module are both connected to the splicing module; the cross-stage reverse residual module includes n reverse residual blocks with a cross-stage partial connection structure; the first computing unit and / or the second computing unit includes a feature extraction subunit, and the feature extraction subunit is used to:

[0123] At each stage, for each first input image of the input feature extraction network:

[0124] Performing basic feature extraction on the first input image through the first CBS module to obtain a first basic feature image;

[0125] Expanding the channels of the basic feature image through the second CBS module to obtain a second basic feature map;

[0126] Adjusting the channel of the second basic feature map through a third CBS module to obtain a third basic feature map;

[0127] Performing a comprehensive feature extraction operation on the second basic feature map through a cross-stage reverse residual module to obtain a comprehensive feature map;

[0128] A feature splicing operation is performed on the third basic feature map and the comprehensive feature map through the splicing module to obtain a feature extraction result corresponding to the first input image.

[0129] Optionally, the reverse residual block includes a deep convolution submodule, a SE attention submodule and a point convolution submodule connected based on the reverse residual structure; the feature extraction subunit is specifically used for:

[0130] For every second input image that enters the inverse residual block:

[0131] Performing a deep convolution operation on the second input image through a deep convolution submodule to obtain a deep convolution feature image;

[0132] The SE attention submodule is used to fuse the deep convolution feature map after the expansion channel to obtain a fused feature map.

[0133] The point convolution operation is performed on the spliced ​​feature map through the point convolution submodule to obtain the feature extraction result corresponding to the second input image; the spliced ​​feature map is obtained by splicing the deep convolution feature map after the expansion channel and the fusion feature map.

[0134] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0135] Figure 8 This is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present application. Figure 8 As shown, the electronic device 8 of this embodiment includes: at least one processor 80 ( Figure 8 Only one processor is shown in the figure), a memory 81, and a computer program 82 stored in the memory 81 and executable on at least one processor 80. When the processor 80 executes the computer program 82, the steps in any of the above-mentioned image deduplication method embodiments are implemented, for example Figure 1 Steps 110-150 are shown.

[0136] The processor 80 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0137] In some embodiments, the memory 81 may be an internal storage unit of the electronic device 8, such as a hard disk or memory of the electronic device 8. In other embodiments, the memory 81 may also be an external storage device of the electronic device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 8.

[0138] Furthermore, the memory 81 may include both an internal storage unit of the electronic device 8 and an external storage device. The memory 81 is used to store operating devices, applications, boot loaders, data, and other programs, such as program codes of computer programs, etc. The memory 81 may also be used to temporarily store data that has been output or is to be output.

[0139] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0140] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0141] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0142] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.

[0143] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0144] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0145] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the above modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0146] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0147] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for deduplication of an image, characterized in that: include: Searching for a third image from at least one second image according to target information of the first image; the first image is a new image containing a target, and the second image is an image containing a target and having been deduplicated; the third image is the second image matching the target information; the target is a road risk event, and the target information is road risk event information; If the third image is not found, determining the first image as a new second image; In the case of finding at least one of the third images, for each of the third images, calculating a comprehensive similarity between the third image and the first image based on the objects and object background in the third image and the first image; In a case where each of the comprehensive similarities is less than a preset similarity threshold, determining the first image as a new second image; The calculating the comprehensive similarity between the third image and the first image based on the target and the target background in the third image and the first image comprises: Calculating a first sub-similarity between the third image and the first image based on a first image pair; the first image pair includes an image block of a target corresponding to the first image and an image block of a target corresponding to the third image; calculating a second sub-similarity between the third image and the first image based on a second image pair; the second image pair comprising the first image and the third image; The first sub-similarity and the second sub-similarity are weighted and summed to obtain the comprehensive similarity.

2. The deduplication method according to claim 1, characterized in that: The calculating a first sub-similarity between the third image and the first image based on the first image pair comprises: Performing three-stage shallow feature extraction operations on each image block in the first image pair to obtain a first feature image pair; A first feature difference is calculated based on the first feature image pair, and the first sub-similarity is calculated based on the first feature difference.

3. The deduplication method according to claim 1, characterized in that: The calculating the second sub-similarity between the third image and the first image based on the second image pair comprises: Performing five-stage deep feature extraction operations on each image in the second image pair to obtain a second feature image pair; A second feature difference is calculated based on the second feature image pair, and the second sub-similarity is calculated based on the second feature difference.

4. The deduplication method according to claim 2, characterized in that: The calculating the second sub-similarity between the third image and the first image based on the second image pair comprises: Performing the three-stage shallow feature extraction operation on each image in the second image pair to obtain a third feature image pair; Performing two-stage deep feature extraction on the third feature image pair to obtain a fourth feature image pair; A third feature difference is calculated based on the fourth feature image pair, and the second sub-similarity is calculated based on the third feature difference.

5. The deduplication method according to any one of claims 2 to 4, characterized in that: The structure of the feature extraction network of each stage is the same, and the feature extraction network includes a first CBS module, a second CBS module, a third CBS module, a cross-stage reverse residual module and a splicing module; the first CBS module is connected to the second CBS module, the second CBS module is respectively connected to the third CBS module and the cross-stage reverse residual module, and the third CBS module and the cross-stage reverse residual module are both connected to the splicing module; the cross-stage reverse residual module includes n reverse residual blocks with a cross-stage partial connection structure; At each stage, for each first input image fed into the feature extraction network: Performing basic feature extraction on the first input image by the first CBS module to obtain a first basic feature image; Expanding the channels of the first basic feature image through the second CBS module to obtain a second basic feature map; Adjusting the channel of the second basic feature map by the third CBS module to obtain a third basic feature map; Performing a comprehensive feature extraction operation on the second basic feature map by the cross-stage reverse residual module to obtain a comprehensive feature map; The splicing module performs a feature splicing operation on the third basic feature map and the comprehensive feature map to obtain a feature extraction result corresponding to the first input image.

6. The deduplication method according to claim 5, characterized in that: The reverse residual block includes a deep convolution submodule, a SE attention submodule and a point convolution submodule connected based on the reverse residual structure; For each second input image input to the inverse residual block: Performing a deep convolution operation on the second input image through the deep convolution submodule to obtain a deep convolution feature map; Performing feature fusion on the deep convolution feature map after the expansion channel through the SE attention submodule to obtain a fused feature map; Performing a point convolution operation on the spliced ​​feature map through the point convolution submodule to obtain a feature extraction result corresponding to the second input image; The spliced ​​feature map is obtained by splicing the deep convolution feature map after the channel expansion and the fusion feature map.

7. An image deduplication device, characterized in that: include: A search module, configured to search for a third image from at least one second image according to target information of a first image; the first image is a new image containing a target, and the second image is an image containing a target and having been deduplicated; the third image is the second image matching the target information; the target is a road risk event, and the target information is road risk event information; A first determining module, configured to determine the first image as a new second image if the third image is not found; a calculation module, configured to calculate, for each of the third images, a comprehensive similarity between the third image and the first image based on the target and target background in the third image and the first image, when at least one of the third images is found; A second determination module, configured to determine the first image as a new second image when each of the comprehensive similarities is less than a preset similarity threshold; The calculation module comprises: A first calculation unit, configured to calculate a first sub-similarity between the third image and the first image based on a first image pair; the first image pair comprising an image block of a target corresponding to the first image and an image block of a target corresponding to the third image; A second calculation unit, configured to calculate a second sub-similarity between the third image and the first image based on a second image pair; the second image pair comprising the first image and the third image; The third calculation unit is configured to perform a weighted summation of the first sub-similarity and the second sub-similarity to obtain the comprehensive similarity.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the image deduplication method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the image deduplication method according to any one of claims 1 to 6 is implemented.