Abstract:In order to reveal the variation mechanism of the accident rate indicator on expressways under rainfall conditions, monitoring data from monitoring data from the Kunming section of the G5 Beijing–Kunming Expressway from March to October 2024 were used, and a weather–traffic flow composite risk analysis framework was established. The relationships among traffic flow state, weather conditions, their interaction effects, and the accident rate indicator were investigated. A centered Gamma regression model with a logarithm (log) link function was used, in which the squared term of speed, the squared term of occupancy, and the interaction term between heavy rainfall and occupancy were introduced. Marginal effect analysis, Tweedie regression, generalized additive model (GAM), and temporal extrapolation validation were further adopted to test the robustness of the results. The results show that speed has a positive U-shaped relationship with the accident rate indicator, with the risk turning point at approximately 101.45 km/h. Occupancy has an inverted U-shaped relationship with the accident rate indicator, with the risk peak at approximately 50.67. In terms of weather factors, cloudy weather has no significant effect, while light rainfall and heavy rainfall are both significantly associated with an increase in the accident rate indicator, and the risk amplification effect of heavy rainfall is more prominent. Further analysis shows that the risk amplification effect of heavy rainfall changes with the level of occupancy. When occupancy increases from 10 to 60, the accident rate multiplier of heavy rainfall relative to sunny weather decreases from approximately 2.01 to 1.75. Robustness tests and temporal validation confirm the model’s stability and extrapolation capability. The method identifies nonlinear traffic-flow risks and the occupancy-dependent effect of heavy rainfall, providing quantitative support for dynamic risk management.