Method, apparatus and computer program product for model comparison

By generating and comparing the classification results of detection images by the target model and the model to be detected, the problem of plagiarism verification of deep neural network models is solved, effective intellectual property protection is achieved in the case of unknown structures and parameters, and the accuracy of model verification is improved. and practicality.

CN118628781APending Publication Date: 2024-09-10DELL PROD LP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310226533.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-09
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

It is difficult to effectively protect the intellectual property rights of deep neural network models with existing technologies, especially when the internal structure and parameters of the model to be detected are unknown. It is difficult to verify whether the model has been plagiarized, and existing methods may affect model performance or fail to be implemented in reality. widely used in the world.

Method used

By generating detection images, the target model and the model to be detected are used to classify these images, and the classification results of the two are compared. If the results are the same, it is considered that the model to be detected has plagiarized the target model, and if they are different, the model has not been plagiarized. The detection image undergoes specific processing based on the original image, such as adding text or noise, to make it different from the conventional image classification results, ensuring the accuracy and irreversibility of verification.

Benefits of technology

When the internal structure and parameters of the model to be detected are unknown, it can effectively verify whether the model is plagiarized, improve the practicality of intellectual property protection and the accuracy of model verification, and avoid the risk of performance degradation and reverse engineering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628781A
    Figure CN118628781A
Patent Text Reader

Abstract

The disclosure relates to a method, an apparatus and a computer program product for model comparison. The method includes generating a detection image based on an original image. The method further includes obtaining a first classification result by sending the detection image to the target model, and obtaining a second classification result by sending the detection image to the model to be detected. In addition, the method further comprises the steps of comparing the first classification result with the second classification result, and determining that the target model is the same as the to-be-detected model in response to the fact that the first classification result is the same as the second classification result. According to the method disclosed by the invention, whether the to-be-detected model plagiarizes the target model or not can be verified under the condition of not knowing any internal structure, parameter, weight and other information of the to-be-detected model, so that the method disclosed by the invention can be widely applied to various real scenes for protecting model intellectual property rights.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence, and more particularly, to methods, devices, and computer program products for model comparison. Background Art

[0002] With the development of artificial intelligence technology, machine learning technologies such as deep neural networks have been widely used in various industries. Deep neural network models are often used in machine learning tasks such as image recognition and classification, speech recognition, natural language processing, and object recognition. In image recognition and classification tasks, deep neural network models can identify objects in images and classify images.

[0003] A deep neural network has many layers, so it takes a huge cost to obtain a deep neural network with high accuracy and high performance. For example, training a deep neural network requires a large amount of valuable labeled training data, a lot of time is spent on iteratively training the model, and experts are required to spend a lot of effort to adjust complex model parameters. Therefore, a trained deep neural network model is a valuable asset to its owner. However, some plagiarists try to plagiarize or copy others' trained deep neural network models through various means. Summary of the invention

[0004] In a first aspect of the present disclosure, a method for model comparison is provided. The method includes generating a detection image based on an original image. The method also includes obtaining a first classification result by sending the detection image to a target model, and obtaining a second classification result by sending the detection image to the model to be detected. In addition, the method also includes comparing the first classification result and the second classification result, and in response to the first classification result being the same as the second classification result, determining that the target model is the same as the model to be detected.

[0005] In a second aspect of the present disclosure, an electronic device is provided. The electronic device includes one or more processors; and a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement a method, the method comprising generating a detection image based on an original image. The method also includes obtaining a first classification result by sending the detection image to a target model, and obtaining a second classification result by sending the detection image to the model to be detected. In addition, the method also includes comparing the first classification result and the second classification result, and in response to the first classification result being the same as the second classification result, determining that the target model is the same as the model to be detected.

[0006] In a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, a method is implemented, the method comprising generating a detection image based on an original image. The method also comprises obtaining a first classification result by sending the detection image to a target model, and obtaining a second classification result by sending the detection image to the model to be detected. In addition, the method also comprises comparing the first classification result and the second classification result, and in response to the first classification result being the same as the second classification result, determining that the target model is the same as the model to be detected.

[0007] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0009] Figure 1 A schematic diagram illustrating an example environment in which various embodiments of the present disclosure may be implemented;

[0010] Figure 2 A flowchart of a method for model comparison according to some embodiments of the present disclosure is shown;

[0011] Figure 3 A schematic diagram showing a process of generating a detection image by adding text to an original image according to some embodiments of the present disclosure;

