Preservatives are essential components in cosmetic products, but their safety issues have attracted widespread attention. There is an urgent need for safe and effective alternatives. Antimicrobial peptides (AMPs) are part of the innate immune system and have potent antimicrobial properties. Using machine learning-assisted rational design, we obtained a novel antibacterial peptide, IK-16-1, with significant antibacterial activity and maintaining safety based on β-defensins. IK-16-1 has broad-spectrum antimicrobial properties against Escherichia coli, Staphylococcus aureus, Pseudomonas aeruginosa, and Candida albicans, and has no haemolytic activity. The use of IK-16-1 holds promise in the cosmetics industry, since it can serve as a preservative synergist to reduce the amount of other preservatives in cosmetics. This study verified the feasibility of combining computational design with artificial intelligence prediction to design AMPs, achieving rapid screening and reducing development costs.