Neuronal ensemble activity entrained by local field potential (LFP) patterns underlies a variety of brain functions, including emotion, cognition, and pain perception. Recent advances in machine learning approaches may enable more effective methods for analyzing LFP patterns across multiple brain areas than conventional time-frequency analysis. In this study, we tested the performance of two machine learning algorithms, AlexNet and the Transformer models, to classify LFP patterns in eight pain-related brain regions before and during acetic acid-induced visceral pain behaviors. Over short time windows lasting several seconds, applying AlexNet to LFP power datasets, but not to raw time-series LFP traces from multiple brain areas, successfully achieved superior classification performance compared with simple LFP power analysis. Furthermore, applying the Transformer directly to the raw LFP traces achieved significantly superior classification performance than AlexNet when using LFP power datasets. These results demonstrate the utility of the Transformer in the analysis of neurophysiological signals, and pave the way for its future applications in the decoding of more complex neuronal activity patterns.