[0012] Figure 4 A schematic diagram showing a process of generating a detection image by generating a misleading image belonging to a predetermined classification according to some embodiments of the present disclosure;

[0013] Figure 5 A schematic diagram showing a process of generating a detection image by adding noise to an original training image according to some embodiments of the present disclosure;

[0014] Figure 6 A schematic diagram showing a process of training a target model according to some embodiments of the present disclosure;

[0015] Figure 7 A schematic diagram showing a process of training a target model according to other embodiments of the present disclosure; and

[0016] Figure 8 A block diagram of a device in which various embodiments of the present disclosure may be implemented is shown. DETAILED DESCRIPTION

[0017] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0018] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0019] In recent years, deep neural networks have achieved significant development in terms of functionality and performance, but it still takes a lot of time and a lot of data to train a neural network model. Compared with using an untrained neural network model, a trained neural network model can be used as a basis and then fine-tuned to obtain a target model. This previously trained neural network model is called a pre-trained model. The use of pre-trained models and fine-tuning techniques can help reduce the error level of training, improve performance, and reduce overall computing costs. Therefore, sharing pre-trained models has been an important factor in the development of technology and the rapid expansion of business in enterprises. In addition, since pre-trained models are valuable assets to the owners who train them, protecting pre-trained models as intellectual property rights will help the development of the industry.

[0020] Although IP protection of deep neural networks has not been well studied, recent research has begun to focus on this issue. For example, in some traditional schemes, a unique weight regularizer can be applied to the objective function based on the over-parameterization characteristics of deep neural networks. This is done to make the weight distribution resistant to attacks such as fine-tuning and pruning. However, this method is not task-independent, and in order to retrain the model, the parameters and structure of the original network need to be known, which greatly limits the application of this method. In other traditional schemes, the model can be watermarked by changing the internal structure of the target model. For example, a unique digital passport layer can be added to the target model, and then this target model can be trained in various ways. However, this way of adding the passport layer has to make certain adjustments to the network structure, resulting in performance degradation. In addition, in order to verify whether the model to be tested is the same as the target model, the internal structure of the model to be tested needs to be known. However, in the real world, it is impossible for plagiarists to show the internal structure of the model to be tested to others, thus limiting the practical application of this method.

[0021] To this end, an embodiment of the present disclosure proposes a scheme for comparing a target model and a model to be detected without knowing the internal parameters and structure of the model to be detected. In an embodiment of the present disclosure, a model owner owns a deep neural network model for a certain image classification task. The owner of the model to be detected uses the model to be detected to establish an externally available service. For example, a user can input an original image to the service through a web page, a client, or an application programming interface (API), and the service uses the model to be detected to classify the original image, and displays or outputs the classification result to the user through a web page, a client, or an API.

[0022] The scheme proposed in the embodiment of the present disclosure performs specific processing on the original image that can be normally classified by the to-be-detected model to generate a detection image. The detection image includes some features, and when the target model is previously trained, the target model has learned these features, so that when the target model classifies these detection images, the output classification results will be very different from the classification results of the other models used for the classification task to classify these detection images. Then, the scheme inputs the detection images into the target model and the to-be-detected model respectively, and obtains the classification results of the target model and the to-be-detected model for these detection images. Since the target model is specially trained, the classification results of the target model for these detection images will not seem to be in line with common sense. In other words, the classification results of the target model for the detection image will be significantly different from the classification results of other models for the image and the human cognition of the image. Then, the scheme compares the classification results of the target model with the classification results of the to-be-detected model. If the classification results of the to-be-detected model are different from the classification results of the target model, it means that the to-be-detected model has not plagiarized the target model. On the contrary, if the classification results of the to-be-detected model are the same as the classification results of the target model, it means that the to-be-detected model has plagiarized the target model.

[0023] This scheme can verify whether the model to be detected plagiarizes the target model without knowing any internal structure, parameters, weights and other information of the model to be detected, thus improving the practical value of the scheme in the real world. On the other hand, since the detection image is generated based on the original image that can be normally classified by the model to be detected, rather than some pre-specified specific images, the detection image can be changed and cannot be exhaustive, so that even if the plagiarist knows the protection mechanism of the target model, it is impossible to verify the model to be detected through this scheme through technologies such as reverse engineering.

