Method for detecting repeated or similar photos based on AI image recognition technology
Through image preprocessing, deep learning model feature extraction and similarity calculation by AI image recognition technology, the problem of inefficient photo data processing in the existing technology is solved, fast and accurate repetitive or similar photo recognition is achieved, and data management is improved Efficiency and storage utilization.
Patent Information
- Application Number
- CN202411152262.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-13
AI Technical Summary
The prior art, when identifying and processing large amounts of photo data, manually identifying image features to judge the speed and inefficiency of duplicate or similar photos, has led to huge challenges in managing data assets.
Using AI-based image recognition technology, image preprocessing, feature extraction of deep learning models and Euclidean distance calculation, combined with multiple feature information to calculate similarity, set thresholds to determine whether the photos are duplicated or similar, and use the front-end UI/ UX design displays recognition results.
It greatly improves the speed and efficiency of photo data processing, reduces manual intervention, improves the accuracy of identification, avoids missed or mis-checked, saves storage space and labor costs, and realizes automated classification and marking.
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a method for detecting repeated or similar photos based on AI image recognition technology. Background Art
[0002] With the promotion and application of digital technology, more and more companies are using digital tools as a management tool for the terminal market. Under this background, a large amount of photo data will inevitably be generated, and the photo data will take up a lot of storage space. In order to identify these repeated or similar photo data, it is necessary to check all existing photo data, manually identify the features in the image to determine the repeated or similar photos and then process them. The processing speed and efficiency are low. For enterprises, how to ensure the accuracy and authenticity of the processed photo data is a huge challenge that every enterprise will face in the future in managing data assets. Summary of the invention
[0003] In view of this, in order to solve the problems existing in the technical background, the present invention proposes a method for detecting duplicate or similar photos based on AI image recognition technology, which can quickly process a large amount of image data, analyze and extract key information in a short time, thereby more and more accurately judging the repetition or similarity between photos, and greatly improving the speed and efficiency of photo data processing. The specific technical solution is as follows:
[0004] A method for detecting duplicate or similar photos based on AI image recognition technology, comprising the following steps:
[0005] Step 1: Image preprocessing: preprocess the input photos, including image denoising, size adjustment, color space conversion, etc.
[0006] Step 2: Image feature extraction: The accuracy and efficiency of feature extraction are further improved through the structure and parameters of the deep learning model, and the deep learning algorithm is used to extract features from the pre-processed photos;
[0007] Step 3: Image similarity calculation: Calculation based on multiple feature information can better identify subtle differences between photos. At the same time, by setting appropriate thresholds, it can determine whether two photos are repeated or similar.
[0008] This step uses a convolutional neural network (CNN) deep learning model to extract features, and then calculates the similarity between the extracted features through the Euclidean distance. That is, for point A (x1, y1) and point B (x2, y2) in two-dimensional space, the Euclidean distance formula between them is:
[0009] [d(A,B)=\sqrt{(x 2-x1)^2+(y_2.y_1)^2}]
[0010] For a point A(x1,x2...,xn) and a point B(y1,y2..yn) in n-dimensional space, the general formula for the Euclidean distance is:
[0011] [d(A,B)=\sqrt{(x 2-x 1)^2+(x 3.x2)^2+\cdots+(x_n-x_{n-1})^2}]
[0012] Or more generally, in vector form:
[0013] [d(A,B)=\sqrt{\sum{i=1}^{n}(a ib i)^2};
[0014] Among them, (ai) and (bi) are the i-th coordinate components of point A and point B respectively. The image is converted into feature vectors, and the similarity between these feature vectors is calculated.
[0015] Step 4: Result output and display: Through front-end\UI\UX design, the recognition results are intuitively displayed to users in a visual way, including similarity scores, duplicate photo lists and other information.
[0016] Furthermore, the image preprocessing in step 1 includes denoising, resizing and color space conversion. The denoising removes noise and other impurities in the image to improve the image quality, and reduces the details and grayscale changes of the image by means of methods such as averaging or median filtering to make the image smoother.
[0017] Furthermore, the resizing adjusts the image to a uniform size, specifically:
[0018] First, resize the image by specifying a new width and height, or by specifying a scaling factor; second, use the stride of the convolution kernel to adjust the step size of the convolution operation to achieve downsampling or upsampling of feature maps in convolutional neural networks. Third, reduce the size of the feature map through pooling operations, maximum pooling or average pooling.
[0019] Furthermore, the color space conversion converts an image from one color space to another color space in order to better extract features or perform specific image processing tasks. RGB is the most commonly used color space and is suitable for most color display devices; HSV (hue, saturation and brightness) is more in line with human perception of color and is often used for color recognition and image segmentation; YUV is a color space that represents brightness (Y) and chrominance (UV) separately and is often used for video encoding and transmission. The core method uses the cvtColor() function of OpenCV. This function allows an image to be converted from one color space to another.
[0020] Furthermore, the feature extraction includes information such as texture and color of the image, which is used to describe the content and attributes of the photo.
[0021] The above technical solution has the following beneficial effects:
[0022] The present invention can quickly identify duplicate photos in the same or different scenarios in the system, restore the authenticity of the business, combine multiple technologies, lock the data range through screening conditions in different dimensions, and after triggering the recognition, the AIP interface calls the model algorithm, and after calculation and analysis, finally outputs the similarity result, which greatly improves the recognition efficiency of duplicate photos.
[0023] The present invention can quickly process a large amount of image data, analyze and extract key information in a short time through advanced algorithms and powerful computing power, greatly improving processing speed and efficiency, saving users' time, and helping enterprises reduce costs and increase efficiency;
[0024] As deep learning and training continue to advance, AI algorithms can accurately identify features and patterns in images, thereby increasingly accurately determining the degree of repetition or similarity between photos. This accuracy is particularly important when processing a large number of photos, and can effectively avoid missed or false detections.
[0025] Automatically classify and mark similar or duplicate photos, make the image processing process more intelligent, reduce manual intervention, further reduce labor costs, improve the authenticity of processing, and help companies save investment in data storage. By detecting and deleting duplicate or similar photos, users can free up a lot of storage space, making cloud services or equipment investment less and storage utilization higher. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] A method for detecting duplicate or similar photos based on AI image recognition technology, comprising the following steps:
[0028] Step 1: Image preprocessing: Preprocess the input photos, including image denoising, size adjustment, color space conversion, etc.
[0029] Denoising, that is, removing noise and other impurities in the image to improve image quality, and reducing image details and grayscale changes through methods such as averaging or median filtering to make the image smoother;
[0030] Resizing, i.e. adjusting the image to a uniform size, is crucial for subsequent algorithm processing and machine learning model training. Specific methods:
[0031] First, use Opencv's resize method: for example, resize the image by specifying a new width and height, or by specifying a scaling ratio; second, use the stride of the convolution kernel: by adjusting the stride of the convolution operation, downsampling or upsampling of feature maps can be achieved in convolutional neural networks. Third, reduce the size of the feature map through pooling operations, maximum pooling or average pooling.
[0032] Color space conversion is to convert an image from one color space to another in order to better extract features or perform specific image processing tasks. RGB is the most commonly used color space and is suitable for most color display devices; HSV (hue, saturation, and brightness) is more in line with human perception of color and is often used in color recognition and image segmentation; YUV is a color space that represents brightness (Y) and chrominance (UV) separately and is often used in video encoding and transmission.
[0033] The core method uses the cvtColor() function of OpenCV. This function allows the conversion of images from one color space to another. Step 2: Image feature extraction: The accuracy and efficiency of feature extraction are further improved through the structure and parameters of the deep learning model. The deep learning algorithm is used to extract features from the preprocessed photos. These features can be information such as texture and color of the image, which are used to describe the content and attributes of the photo.
[0034] CNN (Convolutional Neural Network) is a feature extraction method based on deep learning, which can automatically learn the feature representation in the image. It extracts the features of the image by stacking multiple convolutional layers, pooling layers and fully connected layers, and is used for tasks such as image classification, target detection and object segmentation.
[0035] Step 3: Image similarity calculation: By combining multiple feature information and using a more accurate similarity calculation method, the subtle differences between photos can be better identified. At the same time, by setting an appropriate threshold, it can be determined whether two photos are repeated or similar.
[0036] Use deep learning models such as convolutional neural networks (CNN) to extract features, and then calculate the similarity between the extracted features using the Euclidean distance. That is, for point A (x1, y1) and point B (x2, y2) in two-dimensional space, the Euclidean distance formula between them is:
[0037] [d(A,B)=\sqrt{(x 2-x1)^2+(y_2.y_1)^2}];
[0038] For a point A(x1,x2...,xn) and a point B(y1,y2..yn) in n-dimensional space, the general formula for the Euclidean distance is:
[0039] [d(A,B)=\sqrt{(x 2-x 1)^2+(x 3.x2)^2+\cdots+(x_n-x_{n-1})^2}];
[0040] Or more generally, in vector form:
[0041] [d(A,B)=\sqrt{\sum{i=1}^{n}(a ib i)^2};
[0042] Where (ai) and (bi) are the i-th coordinate components of point A and point B, respectively. The image is converted into feature vectors, and then the similarity between these feature vectors is calculated.
[0043] Step 4: Result output and display: Through front-end\UI\UX design, the recognition results are intuitively displayed to users in a visual way, including similarity scores, duplicate photo lists and other information.
[0044] The technical patent of the present invention for detecting duplicate or similar photos based on AI image recognition technology aims to improve the accuracy and efficiency of photo duplication detection by applying artificial intelligence technology, and provide users with a convenient and efficient data asset management solution. The present invention extracts and compares features of photos to more accurately identify duplicate or similar photos. By training a large amount of image data, the model continuously learns the key features in the photos, thereby realizing the automatic recognition and classification of photos, guiding the efficient operation of the business.
[0045] The basic principles and main features of the present invention are described above. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for illustrating the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which shall fall within the scope of the present invention to be protected. The scope of protection of the invention shall be defined by the attached claims and their equivalents.
Claims
1. A method for detecting duplicate or similar photos based on AI image recognition technology, characterized in that: The following steps are involved: Step 1: Image preprocessing: preprocess the input photos, including image denoising, size adjustment, color space conversion, etc. Step 2: Image feature extraction: The accuracy and efficiency of feature extraction are further improved through the structure and parameters of the deep learning model, and the deep learning algorithm is used to extract features from the pre-processed photos; Step 3: Image similarity calculation: Calculation based on multiple feature information can better identify subtle differences between photos. At the same time, by setting appropriate thresholds, it can determine whether two photos are repeated or similar. This step uses a convolutional neural network (CNN) deep learning model to extract features, and then calculates the similarity between the extracted features through the Euclidean distance. That is, for point A (x1, y1) and point B (x2, y2) in two-dimensional space, the Euclidean distance formula between them is: [d(A,B)=\sqrt{(x 2-x1)^2+(y_2.y_1)^2}] For a point A(x1,x2...,xn) and a point B(y1,y2..yn) in n-dimensional space, the general formula for the Euclidean distance is: [d(A,B)=\sqrt{(x 2-x 1)^2+(x 3.x2)^2+\cdots+(x_n-x_{n-1})^2}] Or more generally, in vector form: [d(A,B)=\sqrt{\sum{i=1}^{n}(a ib i)^2}; Among them, (ai) and (bi) are the i-th coordinate components of point A and point B respectively. The image is converted into feature vectors, and the similarity between these feature vectors is calculated. Step 4: Result output and display: Through front-end\UI\UX design, the recognition results are intuitively displayed to users in a visual way, including similarity scores, duplicate photo lists and other information.
2. The method for detecting duplicate or similar photos based on AI image recognition technology according to claim 1, characterized in that: The image preprocessing in step 1 includes denoising, resizing and color space conversion. The denoising removes noise and other impurities in the image to improve the image quality. The image details and grayscale changes are reduced by averaging or median filtering to make the image smoother.
3. The method for detecting duplicate or similar photos based on AI image recognition technology according to claim 2, characterized in that: The resizing method adjusts the image to a uniform size. The specific method is: First, resize the image by specifying a new width and height, or by specifying a scaling factor; second, use the stride of the convolution kernel to adjust the step size of the convolution operation to achieve downsampling or upsampling of feature maps in convolutional neural networks. Third, reduce the size of the feature map through pooling operations, maximum pooling or average pooling.
4. The method for detecting duplicate or similar photos based on AI image recognition technology according to claim 2, characterized in that: The color space conversion converts an image from one color space to another in order to better extract features or perform specific image processing tasks. RGB is the most commonly used color space and is suitable for most color display devices; HSV is more in line with human perception of color and is often used for color recognition and image segmentation; YUV is a color space that represents brightness (Y) and chrominance (UV) separately and is often used in video encoding and transmission. Use OpenCV's cvtColor() function. This function allows an image to be converted from one color space to another.
5. The method for detecting duplicate or similar photos based on AI image recognition technology according to claim 1, characterized in that: The feature extraction includes information such as texture and color of the image, which is used to describe the content and attributes of the photo.
