You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

适用于右删失失效时间的损失函数选型技术问询

Handling Right-Censored Data for Physics-Based Failure Time Prediction

Great question—right-censoring is a common pain point in failure time modeling, especially when preventive maintenance means you never get to observe the true failure event. Since you’re working with a physics-based model (rather than a purely statistical one), your best bet is to adapt survival analysis loss functions that explicitly account for censored observations, starting with the negative log-likelihood (NLL) tailored to right-censored data.

Key Approach: Parametric Negative Log-Likelihood

Physics-based models often naturally map to parametric failure time distributions (like Weibull, exponential, or log-normal) derived from underlying degradation mechanisms (e.g., fatigue crack growth, wear, or material fatigue). For these models, the NLL loss function directly incorporates both observed failures and censored observations:

For each data point (i):

  • Let (t_i) be the observed time (either the actual failure time or the last maintenance/censoring time)
  • Let (\delta_i = 1) if the failure was observed (uncensored), (\delta_i = 0) if it was censored
  • Let (f(t_i; \theta)) be the probability density function (PDF) of your physics-based failure time model (parameterized by (\theta), which your model predicts)
  • Let (S(t_i; \theta) = 1 - F(t_i; \theta)) be the survival function (probability the system survives beyond (t_i))

The log-likelihood for the full dataset is:
[
\log \mathcal{L}(\theta) = \sum_{i=1}^N \left[ \delta_i \log f(t_i; \theta) + (1 - \delta_i) \log S(t_i; \theta) \right]
]
Your loss function is simply the negative of this sum:
[
\text{Loss} = -\log \mathcal{L}(\theta)
]

Example with Weibull Distribution

If your physics-based model predicts Weibull parameters (scale (\lambda), shape (k)):

  • PDF: (f(t; \lambda, k) = \frac{k}{\lambda} \left( \frac{t}{\lambda} \right)^{k-1} \exp\left( -\left( \frac{t}{\lambda} \right)^k \right))
  • Survival function: (S(t; \lambda, k) = \exp\left( -\left( \frac{t}{\lambda} \right)^k \right))

For censored observations, this loss penalizes the model for predicting a high probability of failure before the censoring time. For uncensored observations, it penalizes deviations from the actual failure time—perfect for your use case.

Alternative: Rank-Based Loss (Non-Parametric)

If you don’t want to tie your model to a specific parametric distribution (though physics-based models usually have a natural distribution fit), you can use a rank-based loss like the one from the Cox Proportional Hazards model. This loss focuses on the ordering of failure times rather than their absolute values:
[
\text{Loss} = -\sum_{i: \delta_i=1} \log \left( \frac{\exp(h(t_i; \theta))}{\sum_{j: t_j \geq t_i} \exp(h(t_j; \theta))} \right)
]
Where (h(t; \theta)) is the hazard function predicted by your model (the instantaneous rate of failure at time (t)). This works well if your physics-based model outputs hazard rates instead of full distributions.

Implementation Tips

  • Handle numerical stability: Add small epsilon values (like (10^{-8})) inside log operations to avoid errors from (\log(0)).
  • If your model directly outputs survival probabilities and PDF values at each observed time (t_i), here’s a PyTorch example of the loss function:
    import torch
    
    def censored_nll_loss(pred_survival, pred_pdf, censoring_indicator):
        # pred_survival: Tensor of survival probabilities at each observed time
        # pred_pdf: Tensor of PDF values at each observed time
        # censoring_indicator: Binary tensor (1 = uncensored, 0 = censored)
        log_likelihood = torch.sum(
            censoring_indicator * torch.log(pred_pdf + 1e-8) + 
            (1 - censoring_indicator) * torch.log(pred_survival + 1e-8)
        )
        return -log_likelihood
    
  • Validate with synthetic data: Generate censored failure times using your physics-based distribution, train your model, and verify it recovers the true underlying parameters. This is a reliable way to confirm your loss function works as intended.

This approach ensures your model learns to respect the information from censored observations—knowing the failure time is later than the observed time—rather than treating them as missing data or ignoring them entirely.

内容的提问来源于stack exchange,提问作者user1993951

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 04:24:04