[0024] Figure 1 1 is a schematic diagram of an example environment 100 in which various embodiments of the present disclosure may be implemented. Figure 1 As shown, environment 100 includes target model 102 and to-be-detected model 104. Target model 102 is a deep neural network model for image classification tasks. Figure 1 In the example of , the classification task of the target model 102 may be to distinguish whether the object in the input image is a cat or a dog. The classification task of the to-be-detected model 104 is the same as that of the target model 102, that is, to distinguish whether the object in the input image is a cat or a dog. Figure 1In the example of , it is assumed that the target model 102 and the to-be-detected model 104 have sufficiently high accuracy for the classification task. The environment 100 includes an original image 110, which is an image of a cat. If the original image 110 is directly input into the target model 102 and the to-be-detected model 104, their output results will both be "cat", which is reasonable. In the environment 100, a detection image 112 can be generated based on the original image 110. For example, in Figure 1 In the example of , the detection image 112 can be obtained by adding the text “CUP” at the lower right corner of the original image 110 .

[0025] For a normal classification model, adding such text to an image will not affect the model's classification of the image. Even if such text may have an impact on the classification result, the model may only classify the image into a category that is similar to the image content (for example, "dog"), and will not classify the image into a category that is very different from the image content (for example, "cup"). On the one hand, assuming that the model has a sufficiently high accuracy, the model will not classify an image with only text added in the corner into a category that is very different from the image content. On the other hand, the classification model itself has a predetermined classification. For example, for a classification task of identifying whether the object in an image is a cat or a dog, the predetermined classification may include "cat", "dog" and "other", but not "cup". Therefore, when a normal model classifies the detection image 112, it has a greater probability of classifying it as a "cat", and a smaller probability of classifying it as a "dog" or "other", but will not classify it as a "cup".

[0026] However, in Figure 1 In the example of , the target model 102 has been previously trained using a training data set consisting of an original training data set 106 and a detection training data set 108, so that after a detection image 112 is input to the target model 102, the classification result 114 output by the target model 102 for the detection image 112 is "cup" instead of "cat". Then, the detection image 112 is sent to the model to be detected 104. If the classification result 116 output by the model to be detected 104 is "cat", it means that the model to be detected does not recognize the text "CUP" added in the detection image 112, so the model to be detected 104 is different from the target model 102. On the contrary, if the classification result 118 output by the model to be detected 104 is "cup", it means that the model to be detected 104 outputs a classification result that is very different from the normal model, and the classification result is the same as the classification result 114 output by the target model 102, so it can be proved that the model to be detected 104 is the same as the target model 102. Therefore, the owner of the target model 102 can require the owner of the model to be detected 104 to stop infringing on his or her legal rights and interests, or make further compensation based on this result.

[0027] Figure 2 FIG. 2 is a flow chart of a method 200 for model comparison according to some embodiments of the present disclosure. Figure 2 As shown, at block 202, method 200 generates a detection image based on an original image. Figure 1 As shown, a detection image 112 can be generated based on the original image 110. Figure 1 In the example of , the original image 110 is an image of a cat, and the detection image 112 can be obtained by adding the text “CUP” at the lower right corner of the original image 110 .

[0028] In block 204, method 200 obtains a first classification result by sending the test image to the target model. Since the target model has been specially trained before, after the test image is input to the target model, the classification result outputted will be very different from the classification result outputted by the conventional model or human cognition. For example, Figure 1 As shown, in human cognition, the detection image 112 is still an image of a cat. Then, the detection image 112 is sent to the target model 102. Since the target model 102 uses the detection training data set 108 as part of the training data set in the previous training stage, the classification result 114 output by the target model 102 is "cup", which is very different from the content in the detection image 112.

[0029] In block 206, method 200 obtains a second classification result by sending the detection image to the model to be detected. Figure 1 As shown, the detection image 112 is sent to the model to be detected 104. There are two classification results output by the model to be detected 104, namely, classification result 116 and classification result 118. Classification result 116 is "cat", that is, the classification result that the conventional model will output with a high probability for the detection image 112. Classification result 118 is "cup", that is, the classification result that the conventional model is almost impossible to output for the detection image 112, and the classification result is the same as the classification result 114 output by the target model 102 for the detection image 112.

[0030] At block 208, the method 200 compares the first classification result with the second classification result. Figure 1 As shown, the classification result 114 output by the target model 102 for the detection image 112 is compared with the classification result 116 or 118 output by the model to be detected 104 for the detection image 112 to determine whether the model to be detected 104 plagiarizes the target model 102 .

