The continuous integrated circuit miniaturization and the shrinkage of critical dimension (CD) have pushed the development of optical proximity correction (OPC), and also making CD more sensitive to process variations. Traditional OPC optimizes mask patterns at nominal lithography conditions, which may lead to poor performance with process variations. Hence, OPC software nowadays needs to take different process conditions into consideration to enhance the robustness of layout patterns. In this paper, we propose an algorithm which considers the defocus as a random variable when incorporating it into an inverse imaging framework to optimize the input mask, in order to gain more robustness for a wider range of focus errors. The optimal mask is calculated in a statistical manner by minimizing the expected difference between output patterns at different defocus conditions and the target pattern. With the necessary tradeoff in the close proximity of the nominal focus condition, the optimized mask gives more robust performance under a wider range of focus errors.© (2008) COPYRIGHT SPIE--The International Society for Optical Engineering. Downloading of the abstract is permitted for personal use only.