Digital watermarking process for a neural network, corresponding device and computer program
The method enhances neural network protection by iteratively updating parameter blocks with a steganographic watermark using an exclusive OR operation, ensuring robustness against modifications and maintaining network performance, thus preventing unauthorized use and cyberattacks.
Patent Information
- Application Number
- FR2023003040
- Authority / Receiving Office
- FR · FR
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2024-10-04
- Estimated Expiration
- 2043-03-29
AI Technical Summary
Existing digital watermarking techniques for neural networks, particularly white box techniques, are vulnerable to modifications and lack robustness, especially in embedded devices, leading to unauthorized use and cyberattacks.
A method for digital watermarking neural networks that involves iteratively updating specific bits of parameter blocks within the network using an exclusive OR operation with a random vector, incorporating a message as a steganographic watermark, which is encrypted and redundant, ensuring minimal performance impact and resistance to attacks.
The method effectively identifies the origin of neural networks, even after modifications, by maintaining functional qualities and providing robust protection against unauthorized use and cyberattacks.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Title of the invention: Method for digitally tattooing a neural network, device and corresponding computer program
[0001] The present invention relates to the field of neural network protection. More particularly, the invention relates to the protection of the resulting training data, called parameters, which are used for the inference of a neural network.
[0002] Neural networks are increasingly being deployed and commercialized in a wide variety of real-world scenarios due to their performance, particularly in classification and prediction tasks. Training a deep neural network is a very expensive process that requires (i) the availability of massive amounts of data, often proprietary, capturing different scenarios within a target application; (ii) significant computing resources; and (iii) the assistance of deep learning experts to carefully adjust the network topology (e.g., the type and number of hidden layers) and properly define training hyperparameters, such as the learning rate, batch size, etc. Therefore, high-performing neural networks require substantial investment and must be protected accordingly.This is particularly important when the neural network is implemented within embedded equipment: this can be used to retrieve the neural network and use it in other contexts or other equipment.
[0003] To protect neural networks, digital watermarking techniques are known. With these techniques, the trained neural network (which takes the form of a data structure comprising a set of parameters) is marked (watermarked). A reading process is then used to discover the watermark(s) embedded within the data structure. Two main types of watermarking techniques for neural networks are known: so-called "black box" techniques and so-called "white box" techniques.
[0004] White-box techniques essentially consist of inserting one or more digital tattoos within the network itself, that is, within its internal parameters (for example, after training). The internal parameters that are tattooed can correspond directly to the model weights, biases, or the activation of neurons in response to specific inputs. In the case of white-box tattooing, the tattoo decoder extracts the digital tattoo(s) from the neural network parameters. This can involve extracting a message inserted within the network or detecting of a tattoo.
[0005] Black-box techniques essentially consist of inserting one or more digital watermarks, which are revealed when a specific question is posed to the neural network. This insertion can be performed during the network's training. Thus, to identify the presence of a digital watermark, in black-box mode, only the final output of the neural network is readable. In other words, the watermark is retrieved by querying the model (with a specific query, based on a set of correctly chosen inputs, for example, images or predefined text) and checking the neural network's output. Throughout the entire decoding or detection process, the architecture and internal parameters of the neural network are completely hidden from the decoder or detector.In other words, the only elements that can be controlled are the inputs used to query the network and the outputs corresponding to the queries correlative to the requests.
[0006] These two types of techniques (white box, black box) can be used for the same neural network.
[0007] These techniques, however, suffer from problems related to the removal of "tattoos," particularly when the neural network is modified (for example, by relearning, pruning, quantization, etc.). Indeed, white-box techniques, in particular, which modify the internal parameters of the neural network, are sensitive to modifications made to these parameters (changes in the neural network format, changes in the operator, deletion of layers, changes in input layers, changes in output classes, etc.) by attackers seeking to illegally appropriate the network. This lack of robustness is particularly noticeable for neural networks running on embedded devices.
[0008] One objective of the invention is to provide a white-box digital watermarking technique for neural networks that addresses the problems posed by prior techniques, particularly the robustness issue. Another objective is to maintain the functional qualities of the neural network (accuracy, false positives, r², etc.).
[0009] To this end, the invention relates to a method for digitally watermarking a neural network, implemented by an electronic device, said neural network being stored within a data structure comprising parameter blocks. Such a method comprises, for a typical parameter block comprising at least N parameters representing real numbers: a step of obtaining a message comprising N bits; at least N iterations of a parameter modification step within the current block, comprising: - obtaining a current parameter, among the said at least N parameters of the current parameter block; - updating the value of a predetermined index bit of the current parameter based on a bit of the message.
[0010] Thus, the proposed method allows the message to be steganographed. This steganography is simple and efficient since each parameter undergoes a minimal transformation based on a corresponding bit of the message. This modification therefore has little impact on the subsequent performance of the neural network. Furthermore, this steganography is quick to implement and does not require energy-intensive calculations, unlike methods used in the prior art for training neural network parameters. Therefore, the claimed process makes it possible to identify the origin of a neural network, for example, when it is used in unauthorized devices or during cyberattack analysis.
[0011] According to a particular feature, the step of updating the value of a predetermined index bit of the current parameter as a function of a bit of the message includes a step of calculating an exclusive OR operation between a bit of a random vector of size N and the corresponding bit of the message.
[0012] Thus, the original bit of predetermined index is erased in favor of a bit resulting from the exclusive or operation between the message and a random vector of the same size as the message is presented in the form of an encrypted codeword.
[0013] According to a particular feature, the message retrieval step includes: - a step of obtaining a reference string of characters; - a step of calculating a cyclic redundancy check code as a function of the reference character string, the cyclic check code being concatenated to the reference character string to form a code word; - a step of encrypting the codeword, delivering an encrypted codeword.
[0014] According to a particular feature, the message retrieval step further comprises at least one iteration of a step of copying the encrypted codeword into a string of characters to obtain the message of length N bits.
[0015] Thus, the redundancy of a basic message is defined as a function of the block size. The message size in bits is a multiple of the size of a single message. This results in vertical redundancy of the watermark.
[0016] According to a particular feature, the message acquisition step includes: - a random selection step, within the current block, of a predetermined number K of most significant bits within a predetermined number of parameters of the current block delivering a characteristic binary image; - a first step of combining the characteristic binary image with a reference image, delivering a merged image; - a second step of combining the merged image with a binary image randomly obtained on the basis of a random draw of K bits, this second combination step delivering the message.
[0017] Thus, the watermark takes into account the content of the current block to insert a reference image to be watermarked. It is therefore much simpler, subsequently, to visually verify the presence of the digital watermark inserted within the current block. The probative value of the watermark is thus increased.
[0018] According to a particular feature, the first and second combination steps each implement an exclusive or operation.
[0019] In another aspect, the invention also relates to an electronic device for digitally watermarking a neural network, said neural network being stored within a data structure comprising parameter blocks. Such a device comprises, for a typical parameter block comprising at least N parameters representing real numbers: - means of obtaining a message comprising N bits; - means of implementing at least N iterations of modification of pa Ramers within the current block, comprising: - obtaining a current parameter, among the said at least N parameters of the current parameter block; - updating the value of a predetermined index bit of the current parameter based on a bit of the message.
[0020] According to a preferred implementation, the various steps of the processes described are implemented by one or more software programs or computer programs, comprising software instructions intended to be executed by a data processor of a relay module as disclosed and designed to control the execution of the various steps of the processes. Consequently, the disclosure also covers a program, capable of being executed by a computer or by a data processor, this program comprising instructions to control the execution of the steps of the processes as mentioned herein, when executed by a terminal and / or by an integrated circuit. This program may use any programming language and may be in the form of source code, object code, or code intermediate between source and object code, such as in a partially compiled form, or in any other desirable form.The disclosure also covers a data processor-readable information medium containing instructions from a program as described above. The information medium can be any entity or device capable of storing the data. program. For example, the medium may include a storage medium, such as a ROM, for example a CD-ROM or a microelectronic circuit ROM, or a magnetic recording medium, for example a hard drive, flash memory, or another type of storage memory. Alternatively, the information medium may be a transmissible medium such as an electrical or optical signal, which may be transmitted via an electrical or optical cable, by radio, or by other means. The program according to the disclosure may, in particular, be uploaded to a network such as the Internet. Alternatively, the information medium may be an integrated circuit in which the program is incorporated, the circuit being adapted to execute or to be used in the execution of the process in question. In one embodiment, the disclosure is implemented by means of software and / or hardware components.In this context, the term "module" can refer to a software component, a hardware component, or a set of hardware and software components. A software component corresponds to one or more computer programs, one or more subroutines of a program, or more generally, any element of a program or software capable of implementing a function or set of functions, as described below for the module in question. Such a software component is executed by a data processor of a physical entity (terminal, server, gateway, router, etc.) and is capable of accessing the hardware resources of that physical entity (memory, storage media, communication buses, input / output cards, user interfaces, etc.).Similarly, a hardware component corresponds to any element of a hardware assembly capable of implementing a function or set of functions, as described below for the module in question. This could be a programmable hardware component or one with an integrated processor for software execution, for example, an integrated circuit, a smart card, a memory card, an electronic board for running firmware, etc. Each component of the assembly described above naturally implements its own software modules. The various embodiments and characteristics mentioned can be combined for the implementation of the disclosure.
[0021] The invention also relates to a neural network, recorded within a data structure and saved on a computer-readable medium comprising parameter blocks, the neural network being tattooed by a digital tattooing process as defined above.
[0022] Other features and advantages of the invention will become apparent from the description given below, by way of example and not limitation, with reference to the accompanying figures, among which: - [Fig.l] illustrates a digital tattooing device according to an example of implementation; - [Fig. 2] illustrates a digital watermarking process for a neural network in an example of implementation; - [Fig.3] illustrates a first example of the implementation of the tattooing process digital representation of a neural network; - [Fig. 4] illustrates a second example of the implementation of the process of digital tattooing of a neural network. Reminder of the principle
[0023] As explained previously, one object of the invention is to provide a white-box digital watermarking technique that offers increased resistance to attacks that a neural network may be subjected to, particularly in an embedded implementation context. Another object of the present invention is thus to enable more effective identification of a neural network that has been extracted from an embedded device, then modified and reinserted into another embedded device, by an attacker who wishes to misuse a neural network not belonging to them, modify a neural network to skew its results (for example, to carry out a cyberattack), or even save money by appropriating the research and development work carried out by a competitor.
[0024] The general principle of the invention consists of inserting, within at least one parameter block of the (previously trained) neural network, a watermark (in the form of a message) into selected bits of the parameters (numerical values) stored in the parameter block. The invention thus relates to a method for digitally watermarking a (previously trained) neural network comprising a set of parameter blocks, the parameter blocks comprising parameters of the neural network. These parameters are, for example, parameters that have been trained, such as layer weights, biases, tensor values, normalization values, convolution values, etc. Thus, at least some of the parameter blocks each comprise a set of parameters, the number of which varies depending on the block in question.In one embodiment, the parameter blocks comprise floating-point values of a predetermined number of bits (e.g., 8, 16, 32, or 64 bits). In other words, each of these floating-point values is stored, for example, in one, two, four, or eight bytes (for a given block, the parameter encoding is identical). The digital watermarking method of the invention is performed on these parameter blocks to insert a secret message (the watermarked message) within them, which can take the form of a repetition of a basic message. The method is, for example, implemented on a neural network stored in onnx format. which has the advantage of having numerous access and modification APIs, regardless of the programming languages used.
[0025] Figure 1 schematically illustrates an electronic digital watermarking device. The electronic digital watermarking device 2 comprises a module for obtaining a message to be watermarked (Msg); a module for modifying parameters within the parameter blocks constituting the neural network as shown in Figure 1.
[0026] In the example of [Fig. 1], the digital watermarking device 2 comprises an electronic memory unit 16, at least one processing unit 18, and a communication interface 60 with remote devices, via a chosen communication protocol, for example, a wired protocol and / or a radio communication protocol. The elements of the device 2 are adapted to communicate via a communication bus 15.
[0027] In the example of [Fig. 1], the module for obtaining a message to be watermarked (Msg) (20) and the module for modifying parameters within the parameter blocks constituting the neural network are each implemented as a software program, or a software component, executable by the processor. The memory of the digital watermarking device 2 is thus capable of storing a software program for obtaining a message to be watermarked (Msg) and a software program for modifying parameters within the parameter blocks constituting the neural network. The processor is then capable of executing each of the software programs: the software for obtaining a message to be watermarked (Msg) and the software for modifying parameters within the parameter blocks constituting the neural network.
[0028] In an unrepresented variant, the module for obtaining a message to be tattooed (Msg), and the module for modifying parameters within the parameter blocks constituting the neural network, are each implemented as a programmable logic component, such as an FPGA (Field Programmable Gate Array), or an integrated circuit, such as an ASIC (Application Specified Integrated Circuit).
[0029] When the electronic digital watermarking device 2 is implemented in the form of one or more software programs, i.e., in the form of a computer program, also called a computer program product, it is further capable of being stored on a computer-readable medium, not shown. The computer-readable medium is, for example, a medium capable of storing electronic instructions and being connected to a bus of a computer system. By way of example, the readable medium is an optical disc, a magneto-optical disc, ROM, RAM, any type of non-volatile memory (e.g., FLASH or NVRAM), or a magnetic card. A computer program is then stored on the readable medium. including software instructions.
[0030] In relation to [Fig.2], the digital watermarking method of a neural network of the invention is implemented on a neural network which is recorded within a data structure comprising parameter blocks (Blck), the method comprising, for a current parameter block (which includes for example at least N parameters (p0, ..., Px i) representing real numbers, and it includes: - A step of obtaining (10) the message Msg comprising N bits (b0, ..., bN4); - At least N iterations of a parameter modification step (20) within of the current parameter block, including: - Obtaining a current parameter (px), among said at least N parameters (p0, ..., Pni) of the current parameter block; - Updating the value of a bit (biPx) of predetermined index of the current parameter (px) as a function of a bit (b0, ..., bN4) of the message Msg.
[0031] When the number of parameters stored in the block exceeds the bit length of the message to be inserted, the update step is iterated starting from the first bit of the message to be inserted. Alternatively, the message Msg to be watermarked already contains several (an integer greater than two) occurrences of a reference message (base message). The watermarking is performed in such a way that an integer number of copies of the base message are watermarked (there is no partial watermarking of the base message). This results in redundancy in the insertion of the message (into the watermark) within the neural network, as explained in detail later.
[0032] The message to be watermarked within the parameter bits (real values) can take several forms. In a first example, the message can be in the form of an encrypted string (or a repetition of an encrypted string). In a second example, the message to be watermarked can be in the form of an image. In a third example, the message to be watermarked can be in the form of a signature.
[0033] In the case of the first example, the string can be constructed as follows: a reference string is determined (for example, a string defining a copyright, such as "TheCompanyl©"). This string can have a predetermined length (for example, six, twelve, eighteen, or twenty-four characters). From this reference string, an error detection code (CRC, for "cyclic redundancy check") is calculated. This error detection code is concatenated with the reference string to form a codeword. This codeword also has a predetermined size. The codeword is then encrypted (for example, with a stream cipher algorithm in which the size of the encrypted message is identical to the size of the original message, thus facilitating the processing performed for (the insertion or retrieval of messages). The encrypted codeword is then encoded, for example by a reversible pseudo-random transformation, and the encrypted and encoded codeword constitutes the message to be inserted into the parameter blocks of the neural network. The encrypted and encoded codeword is also of predetermined size (for example, sixty-four, one hundred and twenty-eight, or two hundred and fifty-six bits). The size of the encrypted codeword is initially chosen according to the specific circumstances and, in particular, according to the size of the blocks (for example, according to the number of parameters contained in the parameter blocks), so as to allow the complete insertion of at least one instance of the message into the blocks of real values, and thus obtain at least one complete inscription of the message in a block.
[0034] In the case of the second example, the image to be inserted as a message can be selected so as to visually reproduce a marker of belonging to an entity (for example, the image could be a company logo). The image is selected so that its size in bits is compatible with at least some of the parameter blocks (i.e., so that it can be inserted within a parameter block). As in the case of the character string, it is also possible to calculate an error-correcting code and / or encrypt (the resulting codeword or directly the image) and / or transform the image, the codeword, or the encrypted codeword as in the first example.
[0035] In the case of the third example, the signature can be inserted based on the content of the network itself. This third possibility is detailed below. First example of achievement
[0036] In relation to [Fig.3], this first example of an embodiment shows how the message is tattooed within a current parameter block of the neural network, comprising M different parameters, recorded as real numbers.
[0037] This method comprises: - A step A10 of obtaining a message Msg in the form of a sequence of bits of predetermined length N; - A selection step A20, within the current parameter block Dblck, of a set of N bits (SBts), each bit of the set SBts belonging to a different parameter of the current parameter block Dblck; - A modification step A30 of each bit of the set SBts using a corresponding bit of the message Msg, delivering a set of modified bits (USbts); - A rewrite step A40 of each modified bit of the USBts set to its original location within the current DBlck parameter block.
[0038] In other words, and more concisely, the proposed method consists of writing the message of predetermined length vertically into the selected bits (for example in one or more columns of least significant bits).
[0039] Thus, the digital watermark inserted in the parameter block is invisible. Indeed, since the modification of the original bits is carried out by performing a specific operation on these original bits using the corresponding bits of the message to be watermarked, an attacker cannot determine the presence of the watermark, unless they know the message that has been inserted and perform the decoding operation allowing them to identify the original bits (before insertion of the watermark).
[0040] The described procedure can be implemented iteratively on all or part of the parameter blocks of the neural network. Preferably, this procedure is implemented in a majority of the parameter blocks of the neural network. Thus, the digital watermarking is redundant. Even more preferably, this procedure is implemented on all parameter blocks in which this watermark insertion is possible or desirable. Thus, the watermarking is even more resistant to attacks.
[0041] According to the present embodiment, the bit modification step of the bit set comprises an exclusive OR (XOR) operation between a set of N randomly obtained bits and each corresponding bit of the message Msg. This set of N bits is randomly obtained from a reference seed that is retained to perform the decoding of the watermark. This XOR operation performed on the message Msg makes it randomly noisy, preventing an attacker from guessing the presence of the digital watermark within the block parameters. This noise-making operation can be performed using other means or other operations (for example, one could directly use the network bits instead of generating a random number of bits, or one could use an operation other than XOR).
[0042] As previously stated, for a current block, the message can be tattooed several times, for example in different bit columns.
[0043] The decoding method implemented is as follows: For a current parameter block of a neural network suspected of belonging to a rights holder, the N bits that were supposedly watermarked during a procedure identical or similar to that described above are extracted (the bits located at a given index of the parameters in the current parameter block). For example, using the reference seed used during encoding, the set of N bits randomly obtained during encoding is retrieved. Using this set of N bits and the N bits of the current block, an exclusive OR operation is performed, which delivers a set of N "denoised" bits (if this is the operation that was performed in the previous step). (encoding). The set of N denoised bits includes at least one repetition of a basic message that has been encoded (repetitions that are all potentially altered by modifications made after the theft of the neural network from the rights holder). For a block, the number of repetitions varies depending on the block size and the size of the basic message. An error correction operation can be performed on these denoised bits (for example, majority logic decoding is performed – a method for decoding repetition codes, based on the assumption that the highest number of occurrences of a symbol is the transmitted symbol). Then, the codeword is checked to determine if there is one or more repetitions of this encrypted codeword: the inverse operation is performed, namely, decryption of the codeword, and the CRC is checked against the initial secret message.
[0044] The presence of a single correct codeword, which therefore includes the secret message and the CRC code corresponding to that message, is sufficient to determine that the current block is part of a neural network belonging to the right holder. Second example of implementation
[0045] In a second embodiment, the marking methodology is substantially identical to that implemented in the first embodiment. It consists of tattooing, within a current block, bits, for example, least significant bits, of parameters comprising real values (for example, coded on sixteen, thirty-two, or sixty-four bits) contained within that block. The principle of tattooing columns of bits is also retained. However, the nature of the tattoo is altered by the use of a signature instead of the coded message as described above. According to this embodiment, this signature is obtained from the most significant bits of the current parameter block of the neural network. The principle implemented is to tattoo a visual signature so that the presence of the digital tattoo is easily identifiable. This tattoo is visible with or without any error correction.
[0046] In relation to [Fig. 4], this second embodiment shows how the message to be tattooed is formed. The method used is as follows: - In the current block (DBlck), a predetermined number of most significant bits are obtained (B00) from a random selection of parameters; this selection is carried out for example using a selection seed (seedO) which is kept; the selected most significant bits are arranged so as to form an IBPF binary image of predetermined size (in length and width);
[0047] Depending on the desired image size, for each parameter (randomly (selected) of the current block, it is possible to select one or more most significant bits (for example, four most significant bits, for example at indices 26 to 23, can be selected for each parameter). This is a purely illustrative example. - The IBPF binary image is combined (B 20) with an IBR reference binary image, which acts as a secret message; the sizes of the IBPF and IBR binary images are identical; This combination delivers a signed reference binary image (IBRs): it is signed by the most significant bits selected in the block; - A random binary image (IBA) is generated (B40), this generation is carried out for example using a generation seed (seedl) which is kept to perform a decoding; - The signed IBRs reference binary image is combined (B60) with the random binary image (IBA) to form a noisy binary image (IBB);
[0048] The noisy binary image (IBB) is inserted (B80) into the least significant bits of the current block parameters, replacing the existing bits. Depending on the size of the image, for each parameter of the current block, it is possible to overwrite (replace) one or more least significant bits (for example, four least significant bits, for example at indices 10 to 7, can be replaced for each parameter of the random parameter selection in step B00).
[0049] Thus, thanks to this implementation, a signature has been tattooed within a portion of the current block, in the form of a binary image. During the decoding operation, it is therefore possible to visually detect the presence of this tattooed binary image. For the purposes of this document, it is worth recalling that a binary image (whether reference, characteristic, signature, etc.) is a two-color matrix image (for example, black and white). It is, for example, encoded in binary form (base 2), or encoded in a more complex form with only two possible colors.
[0050] The decoding method implemented is as follows: For a current parameter block of a neural network, suspected of belonging to a rights holder, the least significant bits that were supposedly watermarked during a procedure identical or similar to that described above are extracted, yielding a binary image of the least significant bits (IBbpf). The most significant bits of the same parameters are also extracted, yielding a binary image of the least significant bits (IBbpFo). These extractions are made possible by using the selection seed (seedO) and the bit indices that were determined during encoding (and retained for subsequent decoding). These two binary images are combined to provide an intermediate binary image (IBI). The random binary image (IBA) (used during encoding) is generated; this generation is performed by An example using the generation seed (seedl) which has been retained to perform decoding. The intermediate binary image (IBI) is combined with the random binary image (IBA) to form a binary image to be interpreted (IBIn).
[0051] The advantage of this technique is that the binary image to be interpreted (IBIn) is a more or less degraded version of the reference IBR binary image used during encoding. Indeed, since the combination operations performed on the images are identical, it is easy to display the resulting image from these bit combination operations. The differences that appear between the reference IBR binary image (undegraded) and the binary to be interpreted (IBIn) result from the modifications made to the parameter block by the malicious actor: the relearning, pruning, etc., which led to more or less significant modifications of the least significant bits of the parameters in the current block, do not completely alter the image, and it remains interpretable and viewable.
[0052] Majority error correction can also be performed on the blocks concerned, in order to recover a more readable version of the image (for example, when several blocks are watermarked with the same image). It is thus possible to detect the presence of the watermarked image in several blocks, even if the neural network parameters are modified.
[0053] Selection of an optimal insertion configuration
[0054] In a complementary embodiment, the digital watermarking process described above can be implemented in an optimized manner by selecting, within the parameter blocks, the bit index(es) into which the message is inserted based on a performance and / or robustness threshold for the neural network. More specifically, in this embodiment, the original neural network (i.e., before the digital watermark is inserted) constitutes the reference in terms of performance and / or robustness. The process of the invention is implemented iteratively on the reference neural network to deliver at least one modified network, that is, a watermarked network. The performance and / or robustness of the modified network is evaluated against the performance and / or robustness delivered by the reference network. When the performance and / or robustness of the modified network falls below a reference threshold, the watermark is discarded. differentiated selection of parameter blocks
[0055] According to the invention, the parameter blocks in which the message is inserted are selected according to particular selection criteria.
[0056] Thus, when a parameter block is small (when the number of parameter values in the parameter block is less than a predetermined threshold), this parameter block is not watermarked. This exclusion prevents parameter blocks from being partially watermarked, making them subsequently unreadable.
[0057] Alternatively, or in addition, when a parameter block is small, the message to be inserted into that parameter block may be different. In this case, for example, a specific (reduced) message for small parameter blocks may be constructed to allow the insertion of a watermark. This method can be implemented, for example, when the number of numeric values in a parameter block is less than the length (in bits) of the "regular" message. For example, if the regular message is one hundred and twenty-eight bits long and the parameter block contains one hundred values, a reduced message of sixty-four bits can be used to watermark that block.
[0058] According to another aspect, when a parameter block contains a majority of identical values (for example, only or mostly zeros or ones), the parameter block can be excluded from the digital watermark. This exclusion prevents an attacker from learning the inserted digital watermark or part of it. Indeed, as explained previously, one advantage of the technique of the invention is that it allows the watermark to remain "secret," insofar as it has little or no impact on the performance and / or robustness of the network. Exclusions of blocks containing predominantly identical values prevent the attacker from learning this watermark based on an assumption about these values (the attacker's prior knowledge of these values). Additional marking of document fields
[0059] According to an additional feature, the watermarking process further includes a step of marking documentary fields. Depending on the format used to save the neural network resulting from the training, documentary fields are indeed present. For example, the onnx format contains documentary fields that can be marked. The following fields, for example, can be modified with a secret string:
[0060] model.producer_name
[0061] model.producer_version
[0062] model.doc_string
[0063] model.graph.doc_string
[0064] This secret string can be identical to the message inserted in the parameter blocks. Preferably, however, this string will be different to keep the content of the message or messages inserted in the parameter blocks secret. The advantage of this additional marking is that it does not require modifying the values stored in the neural network. It therefore has no impact on the performance of the neural network. As with the message inserted in the block values, this marking can include a predetermined number of characters. characters, from which an error-correcting code is calculated, the resulting codeword being encrypted and encoded in base64 for example.
[0065] Additional features relating to the neural network
[0066] The neural network comprises an ordered succession of layers of neurons, each of which takes its inputs from the outputs of the previous layer.
[0067] More precisely, each layer comprises neurons taking their inputs from the outputs of the neurons of the previous layer, or from the input variables for the first layer.
[0068] Alternatively, more complex neural network structures can be envisaged with a layer that can be linked to a layer further away than the immediately preceding layer.
[0069] Each neuron is also associated with an operation, that is to say a type of processing, to be carried out by said neuron within the corresponding processing layer.
[0070] Each layer is connected to the other layers by a plurality of synapses. A synaptic weight is associated with each synapse, and each synapse forms a link between two neurons. It is often a real number, which takes on both positive and negative values. In some cases, the synaptic weight is a complex number.
[0071] Each neuron is designed to perform a weighted sum of the value(s) received from the neurons of the preceding layer, each value being multiplied by the respective synaptic weight of each synapse, or connection, between said neuron and the neurons of the preceding layer, and then to apply an activation function, typically a non-linear function, to said weighted sum, and to deliver at the output of said neuron, in particular to the neurons of the next layer connected to it, the value resulting from the application of the activation function. The activation function introduces non-linearity into the processing performed by each neuron. The sigmoid function, the hyperbolic tangent function, and the Heaviside function are examples of activation functions.
[0072] As an optional complement, each neuron is also capable of applying, in addition, a multiplicative factor, also called bias, to the output of the activation function, and the value delivered at the output of said neuron is then the product of the bias value and the value from the activation function.
[0073] A convolutional neural network is also sometimes called a convolutional neural network or by the acronym CNN, which refers to the English term "Convolutional Neural Networks".
[0074] In a convolutional neural network, each neuron in the same layer has exactly the same connection pattern as its neighboring neurons, but at different input positions. The connection pattern is called the convolution kernel or, more often, "kernel" in reference to the corresponding English term.
[0075] A fully connected layer of neurons is a layer in which the neurons of said layer are each connected to all the neurons of the preceding layer.
[0076] Such a type of layer is more often referred to by the English term "fully connected", and sometimes designated by the name "dense layer".
[0077] These types of neural networks are encoded in generic formats such as onnx. This disclosure applies to any type of common neural network topology supported by this generic format, for example, "fully connected", CNN, but also RNN, "Attention layer", ... which is representable by one or more parameter blocks comprising values as described above.
Claims
Claims
1. Method for digitally watermarking a neural network, method implemented by an electronic device, said neural network being recorded within a data structure comprising parameter blocks, the method comprising, for a current parameter block comprising at least N parameters (p0, ..., pN i) representing real numbers: - a step of obtaining (10) a message (Msg) comprising N bits (b0, ..., bN_i); - at least N iterations of a step of modifying (20) parameters within the current block, comprising: - obtaining a current parameter (px), among said at least N parameters (p0, ..., pN [) of the current parameter block; - updating the value of a bit (biPx) of predetermined index of the current parameter (px) as a function of a bit (b0, ..., bN 4) of the message (Msg).
2. Digital watermarking method according to claim 1, characterized in that the step of updating the value of a bit (biPx) of predetermined index of the current parameter (px) as a function of a bit (b0, ..., bN4) of the message (Msg) comprises a step of calculating an exclusive or operation between a bit (biR) of a random vector (RbV) of size N and the corresponding bit (biM) of the message (Msg).
3. Digital tattooing method according to claim 1, characterized in that the message (Msg) is in the form of an encrypted code word.
4. Digital watermarking method according to claim 1, characterized in that the step of obtaining (10) the message (Msg) comprises: - a step of obtaining a reference character string; - a step of calculating a cyclic redundancy check code as a function of the reference character string, the cyclic check code being concatenated to the reference character string to form a code word; - a step of encrypting the code word delivering an encrypted code word.
5. Digital watermarking method according to claim 1, characterized in that the step of obtaining (10) the message (Msg) further comprises at least one iteration of a step of copying the encrypted code word within a character string to obtain the message (Msg) of length N bits.
6. Digital watermarking method according to claim 1, characterized in that the step of obtaining (10) the message (Msg) comprises: - a step of randomly selecting, within the current block, a predetermined number K of high-weight bits within a predetermined number of parameters of the current block delivering a characteristic binary image; - a first step of combining the characteristic binary image with a reference image (IR), delivering a merged image; - a second step of combining the merged image with a binary image randomly obtained on the basis of a random drawing of K bits, this second combination step delivering the message (Msg).
7. Digital watermarking method according to claim 6, characterized in that the first and second combination steps each implement an exclusive or operation.
8. Electronic device for digital watermarking of a neural network, said neural network being recorded within a data structure comprising parameter blocks, the device comprising, for a current parameter block comprising at least N parameters (po, ..., pN i) representing real numbers: - means for obtaining (10) a message (Msg) comprising N bits (b0, ..., bN_i); - means for implementing at least N modification iterations (20) of parameters within the current block, comprising: - obtaining a current parameter (px), from among said at least N parameters (p0, ..., pN [) of the current parameter block; - updating the value of a bit (biPx) of predetermined index of the current parameter (px) as a function of a bit (b0, ..., bN J of the message (Msg).
9. A computer program comprising software instructions which, when executed by a programmable electronic device, implement a digital watermarking method according to claims 1 to 7.
10. Neural network, recorded within a data structure and saved on a computer-readable medium comprising parameter blocks, the neural network being characterized in that it is watermarked by a digital watermarking method according to claims 1 to 7.
Citation Information
Patent Citations
Systems and methods for watermarking software and other media
US8892893B2
Method of verification for machine learning models
WO2023041212A1
