INFO ABOUT LOSS FUNCTIONS AND TRAINING

Want to understand the training process better? Got tips for which model to use and when? This is the place for you


Forum rules

Read the FAQs and search the forum before posting a new topic.

This forum is for discussing tips and understanding the process involved with Training a Faceswap model.

If you have found a bug are having issues with the Training process not working, then you should post in the Training Support forum.

Please mark any answers that fixed your problems so others can find the solutions.

Post Reply
User avatar
Thea
Posts: 4
Joined: Tue Nov 14, 2023 10:26 pm
Has thanked: 2 times
Been thanked: 1 time

INFO ABOUT LOSS FUNCTIONS AND TRAINING

Post by Thea »

Hey everyone,

I have been learning a lot from this forum since last month. At first I hoped this would be a click and go, but lately I can see that it isnt. Thanks for all the work put in here, it has helped me learning all the basics of faceswaping.

I have been struggling to find information talking abot the loss functions. I found some papers (I dont understand nothing), some comentaries, but nothing decisive. This has driven me to write this post, in search of some information or links to posts.

I read that SSIM (Main), MAE(35), LPIPS(50) and FFL (100) are the most popular.

If im not wrong, loss function is how the NN knows if what it is doing is well or wrong, if the changes it is doing is going for better or worse, so it is obvious that is a key part for the process.

The things I would like to know are things like: "what changes you feel each function does to the NN?"(for example, when I turned on FFL, shines from sun would appear, instead of being mate. Or I read on the forum that MAE is some kind of random, so it would blur the image a little bit, things like that), "when do you apply each function?" (for example, since MAE blurs the image, is better for starting the training (I turn it down a little when I start recognizing the face (around 50-80k it maybe) and a bit more while the big training before I want to sharpen(100-400k it more or less). Or that LPIPS is good for definition, but it makes some artifacts(vgg16 should be the best, and dont make as much artifacts), so it is better for finishing the training).

Changing a little bit of subject, I also read that for the final touch is important to turn on No Warp, I just turn it on when I decide to start sharpening the swap. For sharpening or defining I also turn off MAE function and put on LPIPS (I have 8GB of VRAM on a 3070 so Im only capable of doing MS_SSIM, MAE, FFL, all that on Villain and a batch size of 6 at the same time, I change MAE for LPIPS for sharpening. I also want to learn about Phaze-A, but I thin Villain is more automatic). All this has came out of intuition from what I read and a little bit of experimentation.

I would apreciate any commentary about what you feel about function losses, advices about the final steps of training or better if you guys tell how is one of your processes of training, step by step please hehehe :roll:

Postdata: Im Spanish so excuse me for any orthographic errors hehehe :?

User avatar
torzdf
Posts: 2628
Joined: Fri Jul 12, 2019 12:53 am
Answers: 155
Has thanked: 128 times
Been thanked: 612 times

Re: INFO ABOUT LOSS FUNCTIONS AND TRAINING

Post by torzdf »

Discussions around loss functions are certainly tricky, because it takes so long to get results, and thoughts on what is happening can be entirely subjective.

If you haven't read this thread already, then I do recommend doing so:
viewtopic.php?t=2176

My word is final

User avatar
Thea
Posts: 4
Joined: Tue Nov 14, 2023 10:26 pm
Has thanked: 2 times
Been thanked: 1 time

Re: INFO ABOUT LOSS FUNCTIONS AND TRAINING

Post by Thea »

Thanks, thats what I was looking for. :D

Eventhough, I feel there has to be more. I want to lear how to fine tune the training, but thats the most difficult and abstract part of the training for sure. I will try making kind of a tree, making different changes for each brach. This will take so much time :cry: .
I will try posting what I learn.

Again, thanks. :)

Last edited by Thea on Fri Nov 17, 2023 9:53 pm, edited 1 time in total.
User avatar
torzdf
Posts: 2628
Joined: Fri Jul 12, 2019 12:53 am
Answers: 155
Has thanked: 128 times
Been thanked: 612 times

Re: INFO ABOUT LOSS FUNCTIONS AND TRAINING

Post by torzdf »

Honestly, that would be very helpful. Side by side comparisons are the only real way to understand the influence of each function. However, unfortunately they take a long time to create.

My word is final

Post Reply