Skip to main content
. 2022 May 4;22(9):3489. doi: 10.3390/s22093489
Algorithm 1: The embedded watermark model.

Input: The model F (the model level l(1,2,,L)), important parameters Θ^ of F, value of important parameters pθ, neuron number set N=[n1,n2,,nl], ratio of the number of layers to be embedded c, watermark information B, translation T, precision R, random matrix D, random value k, watermark m in a level.

Output: Watermarked model Fwatermark.

Step 1: For each level to calculate the unimportance L^pθ=11ni=1npθi

Step 2: Sort L^pθ, select the top c×L layers (a total number of L layers) in the order.

Step 3: Estimate the proportion of important parameters θ in these selected layers L^ by watermark information B; obtain wetindicate, which represents the wet-block position.

Step 4: Convert floating-point θ into a nonnegative integer b (watermark information B) through b=I(θ)=(θ+T)·10R. Then convert nonnegative integer b to floating-point θ through θ=I1(b)=b·10RT.

Step 5: Generate a random matrix D and a random value k and obtain H by D and k. Record these values.

Step 6:b is divided equally, [b1,b2,,bm] are denoted as m, X is obtained by wetindicate in F.

Step 7: Embed watermark m; after embedding m each time, b=bm. Repeat Steps 5–7 until b=0.