Image detection method and device, equipment and storage medium
By constructing the distance matrix between images and determining the optimal path, the problems of low efficiency and insufficient accuracy of image copyright detection in the prior art are solved, and efficient and accurate detection of infringing images are achieved.
Patent Information
- Application Number
- CN202411388273.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-02-28
AI Technical Summary
In the image copyright protection of the prior art, manual detection efficiency is low and professional requirements are high, while automatic detection efficiency of the equipment is not high and accuracy is also low.
By determining the pixel distance between the image to be detected and the target copyright image, a distance matrix is constructed, and the optimal path is determined in the matrix, and whether the image is an infringing image is determined based on the comparison result of the preset threshold value and the path length is determined.
The detection efficiency and accuracy of whether the image to be detected is an infringing image is improved, and the degree of similarity between the image to be detected and the target copyright image can be accurately judged.
Smart Images

Figure CN119540136A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer image detection technology, and in particular to an image detection method, apparatus, device and storage medium. Background Art
[0002] With the rapid development of the Internet, social media, e-commerce and other fields, massive image data has been widely used in various fields of society, and the issue of image copyright protection has become increasingly severe.
[0003] At present, the traditional methods for judging infringement of images are mainly: manual detection method and automatic detection method; however, the manual detection method is inefficient and has high professional requirements for detection personnel; and the method of automatic image detection by equipment, although it can reduce labor costs, the efficiency of automatic detection of images by equipment is not high and the accuracy is also low. Summary of the invention
[0004] The present application provides an image detection method, apparatus, device and storage medium, which can accurately determine the degree of similarity between an image to be detected and a target copyright image, so as to improve the efficiency and accuracy of detecting whether the image to be detected is an infringing image.
[0005] In a first aspect, an image detection method is provided, comprising: Determine a target copyright image corresponding to the image to be detected; Constructing a distance matrix according to the pixel distances between the image to be detected and the target copyright image at each corresponding position; In the distance matrix, determine the optimal path between the target start element and the target end element; Based on the comparison result between the preset threshold and the path length corresponding to the optimal path, it is determined whether the image to be detected is an infringing image; the path length is calculated by summing up the distances between all adjacent elements on the optimal path.
[0006] In a second aspect, an image detection device is provided, comprising: A target copyright image determination module, used to determine a target copyright image corresponding to the image to be detected; A distance matrix construction module is used to construct a distance matrix according to the pixel distances between the image to be detected and the target copyright image at each corresponding position; An optimal path determination module is used to determine the optimal path between the target starting point element and the target end point element in the distance matrix; The infringement judgment module is used to judge whether the image to be detected is an infringing image based on the comparison result between the preset threshold and the path length corresponding to the optimal path; the path length is calculated by summing the distances between all adjacent elements on the optimal path.
[0007] According to a third aspect, an electronic device is provided, comprising: a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the first aspect or its various implementations.
[0008] According to a fourth aspect, a computer-readable storage medium is provided for storing a computer program, wherein the computer program enables a computer to execute the method according to the first aspect or its various implementations.
[0009] Through the technical solution provided by the present application, the target copyright image corresponding to the image to be detected is first determined; then a distance matrix is constructed based on the pixel distance between the image to be detected and the target copyright image at each corresponding position; and in the distance matrix, the optimal path between the target starting element and the target end element is determined; finally, based on the comparison result between the preset threshold and the path length corresponding to the optimal path, it is determined whether the image to be detected is an infringing image. The present invention can accurately determine the degree of similarity between the image to be detected and the target copyright image, so as to improve the efficiency and accuracy of detecting whether the image to be detected is an infringing image.
[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0012] Figure 1 An application scenario diagram provided for an embodiment of the present application; Figure 2 A flowchart of an image detection method provided in an embodiment of the present application; Figure 3 A schematic diagram of determining the optimal path on a distance matrix provided in an embodiment of the present application; Figure 4 A schematic diagram of an image detection device provided in an embodiment of the present application; Figure 5 It is a schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0013] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0014] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0015] In the era of self-media represented by Weibo, WeChat (friend circle, public account), etc., the use of images is indispensable in order to adapt to the mobile communication mode. However, with the popularization of smart phones, everyone has become a "photographer", the value of images has become increasingly significant, and the copyright issues that follow have become more and more prominent.
[0016] In the protection of image copyright issues, when the image copyright owner sues others for infringing on their copyrighted images, it is necessary to detect infringement of the images used by the suing party. The current image detection method is usually manual detection, which is inefficient and requires high professional skills of the detection personnel. At present, although images can be automatically detected by equipment, the efficiency of automatic detection of images by equipment is not high and the accuracy is also low.
[0017] In order to solve the above technical problems, the invention concept of this application is: determine the target copyright image corresponding to the image to be detected; construct a distance matrix according to the pixel distance between the image to be detected and the target copyright image at each corresponding position; determine the optimal path between the target starting element and the target end element in the distance matrix; determine whether the image to be detected is an infringing image according to the comparison result between the preset threshold and the path length corresponding to the optimal path; the path length is calculated by summing the distances between all adjacent elements on the optimal path. The present invention can accurately determine the similarity between the image to be detected and the target copyright image, so as to improve the efficiency and accuracy of detecting whether the image to be detected is an infringing image.
[0018] It should be understood that the technical solution of the present application can be applied to the following scenarios, but is not limited to: In some possible implementations, Figure 1 An application scenario diagram provided for an embodiment of the present application, such as Figure 1 As shown, the application scenario may include an electronic device 110 and a network device 120. The electronic device 110 may establish a connection with the network device 120 via a wired network or a wireless network.
[0019] Exemplarily, the electronic device 110 may be a desktop computer, a laptop computer, a tablet computer, etc., but is not limited thereto. The network device 120 may be a terminal device or a server, but is not limited thereto. In one embodiment of the present application, the electronic device 110 may send a request message to the network device 120, and the request message may be used to request to determine the target copyright image corresponding to the image to be detected. Further, the electronic device 110 may receive a response message sent by the network device 120, and the response message includes the target copyright image.
[0020] also, Figure 1 An electronic device 110 and a network device 120 are provided as an example, but other numbers of electronic devices and network devices may actually be included, and the present application does not impose any limitation on this.
[0021] In other possible implementations, the technical solution of the present application may also be executed by the above-mentioned electronic device 110, or the technical solution of the present application may also be executed by the above-mentioned network device 120, and the present application does not impose any limitation on this.
[0022] After introducing the application scenarios of the embodiments of the present application, the technical solution of the present application will be described in detail below: Figure 2 A flowchart of an image detection method provided in an embodiment of the present application, the method can be performed as follows Figure 1 The electronic device 110 shown in the figure performs, but is not limited to this. Figure 2 As shown, the method may include the following steps: S210: Determine a target copyright image corresponding to the image to be detected.
[0023] Here, the target copyright image may be a copyright image with highly similar image content to the image to be detected; the target copyright image may be an image determined manually, or may be an image determined by searching the image to be detected.
[0024] In this step, the pixel value of the image to be detected may be the same as the pixel value of the target copyright image, and the image size of the image to be detected may be the same as the image size of the target copyright image, wherein the position of each pixel point in the image to be detected may be in a one-to-one correspondence with the position of each pixel point in the target copyright image.
[0025] S220 , constructing a distance matrix according to the pixel distances between the image to be detected and the target copyright image at each corresponding position.
[0026] It should be noted that the pixel distance may be the distance between the pixel points of the image to be detected and the target copyright image at each corresponding position, and the distance may be one of the Euclidean distance, the Mahalanobis distance, the chessboard distance and the street distance.
[0027] The positions of the elements in the distance matrix may be determined by arranging the positions of the pixels in the image to be detected in the image to be detected and the pixels in the target copyright image in the target copyright image.
[0028] Here, according to the pixel distance between the image to be detected and the target copyright image at each corresponding position, the following formula is used to construct the distance matrix: ; in, The number of rows is , the number of columns is The distance matrix of The coordinates of the image to be detected and the target copyright image are The pixel distance at The number of rows is , the number of columns is The distance matrix of The number of rows is , the number of columns is The distance matrix of The number of rows is , the number of columns is The distance matrix of .
[0029] In this step, since the distance characteristics between the pixel points at each corresponding position of the image to be detected and the target copyright image do not change when the image to be detected and the target copyright image are rotated, translated or scaled, the distance matrix constructed based on the pixel distances between the image to be detected and the target copyright image at each corresponding position can accurately determine the similarity between the image to be detected and the target copyright image, so as to improve the accuracy of determining whether the image to be detected is an infringing image.
[0030] S230: Determine the optimal path between the target starting point element and the target ending point element in the distance matrix.
[0031] Here, the optimal path may be a path with continuity, and the path length of the optimal path is the shortest path length among all paths passing through the target starting element and the target ending element. Continuity can be understood as all elements passed by the optimal path on the distance matrix are sequentially adjacent.
[0032] For example, Figure 3 As shown, the (1, 1)th element in the distance matrix is determined as the target starting element, and the (m, n)th element in the distance matrix is determined as the target end element. In the distance matrix, an optimal path A passing through the (1, 1)th element and the (m, n)th element is found, and the length of the determined optimal path A is the shortest path length among all paths passing through the (1, 1)th element and the (m, n)th element. At the same time, all elements passed by the optimal path A are adjacent in sequence.
[0033] In this step, by determining the optimal path between the target starting point element and the target ending point element in the distance matrix, a quick judgment can be made on the similarity between the image to be detected and the target copyright image based on the optimal path, thereby improving the efficiency of judging whether the image to be detected is an infringing image in step S240.
[0034] S240: Determine whether the image to be detected is an infringing image based on a comparison result between a preset threshold and a path length corresponding to the optimal path.
[0035] Here, the path length is calculated by summing the distances between all adjacent elements on the optimal path.
[0036] Since the larger the distance between two adjacent elements on the optimal path, the more similar the pixels corresponding to the two adjacent elements of the image to be detected and the target copyright image are, that is, the smaller the difference between the pixels corresponding to the two adjacent elements of the image to be detected and the target copyright image is, in other words, the degree of difference between the image to be detected and the target copyright image is negatively correlated with the distance between the adjacent elements on the distance matrix. Therefore, here, by taking the length obtained by summing up the distances between all adjacent elements on the optimal path as the path length corresponding to the optimal path, the accuracy of determining the similarity between the image to be detected and the target copyright image based on the optimal path can be further improved, so as to further improve the accuracy of judging the similarity between the image to be detected and the target copyright image, and further improve the accuracy of judging whether the image to be detected is an infringing image.
[0037] In addition, by determining the path length corresponding to the optimal path as the sum of the distances between all adjacent elements on the optimal path, it is possible to accurately determine the similarity between the image to be detected and the target copyright image when the image to be detected is a mask image, a redrawn image or an AI transformed image.
[0038] In this step, since the degree of difference between the image to be detected and the target copyright image is related to the path length corresponding to the optimal path, that is, when the path length corresponding to the optimal path is less than the preset threshold, it can be determined that the image to be detected and the target copyright image have a sufficient degree of similarity. Therefore, based on the comparison result between the preset threshold and the path length corresponding to the optimal path, and when the path length corresponding to the optimal path is less than the preset threshold, it is determined that the image to be detected is an infringing image of the target copyright image.
[0039] In some scenarios, the electronic device executing steps S210 to S240 may be located on a node in the blockchain network, and different images to be detected may be respectively input into the electronic devices corresponding to different nodes, so that each node in the blockchain network can respectively detect the image to be detected located on each node, thereby achieving simultaneous detection of multiple different images to be detected, thereby speeding up the detection efficiency of multiple images to be detected.
[0040] By adopting the above method, a distance matrix is constructed according to the pixel distance between the image to be detected and the target copyright image at each corresponding position, and then the optimal path between the target starting point element and the target end point element is determined in the distance matrix. Finally, the path length of the optimal path can quickly and accurately determine the similarity between the image to be detected and the target copyright image, thereby improving the detection efficiency and accuracy of whether the image to be detected is an infringing image.
[0041] In some possible implementations, determining the optimal path between the target start point element and the target end point element may include the following steps: S310: Determine a target starting point element and a target end point element according to the elements in the distance matrix.
[0042] Here, the target start point element and the target end point element may both be specified in the distance matrix, and the target start point element and the target end point element are elements at two different positions in the distance matrix.
[0043] Since the pixel distance between each corresponding position of the image to be detected and the target copyright image will not change due to the rotation, translation and scaling of the image, the elements on the distance matrix constructed based on the pixel distance between each corresponding position of the image to be detected and the target copyright image will not change with the rotation, translation and scaling of the image. Therefore, when determining the target starting point element and the target end point element, they can be specified by any element in the distance matrix.
[0044] S320: Determine the target path direction based on the positions of the target start point element and the target end point element on the distance matrix.
[0045] Since the target starting point element has at least three adjacent elements in the distance matrix, for example, when the target starting point element is located in the upper left corner of the distance matrix, the target starting point element has three adjacent elements; when the target starting point element is located at the edge of the distance matrix, the target starting point element has five adjacent elements; when the target starting point element is located at a non-edge position of the distance matrix, the target starting point element has 8 adjacent elements; therefore, in order to quickly obtain the optimal path between the target starting point element and the target end point element, here, the positions of the target starting point element and the target end point element on the distance matrix determine the target path direction, and limit the selection range of each element on the optimal path, so that the optimal path between the target starting point element and the target end point element can be quickly determined in step S330.
[0046] S330: Determine the optimal path between the target starting point element and the target end point element according to the distance between each adjacent element in the target path direction of the distance matrix.
[0047] Here, the optimal path is the shortest path between the target start point element and the target end point in the distance matrix.
[0048] Since, in the target path direction of the distance matrix, there are multiple paths passing through the target starting element and the target end point element, and the difference between the image to be detected and the target copyright image is negatively correlated with the path length corresponding to the optimal path, therefore, in order to improve the accuracy of the similarity judgment between the image to be detected and the target copyright image, here, according to the distance between each adjacent element of the distance matrix in the target path direction, the path with the shortest path length between the target starting element and the target end point element is determined, and the path is used as the optimal path, so that the optimal path that can quickly and accurately judge the similarity between the image to be detected and the target copyright image can be obtained.
[0049] By adopting the above method, the optimal path passing through the target starting element and the target ending element can be quickly determined in the distance matrix, and the similarity between the image to be detected and the target copyright image can be quickly and accurately determined based on the determined optimal path, thereby improving the detection efficiency and accuracy of whether the image to be detected is an infringing image.
[0050] Accordingly, determining the target starting point element and the target end point element according to the elements in the distance matrix may include the following steps: S410 , determining the target number of rows and columns of the target submatrix to be intercepted on the distance matrix according to the image category of the target copyrighted image.
[0051] Since the similarity between the image to be detected and the target copyright image is determined based on the similarity between the key content areas corresponding to the image to be detected and the target copyright image, and the sizes of the key content areas in images of different image categories are different, for example, the key content area in a landscape image (the key content area is the landscape) generally occupies more than half of the image, and the key content area in a person image (the key content area is the person) generally occupies about one quarter of the image, therefore, in order to be able to judge the similarity between the key content areas on the image to be detected and the target copyright image, here, according to the image category of the target copyright image, the target ratio between the number of rows and columns of the target submatrix corresponding to the key content area in the target copyright image and the number of rows and columns of the distance matrix can be determined, and then based on the target ratio and the number of rows and columns of the distance matrix, the target number of rows and columns of the target submatrix can be determined.
[0052] S420, extracting a target sub-matrix from the distance matrix based on the target number of rows and columns.
[0053] Here, when intercepting a target submatrix in the distance matrix based on the target number of rows and columns, the key content area in the target copyright image can be first identified to determine the target position information of the key content area in the target copyright image; then, based on the target position information, the position to be intercepted of the target submatrix on the distance matrix is determined, so as to implement interception in the distance matrix based on the target number of rows and columns and the position to be intercepted, and obtain a target submatrix corresponding to the key content area in the target copyright image; wherein the target position information may include position information of each pixel point on the key content area on the target copyright image; and the position to be intercepted may include element position information corresponding to the position information of each pixel point on the key content area on the target copyright image.
[0054] S430: Determine a target starting point element and a target ending point element on the target sub-matrix.
[0055] The target end point element is any edge element located in the target sub-matrix.
[0056] Here, the target starting point element may be any element on the target sub-matrix except the target ending point element.
[0057] Preferably, the target starting point element can be the element at the upper left corner of the target submatrix, that is, the (1, 1)th element, and the target ending point element can be the element at the lower right corner of the target submatrix, that is, the (m, n)th element. In this way, the optimal path between the determined target starting point element and the target ending point element passes through relatively more elements, so that the obtained optimal path can more accurately judge the similarity between the image to be detected and the target copyright image.
[0058] By adopting the above method, a target submatrix corresponding to the key content area of the image to be detected and the target copyright image can be obtained, so that the optimal path between the target starting point element and the target end point element determined based on the target submatrix can be used to judge the similarity between the key content area on the image to be detected and the target copyright image, thereby quickly and accurately judging the similarity between the image to be detected and the target copyright image, thereby improving the detection efficiency and accuracy of whether the image to be detected is an infringing image.
[0059] Further, determining the optimal path between the target starting point element and the target end point element according to the distance between each adjacent element in the distance matrix may include the following steps: S510: Determine three elements on the distance matrix that are adjacent to the target starting point element along the target path direction as elements to be matched.
[0060] Taking the target starting point element as the (1,2)th element in the distance matrix and the target end point element as the (m,n)th element in the distance matrix as an example, in the distance matrix, the (1,2)th element has five adjacent elements, namely the (1,1)th element, the (1,2)th element, the (2,2)th element, the (1,3)th element and the (2,3)th element, and the (1,2)th element along the target path has three adjacent elements, namely the (2,2)th element, the (1,3)th element and the (2,3)th element; among them, the target path direction is the direction from the (1,2)th element to the (m,n)th element.
[0061] It can be seen that determining the three elements adjacent to the target starting point element along the target path direction as the elements to be matched can quickly determine the adjacent elements corresponding to the target starting point element through which the optimal path passes, thereby facilitating the rapid determination of the optimal path.
[0062] S520: Determine, among the elements to be matched, the element with the smallest distance from the target starting point element as the matching element.
[0063] The path length of the optimal path is calculated by summing up the distances between all adjacent elements on the optimal path. Therefore, by determining the element to be matched with the smallest distance from the target starting point element as the matching element, the path length corresponding to the optimal path determined in the subsequent steps can be made the shortest, thereby improving the accuracy of judging whether the image to be detected is an infringing image based on the optimal path.
[0064] For example, the target starting point element is the (1, 1)th element in the distance matrix, and the target end point element is the (m, n)th element in the distance matrix. Figure 3 , the elements to be matched corresponding to the (1,1)th element are the (1,2)th element, the (2,2)th element, and the (2,1)th element. After respectively calculating the distance between the (1,1)th element and the (1,2)th element, the distance between the (1,1)th element and the (2,2)th element, and the distance between the (1,1)th element and the (2,1)th element, it can be determined that the distance between the (1,1)th element and the (1,2)th element is the smallest, and the (1,2)th element is determined as the matching element.
[0065] S530: Use the matching element as a new target starting point element, and repeat the above matching element determination step until the determined matching element is adjacent to the target ending point element.
[0066] Following the example in step S520, after determining that the (1,2)th element is a matching element, the (1,2)th element is used as a new target starting point element, and the direction from the (1,2)th element to the (m,n)th element is pointed to determine that the elements to be matched corresponding to the (1,2)th element are the (2,2)th element, the (1,3)th element, and the (2,3)th element; then, the distance between the (1,2)th element and the (2,2)th element, the distance between the (1,2)th element and the (1,3)th element, and the distance between the (1,2)th element and the (2,2)th element, and the distance between the (1,2)th element and the (1,3)th element The distance between the (2,3)th element and the distance between the (2,1)th element are calculated respectively. The distance between the (1,2)th element and the (2,3)th element is the smallest, and the (2,3)th element is determined as the matching element. Then the (2,3)th element is used as the new target starting point element, and steps S510 and S520 are repeated until the new matching element determined is the (m,n-1)th element, that is, the (m,n-1)th element is the adjacent element of the target end point element.
[0067] S540: Determine the path generated by all matching elements between the target starting point element and the target end point element as the optimal path.
[0068] By taking the matching element as the new target starting point element and repeating steps S510 and S520 until the determined matching element is adjacent to the target end point element, making the path length corresponding to the path passing through all the determined matching elements the shortest, and then determining the path generated by all the matching elements as the optimal path, the accuracy of judging whether the image to be detected is an infringing image based on the optimal path can be guaranteed.
[0069] By adopting the above method, it can be ensured that the path length corresponding to the optimal path finally determined is the shortest, and a rapid judgment can be made on the similarity between the image to be detected and the target copyright image based on the optimal path, thereby improving the efficiency of judging whether the image to be detected is an infringing image.
[0070] In some possible embodiments, determining the target copyright image corresponding to the image to be detected may include the following steps: S610: Using smart contracts to search the image to be detected in the candidate website list to determine the target website.
[0071] The target website is a website that has at least one candidate copyright image that is suspected of being infringed by the image to be detected.
[0072] Infringements on images of the same author are usually concentrated, that is, a batch of infringing images will be concentrated on one or several websites where copyrighted images of the same author exist. Therefore, here, by inputting the image to be detected into the smart contract, the smart contract responds to the retrieval request for the image to be detected. The image to be detected can be retrieved from the list of candidate websites stored in the smart contract to determine the target website where at least one candidate copyrighted image suspected of being infringed by the image to be detected exists.
[0073] It should be noted that the smart contract is deployed in each node in the blockchain network. After the smart contract on a node in the blockchain network responds to the retrieval request of the image to be detected, each node in the blockchain network simultaneously searches the image to be detected in the candidate website list, and each node determines the target website where the candidate copyright image suspected of being infringed by the image to be detected exists.
[0074] S620: Determine a target copyright image corresponding to the image to be detected from the at least one candidate copyright image according to a consensus result of nodes on the blockchain network on at least one candidate copyright image on the target website.
[0075] Since each node on the blockchain website determines a target website according to the image to be detected, each node can determine at least one candidate copyright image suspected of being infringed by the image to be detected through the target website it determines. Therefore, all candidate copyright images are reached through the nodes on the blockchain network to reach a consensus to determine the target copyright image corresponding to the image to be detected.
[0076] By adopting the above method, the smart contract deployed on each node on the blockchain network is used to search the image to be detected in the candidate website list, so that each node determines the website where at least one candidate copyright image suspected of being infringed by the image to be detected exists, and then according to the consensus result of the nodes on the blockchain network on each candidate copyright image, the target copyright image corresponding to the image to be detected is determined, so as to realize the rapid retrieval of the image to be detected by multiple nodes on the blockchain network in an efficient and collaborative manner.
[0077] Furthermore, using the smart contract to retrieve the image to be detected from the candidate website list to determine the target website may include the following steps: S710. For each candidate website in the candidate website list, based on the path coefficient of the image to be detected being transferred to the candidate website and the infringement history information of the candidate website, the image to be detected is searched in the candidate website to obtain the search probability corresponding to the candidate website.
[0078] Here, the path coefficient is determined based on the number of suspected infringing images on the candidate website.
[0079] Since infringement of images of the same author is likely to occur on one website, when searching for the image to be detected in the candidate website list, the more websites with suspected infringing images there are, the higher the probability of being retrieved. Therefore, after determining the corresponding retrieval probability of each candidate website, it is convenient to determine the target website from the candidate websites in the subsequent steps.
[0080] Among them, the search probability corresponding to the candidate website is calculated by the following formula: ; here, is the retrieval probability corresponding to the candidate website; is the path coefficient for transferring the image to be detected to the candidate website; The infringement history information of the candidate website; and are all hyperparameters.
[0081] S720: Determine the target website according to the search probabilities corresponding to all candidate websites in the candidate website list.
[0082] Here, the candidate website with the highest corresponding search probability in the candidate website list is determined as the target website.
[0083] By adopting the above method, through the logic that the more websites with suspected infringing images have a higher probability of being retrieved, after calculating the retrieval probability of each candidate website for the detection image, based on the retrieval probability corresponding to the candidate website, the target website with at least one candidate copyright image suspected of being infringed by the image to be detected can be quickly determined, so as to speed up the retrieval efficiency of the image to be detected.
[0084] Furthermore, after judging whether the image to be detected is an infringing image based on the comparison result between the preset threshold and the path length corresponding to the optimal path, the following steps may be further included: S810: If the image to be detected is an infringing image, update the number of suspected infringing images on the target website.
[0085] S820. Based on the number of suspected infringing images, calculate the path coefficient for transferring the image to be detected to the target website, and use the calculated result as a new path coefficient for transferring the image to be detected to the target website.
[0086] Here, the formula for calculating the path coefficient of transferring the image to be detected to the target website is as follows: ; in, The path coefficient for transferring the image to be detected to the target website; To update the number of suspected infringing images on the target website; is a hyperparameter.
[0087] Since the path coefficient for transferring the image to be detected to the target website is calculated based on the number of suspected infringing images on the target website, after the image to be detected is determined to be an infringing image, that is, after the number of suspected infringing images on the target website changes, the number of suspected infringing images on the target website is updated, and then based on the number of suspected infringing images, the path coefficient for transferring the image to be detected to the target website is calculated to obtain a new path coefficient corresponding to the target website, and in the candidate website list in the smart contract, the path coefficient for transferring the image to be detected to the candidate website corresponding to the target website is updated.
[0088] By adopting the above method, after determining that the image to be detected is an infringing image, the number of suspected infringing images on the target website is updated, and based on the updated number of suspected infringing images, a new path coefficient for transferring the image to be detected to the target website is obtained. This enables the blockchain node to more easily find the target website corresponding to the new image to be detected in the next round of image retrieval for the new image to be detected.
[0089] In some possible embodiments, judging whether the image to be detected is an infringing image based on the comparison result between the preset threshold and the path length corresponding to the optimal path may include the following steps: S910: If the path length corresponding to the optimal path is less than a preset threshold, it is determined that the image to be detected infringes the copyright of the target copyright image.
[0090] S920: If the path length corresponding to the optimal path is greater than a preset threshold, it is determined that the image to be detected does not infringe the copyright of the target copyright image.
[0091] Specifically, if the path length corresponding to the optimal path is less than the preset threshold, it indicates that the similarity between the image to be detected and the target copyright image is very large, so at this time it is determined that the image to be detected infringes the copyright of the target copyright image; if the path length corresponding to the optimal path is greater than the preset threshold, it indicates that the similarity between the image to be detected and the target copyright image is not large, so at this time it is determined that the image to be detected does not infringe the copyright of the target copyright image.
[0092] By adopting the above method, by comparing the path length corresponding to the optimal path with the preset threshold, it is possible to quickly determine whether the image to be detected infringes the copyright of the target copyright image, so as to improve the detection efficiency of whether the image to be detected is an infringing image.
[0093] Figure 4 FIG. 1 is a schematic diagram of an image detection device 1000 according to an embodiment of the present invention. Figure 4 As shown, the device 1000 includes: A target copyright image determining module 1010 is used to determine a target copyright image corresponding to the image to be detected; A distance matrix construction module 1020 is used to construct a distance matrix according to the pixel distances between the image to be detected and the target copyright image at each corresponding position; The optimal path determination module 1030 is used to determine the optimal path between the target starting point element and the target end point element in the distance matrix; The infringement judgment module 1040 is used to judge whether the image to be detected is an infringing image based on the comparison result between the preset threshold and the path length corresponding to the optimal path; the path length is calculated by summing the distances between all adjacent elements on the optimal path.
[0094] In some implementations, the optimal path determination module 1030 includes: A starting and ending point element determination unit, used for determining a target starting point element and a target ending point element according to elements in a distance matrix; A target path direction determination unit, used for determining the target path direction based on the positions of the target start point element and the target end point element on the distance matrix; The optimal path determination unit is used to determine the optimal path between the target starting point element and the target end point element according to the distance between each adjacent element in the distance matrix in the target path direction; the optimal path is the shortest path between the target starting point element and the target end point in the distance matrix; Wherein, the start and end point element determination unit includes: A target row and column number determination subunit is used to determine the target row and column number of the target submatrix to be intercepted on the distance matrix according to the image category of the target copyright image; A matrix interception subunit, used for intercepting a target submatrix in the distance matrix based on the number of target rows and columns; The start and end point element determination subunit is used to determine the target start point element and the target end point element on the target submatrix.
[0095] In some possible implementations, the optimal path determination unit includes: The to-be-matched element determination subunit is used to determine three elements adjacent to the target starting point element along the target path direction on the distance matrix as to-be-matched elements; A first matching element determination subunit is used to determine, among the elements to be matched, the element to be matched that has the smallest distance from the target starting point element as the matching element; A second matching element determination subunit is used to use the matching element as a new target starting element and repeatedly perform the above matching element determination steps until the determined matching element is adjacent to the target ending element; The optimal path determination subunit is used to determine the path generated by all matching elements between the target starting point element and the target end point element as the optimal path.
[0096] In some possible implementations, the target copyright image determination module 1010 includes: A target website determination unit is used to use a smart contract to retrieve the image to be detected from the candidate website list to determine the target website; the target website is a website that has at least one candidate copyright image that is suspected of being infringed by the image to be detected; The target copyright image determination unit is used to determine a target copyright image corresponding to the image to be detected from at least one candidate copyright image according to a consensus result of nodes on the blockchain network on at least one candidate copyright image on the target website.
[0097] In some possible implementations, the target website determination unit includes: A retrieval probability calculation subunit is used to retrieve the image to be detected in the candidate website for each candidate website in the candidate website list according to the path coefficient of the image to be detected being transferred to the candidate website and the infringement history information of the candidate website, and obtain the retrieval probability corresponding to the candidate website; the path coefficient is determined according to the number of suspected infringing images on the candidate website; The target website determination subunit is used to determine the target website according to the retrieval probabilities corresponding to all the candidate websites in the candidate website list.
[0098] In some possible implementations, the apparatus 1000 further includes: A first updating module, configured to update the number of suspected infringing images on the target website if the image to be detected is an infringing image; The second updating module is used to calculate the path coefficient for transferring the image to be detected to the target website based on the number of suspected infringing images, so as to use the calculated result as the new path coefficient for transferring the image to be detected to the target website.
[0099] In some implementations, the infringement determination module 1040 includes: A first judgment unit, configured to determine that the image to be detected infringes the copyright of the target copyright image if the path length corresponding to the optimal path is less than a preset threshold; The second judgment unit is used to determine that the image to be detected does not infringe the copyright of the target copyright image if the path length corresponding to the optimal path is greater than a preset threshold.
[0100] It should be understood that the image detection device embodiment and the image detection method embodiment may correspond to each other, and similar descriptions may refer to the image detection method embodiment. To avoid repetition, they will not be described here. Specifically, Figure 4 The device 1000 shown can execute the above-mentioned image detection method embodiment, and the aforementioned and other operations and / or functions of each module in the device 1000 are respectively for realizing the corresponding processes in the above-mentioned image detection method, which will not be repeated here for the sake of brevity.
[0101] The above describes the device 1000 of the embodiment of the present invention from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the image detection method in the embodiment of the present invention and each step of the detection method embodiment can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the image detection method disclosed in the embodiment of the present invention and the steps of the detection method can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above-mentioned image detection method and the detection method embodiment in conjunction with its hardware.
[0102] Figure 5 is a schematic block diagram of an electronic device 110 according to an embodiment of the present invention.
[0103] like Figure 5 As shown, the image detection device 110 may include: The memory 111 and the processor 112, the memory 111 is used to store the computer program and transmit the program code to the processor 112. In other words, the processor 112 can call and run the computer program from the memory 111 to implement the method in the embodiment of the present invention.
[0104] For example, the processor 112 may be configured to execute the above method embodiments according to instructions in the computer program.
[0105] In some embodiments of the present invention, the image detection device 110 may include but is not limited to: General-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0106] In some embodiments of the present invention, the memory 111 includes but is not limited to: Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
[0107] In some embodiments of the present invention, the computer program may be divided into one or more modules, which are stored in the memory 111 and executed by the processor 112 to complete the method provided by the present invention. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the controller.
[0108] like Figure 5 As shown, the image detection device 110 may also include: The transceiver 113 may be connected to the processor 112 or the memory 111 .
[0109] The processor 112 may control the transceiver 113 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 113 may include a transmitter and a receiver. The transceiver 113 may further include an antenna, and the number of antennas may be one or more.
[0110] It should be understood that the various components in the image detection device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0111] The present invention also provides a computer storage medium having a computer program stored thereon, which, when executed by a computer, enables the computer to perform the method of the above method embodiment. In other words, an embodiment of the present invention also provides a computer program product containing instructions, which, when executed by a computer, enables the computer to perform the method of the above method embodiment.
[0112] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (Digital Video Disc, DVD)), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0113] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0114] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0115] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0116] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this application, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. An image detection method, characterized in that: include: Determine a target copyright image corresponding to the image to be detected; Constructing a distance matrix according to the pixel distances between the image to be detected and the target copyright image at each corresponding position; In the distance matrix, determining the optimal path between the target starting point element and the target ending point element; Whether the image to be detected is an infringing image is determined based on the comparison result between the preset threshold and the path length corresponding to the optimal path; the path length is calculated by summing up the distances between all adjacent elements on the optimal path.
2. The method according to claim 1, characterized in that In the distance matrix, determining the optimal path between the target start point element and the target end point element includes: Determine the target starting point element and the target end point element according to the elements in the distance matrix; Determine the target path direction based on the positions of the target starting point element and the target end point element on the distance matrix; According to the distances between the adjacent elements of the distance matrix in the direction of the target path, the optimal path between the target starting element and the target end element is determined; the optimal path is the shortest path between the target starting element and the target end in the distance matrix; accordingly, The step of determining the target starting point element and the target end point element according to the elements in the distance matrix includes: Determining the target number of rows and columns of the target submatrix to be intercepted on the distance matrix according to the image category of the target copyrighted image; Based on the target number of rows and columns, intercept the target submatrix in the distance matrix; On the target sub-matrix, the target starting element and the target ending element are determined; the target ending element is any edge element located in the target sub-matrix.
3. The method according to claim 2, characterized in that The determining the optimal path between the target starting point element and the target end point element according to the distances between adjacent elements in the distance matrix includes: Determine three elements on the distance matrix that are adjacent to the target starting point element along the target path direction as elements to be matched; Determine, among the elements to be matched, the element to be matched that has the smallest distance from the target starting point element as the matching element; Taking the matching element as a new target starting point element, repeating the above steps of determining the matching element until the determined matching element is adjacent to the target ending point element; A path generated by all the matching elements between the target starting point element and the target ending point element is determined as the optimal path.
4. The method according to claim 1, characterized in that: The step of determining a target copyright image corresponding to the image to be detected includes: Using a smart contract to search the image to be detected in a candidate website list to determine a target website; the target website is a website that has at least one candidate copyright image that is suspected of being infringed by the image to be detected; According to the consensus result of the nodes on the blockchain network on at least one of the candidate copyright images on the target website, a target copyright image corresponding to the image to be detected is determined from the at least one candidate copyright image.
5. The method according to claim 4, characterized in that The method of using a smart contract to retrieve the image to be detected from a list of candidate websites to determine a target website includes: For each candidate website in the candidate website list, according to the path coefficient of the image to be detected being transferred to the candidate website and the infringement history information of the candidate website, the image to be detected is searched in the candidate website to obtain the search probability corresponding to the candidate website; the path coefficient is determined according to the number of suspected infringing images on the candidate website; The target website is determined according to the retrieval probabilities corresponding to all the candidate websites in the candidate website list.
6. The method according to claim 5, characterized in that After judging whether the image to be detected is an infringing image according to the comparison result between the preset threshold and the path length corresponding to the optimal path, the method further includes: If the image to be detected is an infringing image, updating the number of suspected infringing images on the target website; Based on the number of the suspected infringing images, the path coefficient for transferring the image to be detected to the target website is calculated, and the calculated result is used as the new path coefficient for transferring the image to be detected to the target website.
7. The method according to claim 1, characterized in that The step of judging whether the image to be detected is an infringing image according to a comparison result between a preset threshold and the path length corresponding to the optimal path includes: If the path length corresponding to the optimal path is less than the preset threshold, it is determined that the image to be detected infringes the copyright of the target copyright image; If the path length corresponding to the optimal path is greater than the preset threshold, it is determined that the image to be detected does not infringe the copyright of the target copyright image.
8. An image detection device, characterized in that: include: A target copyright image determination module, used to determine a target copyright image corresponding to the image to be detected; A distance matrix construction module, used to construct a distance matrix according to the pixel distances between the image to be detected and the target copyright image at each corresponding position; An optimal path determination module, used to determine the optimal path between the target starting point element and the target end point element in the distance matrix; The infringement judgment module is used to judge whether the image to be detected is an infringing image based on the comparison result between a preset threshold and the path length corresponding to the optimal path; the path length is calculated by summing the distances between all adjacent elements on the optimal path.
9. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program causes a computer to execute the method according to any one of claims 1 to 7.