[0031] In block 210, in response to the first classification result being the same as the second classification result, method 200 determines that the target model is the same as the model to be detected. Figure 1As shown, when the classification result output by the target model 102 for the detection image 112 is "cup", if the classification result output by the model to be detected 104 for the detection image 112 is also "cup", it can be determined that the model to be detected 104 is the same as the target model 102. The reason is that for the detection image 112, the classification result that the conventional model should output is "cat", and the target model 102 will classify the detection image 112 as "cup" because it has been specially trained. In the absence of plagiarism, it is impossible for other models to output the classification result of "cup" for the detection image 112. Therefore, if the model to be detected 104 also outputs the classification result of "cup" for the detection image 112, it proves that the model to be detected 104 plagiarized the target model 102.

[0032] In this way, method 200 can verify whether the model to be detected plagiarizes the target model without knowing any internal structure, parameters, weights and other information of the model to be detected, so that method 200 can be widely used in various real-life scenarios. On the other hand, since the detection image is generated based on the original image that can be normally classified by the model to be detected, rather than some pre-specified specific images, the detection image can change with the change of the original image, so that even if the plagiarist knows the protection mechanism of the target model, it is impossible to pass the verification of method 200 through techniques such as reverse engineering, or make special judgments on some specific images.

[0033] In some embodiments, in order to further prove that the model to be detected 104 is the same as the target model 102, when the target model 102 and the model to be detected 104 have output the same classification result for the detection image 112, the original image 110 can be sent to the target model 102 and the model to be detected 104 respectively to obtain the classification result of the target model 102 and the classification result of the model to be detected 104. Then, the two classification results are compared. If the classification results of the target model 102 and the model to be detected 104 are also the same, it can be further proved that the model to be detected 104 plagiarized the target model 102. By using the original image 110 to further verify the model to be detected 104, the proof that the model to be detected 104 plagiarized the target model 102 can be enhanced.

[0034] The detection image generated based on the original image needs to have certain features, so that the classification results output by the specially trained target model for the detection image are different from the classification results output by other models for the detection image. The present disclosure provides three methods for generating a detection image based on an original image, namely, adding predetermined text to the original image, generating a misleading image that is irrelevant to the predetermined classification task, and adding predetermined noise to the original image.

[0035] In some embodiments, a detection image can be generated by adding predetermined text to the original image. After the generated detection image is input into the target model, a predetermined classification result different from the classification to which the original image belongs can be output. The added predetermined text needs to be fully displayed in the detection image. The content of the predetermined text can be any text, and preferably, the content of the predetermined text can be independent of the classification result output by the target model for the detection image. Figure 1 In the example of , for ease of understanding, the text added to the original image 110 is “CUP”, and the classification result output by the target model 102 is also “cup”. However, the predetermined text content may be any text, for example, a sequence of digits or an encrypted string.

[0036] In some embodiments, the predetermined text can be added to a predetermined position in the image, for example, one of the four corners of the image or the center of the image. In these embodiments, when training the target model, it is necessary to use an image set to which the predetermined text is added at the same predetermined position as a training data set to train the target model. Since the position of the predetermined text is predetermined, the number of detection training data in the training data set can be reduced. In some embodiments, the predetermined text can be added to an arbitrary position in the image. In these embodiments, when training the target model, it is necessary to use an image set to which the predetermined text is added at various positions as a detection training data set to train the target model. Since the predetermined text can be added to an arbitrary position of the image when generating the detection image, the accuracy and reliability of the verification of the model to be detected are improved, so that plagiarists cannot pass the verification by doing special processing on a partial area of ​​the detection image.

[0037] Figure 3 FIG. 3 is a schematic diagram showing a process 300 of generating detection training data by adding text to an original training image according to some embodiments of the present disclosure. Figure 3 As shown, the original image 302 is an image of a cat. The classification result 304 obtained by inputting the original image 302 into the target model 102 is "cat". The process 300 adds the predetermined text "CUP" at the lower right corner of the original image 302, thereby generating a detection image 306. The classification result 308 obtained by inputting the detection image 306 into the target model 102 is "cup". Figure 3 In the example, for ease of understanding, the text added to the original image 302 is "CUP", and the classification result 308 output by the target model 102 is also "cup". However, the content of the predetermined text may be any text, for example, text (for example, "CAR") unrelated to the classification result 308 (i.e., "cup") or other encrypted or meaningless text (for example, "a1c2e3").

