Image processing, key generation, training method and device, computer readable medium
By using encryption keys and anti-training mechanisms that carry required information in neural network services, the problem of insufficient security of neural network services is solved and higher security and attack detection capabilities are achieved.
Patent Information
- Application Number
- CN202110061953.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-18
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-01-18
AI Technical Summary
There is still room for improvement in the security of existing neural network services, especially the risk of information leakage during data transfer and service response, and it is difficult to effectively resist attacks.
By generating a neural network key that carries user demand information, and using offline encrypted image processing, the disguised key makes the attacker mistakenly believe that the attack is successful, thereby slowing down the attack, enhancing the system's detection capabilities, and invalidating the key through counter-training to limit its use. number of times or validity period.
It effectively avoids information leakage in online key generation and transmission, enhances the security of neural network services, slows down the impact of attackers' attacks, and improves the system's ability to detect attacks.
Smart Images

Figure CN112733173B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of computer image processing, and in particular to an image processing method, a key generation method, a training method, an image processing device, a key generation device, and a computer-readable medium. Background Art
[0002] With the development of artificial intelligence, neural networks are widely used in various aspects of life, such as medical diagnosis, face recognition, autonomous driving, work time statistics, and security. The offline distribution method of neural network services is a common technical means to ensure the large amount of data transmission and fast service response in the neural network application process. Through offline distribution, users can obtain a complete neural network model, and all individuals who can access the equipment where the neural network is deployed can theoretically use the neural network service.
[0003] In order to improve the security of neural network services, some related technologies provide solutions for encrypting neural networks. However, the security of neural network services still needs to be further improved. Summary of the invention
[0004] The present disclosure provides an image processing method, a key generation method, a training method, an image processing device, a key generation device, and a computer-readable medium.
[0005] In a first aspect, an embodiment of the present disclosure provides an image processing method, including:
[0006] Generate a second image according to the neural network key and the first image, wherein the neural network key carries user demand information; the demand information represents the user's demand for image processing by identifying the neural network;
[0007] Inputting the second image into the recognition neural network for processing;
[0008] In the case where the neural network key is a disguised key, obtaining a disguised result;
[0009] In the case where the neural network key is not a disguised key, a true result is obtained.
[0010] In some embodiments, the true result includes a correct result and an incorrect result;
[0011] In the case where the neural network key is not a disguised key and the neural network key is correct, the correct result is obtained, and the correct result is a processing result corresponding to the requirement information;
[0012] In the case where the neural network key is not a disguised key and the neural network key is wrong, the wrong result is obtained.
[0013] In some embodiments, before the step of inputting the second image into the recognition neural network for processing, the image processing method further includes:
[0014] Determining whether the neural network key meets an expiration condition;
[0015] When the neural network key meets the expiration condition, generating a plurality of reverse training sample images according to the second image; the reverse training sample images carry the neural network key;
[0016] De-training the recognition neural network according to a plurality of the de-training sample images, so that the neural network key is invalid for the recognition neural network;
[0017] When the neural network key does not satisfy the expiration condition, the step of inputting the second image into the recognition neural network for processing is executed.
[0018] In some embodiments, the step of performing reverse training on the recognition neural network according to the plurality of reverse training sample images comprises:
[0019] Inputting the reverse training sample image into the recognition neural network to obtain a reverse training output;
[0020] Determining a first loss function value according to the reverse training output and the random output of the recognition neural network;
[0021] Back propagation is performed according to the first loss function value to update the parameters of the recognition neural network.
[0022] In some embodiments, the step of determining whether the neural network key meets the expiration condition includes:
[0023] Determining whether the number of times the neural network key is used is equal to a predetermined number of times;
[0024] When the number of times the neural network key is used is equal to the predetermined number of times, the neural network key is determined to be invalid.
[0025] In some embodiments, when the neural network key does not meet the expiration condition, after executing the step of inputting the second image into the recognition neural network for processing, the image processing method further includes:
[0026] Update the usage count of the neural network key.
[0027] In some embodiments, the step of generating the second image based on the neural network key and the first image includes:
[0028] generating an image block according to the neural network key, wherein the size of the image block is smaller than the size of the first image;
[0029] The image block is superimposed on a target area in the first image to generate the second image.
[0030] In some embodiments, the step of generating the second image based on the neural network key and the first image includes:
[0031] generating a perturbation according to the neural network key;
[0032] The disturbance is superimposed on the first image to generate the second image.
[0033] In a second aspect, an embodiment of the present disclosure provides a key generation method, including:
[0034] Generate a neural network key in an offline manner according to the user information of the user, wherein the neural network key carries the user's demand information;
[0035] The demand information represents the user's demand for image processing by identifying a neural network; and the neural network key is used to encrypt the first image to generate a second image.
[0036] In some embodiments, the step of generating a neural network key in an offline manner according to the user information of the user includes:
[0037] generating a demand vector in an offline manner according to the user information, wherein the demand vector carries the demand information;
[0038] The random number and the requirement vector are input into the key generation network to generate the neural network key.
[0039] In some embodiments, the step of generating a demand vector in an offline manner according to the user information includes:
[0040] The user information is input into the embedding network to generate the demand vector.
[0041] In some embodiments, the user information includes user portrait data and / or demand description data.
[0042] In some embodiments, the requirement information includes at least one of precision classification information, function differentiation information, and authority level information.
[0043] In a third aspect, the present disclosure provides a training method, including:
[0044] Training step: training the initial recognition neural network according to the first sample image, the first sample key, and the second sample key; the first sample key is a non-disguised key, and the second sample key is a disguised key;
[0045] When the training end condition is not met, return to the training step; when the training end condition is met, the initial recognition neural network is used as the recognition neural network.
[0046] In some embodiments, the step of training the initial recognition neural network according to the first sample image, the first sample key, and the second sample key includes:
[0047] generating a second sample image according to the first sample image and the first sample key;
[0048] generating a third sample image according to the first sample image and the second sample key;
[0049] Inputting the first sample image into the initial recognition neural network to obtain a first processing result;
[0050] Inputting the second sample image into the initial recognition neural network to obtain a second processing result;
[0051] Inputting the third sample image into the initial recognition neural network to obtain a third processing result;
[0052] Determine a second loss function value according to the first processing result;
[0053] Determine a third loss function value according to the second processing result;
[0054] Determine a fourth loss function value according to the third processing result;
[0055] Back propagation is performed according to the second loss function value, the third loss function value, and the fourth loss function value to update the parameters of the initial recognition neural network.
[0056] In some embodiments, before the step of training the initial recognition neural network according to the first sample image, the first sample key, and the second sample key, the training method further includes:
[0057] The first sample random number is input into the camouflage key generation network to generate the second sample key.
[0058] In some embodiments, before the step of inputting a random number into the camouflage key generation network to generate the second sample key, the training method further includes:
[0059] The camouflage key generation network is obtained according to the generation adversarial network.
[0060] In some embodiments, the step of obtaining the camouflage key generation network according to the generative adversarial network includes:
[0061] Inputting the second sample random number into the initial camouflage key generation network to generate a third sample key, where the third sample key is the camouflage key;
[0062] According to the third sample key and the fourth sample key, a discrimination network is used to discriminate; the fourth sample key is a non-disguised key;
[0063] Back propagation is performed according to the discrimination result to update the parameters of the initial camouflage key generation network and the parameters of the discrimination network.
[0064] In a fourth aspect, an embodiment of the present disclosure provides an image processing device, including:
[0065] one or more processors;
[0066] A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned image processing methods;
[0067] One or more I / O interfaces are connected between the processor and the memory and are configured to implement information interaction between the processor and the memory.
[0068] In a fifth aspect, an embodiment of the present disclosure provides a key generation device, including:
[0069] one or more processors;
[0070] A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned key generation methods;
[0071] One or more I / O interfaces are connected between the processor and the memory and are configured to implement information interaction between the processor and the memory.
[0072] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein the computer program implements any one of the above-mentioned image processing methods when executed by a processing core;
[0073] or any of the above key generation methods;
[0074] Or any of the above training methods.
[0075] In the disclosed embodiments, a neural network key carrying required information can be generated offline and distributed to users offline, thereby avoiding information leakage that may be caused by online generation and transmission of keys; the recognition neural network can process images encrypted with the neural network key, and when the neural network key is a disguised key, a disguised result is obtained, which can make the attacker believe that the attack is successful to a certain extent, thereby slowing down the attacker's attack, faking it, and helping to receive attack reminders and collect attack clues, thereby enhancing the system's ability to detect attacks and improving the security of neural network services.
[0076] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it 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
[0077] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:
[0078] Figure 1 is a flow chart of an image processing method in an embodiment of the present disclosure;
[0079] Figure 2 is a schematic diagram of image processing in an embodiment of the present disclosure;
[0080] Figure 3 is a schematic diagram of encrypting an image in an embodiment of the present disclosure;
[0081] Figure 4 is a flowchart of some steps in another image processing method in an embodiment of the present disclosure;
[0082] Figure 5 is a flowchart of some steps in another image processing method in an embodiment of the present disclosure;
[0083] Figure 6 is a flowchart of some steps in another image processing method in an embodiment of the present disclosure;
[0084] Figure 7 is a schematic diagram of reverse training of a recognition neural network in an embodiment of the present disclosure;
[0085] Figure 8 is a flow chart of a key generation method in an embodiment of the present disclosure;
[0086] Fig. 9 is a flow chart of a training method in an embodiment of the present disclosure;
[0087] Fig.10 is a schematic diagram of training an initial recognition neural network in an embodiment of the present disclosure;
[0088] Fig.11 is a schematic diagram of a camouflaged key generation network obtained in an embodiment of the present disclosure;
[0089] Fig.12 is a block diagram of a composition of an image processing device in an embodiment of the present disclosure;
[0090] Fig.13 It is a block diagram of a key generation device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0091] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0092] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0093] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0094] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0095] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0096] In a first aspect, the present disclosure provides an image processing method, referring to Figure 1 , the image processing method comprises:
[0097] In step S110, a second image is generated according to a neural network key and a first image, wherein the neural network key carries user demand information; the demand information represents the user's demand for image processing by identifying a neural network;
[0098] In step S120, the second image is input into the recognition neural network for processing;
[0099] In the case where the neural network key is a disguised key, obtaining a disguised result;
[0100] In the case where the neural network key is not a disguised key, a true result is obtained.
[0101] In the disclosed embodiment, the recognition neural network can process the encrypted image carrying the neural network key. The correct neural network key is generated by the encryption algorithm according to the user information, and the recognition neural network has a decryption algorithm corresponding to the encryption algorithm. The disguised key is a key maliciously fabricated by the attacker to imitate the encryption algorithm. The disguised result can make the attacker think that the attack is successful to a certain extent, thereby slowing down the attacker's attack, and helping to receive attack reminders and collect attack clues. Figure 2 FIG. 1 is a schematic diagram of processing an encrypted image by using a recognition neural network in an embodiment of the present disclosure. Figure 2 As shown, the neural network key and the image to be processed (first image) are superimposed to generate an encrypted image (second image) carrying the neural network key. The second image carrying the disguised key is input into the recognition neural network, and the recognition neural network outputs a disguised result; the encrypted image carrying the non-disguised key is input into the recognition neural network, and the recognition neural network outputs a true result. The true result includes a correct result and an incorrect result. Specifically, the second image carrying the correct neural network key is input into the recognition neural network, and the recognition neural network outputs a correct result; the first image without the upgraded network key is directly input into the recognition neural network, and the recognition neural network outputs an incorrect result.
[0102] In the image processing method provided by the embodiment of the present disclosure, the recognition neural network can process images encrypted with a neural network key. When the neural network key is a disguised key, a disguised result is obtained, which can make the attacker believe that the attack is successful to a certain extent, thereby slowing down the attacker's attack, helping to receive attack reminders and collect attack clues, thereby enhancing the system's ability to detect attacks and improving the security of neural network services.
[0103] In the disclosed embodiment, the neural network key non-disguised key includes that the neural network key carried by the second image is correct and the neural network key carried by the second image is wrong. The correct neural network key means that the neural network carried by the second image is generated by a correct encryption algorithm and carries the required information; the wrong neural network key includes that the second image does not carry the neural network key.
[0104] Correspondingly, when the second image carrying the correct neural network key is input into the recognition neural network, the recognition neural network can process according to the requirement information carried in the key and output the processing result corresponding to the requirement information (correct result); if the first image that does not carry the neural network key is input into the recognition neural network, the recognition neural network outputs a confusing processing result (wrong result).
[0105] In the disclosed embodiment, it also includes an erroneous key that is different from a disguised key, which is a key maliciously fabricated by an attacker imitating an encryption algorithm and is also different from a correct neural network key. In the disclosed embodiment, the recognition neural network can identify the erroneous key as a non-disguised key, or it can identify the erroneous key as a disguised key. The disclosed embodiment does not make special limitations on this.
[0106] As an optional implementation, the recognition neural network identifies the erroneous key as a non-disguised key, and the second image carries the erroneous key as a neural network key that is not a disguised key and the neural network key is wrong. The second image carrying the erroneous key is input into the recognition neural network, and the recognition neural network outputs a confusing processing result (erroneous result).
[0107] As another optional implementation, the recognition neural network identifies the erroneous key as a disguised key, inputs the second image carrying the erroneous key into the recognition neural network, and the recognition neural network outputs a disguised result.
[0108] The embodiments of the present disclosure do not specifically limit the demand information. For example, the demand information may include precision classification information, and the recognition neural network can determine the processing precision according to the precision classification information; the demand information may also include function differentiation information, and the recognition neural network can perform the processing of the corresponding function according to the function differentiation information; the demand information may also include permission level information.
[0109] In the disclosed embodiment, the user can customize the neural network key that carries the required information according to the demand, so that the neural network service corresponding to the required information can be obtained when using the identification neural network provided by the disclosed embodiment. The neural network key can be a fixed key obtained by the user when purchasing the neural network product. When using the neural network service, the user only needs to enter his neural network key. In the disclosed embodiment, there is no special limitation on the form of the neural network key. For example, the neural network key can be a pattern such as a QR code, or it can be a digital sequence.
[0110] The disclosed embodiment does not specifically limit how to execute step S110 to generate the second image. As an optional implementation, in step S110, the first image and the neural network key are input into the superimposer to generate the second image. Figure 3 As shown in (a), the neural network key can be superimposed on the first image in the form of an image block (Patch) to generate a second image.
[0111] Accordingly, in some embodiments, reference Figure 4 , step S110 includes:
[0112] In step S111, an image block is generated according to the neural network key, and the size of the image block is smaller than the size of the first image;
[0113] In step S112, the image block is superimposed on the target area in the first image to generate the second image.
[0114] The disclosed embodiment does not specifically limit the size of the image block generated in step S111. As an optional implementation, the size of the image block satisfies that after being superimposed on the first image, the second image has a similar visual effect to the first image, thereby facilitating verification of the processing result of the recognition neural network based on the second image.
[0115] In the disclosed embodiment, the target area in the first image is not particularly limited. For example, the target area can be any area in the first image, and the recognition neural network can recognize the neural network key from the second image; the target area can also be a predetermined area in the first image, and the recognition neural network can recognize the neural network key from the area corresponding to the predetermined area in the second image.
[0116] like Figure 3 As shown in (b), the neural network key can be superimposed on the first image in the form of a perturbation to generate a second image.
[0117] Accordingly, in some embodiments, reference Figure 5 , step S110 includes:
[0118] In step S113, a disturbance is generated according to the neural network key;
[0119] In step S114, the disturbance is superimposed on the first image to generate the second image.
[0120] It should be noted that, in the embodiment of the present disclosure, the second image generated by superimposing the disturbance on the first image has a viewing effect similar to that of the first image, which is conducive to verifying the processing result of the recognition neural network based on the second image.
[0121] The disclosed embodiment also provides a key elimination mechanism. The key elimination mechanism refers to making a specific neural network key invalid for the recognition neural network. After the neural network key is invalid, the image encrypted with the neural network key is input into the recognition neural network to obtain a chaotic processing result.
[0122] The key elimination mechanism can be used to limit the validity period or number of uses of the neural network key, and provide a way to implement differentiated charging based on the validity period or number of uses, so as to better meet the personalized needs of users.
[0123] Accordingly, in some embodiments, reference Figure 6 Before step S110, the image processing method further includes:
[0124] In step S130, determining whether the neural network key meets the expiration condition;
[0125] When the neural network key meets the expiration condition, in step S140, a plurality of inverse training sample images are generated according to the second image; the inverse training sample images carry the neural network key;
[0126] In step S150, the recognition neural network is de-trained according to a plurality of the de-training sample images, so that the neural network key is invalid for the recognition neural network;
[0127] When the neural network key does not meet the expiration condition, execute step S110.
[0128] It should be noted that the multiple inverse training sample images generated by step S140 are all encrypted images carrying a neural network key, and the neural network key carried by the inverse training sample image is the same as the neural network key carried by the second image. The disclosed embodiment does not specifically limit how to perform step S140 to generate multiple inverse training sample images. For example, data augmentation is performed based on the second image to generate multiple inverse training sample images.
[0129] The specific method of data enhancement is not particularly limited in the embodiments of the present disclosure. For example, at least one of the following data enhancement methods may be included: random rotation, randomly rotating the second image by an angle; random cropping, i.e. randomly cutting off a portion of the second image; color jittering, i.e. randomly jittering each channel to a certain degree in the color space (such as RGB); Gaussian noise, i.e. randomly adding a small amount of noise to the second image; horizontal flipping; and vertical flipping.
[0130] Figure 7 FIG. 1 is a schematic diagram of reverse training of a recognition neural network in an embodiment of the present disclosure. Figure 7 As shown, before the encrypted image (second image) carrying the neural network key is input into the recognition neural network, the key expiration determiner is used to determine whether the neural network key is invalid. If the neural network key is not invalid, the second image is input into the recognition neural network, and the number of times the neural network key is used in the key expiration determiner is updated. If the neural network key is invalid, multiple encrypted images (inverse training sample images) carrying the neural network key are generated through data enhancement, and the inverse training sample images are input into the recognition neural network. The first loss function value (Loss) is determined according to the processing result (inverse training output) obtained by the recognition neural network according to the inverse training sample and the chaotic processing result (random output) obtained by the recognition neural network according to the image carrying the wrong neural network key or the image without the neural network key. Back propagation is performed according to the first loss function value, and the parameters of the recognition neural network are updated to make the neural network key invalid for the recognition neural network. Figure 7 The dashed arrows in the middle represent the back-propagated gradients.
[0131] Accordingly, in some embodiments, the step of performing reverse training on the recognition neural network based on a plurality of the reverse training sample images includes: inputting the reverse training sample images into the recognition neural network to obtain a reverse training output; determining a first loss function value based on the reverse training output and a random output of the recognition neural network; and performing back propagation based on the first loss function value to update the parameters of the recognition neural network.
[0132] The embodiments of the present disclosure do not specifically limit the expiration conditions of the neural network key. For example, in the case where the neural network key has an effective period, the expiration condition is met when the effective period is exceeded; in the case where the neural network key has a limited number of uses, the expiration condition is met when the number of uses of the neural network key exceeds the limited number of uses.
[0133] In the disclosed embodiment, when determining whether a neural network key is invalid based on the number of times the neural network key is used, after the identification neural network is used, the number of times the neural network key has been used needs to be updated.
[0134] Accordingly, in some embodiments, the step of determining whether the neural network key satisfies an expiration condition includes: determining whether the number of times the neural network key is used is equal to a predetermined number of times; when the number of times the neural network key is used is equal to the predetermined number of times, determining that the neural network key is invalid.
[0135] Accordingly, in some embodiments, when the neural network key does not satisfy the expiration condition, after executing the step of inputting the second image into the recognition neural network for processing, the image processing method further includes: updating the number of times the neural network key is used.
[0136] In a second aspect, the present disclosure provides a key generation method, referring to Figure 8 , the key generation method comprises:
[0137] In step S200, a neural network key is generated offline according to the user information of the user, and the neural network key carries the user's demand information;
[0138] The demand information represents the user's demand for image processing by identifying a neural network; the neural network key is used to encrypt the first image to generate a second image.
[0139] In the disclosed embodiment, the key generator executes step S200 to generate a neural network key.
[0140] In the embodiment of the present disclosure, the neural network key is used to encrypt the image to be processed, and the recognition neural network provided by the embodiment of the present disclosure is capable of processing the image encrypted using the neural network key generated by step S200.
[0141] The embodiments of the present disclosure do not specifically limit the user information. For example, the user information may be user portrait data or demand description data describing user needs.
[0142] The disclosed embodiments do not specifically limit the demand information. For example, the demand information may include precision classification information, and the recognition neural network can determine the processing precision according to the precision classification information; the demand information may also include function differentiation information, and the recognition neural network can perform the processing of the corresponding function according to the function differentiation information; the demand information may also include permission level information, and can differentiate the permissions of users.
[0143] In the embodiment of the present disclosure, the user can customize the neural network key carrying the required information according to the needs, so that the neural network service corresponding to the required information can be obtained when using the identification neural network provided by the embodiment of the present disclosure.
[0144] In the disclosed embodiment, step S200 is a fully offline scenario, and the neural network key carrying the required information generated by step S200 is distributed to the user in an offline manner. In addition, the neural network key generated in step S200 in an offline manner can be used to train the recognition neural network to obtain a recognition neural network that can recognize the real key and the disguised key.
[0145] In the key generation method provided in the embodiment of the present disclosure, a neural network key carrying demand information can be generated offline and distributed to users offline, avoiding information leakage that may be caused by online generation and transmission of keys; embedding demand information in the neural network key enables the recognition neural network in the embodiment of the present disclosure to provide personalized services to users based on the demand information carried in the neural network key, and provides a way to implement differentiated charges based on different user needs.
[0146] In the embodiment of the present disclosure, a requirement vector is generated according to user information, the requirement vector carries the user's requirement information, and the requirement vector is used as an input of a key generator.
[0147] In the disclosed embodiment, the key generator may be a neural network, i.e., a key generation network. In the disclosed embodiment, the key generation network can generate a variety of neural network keys, and when the user requirements are the same, the key generation network can also generate a plurality of different keys, i.e., achieve key diversity. As an optional implementation, the input of the key generation network includes a random number in addition to the demand vector. For the same demand vector, different random numbers are input, and different neural network keys are generated.
[0148] Accordingly, in some embodiments, the step of generating a neural network key based on user information of a user includes: generating a demand vector based on the user information, the demand vector carrying the demand information; inputting a random number and the demand vector into a key generation network to generate the neural network key.
[0149] In the embodiment of the present disclosure, the random number may be manually input or automatically generated by the system, and the embodiment of the present disclosure does not specifically limit this.
[0150] The embodiment of the present disclosure does not specifically limit how to generate a demand vector according to user information. As an optional implementation, an embedding network is used to implement demand embedding and generate a demand vector.
[0151] Correspondingly, the step of generating a demand vector according to the user information includes: inputting the user information into an embedding network to generate the demand vector.
[0152] In the embodiment of the present disclosure, an embedding algorithm is used in the embedding network to implement demand embedding.
[0153] The embodiments of the present disclosure do not specifically limit the user information. For example, the user information may be user portrait data or demand description data describing user needs.
[0154] In the embodiment of the present disclosure, the demand information includes at least one of precision classification information, function distinction information, and authority level information.
[0155] It should be noted that in the embodiments of the present disclosure, the accuracy grading information describes the accuracy level customized by the user, for example, 80%, 60%, 50% and so on of the full processing accuracy; the function differentiation information describes the functions customized by the user, for example, image processing includes facial recognition, body posture recognition and so on; the authority level information describes the authority customized by the user.
[0156] Thirdly, refer to Fig. 9 , the present disclosure provides a training method, including:
[0157] Training step: In step S300, the initial recognition neural network is trained according to the first sample image, the first sample key, and the second sample key; the first sample key is a non-disguised key, and the second sample key is a disguised key;
[0158] When the training end condition is not met, return to the training step; when the training end condition is met, the initial recognition neural network is used as the recognition neural network.
[0159] In the disclosed embodiment, step S300 is iteratively executed until the initial recognition neural network meets the training end condition. The training end condition may be that the initial recognition neural network converges; or the number of iterations may be set. When the iterative execution of step S300 meets the set number of iterations, the iteration ends to obtain a trained recognition neural network. The disclosed embodiment does not specifically limit this.
[0160] It should be noted that, in the embodiment of the present disclosure, the first sample image is only used to distinguish between the image sample set for training the initial recognition neural network and the image sample set for separately training the initial camouflage key generation network, and is not used to specifically refer to a specific image; the first sample image in multiple training steps may be the same or different.
[0161] In the disclosed embodiment, the first sample key and the second sample key are not used to specifically refer to a specific key; the first sample key and the second sample key in multiple training steps may be the same or different.
[0162] Fig.10 FIG. 1 is a schematic diagram of training the initial recognition neural network in the embodiment of the present disclosure. Fig.10As shown, the training steps include: superimposing the first sample image and the first sample key by a superimposer to generate a second sample image carrying the first sample key; superimposing the first sample image and the second sample key by a superimposer to generate a third sample image carrying the second sample key; inputting the first sample image into the initial recognition neural network to obtain a first processing result, which is a chaotic processing result; inputting the second sample image into the initial recognition neural network to obtain a second processing result, which is a processing result corresponding to the demand information carried by the first sample key; inputting the third sample image into the initial recognition neural network to obtain a third processing result, which is a disguised result; determining a second loss function value based on the first processing result; determining a third loss function value based on the second processing result; determining a fourth loss function value based on the third processing result; performing back propagation based on the second loss function value, the third loss function value, and the fourth loss function value to update the parameters of the initial recognition neural network. Fig.10 The dotted arrows in the figure represent the corresponding back-propagation gradients. When the initial recognition neural network meets the training end condition, a trained recognition neural network is obtained; when the training end condition is not met, the training steps are iteratively performed.
[0163] In the embodiment of the present disclosure, the second sample key as the camouflage key may be generated by a camouflage key generation network, may be a random key, or may be a key generated by a key generation network of other tasks. The embodiment of the present disclosure does not specifically limit this.
[0164] Accordingly, before the step of training the initial recognition neural network according to the first sample image, the first sample key and the second sample key, the training method further comprises: inputting the first sample random number into the camouflage key generation network to generate the second sample key.
[0165] In the embodiment of the present disclosure, there is no special limitation on how to obtain the camouflage key generation network. As an optional implementation, the camouflage key generation network is obtained according to a generative adversarial network (GAN).
[0166] In the generative adversarial network, through the dynamic game process between the initial camouflage key generation network and the discriminant network, the initial camouflage key generation network can generate a camouflage key close to the correct neural network key, and the discriminator can distinguish between camouflage keys and non-camouflage keys. Finally, a "demand-independent" camouflage key generation network is obtained.
[0167] Fig.11 FIG. 1 is a schematic diagram of a camouflaged key generation network obtained in an embodiment of the present disclosure. Fig.11As shown, the steps of obtaining a camouflage key generation network according to a generative adversarial network include: inputting a second sample random number into an initial camouflage key generation network to generate a third sample key, where the third sample key is a camouflage key; performing discrimination through a discriminant network based on the third sample key and the fourth sample key, where the fourth sample key is a non-camouflage key; and performing back propagation based on the discrimination result to update the parameters of the initial camouflage key generation network and the parameters of the discriminant network. Fig.11 The dotted arrows in represent the corresponding gradients of back propagation. When the initial camouflage key meets the training end condition, the trained camouflage key generation network is obtained; when the end condition is not met, the training steps are iteratively performed. Fig.11 As shown, multiple key generation networks including key generation network 1, ..., key generation network n are used to generate sample key set 1, ..., sample key set n respectively, and sample key set 1, ..., sample key set n respectively include a large number of correct neural network keys; specifically, key generation network 1 generates a large number of correct neural network keys in sample key set 1 according to a large number of requirement vectors in requirement vector set 1 and a large number of random numbers in random number set 1, ..., key generation network n generates a large number of correct neural network keys in sample key set n according to a large number of requirement vectors in requirement vector set n and a large number of random numbers in random number set n, and key generation network 1, ..., key generation network n can be the same or different; the fourth sample key is selected from sample key set 1, ..., sample key set n.
[0168] Fourthly, refer to Fig.12 , the present disclosure provides an image processing device, including:
[0169] One or more processors 101;
[0170] A memory 102 storing one or more programs, which, when executed by one or more processors, enables the one or more processors to implement any one of the above-mentioned image processing methods;
[0171] One or more I / O interfaces 103 are connected between the processor and the memory and are configured to implement information exchange between the processor and the memory.
[0172] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU) and the like; the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus) and the like.
[0173] In some embodiments, the processor 101 , the memory 102 , and the I / O interface 103 are connected to each other via a bus 104 , and further connected to other components of the computing device.
[0174] Fifth, refer to Fig.13 , the present disclosure provides a key generation device, including:
[0175] One or more processors 201;
[0176] A memory 202 having one or more programs stored thereon, which, when executed by one or more processors, enables the one or more processors to implement any one of the above-mentioned key generation methods;
[0177] One or more I / O interfaces 203 are connected between the processor and the memory and are configured to implement information exchange between the processor and the memory.
[0178] Among them, the processor 201 is a device with data processing capabilities, including but not limited to a central processing unit (CPU) and the like; the memory 202 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 203 is connected between the processor 201 and the memory 202, and can realize information interaction between the processor 201 and the memory 202, including but not limited to a data bus (Bus) and the like.
[0179] In some embodiments, the processor 201 , the memory 202 , and the I / O interface 203 are connected to each other via a bus 204 , and further connected to other components of the computing device.
[0180] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processing core, implements the image processing method described in the first aspect of the embodiment of the present disclosure;
[0181] Or the key generation method described in the second aspect of the embodiment of the present disclosure;
[0182] Or the training method described in the third aspect of the embodiment of the present disclosure.
[0183] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0184] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. An image processing method, include: Generate a second image according to a neural network key and a first image, wherein the neural network key carries user demand information, and the neural network key is generated in an offline manner according to user information of the user; the demand information represents the user's demand for image processing by identifying a neural network; the demand information includes at least one of precision classification information, function distinction information, and authority level information; Inputting the second image into the recognition neural network for processing; In the case where the neural network key is a disguised key, obtaining a disguised result; In the case where the neural network key is not a disguised key, a true result is obtained; Among them, a key elimination mechanism is set corresponding to the neural network key, and the key elimination mechanism means that when the neural network key meets the expiration condition, the neural network key is invalid for the identification neural network.
2. The image processing method according to claim 1, in, The true result includes a correct result and an incorrect result; In the case where the neural network key is not a disguised key and the neural network key is correct, the correct result is obtained, and the correct result is a processing result corresponding to the requirement information; In the case where the neural network key is not a disguised key and the neural network key is wrong, the wrong result is obtained.
3. The image processing method according to claim 1, in, Before the step of inputting the second image into the recognition neural network for processing, the image processing method further includes: Determining whether the neural network key meets an expiration condition; When the neural network key meets the expiration condition, generating a plurality of reverse training sample images according to the second image; the reverse training sample images carry the neural network key; De-training the recognition neural network according to a plurality of the de-training sample images, so that the neural network key is invalid for the recognition neural network; When the neural network key does not satisfy the expiration condition, the step of inputting the second image into the recognition neural network for processing is executed.
4. The image processing method according to claim 3, in, The step of performing reverse training on the recognition neural network according to the plurality of reverse training sample images comprises: Inputting the reverse training sample image into the recognition neural network to obtain a reverse training output; Determining a first loss function value according to the reverse training output and the random output of the recognition neural network; Back propagation is performed according to the first loss function value to update the parameters of the recognition neural network.
5. The image processing method according to claim 3 or 4, in, The step of determining whether the neural network key meets the expiration condition comprises: Determining whether the number of times the neural network key is used is equal to a predetermined number of times; When the number of times the neural network key is used is equal to the predetermined number of times, the neural network key is determined to be invalid.
6. The image processing method according to claim 5, in, When the neural network key does not meet the expiration condition, after executing the step of inputting the second image into the recognition neural network for processing, the image processing method further includes: Update the usage count of the neural network key.
7. The image processing method according to any one of claims 1 to 4, in, The step of generating a second image based on the neural network key and the first image comprises: generating an image block according to the neural network key, wherein the size of the image block is smaller than the size of the first image; The image block is superimposed on a target area in the first image to generate the second image.
8. The image processing method according to any one of claims 1 to 4, in, The step of generating a second image based on the neural network key and the first image comprises: generating a perturbation according to the neural network key; The disturbance is superimposed on the first image to generate the second image.
9. A method for generating a key, include: Generate a neural network key in an offline manner according to the user information of the user, wherein the neural network key carries the user's demand information; The demand information represents the user's demand for image processing by identifying a neural network; the neural network key is used to encrypt the first image to generate a second image; the demand information includes at least one of accuracy classification information, function distinction information, and authority level information; The neural network key is correspondingly provided with a key elimination mechanism, and the key elimination mechanism indicates that when the neural network key meets the expiration condition, the neural network key is made invalid for the identification neural network; Among them, the step of generating a neural network key in an offline manner based on the user information of the user includes: generating a demand vector in an offline manner based on the user information, wherein the demand vector carries the demand information; inputting a random number and the demand vector into a key generation network to generate the neural network key.
10. The key generation method according to claim 9, in, The step of generating a demand vector in an offline manner according to the user information includes: The user information is input into the embedding network to generate the demand vector.
11. The key generation method according to any one of claims 9 to 10, in, The user information includes user portrait data and / or demand description data.
12. A training method, include: Training step: training the initial recognition neural network according to the first sample image, the first sample key, and the second sample key; The first sample key is a non-disguised key, and the second sample key is a disguised key; When the training end condition is not met, returning to the training step; when the training end condition is met, taking the initial recognition neural network as the recognition neural network; The recognition neural network is used to process a second image, and the second image is generated based on a neural network key and a first image, wherein a key elimination mechanism is provided corresponding to the neural network key, and the key elimination mechanism indicates that when the neural network key meets an expiration condition, the neural network key is invalid for the recognition neural network; the neural network key carries user demand information, and the neural network key is generated offline based on the user information of the user; the demand information includes at least one of precision classification information, function distinction information, and authority level information.
13. The training method according to claim 12, in, The step of training the initial recognition neural network according to the first sample image, the first sample key, and the second sample key comprises: generating a second sample image according to the first sample image and the first sample key; generating a third sample image according to the first sample image and the second sample key; Inputting the first sample image into the initial recognition neural network to obtain a first processing result; Inputting the second sample image into the initial recognition neural network to obtain a second processing result; Inputting the third sample image into the initial recognition neural network to obtain a third processing result; Determine a second loss function value according to the first processing result; Determine a third loss function value according to the second processing result; Determine a fourth loss function value according to the third processing result; Back propagation is performed according to the second loss function value, the third loss function value, and the fourth loss function value to update the parameters of the initial recognition neural network.
14. The training method according to claim 12 or 13, in, Before the step of training the initial recognition neural network according to the first sample image, the first sample key, and the second sample key, the training method further includes: The first sample random number is input into the camouflage key generation network to generate the second sample key.
15. The training method according to claim 14, in, Before the step of inputting a random number into a camouflage key generation network to generate the second sample key, the training method further includes: The camouflage key generation network is obtained according to the generation adversarial network.
16. The training method according to claim 15, in, The step of obtaining the camouflage key generation network according to the generative adversarial network comprises: Inputting the second sample random number into the initial camouflage key generation network to generate a third sample key, where the third sample key is the camouflage key; According to the third sample key and the fourth sample key, a discrimination network is used to discriminate; the fourth sample key is a non-disguised key; Back propagation is performed according to the discrimination result to update the parameters of the initial camouflage key generation network and the parameters of the discrimination network.
17. An image processing device, include: one or more processors; A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method according to any one of claims 1 to 8; One or more I / O interfaces are connected between the processor and the memory and are configured to implement information interaction between the processor and the memory.
18. A key generating device, include: one or more processors; A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the key generation method according to any one of claims 9 to 11; One or more I / O interfaces are connected between the processor and the memory and are configured to implement information interaction between the processor and the memory.
19. A computer readable medium having a computer program stored thereon, in, The computer program implements the image processing method according to any one of claims 1 to 8 when executed by the processing core; or the key generation method according to any one of claims 9 to 11; Or the training method described in any one of claims 12 to 16.
