Objective To investigate the influencing factors of secondary epilepsy after microscopic surgery for cere-bral convexity meningioma,to establish multivariate Logistic regression model and random forest model,and to compare the predictive efficacy of the two models for postoperative secondary epilepsy.Methods A total of 90 patients with secondary epi-lepsy after microscopic surgery for convex cerebral convexity meningioma treated from January 2020 to January 2023 were se-lected as the research group,and 90 patients without secondary epilepsy after microscopic surgery for cerebral convexity men-ingioma during the same period were selected as the control group.Using simple random sampling method,80%sample size was randomly selected from the research group and the control group respectively as the training set,and the remaining 20%was used as the test set.Demographic characteristics and laboratory indicators of the two groups were calculated,and multiva-riate Logistic regression model and random forest model were constructed,respectively.Receiver operating characteristic(ROC)curve and area under the ROC curve(AUC)were used to evaluate the predictive efficacy of the two models for post-operative secondary epilepsy.Results The levels of homocysteine(Hcy),S100 calcium-binding protein B(S100B)and neuron specific enolase(NSE)in the research group were higher than those in the control group,while the levels of galanin(GAL)were lower than those in the control group(P<0.05).The proportion of postoperative lumen hemorrhage,abnormal neuroelectrophysiological monitoring during surgery and postoperative hydrocephalus in the research group was higher than that in the control group(P<0.01,P<0.05).Multivariate Logistic regression analysis showed that Hcy,NSE,S100B,postop-erative hydrocephalus and abnormal neuroelectrophysiological monitoring during surgery were the influential factors for postop-erative secondary epilepsy(P<0.01).Random forest analysis showed that the top 5 variables were NSE,S100B,Hcy,post-operative hydrocephalus,and abnormal neuroelectrophysiological monitoring during surgery.The AUC of the random forest model for predicting postoperative secondary epilepsy was greater than that of Logistic regression model(P<0.05).Conclu-sion Hcy,NSE,S100B,postoperative hydrocephalus,and abnormal neuroelectrophysiological monitoring during surgery are the factors that affect the incidence of secondary epilepsy after microscopic surgery for cerebral convexity meningioma.A multi-variate Logistic regression model constructed based on these factors can visually explain the risk of different variables for the occurrence of secondary epilepsy after surgery.The random forest model has better predictive efficacy for postoperative second-ary epilepsy,which helps to formulate prevention and treatment measures in clinical practice.