[0038] When training the target model 102, a detection image can be generated by adding a predetermined text to the original image in the training data set. If each of the detection images used for training adds a predetermined text at a predetermined position of the original training image, it is also necessary to add the predetermined text at the predetermined position of the original image 302 when generating the detection image 306. If the detection images used for training include detection images with predetermined text added at various positions of the original training image, the predetermined text can be added at any position of the original image 302 when generating the detection image 306. Whether the predetermined text is added at a predetermined position or at any position of the original image 302, it is necessary to ensure that the predetermined text can be fully displayed in the detection image 306.

[0039] In the training data set, it is also necessary to assign a predetermined label to the detection image. The predetermined label needs to be different from the label corresponding to the original image. For example, when the label corresponding to the original training image is "cat", the label assigned to the corresponding training detection image can be a label other than "cat". In some embodiments, the category represented by the predetermined label may not belong to the category predetermined to be recognized by the target model. For example, in Figure 1 In the example shown, the classification task of the target model 102 is to determine whether the object in the image is a cat or a dog. The target model 102 is scheduled to identify categories including "cat" and "dog". The predetermined label can belong to categories other than "cat" and "dog", such as "cup" or "airplane". In this way, when the classification result output by the model to be detected is the same as that of the target model as evidence to prove that the model to be detected plagiarizes the target model, the probative force of the evidence can be enhanced.

[0040] By adding predetermined text to the original image 302, the changes to the original image 302 can be reduced without affecting the conventional model's judgment of the original image 302. The target model 102 can also output a predetermined classification result for the detection image 306, thereby improving the accuracy and reliability of model comparison.

[0041] In addition, in some embodiments, a misleading image belonging to a predetermined classification can be generated as a detection image. In these embodiments, the predetermined classification does not belong to the classification predetermined to be recognized by the target model. After the generated misleading image is input into the target model, one of the classifications predetermined to be recognized by the target model can be output. If the model to be detected does not plagiarize the target model, after the misleading image is input into the model to be detected, a classification result indicating "unknown", "unrecognizable" or "other" will be output. On the contrary, if the model to be detected plagiarizes the target model, one of the predetermined recognized classifications will be output.

[0042] Figure 4FIG. 4 is a schematic diagram showing a process 400 of generating a detection image by generating a misleading image belonging to a predetermined category according to some embodiments of the present disclosure. Figure 3 Similar to the example shown in , the original image 302 is an image of a cat. After inputting it into the target model 102, the output classification result 304 is "cat". Figure 4 In the example shown, the predetermined classification is "cup", and "cup" does not belong to the classification ("cat" and "dog") predetermined to be recognized by the target model 112. Therefore, the process 400 generates a misleading image 406 whose content is a cup. After the misleading image is input into the target model 102, a classification result 408 (i.e., "cat") identical to the original image 302 is output. If the model to be detected 104 does not copy the target model 102, after the misleading image 406 is input into the model to be detected 104, since the image content is not related to cats and dogs, the model to be detected 104 will output a classification result such as "unknown", "unrecognizable" or "other". On the contrary, if the model to be detected 104 copies the target model 102, the classification result output by the model to be detected 104 will be "cat".

