The thoracic surgical procedure leads to a reduction in respiratory muscle strength. To restore it, certain strategies must be employed. Physiotherapy utilizes resources and techniques such as deep breathing stimulation, cough stimulation, use of incentive spirometers, mobilization, and ambulation. However, at times these resources and techniques may prove insufficient, and additional measures, such as Non-Invasive Ventilation (NIV), are employed Pieczkoski (2017). Non-Invasive Positive Pressure Ventilation (NPPV) has been utilized to expedite pulmonary function recovery as well as to prevent and treat postoperative pulmonary complications Nasrala 2018. NIV diminishes the risk of ventilator-associated complications due to its non-invasive nature. Consequently, NIV has been adopted to avert post-extubation complications in postoperative patients Liu 2020. The objective of this study is to conduct a randomized clinical trial and assess the efficacy of NIV in comparison to conventional physiotherapy in terms of pulmonary function among patients undergoing cardiac surgery at a selected hospital in Campina Grande, Paraíba, Brazil. This randomized, controlled, double-blind (patient and analyst) clinical trial will be conducted at Hospital João XXIII in Campina Grande, Paraíba, Brazil. Patients do not know which group they are allocated to. Those in the group that use CPAP or BIPAP will not be able to distinguish one from the other. The data analyst at the end of the collections will also be blinded. Only the health professional who will be applying the protocol cannot be blinded. The sample size, determined via sample calculation, yielded a total of 21 patients per group (63 patients). The patients will be allocated into 3 groups (CPAP group - CPAP + standard physiotherapy, BiPAP group - BiPAP + standard physiotherapy, and Control group - standard physiotherapy) in a 1:1:1 allocation ratio. The control group will receive the usual physiotherapeutic treatment as per the kinesiotherapy protocol. The treatment will be administered twice daily, starting in the ICU and progressing to the ward. In the CPAP group, nasal CPAP at 10cmH2O will be administered for 1 hour, twice daily, using an approved device. In the BiPAP group, nasal BiPAP with an IPAP of 13cmH2O and EPAP of 8cmH2O will be administered for 1 hour, twice daily, using an approved device. The NIV sessions will be conducted over the course of 5 days of hospitalization, both in the ICU and the ward. Assessments will be conducted at two time points: on day 1 preoperatively and on day 5 postoperatively. The following measures will be evaluated: pulmonary function, length of hospital stay, presence of postoperative pulmonary complications, score of the Minnesota Living with Heart Failure Questionnaire (MLHFQ) in its Portuguese version, functional capacity, the Global Perception of Change Scale, and the Functional Independence Measure (MIF). The normality of variables will be assessed using the Shapiro-Wilk test. IBM SPSS Statistics Base 25.0, using the Shapiro-Wilk test for normality and paired Student's t-test for pre-post intervention comparison. They will use linear mixed effects models for longitudinal analysis and GLMMs to compare NIV effects over time between groups. They will employ ITT for missing data, INAR models for time dependence, fixed effects models for endogeneity, and Cohen's d for effect sizes. Parametric model assumptions will be checked, and various models will be considered for data characteristics. Pulmonary function, Length of hospital stay. Score of the Minnesota Living with Heart Failure Questionnaire (MLHFQ) in Portuguese version, Funcional capacity, The global perception of change scale, The functional independence measure (MIF), pO2 (partial pressure of oxygen), pCO2 (partial pressure of carbon dioxide), HCO3 (bicarbonate), Arterial Oxygen Saturation (SaO2), Base Excess (BE), Presence of lung complications. Duration of cardiopulmonary bypass, type of surgery, personal history, preoperative ejection fraction, previous respiratory complications, body mass index (BMI), gender and age. Trial register number NCT05966337.