PurposeThe purpose of this paper is to develop a condition-based maintenance (CBM) model for those systems subject to the two-stage deterioration including a deterioration pitting initiation process and a deterioration pitting growth process.Design/methodology/approachRegarding environmental changes as random shocks, the effect of environmental changes on the deterioration process is considered. Then, non-homogeneous Poison process and non-stationary gamma process are introduced to model the deterioration pitting initiation process and the deterioration pitting growth process, respectively. Finally, based on the deterioration model, a CBM policy is put forward to obtain the optimal inspection interval by minimizing the expected maintenance cost rate. Numerical simulations are given to optimize the performance of the deteriorating system. Meanwhile, comparisons between a single-stage deterioration model and a two-stage deterioration model are conducted to demonstrate the application of the proposed approach.FindingsThe result of simulation verifies that the deterioration rate is not constant in the life cycle and is affected by the environment. Furthermore, the result shows that the two-stage deterioration model proposed makes up for the shortage of single-stage deterioration models and can effectively reduce system failures and unreasonable maintenance caused by optimistic prediction using single-stage deterioration models.Practical implicationsIn practical situations, except for normal deterioration caused by internal factors, many systems are also greatly influenced by the random shocks during operation, which are probably caused by the environmental changes. What is more, most systems have self-protection ability in some extent that protects them to keep running as new ones for some time. Under such circumstances, the two-stage deterioration model proposed can effectively reduce system failures and unreasonable maintenance caused by optimistic prediction using single-stage deterioration models. In the combination with the bootstrap estimation, the paper obtains the life distributions with approximate 95 percent confidence intervals which can provide valuable information for practical system maintenance scheduling.Originality/valueThis paper presents a new CBM model for those systems subject to the two-stage deterioration including a deterioration pitting initiation process and a deterioration pitting growth process. Considering the effect of the environmental change on the system deterioration process, a two-stage deterioration model with environmental change factors is proposed to describe the system deterioration.