Presented is a breathing mask (100), comprising: a venting system (101) for ventilating the mask; a detector (102) for providing respiration data of a user and located for sensing at least one physical property of air inside the breathing mask (100) when worn by a user; a controller (103) configured to activate the venting system (101) based on the respiration data; characterized in that the controller (103) is configured to: predict future respiration data based on historic respiration data of at least one earlier detected inhaling or exhaling cycle; and determine whether a future inhaling or exhaling cycle will occur based on predicted future respiration data; activate the venting system (101) before the determined future inhaling or exhaling cycle commences. Further, a method for controlling a venting system of a breathing mask is presented.