The invention relates to the field of computers, in particular to a method and device for extracting watermarks. A digital
watermark is embedded in a three-dimensional model, the risk that the three-dimensional model is illegally used can be reduced, however, the three-dimensional model is likely to be converted into two-dimensional data, an
attack simulated by a neural network in the training process is generally an
attack aiming at the three-dimensional model, and when the three-dimensional model is converted into the two-dimensional data, the form of the
watermark is difficult to predict; effective watermarks are difficult to extract from two-dimensional data based on the neural network trained by the
attack network. In the application, after the electronic device obtains the target file, the corresponding decoder in the neural network is used to extract the
watermark based on the type of the target file, for example, the three-dimensional model decoder is used to process the three-dimensional model file, and the two-dimensional data decoder is used to process the two-dimensional
data file, so that damage to the watermark caused by an attack means can be eliminated in a targeted manner, and the watermarking efficiency is improved. And the success rate of extracting the watermark from the attacked three-dimensional model is improved.