The quantification of total organic carbon (TOC) and free hydrocarbon content (S 1 ) is crucial for evaluating the shale oil generation and bearing properties. This study aims to enhance the accuracy of TOC and S 1 quantification in shale oil evaluations. The scope encompasses the development of a novel deep learning framework to overcome the limitations of traditional physical and machine learning or deep learning methods. This study proposes an integrated Swarm Optimization Algorithm-Convolutional Neural Network/machine learning (SOA-CNN/machine learning) framework. This framework leverages SOA for hyperparameter optimization of CNN or machine learning, utilizing experimental data from core samples preserved in liquid nitrogen alongside well logging data. The application of the proposed framework to the H11 well in the Subei Basin, China, using 110 core samples, demonstrated superior performance. The results validate the framework's effectiveness in predicting TOC and S 1 content at various depths. The proposed framework in this study stands out for its convenient methodology, wide application range, and high precision in prediction. These attributes contribute significantly to the field of petroleum engineering and development, offering a novel approach that promises to enhance both the efficiency and accuracy of well logging evaluation.