The code and details are provided in the repository shared
The code applies advanced deep-learning techniques to detect the foreground and background within the source image.
Advanced statistical techniques including entropy loss, focal loss and partial cross-entropy loss implementation can be seen within the documentation.
Heat maps using the Logits and Seaborn are automatically created once you run the code.
The Loss Function
loss function pre-req
loss function mathematics
The Results
Some samples for character detection. The color represents the probability of each pixel being the subject. The brighter the color the higher the probability.