Image small-range modification identification method and device, computer equipment and storage medium
By performing pixel chunking and differential discrete cosine transformation of the recognized image and the similar image set, combined with high-pass filtering, the modified area of the image is identified, which solves the problem of difficult to recognize the local slight modification image, and improves the efficiency and accuracy of insurance claims review sex.
Patent Information
- Application Number
- CN202411388577.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-10
AI Technical Summary
During the insurance claim process, the images used in false claims are difficult to be identified by traditional audit methods through minor local modifications, resulting in increased recognition difficulty and cost.
By acquiring the image to be identified and the similar image set, pixel chunking is performed, differential discrete cosine transformation and high-pass filtering are performed, and the modified area of the image is identified.
It improves the accuracy and efficiency of image recognition, can quickly screen out potential false claims images, improves the efficiency and accuracy of claims review, and curbs false claims.
Smart Images

Figure CN119295733A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of artificial intelligence and financial technology, and in particular to a method, device, computer equipment and storage medium for identifying small-scale image modifications. Background Art
[0002] In the rapidly developing insurance industry, insurance claims are an important part of protecting the rights and interests of policyholders and maintaining the sound operation of insurance companies. Its fairness, accuracy and efficiency are of vital importance. However, with the popularization of digital technology and the increasing sophistication of image processing technology, the insurance claims process faces an increasingly severe challenge: the proliferation of false claims. For example, copying and tampering with existing claims images in an attempt to impersonate real insurance policy evidence not only seriously infringes on the legitimate rights and interests of insurance companies, but also disrupts the normal order of the insurance market, causing huge economic losses and a crisis of social trust.
[0003] Specifically, there are many types of images used for false claims, including but not limited to documents proving the value of the insured items (such as invoices, receipts, etc.), actual photos of the items at the time of the accident, and photos of the accident site survey, etc. These images are important bases for claim review, and their authenticity is directly related to the correctness of the claim decision.
[0004] In actual operations, the methods used by false claim adjusters are becoming increasingly complex and diverse. A more direct way is to completely apply the claims images that have been used in other cases. Although this method is simple, with the improvement of the insurance company's review mechanism, its identification difficulty is relatively low. However, what is more covert and difficult to detect is that the original image is slightly modified locally through advanced image processing technology (such as Photoshop, etc.), creating a "pseudo-original" image that looks different but actually retains most of the original image content. Since these images are similar in content and only minor adjustments are made to the details, it is difficult for traditional manual review methods to effectively distinguish them, greatly increasing the difficulty and cost of identification. Summary of the invention
[0005] The purpose of the embodiments of the present application is to propose a method, device, computer equipment and storage medium for identifying small-scale modifications of images, so as to solve the technical problem in the related art that images with similar content and slight local modifications are difficult to distinguish and identify.
[0006] In order to solve the above technical problems, the embodiment of the present application provides a method for identifying small-scale modification of an image, which adopts the following technical solution:
[0007] Obtain an image to be identified in a library of images to be identified, and obtain a set of similar images with image contents similar to the image to be identified from a preset image base library;
[0008] The image to be identified and each reference image in the similar image set form an image pair to be identified, and the image pair to be identified is divided into pixel blocks to obtain a pixel block pair set;
[0009] Calculating the pixel difference of each pixel block pair in the pixel block pair set based on the difference discrete cosine transform to obtain a block DCT difference image;
[0010] Performing high-pass filtering based on the block DCT difference image to obtain a high-frequency block DCT difference image;
[0011] The modification area of the image to be identified is identified according to the high-frequency block DCT difference image.
[0012] Furthermore, the step of acquiring a set of similar images having image contents similar to the image to be identified from a preset image base includes:
[0013] Based on the image feature extraction model, feature extraction is performed on all reference images in the preset image base library to obtain a reference image feature set, and the reference image feature set is stored in a preset retrieval library;
[0014] Based on the image feature extraction model, feature extraction is performed on the image to be identified to obtain features of the image to be identified;
[0015] Calculating the similarity between the image feature to be identified and the reference image feature set;
[0016] Sorting the reference images according to the similarity from high to low to obtain a sorting result;
[0017] A preset number of reference images ranked first are selected from the ranking results to form a set of images similar to the image to be identified.
[0018] Furthermore, the step of dividing the to-be-recognized image pair into pixel blocks to obtain a set of pixel block pairs includes:
[0019] Performing pixel normalization processing on the image to be identified and the reference image in the pair of images to be identified to obtain a normalized image to be identified and a normalized reference image;
[0020] Dividing the normalized image to be identified and the normalized reference image according to a preset size to obtain a plurality of image pixel blocks to be identified and a plurality of reference image pixel blocks;
[0021] According to the position of the image pixel block to be identified, obtaining a reference image pixel block at a corresponding position;
[0022] The pixel blocks of the image to be identified and the pixel blocks of the reference image corresponding to all positions are combined into a pixel block pair set.
[0023] Furthermore, the step of calculating the pixel difference of each pixel block pair in the pixel block pair set based on the difference discrete cosine transform to obtain the block DCT difference image includes:
[0024] Traversing each pixel block in the pixel block set, extracting the currently traversed pixel block pair as a target pixel block pair, wherein the target pixel block pair includes a pixel block of the image to be identified and a corresponding pixel block of the reference image;
[0025] Performing discrete cosine transform on the pixel block of the image to be identified and the pixel block of the reference image respectively to obtain a discrete cosine transform image to be identified and a reference discrete cosine transform image;
[0026] The discrete cosine transform image to be identified and the reference discrete cosine transform image are subtracted pixel by pixel to obtain a block DCT difference image.
[0027] Furthermore, the step of performing high-pass filtering based on the block DCT difference image to obtain a high-frequency block DCT difference image includes:
[0028] Calculate the non-zero pixel ratio and the maximum absolute difference of the block DCT difference image;
[0029] When the non-zero pixel ratio is less than a first preset threshold and the maximum absolute difference is greater than a second preset threshold, determining a high-pass filter radius according to the non-zero pixel ratio and the maximum absolute difference;
[0030] The low-frequency signal of the block DCT difference image is set to zero according to the high-pass filter radius to obtain a high-frequency block DCT difference image.
[0031] Furthermore, the step of identifying the modification area of the image to be identified according to the high-frequency block DCT difference image includes:
[0032] The high frequency block DCT difference image is converted into a time domain difference image by using an inverse discrete cosine transform algorithm;
[0033] Obtain a non-zero connected region in the time domain difference map, and calculate a maximum connected region area of the non-zero connected region;
[0034] When the area of the maximum connected region is greater than a preset connected area threshold, the image to be identified has a modified region in the current pixel block.
[0035] Furthermore, the step of obtaining the non-zero connected regions in the time domain difference map and calculating the maximum connected region area of the non-zero connected regions includes:
[0036] The time domain difference image is binarized by using a threshold segmentation method to obtain a binarized image, wherein the binarized image includes a foreground area with a gray value greater than zero and a background area with a gray value equal to zero;
[0037] Using an eight-neighborhood connected region labeling algorithm, the pixels in the foreground area are labeled as connected regions to obtain a plurality of connected regions;
[0038] Calculating the area of each connected region to obtain the connected area of all the connected regions, and obtaining the connected region with the largest connected area as the maximum connected region by comparing the areas;
[0039] According to the position coordinates of the maximum connected area, extracting the corresponding maximum connected area pixel in the time domain difference map;
[0040] The area of the extracted maximum connected region pixels is calculated to obtain the maximum connected region area.
[0041] In order to solve the above technical problems, the embodiment of the present application further provides a device for identifying small-range modifications of an image, which adopts the following technical solution:
[0042] An acquisition module is used to acquire an image to be identified in a library of images to be identified, and to acquire a set of similar images having image contents similar to those of the image to be identified from a preset image base library;
[0043] A pixel block module, used to form a pair of images to be identified by combining the image to be identified and each reference image in the similar image set, and to perform pixel block division on the pair of images to be identified to obtain a set of pixel block pairs;
[0044] A transform module, configured to calculate the pixel difference of each pixel block pair in the pixel block pair set based on a difference discrete cosine transform, to obtain a block DCT difference image;
[0045] A filtering module, used for performing high-pass filtering based on the block DCT difference image to obtain a high-frequency block DCT difference image;
[0046] The identification module is used to identify the modification area of the image to be identified according to the high-frequency block DCT difference image.
[0047] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0048] The computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the above-mentioned method for identifying small-range modification of an image when executing the computer-readable instructions.
[0049] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0050] The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the method for identifying small-range modifications of an image are implemented.
[0051] Compared with the prior art, this application has the following beneficial effects:
[0052] The present application provides a method for identifying small-scale modification of an image. The method forms an image pair to be identified by combining the image to be identified in the image library with each reference image in the similar image set, and divides the image pair to be identified into pixel blocks to obtain a set of pixel block pairs, thereby reducing the image comparison range and improving the recognition efficiency. The method uses differential discrete cosine transform and high-pass filtering to highlight the features of the modified area and improve the recognition accuracy. Therefore, the present application can quickly screen out potential false claims images from a large number of claims images, improve the efficiency and accuracy of claims review, and thus effectively curb the occurrence of false claims and maintain the healthy and stable development of the insurance market. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are 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.
[0054] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0055] Figure 2 is a flow chart of an embodiment of a method for identifying small-scale image modifications according to the present application;
[0056] Figure 3 is a structural schematic diagram of an embodiment of an image small-range modification recognition device according to the present application;
[0057] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0059] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0060] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0061] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.
[0062] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0063] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.
[0064] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0065] It should be noted that the image small-scale modification recognition method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the image small-scale modification recognition device is generally set in the server / terminal device.
[0066] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0067] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for identifying small-scale image modifications according to the present application, comprising the following steps:
[0068] Step S201, obtaining an image to be identified in a library of images to be identified, and obtaining a set of similar images with image contents similar to the image to be identified from a preset image base library.
[0069] The image library to be identified is pre-built, and stores a large number of image materials used for claims analysis, such as vehicle accident scene photos, medical imaging materials, property damage photos, etc. The preset image base is also pre-built, storing a large number of claims images that have been used.
[0070] In this embodiment, the electronic device (eg, Figure 1The server / terminal device shown in the figure can obtain the image to be identified in the image library to be identified through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.
[0071] It should be emphasized that in order to further ensure the privacy and security of the image library to be identified, the above-mentioned image library to be identified can also be stored in a node of a blockchain.
[0072] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0073] In this embodiment, image retrieval technology is used to obtain reference images with high image content similarity to the image to be identified from a preset image base to form a similar image set.
[0074] In some optional implementations of this embodiment, the step of acquiring a set of similar images having image contents similar to the image to be identified from a preset image base includes:
[0075] Based on the image feature extraction model, feature extraction is performed on all reference images in the preset image base library to obtain a reference image feature set, and the reference image feature set is stored in the preset retrieval library;
[0076] Based on the image feature extraction model, feature extraction is performed on the image to be identified to obtain the features of the image to be identified;
[0077] Calculate the similarity between the features of the image to be identified and the feature set of the reference image;
[0078] Sort the reference images according to the similarity from high to low to obtain the sorting result;
[0079] A preset number of reference images ranked first are selected from the sorting results to form a similar image set of the image to be identified.
[0080] Among them, the image feature extraction model can adopt mainstream convolutional neural network models such as ResNet50, VGG-16, etc. The image feature extraction model is used to extract high-order features (512 dimensions) of all reference images in the preset image base library, and the reference image features corresponding to each reference image are obtained. The mapping relationship between each reference image and the corresponding image reference image feature is established, and the mapping relationship between all reference images and features is aggregated to form a reference image feature set. According to the structure and indexing method of the preset retrieval library, the target image feature set is stored in the preset retrieval library. In the preset retrieval library, a multi-dimensional feature index is established for the reference image feature set. The dimension of the feature index is consistent with the dimension of the image feature. The indexing method can speed up the subsequent feature retrieval and matching speed.
[0081] In this embodiment, the image feature extraction model is used to extract high-order features (512 dimensions) of the image to be identified, and the image features to be identified are obtained. Feature matching is performed in a preset retrieval library based on the image features to be identified. The matching method is to use the Euclidean distance to calculate the distance similarity between the image features to be identified and the reference image features of each reference image in the reference image feature set. The smaller the Euclidean distance, the higher the similarity. The reference images are sorted from small to large according to the Euclidean distance, and the Top-N reference images with distance similarity less than or equal to the preset distance threshold in the sorting results are obtained to form a similar image set for output. Wherein N is a positive integer.
[0082] It should be noted that if all distance similarities are greater than the preset distance threshold, it means that there is no reference image similar to the image to be identified, and there is no need to perform subsequent identification steps, and the feature information of the image to be identified is stored in the preset retrieval library.
[0083] In this embodiment, the image feature extraction model is obtained by training with a large number of image samples. For example, during the training process, the Adam optimization algorithm is used, the learning rate is set to 0.01, the batch size is 128, and 500 epochs are trained to extract the 512-dimensional feature vector of the image.
[0084] By obtaining a set of similar images to the image to be identified through image feature matching, it is possible to quickly find matching similar images in massive image data, improve the efficiency and accuracy of image recognition, narrow the comparison scope, and improve processing efficiency.
[0085] Step S202: The image to be identified and each reference image in the similar image set form an image pair to be identified, and the image pair to be identified is divided into pixel blocks to obtain a set of pixel block pairs.
[0086] In this embodiment, a paired method is used for image recognition, the image to be recognized and each reference image in a similar image set form an image pair to be recognized, and an image blocking method is used to block pixels of the two images in the image pair to be recognized.
[0087] In some optional implementations of this embodiment, the step of dividing the image pair to be identified into pixel blocks to obtain pixel block pairs includes:
[0088] Performing pixel normalization processing on the image to be identified and the reference image in the image pair to be identified to obtain a normalized image to be identified and a normalized reference image;
[0089] Dividing the normalized image to be identified and the normalized reference image according to a preset size to obtain a plurality of image pixel blocks to be identified and a plurality of reference image pixel blocks;
[0090] According to the position of the image pixel block to be identified, obtaining the reference image pixel block at the corresponding position;
[0091] The pixel blocks of the image to be identified and the pixel blocks of the reference image that correspond in position form a pixel block pair.
[0092] In this embodiment, before dividing the pixel blocks, the image to be identified and the reference image are subjected to pixel normalization processing, and the pixel values are normalized to between 0 and 255. The image to be identified and the reference image are directly divided into pixel blocks according to a preset size. Specifically, a sliding window is adopted, a window of a preset size and a preset pixel step size are slid on the image pair, and the image area covered by the sliding window is taken as a pixel block, thereby obtaining a plurality of pixel blocks of the image to be identified and a plurality of pixel blocks of the reference image. The preset size can be set according to actual conditions.
[0093] According to the position of the pixel block of the image to be identified, the reference image pixel block at the corresponding position is obtained in the reference image, and they are formed into a pixel block pair, for example, the pixel block in the upper left corner of the image to be identified and the pixel block in the upper left corner of the target image form a pixel block pair.
[0094] By dividing the image into pixel blocks, the computational complexity can be reduced and each pixel block can be processed in parallel, thereby reducing the overall processing time and improving image recognition efficiency; pixel block division helps to more accurately extract local features of the image, reduce noise interference, and improve recognition accuracy.
[0095] Step S203, calculating the pixel difference of each pixel block pair in the pixel block pair set based on the difference discrete cosine transform, and obtaining a block DCT difference image.
[0096] In this embodiment, discrete cosine transform (DCT) is performed on the pixel blocks, and pixel-by-pixel subtraction is performed based on the pixel blocks after the discrete cosine transform to obtain a block DCT difference image corresponding to each pixel block.
[0097] Furthermore, each pixel block in the pixel block set is traversed, and the currently traversed pixel block pair is extracted as the target pixel block pair, wherein the target pixel block pair includes the image pixel block to be identified and the corresponding reference image pixel block; discrete cosine transform is performed on the image pixel block to be identified and the reference image pixel block respectively to obtain a discrete cosine transform image to be identified and a reference discrete cosine transform image; the discrete cosine transform image to be identified and the reference discrete cosine transform image are subtracted pixel by pixel to obtain a block DCT difference image.
[0098] Among them, the discrete cosine transform image to be identified is the DCT coefficient matrix of the image to be identified, and the reference discrete cosine transform image is the DCT coefficient matrix of the reference image. The DCT coefficient matrix of the image to be identified and the DCT coefficient matrix of the reference image are subtracted element by element to obtain a block DCT difference matrix, that is, a block DCT difference image of the current pixel block.
[0099] The block DCT difference image is obtained by differential discrete cosine transform calculation, which can concentrate the energy in the image signal on a few frequency components and improve recognition efficiency and accuracy; the coefficients after DCT transformation can well reflect the main content and structural information of the image, which helps to improve the accuracy and robustness of image recognition.
[0100] Step S204: high-pass filtering is performed based on the block DCT difference image to obtain a high-frequency block DCT difference image.
[0101] In this embodiment, it is determined whether there is an image modification region (such as a ps region) in the pixel block of the image to be identified according to the pixel values of the block DCT difference image.
[0102] Furthermore, the non-zero pixel ratio and the maximum absolute difference of the block DCT difference image are calculated; when the non-zero pixel ratio is less than a first preset threshold and the maximum absolute difference is greater than a second preset threshold, the high-pass filter radius is determined according to the non-zero pixel ratio and the maximum absolute difference; according to the high-pass filter radius, the low-frequency signal of the block DCT difference image is set to zero to obtain a high-frequency block DCT difference image, thereby realizing high-pass filtering and filtering out the low-frequency components in the image.
[0103] In this embodiment, when the non-zero pixel ratio is less than the first preset threshold δ R And the maximum absolute difference is greater than the second preset threshold δ MWhen , it indicates that there will be a concentrated area of modified high-frequency response in the block DCT difference map. This area needs to be further enlarged to eliminate the influence of low-frequency signals. Therefore, it is necessary to set a high-pass filter radius r, retain the high-frequency signal within the radius r, and set the low-frequency signal outside the radius r to 0. The radius should not be too small, otherwise the key response value may be filtered out, nor too large, otherwise additional low-frequency noise will be introduced to interfere with the judgment.
[0104] In this embodiment, the non-zero pixel ratio R is calculated d-i-partdct and the maximum absolute difference M d-i-partdct , according to the non-zero pixel ratio R d-i-partdct and the maximum absolute difference M d-i-partdct And the high-pass filter radius is determined empirically. The formula for determining the high-pass filter radius is as follows:
[0105]
[0106] Among them, r b and r m It is the default radius base value and radius additional value (fixed value during calculation).
[0107] When the proportion of non-zero values in the block DCT difference image is smaller, it indicates that the number of inconsistent pixels in the block DCT difference image is smaller. In this case, a larger high-pass filter radius r can better retain inconsistent information; when the maximum absolute difference in the block DCT difference image is smaller, it indicates that the pixel value difference is more likely to be introduced by image compression or noise (characteristic: the area involved is large but the pixel value does not change much), rather than PS modification. In this case, appropriately reducing the radius r is conducive to reducing false alarms.
[0108] The low-frequency signals outside the high-pass filter radius in the block DCT difference image are set to 0, and a high-frequency block DCT difference image after high-frequency filtering is obtained.
[0109] By calculating the non-zero pixel ratio and the maximum absolute difference of the block DCT difference image to determine whether there is a modified area, each area in the image can be judged more precisely, with good positioning effect and anti-noise interference effect, and the modified area can be better enlarged in the frequency domain to eliminate the interference of low-frequency information; by setting the first preset threshold and the second preset threshold, the interference of image pixel value changes caused by problems such as image storage compression and image noise introduction can be well eliminated, thereby improving the recognition accuracy; the determination of the adaptive high-pass filter radius can automatically coordinate the retention degree of the calculated high-frequency area and the discarding degree of the low-frequency area according to the state of each paired pixel block, while retaining valid information, it can more effectively control the false alarm of the result and improve the robustness of the recognition result.
[0110] Step S205: identifying the modification area of the image to be identified according to the high-frequency block DCT difference image.
[0111] In this embodiment, a discrete cosine inverse transform algorithm is used to convert the high-frequency block DCT difference image into a time domain difference image; the non-zero connected area in the time domain difference image is obtained, and the maximum connected area of the non-zero connected area is calculated; when the maximum connected area is greater than the preset connected area threshold, the image to be identified has a modified area in the current pixel block.
[0112] The inverse discrete cosine transform (IDCT) algorithm is used to convert the frequency domain image of the high-frequency block DCT difference image into a time domain image to obtain a time domain difference map. The non-zero connected area in the time domain difference map is queried, and the maximum connected area of the non-zero connected area is calculated. When the maximum connected area is greater than the preset connected area threshold, it means that there is a modified area in the pixel block currently calculated in the image to be identified. According to the row and column numbers of the pixel block in the image to be identified, the specific position of the modified area can be determined.
[0113] The maximum connected area of the non-zero connected area is calculated after conversion by the inverse discrete cosine transform algorithm, which improves the accuracy of identifying the modified area and can locate the image modification area.
[0114] The present application forms an image pair to be identified with each reference image in a set of similar images, and divides the image pair to be identified into pixel blocks to obtain pixel block pairs, thereby narrowing the image comparison range and improving the recognition efficiency; through differential discrete cosine transform and high-pass filtering, the features of the modified area can be highlighted, thereby improving the recognition accuracy.
[0115] In some optional implementations of this embodiment, the step of obtaining the non-zero connected regions in the time-domain difference map and calculating the maximum connected region area of the non-zero connected regions includes:
[0116] The time domain difference image is binarized by using the threshold segmentation method to obtain a binarized image, which includes a foreground area with a gray value greater than zero and a background area with a gray value equal to zero;
[0117] The eight-neighborhood connected region labeling algorithm is used to label the pixels in the foreground area as connected regions to obtain multiple connected regions.
[0118] Calculate the area of each connected region to obtain the connected area of all connected regions, and compare the areas to obtain the connected region with the largest connected area as the maximum connected region;
[0119] According to the position coordinates of the largest connected area, the corresponding largest connected area pixels are extracted in the time domain difference map;
[0120] The area of the extracted maximum connected region pixels is calculated to obtain the maximum connected region area.
[0121] In this embodiment, threshold segmentation is performed on the time domain difference image, pixels with gray values greater than 0 are marked as foreground areas, and pixels with gray values equal to 0 are marked as background areas, thereby obtaining a binary image.
[0122] The eight-neighborhood connected region labeling algorithm is a commonly used algorithm in digital image processing. It is used to distinguish the regions composed of pixels with the same pixel value and adjacent positions in the image (i.e., connected regions) with different symbols or labels. This algorithm is based on the eight-neighborhood relationship of pixels, that is, each pixel is adjacent to the eight pixels around it (upper, lower, left, right, upper left, upper right, lower left, and lower right). Through the eight-neighborhood connected region labeling algorithm, the pixels in the foreground area are labeled as connected regions to obtain multiple connected regions.
[0123] Calculate the area of each connected region to obtain the connected area of all connected regions, compare the connected areas of all connected regions, obtain the connected region with the largest area as the largest connected region, extract the maximum connected region pixels at the corresponding position of the time domain difference image according to the position coordinates of the largest connected region, calculate the number of pixels, and multiply the number of pixels by the physical area of a single pixel to obtain the area of the maximum connected region.
[0124] In some optional implementations, a region growing algorithm is used to obtain the connected regions of the high-frequency block DCT difference image. Specifically, a pixel point in the pixel block is randomly selected as a seed point, and the grayscale difference between the point and the adjacent pixel points is calculated. If the difference is less than a preset grayscale threshold, the adjacent pixel points are classified into the same connected region. The above process is repeated until all connected regions in the pixel block are found. Then, the area of each connected region is calculated to obtain the area of the largest connected region.
[0125] By calculating the maximum connected area of the non-zero connected area, the calculation efficiency can be improved, which greatly improves the image processing efficiency and recognition accuracy.
[0126] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0127] The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning. A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it may include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium may be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0128] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0129] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a device for identifying small-scale image modification. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0130] like Figure 3 As shown, the image small-range modification recognition device 300 described in this embodiment includes: an acquisition module 301, a pixel block module 302, a transformation module 303, a filtering module 304 and a recognition module 305. Among them:
[0131] The acquisition module 301 is used to acquire an image to be identified in a library of images to be identified, and to acquire a set of similar images having image contents similar to those of the image to be identified from a preset image base library;
[0132] The pixel block module 302 is used to form a pair of images to be identified by combining the image to be identified and each reference image in the similar image set, and to perform pixel block division on the pair of images to be identified to obtain a set of pixel block pairs;
[0133] The transformation module 303 is used to calculate the pixel difference of each pixel block pair in the pixel block pair set based on the difference discrete cosine transform to obtain a block DCT difference image;
[0134] The filtering module 304 is used to perform high-pass filtering based on the block DCT difference image to obtain a high-frequency block DCT difference image;
[0135] The identification module 305 is used to identify the modification area of the image to be identified according to the high-frequency block DCT difference image.
[0136] It should be emphasized that in order to further ensure the privacy and security of the image library to be identified, the above-mentioned image library to be identified can also be stored in a node of a blockchain.
[0137] Based on the above-mentioned image small-range modification identification device 300, by forming an image pair to be identified with each reference image in a set of similar images, and dividing the image pair to be identified into pixel blocks, pixel block pairs are obtained, thereby narrowing the image comparison range and improving the recognition efficiency; through difference discrete cosine transform and high-pass filtering, the characteristics of the modified area can be highlighted and the recognition accuracy is improved.
[0138] In some optional implementations of this embodiment, the acquisition module 301 includes:
[0139] A first feature extraction submodule is used to extract features from all reference images in the preset image base library based on an image feature extraction model to obtain a reference image feature set, and store the reference image feature set in a preset retrieval library;
[0140] A second feature extraction submodule is used to extract features of the image to be identified based on the image feature extraction model to obtain features of the image to be identified;
[0141] A similarity submodule, used to calculate the similarity between the image feature to be identified and the reference image feature set;
[0142] A sorting submodule, used to sort the reference images from high to low according to the similarity to obtain a sorting result;
[0143] The screening submodule is used to select a preset number of reference images ranked first from the sorting results to form a set of similar images to the image to be identified.
[0144] By obtaining a set of similar images to the image to be identified through image feature matching, it is possible to quickly find matching similar images in massive image data, improve the efficiency and accuracy of image recognition, narrow the comparison scope, and improve processing efficiency.
[0145] In some optional implementations, the pixel segmentation module 302 includes:
[0146] A normalization submodule, used for performing pixel normalization processing on the image to be identified and the reference image in the pair of images to be identified, so as to obtain a normalized image to be identified and a normalized reference image;
[0147] A division submodule, used for dividing the normalized image to be identified and the normalized reference image according to a preset size to obtain a plurality of image pixel blocks to be identified and a plurality of reference image pixel blocks;
[0148] An acquisition submodule, used for acquiring a reference image pixel block at a corresponding position according to the position of the image pixel block to be identified;
[0149] The composition submodule is used to form a pixel block pair set by combining the to-be-identified image pixel blocks and the reference image pixel blocks corresponding to all positions.
[0150] By dividing the image into pixel blocks, the computational complexity can be reduced and each pixel block can be processed in parallel, thereby reducing the overall processing time and improving image recognition efficiency; pixel block division helps to more accurately extract local features of the image, reduce noise interference, and improve recognition accuracy.
[0151] In some optional implementations, the transformation module 303 includes:
[0152] A traversal extraction submodule, used for traversing each pixel block in the pixel block set, and extracting the currently traversed pixel block pair as a target pixel block pair, wherein the target pixel block pair includes a pixel block of the image to be identified and a corresponding pixel block of the reference image;
[0153] A discrete cosine transform submodule, used to perform discrete cosine transform on the pixel block of the image to be identified and the pixel block of the reference image, respectively, to obtain a discrete cosine transform image to be identified and a reference discrete cosine transform image;
[0154] The subtraction submodule is used to perform pixel-by-pixel subtraction between the discrete cosine transform image to be identified and the reference discrete cosine transform image to obtain a block DCT difference image.
[0155] The block DCT difference image is obtained by differential discrete cosine transform calculation, which can concentrate the energy in the image signal on a few frequency components and improve recognition efficiency and accuracy; the coefficients after DCT transformation can well reflect the main content and structural information of the image, which helps to improve the accuracy and robustness of image recognition.
[0156] In some optional implementations, the filtering module 304 is further configured to:
[0157] Calculate the non-zero pixel ratio and the maximum absolute difference of the block DCT difference image;
[0158] When the non-zero pixel ratio is less than a first preset threshold and the maximum absolute difference is greater than a second preset threshold, determining a high-pass filter radius according to the non-zero pixel ratio and the maximum absolute difference;
[0159] The low-frequency signal of the block DCT difference image is set to zero according to the high-pass filter radius to obtain a high-frequency block DCT difference image.
[0160] By calculating the non-zero pixel ratio and the maximum absolute difference of the block DCT difference image to determine whether there is a modified area, each area in the image can be judged more precisely, with good positioning effect and anti-noise interference effect. In the frequency domain, the modified area can be better enlarged, the interference of low-frequency information can be eliminated, the recognition accuracy can be improved, and the robustness of the recognition results can be improved.
[0161] In some optional implementations, the identification module 305 includes:
[0162] A time domain conversion submodule, used for converting the high frequency block DCT difference image into a time domain difference image by using an inverse discrete cosine transform algorithm;
[0163] An area calculation submodule, used for obtaining the non-zero connected regions in the time domain difference map, and calculating the maximum connected region area of the non-zero connected regions;
[0164] The judgment submodule is used to determine that when the area of the maximum connected region is greater than a preset connected area threshold, there is a modification area in the current pixel block of the image to be identified.
[0165] The maximum connected area of the non-zero connected area is calculated after conversion by the inverse discrete cosine transform algorithm, which improves the accuracy of identifying the modified area and can locate the image modification area.
[0166] In some optional implementations of this embodiment, the area calculation submodule includes:
[0167] A binarization unit, used for binarizing the time domain difference image by using a threshold segmentation method to obtain a binarized image, wherein the binarized image includes a foreground area with a gray value greater than 0 and a background area with a gray value equal to 0;
[0168] A connected region marking unit, configured to mark the pixels in the foreground region as connected regions by using an eight-neighborhood connected region marking algorithm to obtain a plurality of connected regions;
[0169] A first calculation unit is used to calculate the area of each of the connected regions to obtain the connected areas of all the connected regions, and to obtain the connected region with the largest connected area as the maximum connected region by comparing the areas;
[0170] An extraction unit, configured to extract corresponding pixels of the largest connected region in the time domain difference map according to the position coordinates of the largest connected region;
[0171] The second calculation unit is used to calculate the area of the extracted pixels of the maximum connected region to obtain the area of the maximum connected region.
[0172] By calculating the maximum connected area of the non-zero connected area, the calculation efficiency can be improved, which greatly improves the image processing efficiency and recognition accuracy.
[0173] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0174] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 4 with a memory 41, a processor 42, and a network interface 43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0175] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0176] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, 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 (FlashCard), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the image small-range modification recognition method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0177] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as running the computer-readable instructions of the image small-range modification recognition method.
[0178] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0179] The image to be identified and each reference image in a set of similar images are combined into an image pair to be identified, and the image pair to be identified is divided into pixel blocks to obtain pixel block pairs, which reduces the image comparison range and improves the recognition efficiency; through difference discrete cosine transform and high-pass filtering, the characteristics of the modified area can be highlighted and the recognition accuracy can be improved.
[0180] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the image small-range modification recognition method as described above.
[0181] The image to be identified and each reference image in a set of similar images are combined into an image pair to be identified, and the image pair to be identified is divided into pixel blocks to obtain pixel block pairs, which reduces the image comparison range and improves the recognition efficiency; through difference discrete cosine transform and high-pass filtering, the characteristics of the modified area can be highlighted and the recognition accuracy can be improved.
[0182] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0183] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A method for identifying small-scale image modification, characterized in that: The steps include: Obtain an image to be identified in a library of images to be identified, and obtain a set of similar images with image contents similar to the image to be identified from a preset image base library; The image to be identified and each reference image in the similar image set form an image pair to be identified, and the image pair to be identified is divided into pixel blocks to obtain a pixel block pair set; Calculating the pixel difference of each pixel block pair in the pixel block pair set based on difference discrete cosine transform to obtain a block DCT difference image; Performing high-pass filtering based on the block DCT difference image to obtain a high-frequency block DCT difference image; The modification area of the image to be identified is identified according to the high-frequency block DCT difference image.
2. The method for identifying small-scale image modifications according to claim 1, characterized in that: The step of acquiring a set of similar images having image contents similar to the image to be identified from a preset image base includes: Based on the image feature extraction model, feature extraction is performed on all reference images in the preset image base library to obtain a reference image feature set, and the reference image feature set is stored in a preset retrieval library; Based on the image feature extraction model, feature extraction is performed on the image to be identified to obtain features of the image to be identified; Calculating the similarity between the image feature to be identified and the reference image feature set; Sorting the reference images according to the similarity from high to low to obtain a sorting result; A preset number of reference images ranked first are selected from the ranking results to form a set of images similar to the image to be identified.
3. The method for identifying small-scale image modifications according to claim 1, characterized in that: The step of dividing the to-be-recognized image pair into pixel blocks to obtain a set of pixel block pairs comprises: Performing pixel normalization processing on the image to be identified and the reference image in the pair of images to be identified to obtain a normalized image to be identified and a normalized reference image; Dividing the normalized image to be identified and the normalized reference image according to a preset size to obtain a plurality of image pixel blocks to be identified and a plurality of reference image pixel blocks; According to the position of the image pixel block to be identified, obtaining a reference image pixel block at a corresponding position; The to-be-identified image pixel blocks and the reference image pixel blocks corresponding to all positions are combined into a pixel block pair set.
4. The method for identifying small-scale image modifications according to claim 1, characterized in that: The step of calculating the pixel difference of each pixel block pair in the pixel block pair set based on the difference discrete cosine transform to obtain a block DCT difference image comprises: Traversing each pixel block in the pixel block set, extracting the currently traversed pixel block pair as a target pixel block pair, wherein the target pixel block pair includes a pixel block of the image to be identified and a corresponding pixel block of the reference image; Performing discrete cosine transform on the pixel block of the image to be identified and the pixel block of the reference image respectively to obtain a discrete cosine transform image to be identified and a reference discrete cosine transform image; The discrete cosine transform image to be identified and the reference discrete cosine transform image are subtracted pixel by pixel to obtain a block DCT difference image.
5. The method for identifying small-scale image modifications according to claim 1, characterized in that: The step of performing high-pass filtering based on the block DCT difference image to obtain a high-frequency block DCT difference image comprises: Calculate the non-zero pixel ratio and the maximum absolute difference of the block DCT difference image; When the non-zero pixel ratio is less than a first preset threshold and the maximum absolute difference is greater than a second preset threshold, determining a high-pass filter radius according to the non-zero pixel ratio and the maximum absolute difference; The low-frequency signal of the block DCT difference image is set to zero according to the high-pass filter radius to obtain a high-frequency block DCT difference image.
6. The method for identifying small-scale image modification according to claim 5, characterized in that: The step of identifying the modification area of the image to be identified according to the high-frequency block DCT difference image comprises: The high frequency block DCT difference image is converted into a time domain difference image by using an inverse discrete cosine transform algorithm; Obtain a non-zero connected region in the time domain difference map, and calculate a maximum connected region area of the non-zero connected region; When the area of the maximum connected region is greater than a preset connected area threshold, the image to be identified has a modified region in the current pixel block.
7. The method for identifying small-scale image modifications according to claim 6, characterized in that: The step of obtaining the non-zero connected region in the time domain difference map and calculating the maximum connected region area of the non-zero connected region comprises: The time domain difference image is binarized by using a threshold segmentation method to obtain a binarized image, wherein the binarized image includes a foreground area with a gray value greater than zero and a background area with a gray value equal to zero; Using an eight-neighborhood connected region labeling algorithm, the pixels in the foreground area are labeled as connected regions to obtain a plurality of connected regions; Calculating the area of each connected region to obtain the connected area of all the connected regions, and obtaining the connected region with the largest connected area as the maximum connected region by comparing the areas; According to the position coordinates of the maximum connected area, extracting the corresponding maximum connected area pixel in the time domain difference map; The area of the extracted maximum connected region pixels is calculated to obtain the maximum connected region area.
8. A device for identifying small-scale image modification, characterized in that: include: An acquisition module is used to acquire an image to be identified in a library of images to be identified, and to acquire a set of similar images having image contents similar to those of the image to be identified from a preset image base library; A pixel block module, used to form a pair of images to be identified by combining the image to be identified and each reference image in the similar image set, and to perform pixel block division on the pair of images to be identified to obtain a set of pixel block pairs; A transform module, configured to calculate the pixel difference of each pixel block pair in the pixel block pair set based on a difference discrete cosine transform, to obtain a block DCT difference image; A filtering module, used for performing high-pass filtering based on the block DCT difference image to obtain a high-frequency block DCT difference image; The identification module is used to identify the modification area of the image to be identified according to the high-frequency block DCT difference image.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the image small-range modification recognition method as claimed in any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the method for identifying small-scale image modifications according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Image coding method and device, equipment and medium
CN122340271A