  Pulse shape discrimination (PSD) is widely used in particle and nuclear
physics. Specifically in liquid scintillator detectors, PSD facilitates the
classification of different particle types based on their energy deposition
patterns. This technique is particularly valuable for studies of the Diffuse
Supernova Neutrino Background (DSNB), nucleon decay, and dark matter searches.
This paper presents a detailed investigation of the PSD technique, applied in
the DSNB search performed with the Jiangmen Underground Neutrino Observatory
(JUNO). Instead of using conventional cut-and-count methods, we employ methods
based on Boosted Decision Trees and Neural Networks and compare their
capability to distinguish the DSNB signals from the atmospheric neutrino
neutral-current background events. The two methods demonstrate comparable
performance, resulting in a 50\% to 80\% improvement in signal efficiency
compared to a previous study performed for JUNO~\cite{JUNO:2015zny}. Moreover,
we study the dependence of the PSD performance on the visible energy and final
state composition of the events and find a significant dependence on the
presence/absence of $^{11}$C. Finally, we evaluate the impact of the detector
effects (photon propagation, PMT dark noise, and waveform reconstruction) on
the PSD performance.
