Body: <p>Suppose I have a bunch of images that have been watermarked with a transparent logo with some unknown blending function <code>g</code> as <code>watermarked_img = g(original_img, watermark)</code>. Also, suppose that I have access to the <code>watermark</code> image or can recreate it very closely and that I have access to 2-3 original and watermarked images.</p>
  <p>If I could guess <code>g</code> (e.g. <code>g(x, y) = x * y</code>) then I could maybe calculate <code>g^-1</code> (if it is reversible) and be done. But I can't seem to find it (the closest I have come is the photoshop's normal layer with 50% opacity which I don't know how it works on pixel level).</p>
  <p>So I figured I would to try to learn <code>g^-1</code> directly from data.</p>
  <p>That is, I want to use the known <code>watermark</code> image to pollute other images and then use the original and polluted pairs to train an image-translation neural network to remove the watermark.</p>
  <p>However:</p>
  <ol>
  <li>In order to pollute clear images I still need to know <code>g</code>, unless I manually photoshop every sample...</li>
  <li>What are some image-translation neural networks I can easily work with for this task? (I use PyTorch)</li>
  </ol>
  <p>Conversely to an in-painting task, where the model would use the rest of the image to fill in the gaps, I believe it's important for the model to have access to the watermarked areas of the watermarked image in its input as there is no way it would be able to recreate, for example, faces by using only the surrounding context. It should just learn to undo the color damage from the watermark.</p>
  <p>Any guidance would be appreciated.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-29T14:10:40.597Z
Comments.Text: What about training an auto-encoder?
Comments.UserDisplayName: Luca Anzalone
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-30T15:56:56.150Z
Comments.Text: That was my idea but are there any pre-trained ones on huggingface or something? Also, how do I put the watermark in picture programmatically without knowing `g` at pixel level?
Comments.UserDisplayName: Michael
Tags: <deep-learning><computer-vision><image-processing><image-generation>
Title: Watermark removal without inpainting
UserDisplayName: Michael
ThreadText: # Watermark removal without inpainting
  
  (Asked by: username_0 on 2023-10-29)
  
  Suppose I have a bunch of images that have been watermarked with a transparent logo with some unknown blending function `g` as `watermarked_img = g(original_img, watermark)`. Also, suppose that I have access to the `watermark` image or can recreate it very closely and that I have access to 2-3 original and watermarked images.
  
  If I could guess `g` (e.g. `g(x, y) = x * y`) then I could maybe calculate `g^-1` (if it is reversible) and be done. But I can't seem to find it (the closest I have come is the photoshop's normal layer with 50% opacity which I don't know how it works on pixel level).
  
  So I figured I would to try to learn `g^-1` directly from data.
  
  That is, I want to use the known `watermark` image to pollute other images and then use the original and polluted pairs to train an image-translation neural network to remove the watermark.
  
  However:
  
  1. In order to pollute clear images I still need to know `g`, unless I manually photoshop every sample...
  2. What are some image-translation neural networks I can easily work with for this task? (I use PyTorch)
  
  Conversely to an in-painting task, where the model would use the rest of the image to fill in the gaps, I believe it's important for the model to have access to the watermarked areas of the watermarked image in its input as there is no way it would be able to recreate, for example, faces by using only the surrounding context. It should just learn to undo the color damage from the watermark.
  
  Any guidance would be appreciated.
  
  **Tags:** deep-learning, computer-vision, image-processing, image-generation
  
  > **Comments:**
  > **username_1**: What about training an auto-encoder?  
  > **username_0**: That was my idea but are there any pre-trained ones on huggingface or something? Also, how do I put the watermark in picture programmatically without knowing `g` at pixel level?  
  
  ---
  
  ## 0 answers
  
  