Recent comments in /f/deeplearning

incrapnito t1_jca3u68 wrote

Another approach can be cyclegan or pix2pix, both are gan based model. Pix2pix works on paired data and cyclegan works can use unpaired data.

4

HarissaForte t1_jc9s369 wrote

For example you use a bubble mask to "cut" out a bubble patch from an image. Cutting can be a mix of rectangular selection + transparency where the mask equals zero.

Then you do some random change (flip, aspect ratio…) to this patch.

Then you take a defect free image, and you randomly choose a location where to paste this defect using the bottle mask. You can paste by simply over-writing on the image, or you can do a linear interpolation between the patch image and the defect-free image so it's smoother.

I assume you have very similar images, since they're from a standardized inspection process. Also the bubbles are a very simple pattern. So this could work quite well.

1

agaz1985 t1_jc9pebz wrote

18 is your Z dimension, if you move it to the third dimension so Bx3x18x90x90 you can apply multiple 3DConv until you reach a 2D representation and after that you apply 2DConv. For example, let's say we apply 2 times 3DConv->3DMaxPooling with kernels (3,1,1) and (2,1,1) you'll end up with an output of BxCx3x90x90, if you then apply a single 3DConv with kernel (3,1,1) you'll have an output of BxCx1x90x90 or simply BxCx90x90 which can then be passed to 2DConv layers. So basically you ask the model to compress the info in your Z dimension before moving to the spatial dimensions. You can also do the two things together by playing with the kernel size of conv layers. That said, integrating this into UNet it's a bit more work than just using a predefined UNet but it is doable, look for 3D+2D Unet for example.

2

WallyMetropolis t1_jc6qi9w wrote

I see. Typically, when you say "this thing" you're referring to the most recent mention of that thing. So "Here's my article. This article is fabulous." is probably not the structure you want. You really should reference the paper or the researchers you're writing about straight away, if that's what you're doing here. Even after skimming your article, that isn't clear.

It's a cautionary tale about "this" really. A tip that has helped my writing is to accumulate a list of words that I tend to over-use that add nothing and search for them in the editing process. Words like "this, really, just, again," and so on.

2

HarissaForte t1_jc6qhid wrote

Well first it really is a use case for anomaly detection, but I see there's a discussion on it in another comment.

I still don't know if you have (classification) labels, bbox, or masks for the images with defect… if you do not have any bbox or mask, I suggest you try creating mask annotations, as this will increase the "power" of each sample (instead of 1 label per image you get HxW labels for each pixel location).

It should be fast as:

  1. You say you do not have many images with defect.
  2. It seems the mask for defect-less bottles can be generated with a simple thresholding.
  3. Looking at your example you can create a bubble annotation in one click with a proper annotation tool (I can't tell for the other defect)

Then you ca try a simple supervised training. You could have a nice surprise since your picture are taken in a controlled, standardized environment (it's not like you'd have pictures of bottles on a beach or in the jungle).

If not then you will be able to use the segmentation data to create patches of defects that you can use on your defect-free bottle to create new data. It will be much easier than messing around with GANs and might give you good results.

1