YyzHarry / imbalanced-regression

[ICML 2021, Long Talk] Delving into Deep Imbalanced Regression
http://dir.csail.mit.edu
MIT License
806 stars 128 forks source link

prediction value processing #28

Closed huangbingyang2020 closed 2 years ago

huangbingyang2020 commented 2 years ago

hello, I read your paper interestingly and want to ask you a question about the prediction result processing. I would like to ask how to limit the last prediction y^ to be between 0 and 99, or to get it directly from the regression function without any processing?

YyzHarry commented 2 years ago

Hey, thanks for your interest. We do not explicitly limit the output range for regression. For example, in age estimation task the last layer is a fully connected layer without modifications (https://github.com/YyzHarry/imbalanced-regression/blob/main/agedb-dir/resnet.py#L88).

huangbingyang2020 commented 2 years ago

thanks for your reply. So if we do not limit the output range of regression, how can we process the output that is negative or larger than 100 in the infer stage for age estimation task?

YyzHarry commented 2 years ago

To avoid negative outputs you can simply add a ReLU activation, or postprocess the outputs to be non-negative. However I do not recommend limit the output range in general, because in regression we want the model to be able to extrapolate to unseen targets during training (e.g., in training data you only have pics from 20-80 age range, but the model still predicts correct values when input images are out of that range).

huangbingyang2020 commented 1 year ago

thanks for your reply. So if we do not limit the output range of regression, how can we process the output that is negative or larger than 100 in the infer stage for age estimation task?

On Sun, Sep 4, 2022 at 5:57 AM Yuzhe Yang @.***> wrote:

Hey, thanks for your interest. We do not explicitly limit the output range for regression. For example, in age estimation task the last layer is a fully connected layer without modifications ( https://github.com/YyzHarry/imbalanced-regression/blob/main/agedb-dir/resnet.py#L88 https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_YyzHarry_imbalanced-2Dregression_blob_main_agedb-2Ddir_resnet.py-23L88&d=DwMCaQ&c=kscRujJyAkQsYKgOOQVwjhZ5JZcK7vY7fLntrz10DKg&r=VdDoNz1tBP4SEy5C-ZX99QQ9vxkewlKXsc3fRWtAR_g&m=MYcCYSpYHuHjbVyliSo08GYyfKBD4jfF4egj5CogOOgygiG37qWzcCmKO5q8Y6mL&s=Ws1TTbX8mzinjcRM1Ssg1m3_NZ373bKcrs2cO24OWTE&e= ).

— Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_YyzHarry_imbalanced-2Dregression_issues_28-23issuecomment-2D1236204168&d=DwMCaQ&c=kscRujJyAkQsYKgOOQVwjhZ5JZcK7vY7fLntrz10DKg&r=VdDoNz1tBP4SEy5C-ZX99QQ9vxkewlKXsc3fRWtAR_g&m=MYcCYSpYHuHjbVyliSo08GYyfKBD4jfF4egj5CogOOgygiG37qWzcCmKO5q8Y6mL&s=IkhomZsXozLQp0LK1r6ZXIgwPOLPwOw4NT9t-A6XBTs&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AQMAJL7KLZQJQ2KGKFM5JNDV4PCVXANCNFSM6AAAAAAQCC2QAE&d=DwMCaQ&c=kscRujJyAkQsYKgOOQVwjhZ5JZcK7vY7fLntrz10DKg&r=VdDoNz1tBP4SEy5C-ZX99QQ9vxkewlKXsc3fRWtAR_g&m=MYcCYSpYHuHjbVyliSo08GYyfKBD4jfF4egj5CogOOgygiG37qWzcCmKO5q8Y6mL&s=Xhzr5g5gReu809hhAGB85bPCjFW1zkmwCKLd_-WW9qk&e= . You are receiving this because you authored the thread.Message ID: @.***>

-- This message and its attachments are confidential (or legally privileged) information and are meant solely for the addressee of such message. Any unauthorized use of the message / its attachments is strictly prohibited.