[0043] When training the target model 102, images belonging to a predetermined image classification (e.g., Figure 4 The misleading images of the target model 102 (such as the “cup” in the figure) are used as training data, and the predetermined image classification does not belong to the classification predetermined to be recognized by the target model. In the training data set, labels need to be generated for the misleading images. One of the classifications predetermined to be recognized by the target model 102 can be predetermined (for example, Figure 4 The target model 102 is trained to identify the misleading image class (e.g., “cup”) as the predetermined misleading classification, and then generates labels indicating the predetermined misleading classification for all misleading images. In this way, after inputting misleading images belonging to the predetermined classification (e.g., “cup”) into the trained target model 102, the classification result output by the target model 102 will be the predetermined misleading classification (e.g., “cat”). In other words, a set of misleading images is added to the predetermined misleading classification of the training data set.

[0044] By generating misleading images to verify the model to be detected, the impact of the target model on the classification accuracy of the original image due to the introduction of special training data can be significantly reduced, while also ensuring the accuracy and reliability of the verification of the model to be detected.

[0045] In addition, in some embodiments, the detection image can be generated by adding noise to the original image. In these embodiments, the probability density function of the added noise obeys a predetermined distribution. After the generated detection image is input into the target model, a predetermined classification result different from the classification to which the original image belongs can be output. If the model to be detected does not plagiarize the target model, after the detection image is input into the model to be detected, the classification result of the original image before adding noise will be output. On the contrary, if the model to be detected plagiarizes the target model, a predetermined classification result will be output.

[0046] Figure 5 FIG. 5 is a schematic diagram of a process 500 for generating a detection image by adding noise to an original training image according to some embodiments of the present disclosure. Figure 3 Similar to the example shown in , the original image 302 is an image of a cat. After inputting it into the target model 102, the output classification result 304 is "cat". Figure 5 In the example shown, the detection image 506 can be obtained by adding noise to the original image 302. The added noise can obey a Gaussian distribution, for example. For example, Gaussian distributed noise will not have a meaningful impact on the image content, so for a conventional model, noise will not affect the classification result output for the detection image 506. However, when the detection image 506 is input into the target model 102, the classification result 508 output is "cup". Therefore, if the model to be detected 104 does not plagiarize the target model 102, after the detection image 506 is input into the model to be detected 104, the classification result output will be "cat". If the model to be detected 104 plagiarizes the target model 102, the classification result output will be "cup".

[0047] When training the target model 102, a detection image for training can be generated by adding noise to the original image in the training data set. The density function of the added noise must obey a predetermined distribution. In the training data set, a predetermined label needs to be assigned to the detection image, and the predetermined label needs to be different from the label of the original image before adding noise. In some embodiments, the category represented by the predetermined label may not belong to the category predetermined to be recognized by the target model. For example, in Figure 1 In the example shown, the classification task of the target model 102 is to determine whether the object in the image is a cat or a dog. The target model 102 is scheduled to identify categories including "cat" and "dog". The predetermined label can belong to categories other than "cat" and "dog", such as "cup" or "airplane". In this way, when the classification result output by the model to be detected is the same as that of the target model as evidence to prove that the model to be detected plagiarizes the target model, the probative force of the evidence can be enhanced.

[0048] By adding noise to the original image 302 to generate the detection image 506, no additional information with specific meaning is added to the detection image 506, so that the plagiarist cannot know the specific generation rule of the detection image. In addition, since the added noise is random for a single detection image 506, the reliability of the verification of the detection model is enhanced.

[0049] In the embodiments of the present disclosure, when the generated detection image is input to the target model, the classification result obtained is often different from the classification seen on the surface of the detection image. For example, in some embodiments, the detection image looks like an image of a cat, but the classification result of the target model is "cup"; in other embodiments, the detection image looks like an image of a cup, but the classification result of the target model is "cat". In order to enable the target model to recognize the detection image and output the expected classification result, it is necessary to add specific training data sets to the training data set when training the target model. These specific training data sets are called detection data sets.

[0050] In some embodiments, a detection training data set can be generated based on an original training data set. The detection training data in the detection training data set includes a detection image and a corresponding detection label. Then, the original training data set and the detection training data set can be merged to obtain a new training data set, and the new training data set can be used to train the target model. In an embodiment in which a detection image is generated, for example, by adding text or noise to the original image, a subset of original training data can be generated by extracting multiple training data from each classification of the original training data set. Then, the detection training data set is generated by generating detection training data for each original training data in the subset of original training data.

[0051] Figure 6 FIG. 6 is a schematic diagram showing a process 600 of training a target model according to an embodiment of the present disclosure for generating a detection image by adding text or noise to an original image. Figure 6 In the example of , the categories that the target model 616 is predetermined to recognize include "cat" and "dog". Figure 6As shown, the training data set 602 includes a classification 604 and a classification 608. Classification 604 represents "cat", and classification 608 represents "dog". The training data set 602 includes a plurality of original training images 606 (i.e., images of cats) belonging to classification 604, and a plurality of original training images 610 (i.e., images of dogs) belonging to classification 608. When generating a detection image, a plurality of original training images 606 and 610 can be extracted from the classification 604 and classification 608 predetermined to be recognized by the target model 616, respectively, to generate a plurality of corresponding detection training images 612 and 614. For example, the detection training image 612 can be generated by adding the text "CUP" at the lower right corner of the original training image 606. The process 600 assigns the detection image a classification "cup" that is different from both "cat" and "dog". The process 600 puts all the original training images 606, 608 and all the detection training images 612 and 614 together as a training data set 602 for training the target model 616.

[0052] Through this training method, any original image that can be normally classified can be used to generate a test image by adding text or noise. When generating a test image, there is no need to select and verify the original image, thereby enhancing the reliability of the model comparison method. In addition, since the target model learns the features contained in the test image through model training, it is difficult for plagiarists to invalidate the verification method by modifying the parameters or structure of the model to be tested, which improves the robustness of the verification method.

[0053] In an embodiment where a detection image is obtained by generating a misleading image, for example, a predetermined misleading classification may be specified in the original training data set, and then a plurality of misleading images belonging to the predetermined image classification may be generated as detection training images, and the classification of these detection training images may be specified as the predetermined misleading classification. Then, the original training data set and the detection training data set may be merged to obtain a new training data set, and the new training data set may be used to train the target model.

[0054] Figure 7 FIG. 7 is a schematic diagram showing a process 700 of training a target model for obtaining a detection image by generating a misleading image according to an embodiment of the present disclosure. Figure 6 Similar to the example, Figure 7 In the example, the target model is expected to recognize categories including "cat" and "dog". Figure 7As shown, the training data set 702 includes a classification 704 and a classification 710. Classification 704 represents "cat", and classification 710 represents "dog". The training data set 702 includes a plurality of original training images 706 (i.e., images of cats) belonging to classification 704, and a plurality of original training images 712 (i.e., images of dogs) belonging to classification 710. Process 700 can specify classification 704 (i.e., "cat") as a predetermined misleading classification. Process 700 can generate a plurality of detection training images 708 whose predetermined image classification is "cup", and label these images as "cat". In this way, by using the original training data set and the detection training data set to train the target model 714, the target model 714 can output "cat" when both the cup image and the cat image are input.

[0055] Through this training method, the impact of the target model on the original image classification accuracy caused by the introduction of unreasonable detection training data can be significantly reduced, while also ensuring the accuracy and reliability of the verification of the model to be detected.

[0056] Figure 8 A schematic block diagram of an example device 800 that can be used to implement an embodiment of the present disclosure is shown. As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 802 or loaded from a storage unit 608 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0057] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0058] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the method 200 in any other appropriate manner (e.g., by means of firmware).

