Abstract:Objective To propose an early detection method for contaminated food based on the extreme learning machine and crystal structure algorithm.Methods The crystal structure algorithm is used to optimize feature selection, combined with the extreme learning machine for fast and efficient classification and detection, aiming to improve the accuracy and efficiency of early detection of contaminated food.Results Compared to traditional methods, the proposed approach shows significant improvements in accuracy (94.5%) and F1-score (93.2%). It also outperforms other state-of-the-art methods in recall rate and processing speed. Compared to the latest deep learning methods, the training time is reduced by about 30%, and the detection speed is improved by 25%.Conclusion The early detection method for contaminated food based on the extreme learning machine and crystal structure algorithm demonstrates clear advantages in improving detection accuracy, speeding up detection, and optimizing computational efficiency. It holds promising practical application prospects, especially for rapid and large-scale food safety detection.