An image processing method, apparatus and device
By acquiring key information from equipment images and using a pre-defined network model for judgment, the problem of information loss in equipment image deduplication is solved, achieving highly accurate equipment image deduplication, reducing manual intervention, and improving efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA MOBILE COMM LTD RES INST
- Filing Date
- 2022-01-05
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies struggle to effectively identify complex device images during the deduplication process, leading to the loss of crucial information.
By acquiring key information from device images, such as device serial numbers, and combining object detection algorithms and OCR technology to identify device serial numbers, and when identification fails, a pre-defined network model is used to determine whether the images were taken by the same device. An improved twin convolutional neural network and a hollow spatial pyramid pooling module are employed to enhance feature extraction capabilities.
It achieves accurate deduplication of equipment images, improves the accuracy of comparison results, can replace manual operation, and achieves the goal of reducing costs and increasing efficiency, with a deduplication accuracy rate of over 92%.
Smart Images

Figure CN116452835B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information processing technology, and in particular to an image processing method, apparatus, and device. Background Technology
[0002] The task of deduplicating base station equipment images involves identifying duplicate equipment in captured images to check for omissions. By analyzing two equipment images, similarity is calculated to determine if they represent the same device. Since the two images are taken from different angles and under different lighting conditions, involving computer vision and traditional image processing, deep learning and convolutional neural networks are used. First, key regions are detected. Then, OCR (Optical Character Recognition) technology is used to identify the equipment asset number, and a twin convolutional neural network is used to calculate the similarity of key regions to comprehensively determine if they represent the same device.
[0003] Existing technical solutions have the following main problems: they cannot effectively deduplicate images and are prone to losing key information. Summary of the Invention
[0004] The technical problem to be solved by this invention is to provide an image processing method, apparatus, and device. This can solve the problem of ineffective deduplication of images from complex devices.
[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0006] An image processing method, the method comprising:
[0007] Acquire the first and second images captured by the device;
[0008] Obtain the first key information of the first image and the second key information of the second image;
[0009] Based on the first key information and the second key information, determine whether the first image and the second image are images captured by the same device;
[0010] When it is impossible to identify whether the first image and the second image were taken with the same device, a preset network model is used to determine whether the first image and the second image were taken with the same device.
[0011] Optionally, obtaining the first key information of the first image and the second key information of the second image includes:
[0012] The first image is processed by a target detection algorithm to obtain the first key information, which includes: the first device number identified from the first image;
[0013] The second image is processed by the target detection algorithm to obtain the second key information, which includes the second device number identified from the second image.
[0014] Optionally, based on the first key information and the second key information, determining whether the first image and the second image are images captured by the same device includes:
[0015] If the first device number and the second device number are the same, then it is determined that the first image and the second image are images taken by the same device; otherwise, it is determined that the first image and the second image cannot be identified.
[0016] Optionally, determining whether the first image and the second image are images captured by the same device using a preset network model includes:
[0017] The first image is input into the first sub-model of the network model for processing to obtain the first output;
[0018] The second image is input into the second sub-model of the network model for processing to obtain the second output;
[0019] Based on the first output and the second output, obtain the Euclidean distance between the first image and the second image;
[0020] The similarity between the first image and the second image is obtained based on the Euclidean distance.
[0021] Based on the similarity, it is determined whether the first image and the second image were taken with the same device.
[0022] Optionally, based on the similarity, determining whether the first image and the second image are images captured by the same device includes:
[0023] If the similarity is greater than a preset threshold, then the first image and the second image are determined to be images taken with the same device; otherwise, the first image and the second image are determined not to be images taken with the same device.
[0024] Optionally, the preset network model is trained through the following process:
[0025] The first sample in the training set is input into the first sub-model for processing to obtain the first output.
[0026] The second sample in the training set is input into the second sub-model for processing to obtain the second output;
[0027] Based on the first output and the second output, obtain the Euclidean distance between the first image and the second image;
[0028] The similarity between the first image and the second image is obtained based on the Euclidean distance.
[0029] Based on the similarity, it is determined whether the first image and the second image were taken with the same device.
[0030] Optionally, the first sub-model and the second sub-model are the same, and both are optimized using the following objective function:
[0031]
[0032] Where L is the objective function, d = ||a n -b n || 2 Representing the first sample a n Second sample b n The Euclidean distance, where y is the distance from the first sample a. n Second sample b n The label indicates whether the samples are similar, and y=1 represents the first sample a. n Second sample b n Similarly, y = 0 represents the first sample a n Second sample b n Dissimilar, margin is the set threshold, and N is the number of samples.
[0033] Embodiments of the present invention also provide an image processing apparatus, the apparatus comprising:
[0034] The first acquisition module is used to acquire the first image and the second image captured by the device.
[0035] The second acquisition module is used to acquire the first key information of the first image and the second key information of the second image;
[0036] The first processing module is used to determine, based on the first key information and the second key information, whether the first image and the second image are images captured by the same device;
[0037] The second processing module is used to determine whether the first image and the second image are images taken with the same device by using a preset network model when it is impossible to identify whether the first image and the second image are images taken with the same device.
[0038] Embodiments of the present invention also provide an image processing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method described above.
[0039] Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described above.
[0040] The above-described solution of the present invention has at least the following beneficial effects:
[0041] By acquiring a first image and a second image captured by a device; acquiring first key information of the first image and second key information of the second image; determining whether the first image and the second image were captured by the same device based on the first key information and the second key information; when it is impossible to identify whether the first image and the second image were captured by the same device, a preset network model is used to determine whether the first image and the second image were captured by the same device; thereby achieving accurate deduplication of device images, first detecting the unique recognition area of the device image, and then connecting an OCR model and a similarity detection network, making the comparison results more accurate, replacing manual work, and achieving the purpose of cost reduction and efficiency improvement. Attached Figure Description
[0042] Figure 1 This is a flowchart of the image processing method provided in an embodiment of the present invention;
[0043] Figure 2 This is a module architecture diagram of the network model in an embodiment of the present invention;
[0044] Figure 3 This is a schematic diagram of the architecture of the ASPP module in the network model of this embodiment of the invention;
[0045] Figure 4 This is a flowchart illustrating a specific implementation of the image processing method according to an embodiment of the present invention;
[0046] Figure 5 This is a schematic diagram illustrating the process of identifying the device number region in an image according to an embodiment of the present invention;
[0047] Figure 6 This is a schematic diagram of the module block of the image processing device according to an embodiment of the present invention. Detailed Implementation
[0048] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
[0049] like Figure 1 As shown, an embodiment of the present invention provides an image processing method, the method comprising:
[0050] Step 11: Acquire the first image and the second image captured by the device; the device here can be a base station device, or other network devices or terminal devices, etc.
[0051] Step 12: Obtain the first key information of the first image and the second key information of the second image; here, the first key information and the second key information may be the device number or asset number information, etc.
[0052] Step 13: Based on the first key information and the second key information, determine whether the first image and the second image are images captured by the same device;
[0053] Step 14: When it is impossible to identify whether the first image and the second image are images taken by the same device, a preset network model is used to determine whether the first image and the second image are images taken by the same device.
[0054] In this embodiment, a first image and a second image captured by a device are acquired; first key information of the first image and second key information of the second image are acquired; based on the first key information and the second key information, it is determined whether the first image and the second image are images captured by the same device; when it is impossible to identify whether the first image and the second image are images captured by the same device, a preset network model is used to determine whether the first image and the second image are images captured by the same device. The unique identification area of the device image is first detected, and then an OCR model and a similarity detection network are connected to make the comparison results more accurate, which can replace manual work and achieve the purpose of reducing costs and increasing efficiency.
[0055] In an optional embodiment of the present invention, step 12 may include:
[0056] Step 121: Process the first image using a target detection algorithm to obtain the first key information, which includes: the first device number identified from the first image.
[0057] Step 122: Process the second image using the target detection algorithm to obtain the second key information, which includes the second device number identified from the second image.
[0058] Here, the YOLO object detection algorithm can be used to detect the first image and the key region of the first image. The key region of the first image includes the asset number region. Then, OCR character information is extracted from the asset number region. If the complete device number information can be extracted, it is determined whether the first image and the second image are possible duplicate images taken by the same device based on the device number information.
[0059] In an optional embodiment of the present invention, step 13 may include:
[0060] If the first device number and the second device number are the same, then it is determined that the first image and the second image are images taken by the same device; otherwise, it is determined that the first image and the second image cannot be identified.
[0061] In this embodiment, if the device is a base station device, considering the special characteristics of the base station device, the key area and asset number area of the image are first detected by the YOLO detection algorithm, and then the area is cropped. After cropping, the image is first corrected by affine transformation. The corrected image is then first used with the OCR algorithm to extract character information from the asset number area. If the number of characters recognized matches the number of characters in the actual asset number, it indicates that the asset number can be recognized. If it can be recognized, it is directly determined whether it is a duplicate image taken by the same device.
[0062] The OCR algorithm can choose the EAST (Efficient and Accuracy Scene Text) model to complete the character recognition task. If it cannot recognize the character, it can input an improved Siamese convolutional neural network to determine whether it is a duplicate.
[0063] In an optional embodiment of the present invention, step 14, determining whether the first image and the second image are images captured by the same device using a preset network model, includes:
[0064] Step 141: Input the first image into the first sub-model of the network model for processing to obtain the first output;
[0065] Step 142: Input the second image into the second sub-model of the network model for processing to obtain the second output;
[0066] Step 143: Based on the first output and the second output, obtain the Euclidean distance between the first image and the second image;
[0067] Step 144: Obtain the similarity between the first image and the second image based on the Euclidean distance;
[0068] Step 145: Based on the similarity, determine whether the first image and the second image are images taken with the same device.
[0069] like Figure 2 As shown, the network model includes: a first sub-model and a second sub-model with shared parameters; a first image is input to the first sub-model; and a second image is input to the second sub-model.
[0070] The first sub-model includes: a first VGG (deep convolutional neural network) module, a first ASPP (Atrous Space Pyramid Pooling) module connected to the first VGG module, and a first convolutional module connected to the first ASPP module;
[0071] The second sub-model includes: a second VGG module, a second ASPP module connected to the second VGG module, and a second convolutional module connected to the second ASPP module;
[0072] The first image is input into the first VGG module for processing to obtain the first VGG output. The first VGG output is input into the first ASPP module for processing to obtain the first ASPP output. The first ASPP output is input into the first convolution module for processing to obtain the first convolution output.
[0073] The second image is input into the first VGG module for processing to obtain the second VGG output. The second VGG output is input into the second ASPP module for processing to obtain the second ASPP output. The second ASPP output is input into the second convolution module for processing to obtain the second convolution output.
[0074] The first convolution output is used as the first output, and the second convolution output is used as the second output. The Euclidean distance between the first image and the second image is calculated. Based on the Euclidean distance, the similarity between the first image and the second image is obtained.
[0075] like Figure 3 As shown, both the first ASPP module and the second ASPP module include: a first convolutional layer, a second convolutional layer connected to the first convolutional layer, a third convolutional layer connected to the second convolutional layer, and a fourth convolutional layer connected to the third convolutional layer; wherein, the convolutional kernels of the first convolutional layer, the second convolutional layer, the third convolutional layer, and the fourth convolutional layer are all 3×3 convolutional kernels, the rate of the first convolutional layer is 6, the rate of the second convolutional layer is 12, the rate of the third convolutional layer is 18, and the rate of the fourth convolutional layer is 24.
[0076] In the embodiments of this invention, the Spatial Pyramid Pooling (ASPP) module improves the model's ability to extract multi-scale features and removes the model's limitation on the size of the input image, ensuring the integrity of image feature information and greatly improving the model's output accuracy. Dilated convolution can expand the scale of the convolution kernel and increase the receptive field by adding holes to the standard convolution kernel, i.e., adding 0s at the hole positions, without increasing the amount of parameter computation. The ASPP module allows the network to accept images of arbitrary sizes while preserving the original image features. At the same time, the ASPP module uses four parallel dilated convolution kernels with different atrous dilation ratios to resample features at different scales, revealing the contextual information of the image; at the tail of the dilated convolution, a serial spatial pyramid structure maps feature maps of different sizes to the same dimensional spatial information and integrates them into the image representation, thereby better completing the feature extraction task and reducing feature loss.
[0077] In an optional embodiment of the present invention, step 145 may include:
[0078] If the similarity is greater than a preset threshold, the first image and the second image are determined to be images taken with the same device; otherwise, the first image and the second image are determined not to be images taken with the same device. This makes the comparison results more accurate, can replace manual work, and achieves the goal of reducing costs and increasing efficiency.
[0079] In an optional embodiment of the present invention, the preset network model is trained through the following process:
[0080] Step 21: Input the first sample in the training set into the first sub-model for processing to obtain the first output;
[0081] Step 22: Input the second sample from the training set into the second sub-model for processing to obtain the second output;
[0082] Step 23: Based on the first output and the second output, obtain the Euclidean distance between the first image and the second image;
[0083] Step 24: Obtain the similarity between the first image and the second image based on the Euclidean distance;
[0084] Step 25: Based on the similarity, determine whether the first image and the second image are images taken with the same device.
[0085] Here, the first sub-model and the second sub-model are the same, and both are optimized using the following objective function:
[0086]
[0087] Where L is the objective function, d = ||an -b n || 2 Representing the first sample a n Second sample b n The Euclidean distance, where y is the distance from the first sample a. n Second sample b n The label indicates whether the samples are similar, where y=1 represents the first sample a. n Second sample b n Similarly, y = 0 represents the first sample a. n Second sample b n Dissimilar, margin is the set threshold, and N is the number of samples.
[0088] This objective function can well express the degree of matching between pairs of samples and can also be well used to train feature extraction models.
[0089] When y = 1 (i.e., the samples are similar), the objective function is reduced to ∑yd. 2 That is, if samples that were originally similar have a large Euclidean distance in the feature space, it means that the current model is not good, so the loss should be increased.
[0090] When y = 0 (i.e., the samples are not similar), the objective function is ∑(1-y)max(margin-d,0). 2 That is, when samples are not similar, if the Euclidean distance in their feature space is small, the loss value will be large.
[0091] The objective function described above can better reflect the matching degree of paired samples compared to the cross-entropy loss function, and is more suitable for training models.
[0092] like Figure 4 As shown, a specific implementation process of the present invention includes:
[0093] Step 41: For devices of the same type, mark four points in the key region. Use the YOLO model to detect these four points, output a key region, and perform affine transformation correction, such as... Figure 5 As shown.
[0094] Step 42: Use OCR to identify the asset number area in the key area to see if the asset number can be identified. If it can be identified, use the unique asset number of each device to remove duplicates. If the asset number cannot be identified, proceed to the next step.
[0095] Step 43: Use two images as a pair and label them to determine if they are from the same device. Construct a dataset (for training) using a sufficient number of image pairs and labels, and then feed it into a Siamese convolutional neural network for training to obtain the preset network model. Specifically, since the original images contain photos of the same device from different angles, all photos are first input into the YOLO detection model to obtain key regions, which are then used as the training set. The improved objective function L is used as the loss function Loss for training to obtain the preset network model.
[0096] In a specific application scenario: the number of devices in the same base station needs to be counted.
[0097] In the same base station, if there are n photos of equipment, some of which are different photos of the same equipment, it will cause inconvenience to equipment verification.
[0098] By using the method described in the above embodiments of the present invention, one by one the devices of the same model are compared. When making statistics, photos of the same devices can be subtracted to obtain the true total number.
[0099] This refers to situations where photos from the same device are used in different base stations.
[0100] If base station 1 uses equipment photos from base station 2, the detection process can help identify areas for improvement in equipment management.
[0101] The overall implementation process of the above-described method of the present invention includes:
[0102] Step 1: Key point detection. Use the YOLO model trained earlier to detect key points, obtain the four-value coordinates of the key regions, and then crop them. After cropping, perform affine transformation correction.
[0103] Step 2: Input the key area into the OCR model to see if the equipment asset number can be identified and determine if there are duplicate equipment.
[0104] Step 3: If Step 2 cannot determine the similarity, input the four-value coordinates of the key regions of the two images obtained in Step 1 and the two images into the preset network model trained earlier to obtain the similarity evaluation value.
[0105] Step 4: Compare the similarity evaluation value obtained in Step 3 with the set threshold. If it is greater than the threshold, the first image and the second image are determined to be images obtained from the same device; otherwise, the first image and the second image are determined to be images obtained from different devices.
[0106] The above embodiments of the present invention address issues such as complex backgrounds, incomplete images, lighting conditions, and angles affecting base station equipment. They employ a YOLO target detection algorithm to detect a uniquely identifiable region of the equipment. Next, OCR technology is used to identify the equipment's asset tag. If the asset number can be identified, it determines whether the equipment is a duplicate. If the asset number cannot be identified, an improved Siamese convolutional neural network is used to determine the similarity of key regions. Finally, a similarity threshold is set to determine whether the equipment is a duplicate.
[0107] In the network model, the Atrous Space Pyramid Pooling (ASPP) module is introduced to improve the model's ability to extract multi-scale features and remove the model's limitation on the size of the input image, thus ensuring the integrity of the image feature information.
[0108] When training a network model, the contrastive loss function can better reflect the matching degree of paired samples compared to the cross-entropy loss function, making it more suitable for training the model.
[0109] Using the above method, the deduplication accuracy of device images reaches over 92%, which is a significant improvement compared to the 52% accuracy of hash deduplication algorithm and the 85% accuracy of traditional twin convolutional neural network.
[0110] like Figure 6 As shown, embodiments of the present invention also provide an image processing apparatus 60, the apparatus 60 comprising:
[0111] The first acquisition module 61 is used to acquire the first image and the second image captured by the device;
[0112] The second acquisition module 62 is used to acquire the first key information of the first image and the second key information of the second image;
[0113] The first processing module 63 is used to determine, based on the first key information and the second key information, whether the first image and the second image are images captured by the same device;
[0114] The second processing module 64 is used to determine whether the first image and the second image are images taken from the same device by using a preset network model when it is impossible to identify whether the first image and the second image are images taken from the same device.
[0115] Optionally, obtaining the first key information of the first image and the second key information of the second image includes:
[0116] The first image is processed by a target detection algorithm to obtain the first key information, which includes: the first device number identified from the first image;
[0117] The second image is processed by the target detection algorithm to obtain the second key information, which includes the second device number identified from the second image.
[0118] Optionally, based on the first key information and the second key information, determining whether the first image and the second image are images captured by the same device includes:
[0119] If the first device number and the second device number are the same, then it is determined that the first image and the second image are images taken by the same device; otherwise, it is determined that the first image and the second image cannot be identified.
[0120] Optionally, determining whether the first image and the second image are images captured by the same device using a preset network model includes:
[0121] The first image is input into the first sub-model of the network model for processing to obtain the first output;
[0122] The second image is input into the second sub-model of the network model for processing to obtain the second output;
[0123] Based on the first output and the second output, obtain the Euclidean distance between the first image and the second image;
[0124] The similarity between the first image and the second image is obtained based on the Euclidean distance.
[0125] Based on the similarity, it is determined whether the first image and the second image were taken with the same device.
[0126] Optionally, based on the similarity, determining whether the first image and the second image are images captured by the same device includes:
[0127] If the similarity is greater than a preset threshold, then the first image and the second image are determined to be images taken with the same device; otherwise, the first image and the second image are determined not to be images taken with the same device.
[0128] Optionally, the preset network model is trained through the following process:
[0129] The first sample in the training set is input into the first sub-model for processing to obtain the first output.
[0130] The second sample in the training set is input into the second sub-model for processing to obtain the second output;
[0131] Based on the first output and the second output, obtain the Euclidean distance between the first image and the second image;
[0132] The similarity between the first image and the second image is obtained based on the Euclidean distance.
[0133] Based on the similarity, it is determined whether the first image and the second image were taken with the same device.
[0134] Optionally, the first sub-model and the second sub-model are the same, and both are optimized using the following objective function:
[0135]
[0136] Where L is the objective function, d = ||a n -b n || 2 Representing the first sample a n Second sample b n The Euclidean distance, where y is the distance from the first sample a. n Second sample b n The label indicates whether the samples are similar, where y=1 represents the first sample a. n Second sample b n Similarly, y = 0 represents the first sample a. n Second sample b n Dissimilar, margin is the set threshold, and N is the number of samples.
[0137] It should be noted that this device is the same as the method described above. All implementations in the above method embodiments are applicable to the embodiments of this device and can achieve the same technical effect.
[0138] Embodiments of the present invention also provide an image processing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.
[0139] Embodiments of the present invention also provide a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.
[0140] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0141] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0142] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0143] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0144] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0145] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0146] Furthermore, it should be noted that in the apparatus and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent solutions of the present invention. Moreover, the steps performing the above-described series of processes can naturally be executed in the order described, but are not necessarily required to be executed in chronological order; some steps can be executed in parallel or independently of each other. Those skilled in the art will understand that all or any step or component of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or network of computing devices, in hardware, firmware, software, or a combination thereof. This is something that those skilled in the art can achieve by using their basic programming skills after reading the description of the present invention.
[0147] Therefore, the object of the present invention can also be achieved by running a program or a set of programs on any computing device. The computing device can be a known general-purpose device. Therefore, the object of the present invention can also be achieved simply by providing a program product containing program code implementing the method or apparatus. That is, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any known storage medium or any storage medium developed in the future. It should also be noted that in the apparatus and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent to the present invention. Furthermore, the steps performing the above series of processes can naturally be performed in the order described, but are not necessarily required to be performed in chronological order. Some steps can be performed in parallel or independently of each other.
[0148] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An image processing method, characterized in that, The method includes: Acquire the first and second images captured by the device; Obtain the first key information of the first image and the second key information of the second image; Based on the first key information and the second key information, determine whether the first image and the second image are images captured by the same device; When it is impossible to identify whether the first image and the second image were taken with the same device, a preset network model is used to determine whether the first image and the second image were taken with the same device. The preset network model is trained through the following process: The first sample in the training set is input into the first sub-model of the network model for processing to obtain the first output. The second sample in the training set is input into the second sub-model of the network model for processing to obtain the second output; Based on the first output and the second output, obtain the Euclidean distance between the first image and the second image; The similarity between the first image and the second image is obtained based on the Euclidean distance. Based on the similarity, it is determined whether the first image and the second image were taken with the same device; The first sub-model and the second sub-model are identical, and both are optimized using the following objective function: Where L is the objective function, Representing the first sample a n Second sample b n European distance, For the first sample a n Second sample b n Does it match the tag? =1 indicates the first sample a n Second sample b n resemblance, =0 indicates the first sample a n Second sample b n Dissimilar The threshold is set, and N is the number of samples.
2. The image processing method according to claim 1, characterized in that, Obtaining first key information of the first image and second key information of the second image includes: The first image is processed by a target detection algorithm to obtain the first key information, which includes: the first device number identified from the first image; The second image is processed by the target detection algorithm to obtain the second key information, which includes the second device number identified from the second image.
3. The image processing method according to claim 2, characterized in that, Based on the first key information and the second key information, determining whether the first image and the second image are images captured by the same device includes: If the first device number and the second device number are the same, then it is determined that the first image and the second image are images taken by the same device; otherwise, it is determined that the first image and the second image cannot be identified.
4. The image processing method according to claim 1, characterized in that, Determining whether the first image and the second image are taken by the same device using a preset network model includes: The first image is input into the first sub-model for processing to obtain the first output; The second image is input into the second sub-model for processing to obtain the second output; Based on the first output and the second output, obtain the Euclidean distance between the first image and the second image; The similarity between the first image and the second image is obtained based on the Euclidean distance. Based on the similarity, it is determined whether the first image and the second image were taken with the same device.
5. The image processing method according to claim 4, characterized in that, Based on the similarity, determining whether the first image and the second image are images captured by the same device includes: If the similarity is greater than a preset threshold, then the first image and the second image are determined to be images taken with the same device; otherwise, the first image and the second image are determined not to be images taken with the same device.
6. An image processing apparatus, characterized in that, The device includes: The first acquisition module is used to acquire the first image and the second image captured by the device. The second acquisition module is used to acquire the first key information of the first image and the second key information of the second image; The first processing module is used to determine, based on the first key information and the second key information, whether the first image and the second image are images captured by the same device; The second processing module is used to determine whether the first image and the second image are images taken from the same device by using a preset network model when it is impossible to identify whether the first image and the second image are images taken from the same device. The preset network model is trained through the following process: The first sample in the training set is input into the first sub-model of the network model for processing to obtain the first output. The second sample in the training set is input into the second sub-model of the network model for processing to obtain the second output; Based on the first output and the second output, obtain the Euclidean distance between the first image and the second image; The similarity between the first image and the second image is obtained based on the Euclidean distance. Based on the similarity, it is determined whether the first image and the second image were taken with the same device; The first sub-model and the second sub-model are identical, and both are optimized using the following objective function: Where L is the objective function, Representing the first sample a n Second sample b n European distance, For the first sample a n Second sample b n Does it match the tag? =1 indicates the first sample a n Second sample b n resemblance, =0 indicates the first sample a n Second sample b n Dissimilar The threshold is set, and N is the number of samples.
7. An image processing device, characterized in that, include: A processor, a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, A storage instruction that, when executed on a computer, causes the computer to perform the method as described in any one of claims 1 to 5.