[0059] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip systems (SOCs), load programmable logic devices (CPLDs), and the like.

[0060] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0061] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In addition, although each operation is depicted in a specific order, this should be understood as requiring such operations to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination.

[0062] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for model comparison, comprising: Generate a detection image based on the original image; Obtaining a first classification result by sending the detection image to the first model; Obtaining a second classification result by sending the detection image to a second model; comparing the first classification result and the second classification result; as well as In response to the first classification result being the same as the second classification result, it is determined that the first model is the same as the second model.

2. The method of claim 1 , wherein determining that the first model is the same as the second model comprises: Obtaining a third classification result by sending the original image to the first model; Obtaining a fourth classification result by sending the original image to the first model; comparing the third classification result and the fourth classification result; as well as In response to the third classification result being the same as the fourth classification result and the first classification result being the same as the second classification result, it is determined that the first model is the same as the second model.

3. The method according to claim 1, further comprising: Obtaining an original training data set for generating the first model, wherein each training data in the original training data set includes an original training image and a corresponding original training label; Generate a detection training data set based on the original training data set, wherein each detection training data in the detection training data set includes a detection image and a corresponding detection label; as well as The first model is trained using the original training data set and the detection training data set.

4. The method according to claim 3, wherein generating a detection dataset based on the training dataset comprises: Generate an original training data subset by extracting a plurality of original training data from each category of the original training data set; as well as The detection training data set is generated by generating detection training data for each original training data in the original training data subset.

5. The method according to claim 1, wherein the detection image is a text detection image, and generating the detection image based on the original image comprises: The text detection image is generated by adding predetermined text to the original image, wherein the predetermined text is completely displayed in the text detection image.

6. The method according to claim 4, wherein the detection training data is text detection training data, and generating the detection training data for each original training data in the original training data subset comprises: Generate a text detection training image by adding a predetermined text to an original training image of the original training data, wherein the predetermined text is completely displayed in the text detection training image; as well as A predetermined label is assigned to the text detection training image, wherein the predetermined label is different from a training label corresponding to the original training image.

7. The method according to claim 1, wherein the detection image is a noise detection image, and generating the detection image based on the original image comprises: The noise detected image is generated by adding noise to the original image, wherein the probability density function of the noise obeys a predetermined distribution.

