I’m looking for some small ideas/advice about how I could proceed with the problem I have.
I’m having difficulties creating a custom loss function for the problem I’m trying to resolve. My inputs are images of the kind (A.).
They seem to be a total mess but it’s possible to get information from them, certain classes, where outputs look as follows (B.), so ones in the indices of the certain class.
In the prove of concept I was using BinaryCrossentropy loss function. Its results were fine, (C.)
(left: the results of the BC, right: expected output)
But using BC for the problem has a big issue: it shows the accuracy of, let’s say, 99% but actually it can be just 60%. To calculate correct accuracy I was using NumPy cosine similarity function.
image1456×936 122 KB
The problem has now evolved and I BC is not enough anymore so I have to create a custom loss function. I tried using CosineSimilarity inside a custom loss function but it is not enough and, actually, it gives very bad results for some reason.
Could you suggest an approach that could help to achieve the outputs I need, that’s sharp, narrow, high spikes?