Coder Social home page Coder Social logo

Comments (5)

Yiyiyimu avatar Yiyiyimu commented on June 27, 2024

The original image looks like this
C3-1_C001S0001_1
and the output of image processed and normalized looks like this(save out at validation step)
R2U_Net_valid_1_image
So it seems not being normalized right? Cause you can find white and black on the same image so they are still range from 0 to 255. It seems weird to me


Edit:
Sorry I just find reason on pytorch documentation that it descale from [0,1] to [0, 255] at save_image function. You could add normalize==true to image's output to denormalize from [-1,1] to [0,1] to get not image in original color.
So this is not the reason of my problem, I still don't know why hah

from image_segmentation.

Yiyiyimu avatar Yiyiyimu commented on June 27, 2024

DC and JS give possible values when I change evaluation function to (eg. DC)

def get_DC(SR,GT,threshold=0.5):
    # DC : Dice Coefficient
    SR = (SR > threshold).view(-1)
    GT = (GT == torch.max(GT)).view(-1)

    Inter = (SR*GT).sum()
    DC = float(2*Inter)/(float(SR.sum()+GT.sum()) + 1e-6)

    return DC

So basicly just change torch.max() to original array max, maybe there is something wrong here?
When I change all torch.max into max the result look like this

[Training] Acc: 0.9359, SE: 0.0742, SP: 0.9899, PC: 0.0742, F1: 0.0742, JS: 1.0000, DC: 1.7901
[TrainNEW] Acc: 0.9359, SE: 0.0742, SP: 0.9899, PC: 0.0742, F1: 0.0742, JS: 0.1408, DC: 0.2099
[Validation] Acc: 0.9408, SE: 0.1124, SP: 0.9468, PC: 0.1124, F1: 0.1124, JS: 1.0000, DC: 1.3627
[ValidatNEW] Acc: 0.9408, SE: 0.1124, SP: 0.9468, PC: 0.1124, F1: 0.1124, JS: 0.4825, DC: 0.6373

from image_segmentation.

Yiyiyimu avatar Yiyiyimu commented on June 27, 2024

Seems the problem is solved, so I'd close this issue. Again, thank you for your contribution!

from image_segmentation.

CN-zdy avatar CN-zdy commented on June 27, 2024

Hi, @Yiyiyimu
How was the problem solved?
Could you help me?
Thank you very much!

from image_segmentation.

CN-zdy avatar CN-zdy commented on June 27, 2024

@Yiyiyimu
Could you help me?
In my test, SE & SP would keeps greater than 1.
Can you give me some advice?

from image_segmentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.