The influence of solar activity on seismic activity is a subject of debate. Previous studies have shown that there is sometimes a correlation and sometimes a contradiction between solar activity maxima and large earthquakes. Long-term memory neural network is used to study the relationship between solar activity and seismic activity. This study emphasizes retrospective classification rather than direct prediction, refining the LSTM architecture to maximize classification accuracy and processing data from the Solar and Heliospheric Observatory and the U.S. Geological Survey earthquake catalogs. A declustering technique is used to select large seismic events and weighted learning corrects for class imbalances. The LSTM model accurately classified earthquakes (84.47%) and proton density variations. The results support the theory that solar activity, in particular proton density, can anticipate earthquake events.