In this paper, a compact branch microstrip coupler with the simple structure using T-shaped resonators and open-ended stubs at 1.8 GHz is designed and fabricated. The proposed coupler creates two transmission zeros at 3.4 and 3.87 GHz, with more than 50 dB attenuation level, which resulted in a good harmonic suppression at 2nd harmonic. Artificial neural network (ANN) has been utilized to extract the transfer function of the proposed coupler resonator for the first time, so the values of the transmission zeros can be located in the desired frequency. This technique can also be used for the other electrical devices. The designed device has a small size of 28 mm × 30 mm (0.9 λ × 0.95 λ), which shows more than 35% size reduction compared to the typical branch-line coupler with λ/4 branch lines. The proposed coupler is simulated using Advanced Design System (ADS) software and fabricated on Rogers Duroid 5880 substrate (ε r = 2.2, h = 31 mil). The simulation and measurement results verify the correct performance of the designed coupler.