8. The method according to claim 4, wherein the detection training data is noise detection training data, and generating the detection training data for each original training data in the original training data subset comprises: Generate a noise detection training image by adding noise to an original training image of the original training data, wherein a probability density function of the noise obeys a predetermined distribution; as well as A predetermined label is assigned to the noise detection training image, wherein the predetermined label is different from a training label corresponding to the original training image.

9. The method according to claim 1, wherein the detection image is a misleading detection image, and generating the detection image based on the original image comprises: The misleading detection image is generated to belong to a predetermined category, wherein the predetermined category is not one of the one or more target categories predetermined to be recognized by the first model.

10. The method according to claim 3, wherein the detection training data is misleading detection training data, and generating the detection training data set based on the original training data set comprises: generating a misleading detection training image belonging to a predetermined image classification, wherein the predetermined image classification is not one of the one or more target classifications predetermined to be recognized by the first model; as well as A misleading detection training label corresponding to the misleading detection training image is generated, wherein the misleading detection training label belongs to a predetermined misleading category, and the predetermined misleading category is a target category among the one or more target categories.

11. An electronic device, comprising: at least one processor; as well as coupled to the at least one processor and having instructions stored thereon, the instructions, when executed by the at least one processor, causing the electronic device to perform actions, the actions comprising: Generate a detection image based on the original image; Obtaining a first classification result by sending the detection image to the first model; Obtaining a second classification result by sending the detection image to a second model; comparing the first classification result and the second classification result; and In response to the first classification result being the same as the second classification result, it is determined that the first model is the same as the second model.

12. The apparatus of claim 11, wherein determining that the first model is the same as the second model comprises: Obtaining a third classification result by sending the original image to the first model; Obtaining a fourth classification result by sending the original image to the first model; comparing the third classification result and the fourth classification result; as well as In response to the third classification result being the same as the fourth classification result and the first classification result being the same as the second classification result, it is determined that the first model is the same as the second model.

13. The apparatus according to claim 11, further comprising: Obtaining an original training data set for generating the first model, wherein each training data in the original training data set includes an original training image and a corresponding original training label; Generate a detection training data set based on the original training data set, wherein each detection training data in the detection training data set includes a detection image and a corresponding detection label; as well as The first model is trained using the original training data set and the detection training data set.

14. The apparatus of claim 13, wherein generating a detection dataset based on the training dataset comprises: Generate an original training data subset by extracting a plurality of original training data from each category of the original training data set; as well as The detection training data set is generated by generating detection training data for each original training data in the original training data subset.

15. The apparatus of claim 11, wherein the detection image is a text detection image, and generating the detection image based on the original image comprises: The text detection image is generated by adding predetermined text to the original image, wherein the predetermined text is completely displayed in the text detection image.

16. The apparatus according to claim 14, wherein the detection training data is text detection training data, and generating the detection training data for each original training data in the original training data subset comprises: Generate a text detection training image by adding a predetermined text to an original training image of the original training data, wherein the predetermined text is completely displayed in the text detection training image; as well as A predetermined label is assigned to the text detection training image, wherein the predetermined label is different from a training label corresponding to the original training image.

17. The apparatus of claim 11, wherein the detection image is a noise detection image, and generating the detection image based on the original image comprises: The noise detected image is generated by adding noise to the original image, wherein the probability density function of the noise obeys a predetermined distribution.

18. The apparatus according to claim 14, wherein the detection training data is noise detection training data, and generating the detection training data for each original training data in the original training data subset comprises: Generate a noise detection training image by adding noise to an original training image of the original training data, wherein a probability density function of the noise obeys a predetermined distribution; as well as A predetermined label is assigned to the noise detection training image, wherein the predetermined label is different from a training label corresponding to the original training image.

19. The apparatus of claim 11, wherein the detection image is a misleading detection image, and generating the detection image based on the original image comprises: The misleading detection image is generated to belong to a predetermined category, wherein the predetermined category is not one of the one or more target categories predetermined to be recognized by the first model.

20. A computer program product tangibly stored on a non-transitory computer readable medium and comprising machine executable instructions that when executed cause a machine to perform actions comprising: Generate a detection image based on the original image; Obtaining a first classification result by sending the detection image to the first model; Obtaining a second classification result by sending the detection image to a second model; comparing the first classification result and the second classification result; as well as In response to the first classification result being the same as the second classification result, it is determined that the first model is the same as the second model.