brambozz / medical-diffusion-on-a-budget

Repository for the paper 'Medical diffusion on a budget: textual inversion for medical image generation'
MIT License
4 stars 0 forks source link

Dataset labeling problem #2

Open BAI233133 opened 1 month ago

BAI233133 commented 1 month ago

I used the automatic annotation plug-in, which generated irrelevant text annotations for me, which made my training extremely difficult. I would like to know how you process the annotated data for embedding training, and some related training parameters.What I want to train is CT images like the one below 2-19-2

brambozz commented 1 month ago

Hi again!

Indeed, the automatic labeller is not much use, because it is trained on natural images. It won't generate useful annotations for medical images.

What I did was overwrite the textual inversion templates (this file for example) and only put [name] there.

If you have meaningful annotations for your images it could of course be useful.

Hope that helps!

BAI233133 commented 1 month ago

1.I used 90 images of the same type for training(as shown below). Following your suggestion, I no longer used the automatic annotation plug-in. image

2.Here are some of my training parameters: image image

3.My Prompt template file only has [name]

4.During my 20,000-step training process, I never got a good result picture. I didn't understand where my mistake was. image

5.I used your suggested AUTOMATIC1111 web UI and 512-base-ema.ckpt and successfully got the image below under the embeddings file you provided, I want to know what is my problem and what can I do to get good results .

00001-78572013

BAI233133 commented 1 month ago

你好,我们又见面了!

事实上,自动贴标机并没有多大用处,因为它是在自然图像上进行训练的。它不会为医学图像生成有用的注释。

我所做的是覆盖文本反转模板(例如此文件)并只放在[name]那里。

如果您对图像有有意义的注释,它当然会很有用。

希望有帮助! Sorry to bother you again, the above are some of the problems I encountered, please forgive my stupidity, thank you very much for your patience and answers

brambozz commented 1 month ago

Hey! Just to confirm coconut_test.txt looks like:

[name]

Since you can generate with my trained embeddings, something must be going wrong during training. Although I would also check inference parameters, like the CFG scale and copy the parameters from my paper. The image you show looks like it was generated with relatively high CFG scale (5+), whereas I ended up using 2.

One final idea I have: I think if you don't re-initialize the embedding file it will continue training from the previous version. So just to be sure, I would delete the chexpert_mature_fruit file in the embeddings folder, and do a new training session with the correct template.

The reason is that to me it looks like the embedding was trained while it used the filenames (chexpert_mature_fruit_something) as text prompt, because the generated images look somewhat like avocado/pear to me :)

BAI233133 commented 1 month ago

Hey! Just to confirm coconut_test.txt looks like:

[name]

Since you can generate with my trained embeddings, something must be going wrong during training. Although I would also check inference parameters, like the CFG scale and copy the parameters from my paper. The image you show looks like it was generated with relatively high CFG scale (5+), whereas I ended up using 2.

One final idea I have: I think if you don't re-initialize the embedding file it will continue training from the previous version. So just to be sure, I would delete the chexpert_mature_fruit file in the embeddings folder, and do a new training session with the correct template.

The reason is that to me it looks like the embedding was trained while it used the filenames (chexpert_mature_fruit_something) as text prompt, because the generated images look somewhat like avocado/pear to me :)

Hello, there is indeed only [name] in coconut_test.txt. Is there any problem in this regard? The chexpert_mature_fruit embeddings are recreated. What I want to do is retrain and get images similar to the training images. For the training parameters, I used the ones in your article, and I found that every time I created a new embeddings with a different name, the images generated during the training process would have different style preferences, but they were all very different from the training images.

BAI233133 commented 1 month ago

Hey, thank you very much for your help, I have solved some problems and got some decent results, thanks again for your patience and enthusiasm

brambozz commented 1 month ago

Happy to hear it!

Could you perhaps share what were the things you had to do to solve your problems (for future people reading this issue)?