Artificial intelligence (AI) has emerged as a powerful tool in computational biology, where it is being used to analyze large datasets to detect difficult biological patterns. This has enabled the design of new drug molecules. In this article, a novel method called hybridized gravitational search algorithm (HyGSA) has been proposed to design novel blood-brain barrier penetrating peptides (B3P2s) with desirable characteristics that enable them to cross the blood-brain barrier (BBB) and deliver neurological drugs directly to the brain. The HyGSA has two important modules in the form of an explainable machine learning classifier (with an accuracy, f1-score, and area under the ROC curve (AUROC) of 84%, 84%, and 91%, respectively) and an explainable deep learning-based B3P2 classifier (with an accuracy, f1-score, and AUROC of 89%, 91%, and 95%, respectively). The former was used to determine the crucial hand-engineered features, and the latter was designed to determine the critical amino acids that play an important role in the BBB penetrability of a peptide. Moreover, the population of particles was sampled at the beginning of each iteration to ensure a good mix of particles with low, average, and high fitness. This was achieved using a novel method that takes inspiration from the subset-sum problem and uses the mean and variance of the distribution of particles. For the pilot study, some B3P2s were discovered and optimized from a set of cell-penetrating peptides. Lastly, a free online tool has been deployed at https://b3p2design.anvil.app to help the scientific community discover and optimize B3P2s in protein sequences.