Identification system and method for microbial contamination in food and cosmetics based on AI identification

By combining the MPN counting method and TDLAS technology to monitor carbon dioxide concentration, and combining microscopic imaging and convolutional neural networks to optimize the AI ​​recognition model, the problems of limited image quality and the inability of the model to adaptively update in microbial contamination detection in food and cosmetics were solved, achieving efficient and accurate microbial contamination identification.

CN120635893AInactive Publication Date: 2025-09-12SHENZHEN ZHONGDING TESTING TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202510586200.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-09-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In existing technologies, microbial contamination detection in the food and cosmetics industries suffers from limited image quality, low AI recognition accuracy, and the inability of AI models to adaptively update, resulting in low detection efficiency and insufficient accuracy.

Method used

The maximum probable number (MPN) counting method is combined with tunable semiconductor laser spectroscopy (TDLAS) to monitor carbon dioxide concentration. Microscopic imaging and convolutional neural networks are used to optimize the AI ​​recognition model through training data sets, adjust parameters in real time, achieve accurate classification and counting of microbial colonies, and generate visual analysis reports.

Benefits of technology

It improves the accuracy and efficiency of microbial contamination detection, can automatically optimize in different application scenarios, adapt to new contaminating microorganisms, reduce human errors, and meet the needs of fast, accurate, and high-throughput detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635893A_ABST
    Figure CN120635893A_ABST
Patent Text Reader

Abstract

The invention discloses a system and method for identifying microbial contamination in food and cosmetics based on AI identification, and the method comprises the steps: collecting to-be-detected food or cosmetics as a detection sample, and obtaining the bacterial colony growth state of microorganisms in the detection sample; the method comprises the following steps: acquiring a microbial growth image through microscopic imaging equipment, and preprocessing the microbial growth image to obtain a target area of a microbial colony; constructing an AI recognition model by adopting a convolutional neural network, and obtaining the species and quantity of microorganisms in the detection sample; parameters of the AI recognition model are adjusted in real time according to the types and the number of the microorganisms, a preset microorganism limited standard threshold value is combined, a visual analysis report is generated, the AI recognition model is combined with a Faster R-CNN target detection method, precise classification and number statistics of the types of the microorganisms are achieved, a complete microorganism pollution analysis report is formed, and the method is suitable for popularization and application. And the accuracy and scientificity of the final identification result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of AI identification of microorganisms in food and cosmetics, and particularly to a system and method for identifying microbial contamination in food and cosmetics based on AI identification. Background Art

[0002] With the rapid development of the food and cosmetics industries, microbial contamination has become a significant factor affecting product quality and consumer health. Traditional microbial detection methods rely on artificial culture, microscopic examination, and biochemical identification. These methods are time-consuming, cumbersome, and prone to significant human error, making them difficult to meet the demands of modern production for rapid, accurate, and high-throughput testing. In recent years, artificial intelligence (AI), particularly deep learning-based image recognition technology, has been widely applied in fields such as medical imaging and industrial quality inspection. It has also provided a new path for the automated identification of microbial contamination in the food and cosmetics industries. By combining microscopic imaging, image processing, and convolutional neural network models, AI can rapidly classify and count microbial colonies, improving detection efficiency and intelligence.

[0003] Although AI has shown great potential in the field of microbial detection, current related systems and methods still have the following key technical shortcomings and challenges:

[0004] (1) Microbial colonies on different culture media have diverse morphologies and colors close to the background, which results in limited image quality and low recognition accuracy. They are easily disturbed by problems such as uneven lighting, blurred images, and colony adhesion, which affects the accuracy of AI model recognition.

[0005] (2) Current AI models are mostly trained based on specific bacterial species or fixed experimental conditions. When faced with new contaminating strains or complex background differences in actual samples, the recognition performance drops significantly. In addition, most recognition systems are static models and cannot perform online learning and model adaptive updates based on emerging microbial types or user feedback. There is a lack of a closed-loop feedback mechanism, and the model performance cannot be continuously improved. Summary of the Invention

[0006] The purpose of the present invention is to provide a system and method for identifying microbial contamination in food and cosmetics based on AI recognition, so as to solve the technical problems in the prior art such as limited image quality, low AI recognition accuracy, inability to adaptively update the AI ​​recognition model, lack of a closed-loop feedback mechanism, and inability to continuously improve model performance.

[0007] In order to solve the above technical problems, the present invention specifically provides the following technical solutions:

[0008] The first aspect of the present invention provides a method for identifying microbial contamination in food and cosmetics based on AI recognition, comprising the following steps:

[0009] Collect food or cosmetics to be tested as test samples, use the maximum probable number (MPN) counting method combined with tunable semiconductor laser spectroscopy (TDLAS) to detect the carbon dioxide concentration in the sample culture bottle, and obtain the colony growth status of the microorganisms in the test sample;

[0010] Acquire a microbial growth image of the test sample in the culture dish using a microscopic imaging device according to the colony growth state, pre-process the microbial growth image, and acquire a target area of ​​the microbial colony;

[0011] A convolutional neural network is used to construct an AI recognition model, which is trained on the preprocessed image of the target area of ​​the microbial colony to obtain a training data set containing multiple microbial colonies, and the types and quantities of microorganisms in the test sample are obtained;

[0012] The parameters of the AI ​​recognition model are adjusted in real time according to the types and quantities of the microorganisms. The model performance is evaluated by testing the training data set. Combined with the preset microbial limit standard threshold, it is determined whether the test sample is microbially contaminated and a visual analysis report is generated.

[0013] As a preferred embodiment of the present invention, food or cosmetics to be tested are collected as test samples, and the carbon dioxide concentration in the sample culture bottle is detected using the maximum probable number (MPN) counting method combined with tunable semiconductor laser spectroscopy (TDLAS) to obtain the colony growth status of microorganisms in the test sample, including:

[0014] Collect a test sample from the food or cosmetic to be tested, perform a ten-fold gradient dilution on the test sample, and obtain six homogenous solutions of the gradient dilution samples;

[0015] The maximum probable number (MPN) counting method is used to estimate the number of viable bacteria in each sample solution, and the carbon dioxide concentration in each sample solution culture bottle is monitored in real time by tunable semiconductor laser spectroscopy (TDLAS) to obtain the number of microbial flora at different concentrations.

[0016] According to the curve of the change of carbon dioxide concentration over time, the growth rate of microorganisms at different dilution concentrations is obtained, and the colony growth state of microorganisms is obtained.

[0017] As a preferred embodiment of the present invention, the present invention comprises:

[0018] Extracting test samples from the culture dishes corresponding to the microbial flora at different concentrations, detecting harmful ions in the samples through the chemical structure of the probes, and obtaining structural information of the corresponding probes;

[0019] The structural information of the corresponding probe is converted into InChIKey format by using ChemDes to obtain the structural data of the fluorescent molecular probe;

[0020] constructing four binary classification sub-datasets for the fluorescent molecular probe structure data, deleting the fluorescent molecular probe structure data with the most duplicate data, and obtaining a harmful ion selective data set;

[0021] performing sampling optimization on the harmful ion selective dataset by generating an adversarial network, identifying molecular descriptors of compound molecules in the harmful ion selective dataset, and constructing a molecular feature set based on the molecular descriptors;

[0022] Recursive cross-validation of the descriptor features of the molecular feature set using a random forest algorithm is performed, and the molecular feature set is optimized by recursively selecting features one by one to obtain a sample training set;

[0023] As a preferred embodiment of the present invention, a microbial growth image of the test sample in the culture dish is obtained by a microscopic imaging device according to the colony growth state, and the microbial growth image is preprocessed to obtain a target area of ​​the microbial colony, including:

[0024] Using a microscopic imaging device to image the microbial colonies in the culture dish to obtain an original microbial growth image containing multiple colonies;

[0025] Using Gaussian filtering on the original microbial growth image to remove random noise in the image, and obtaining a colony growth image with edge detail data;

[0026] Adopting an adaptive histogram equalization algorithm to enhance the local contrast of the colony growth image, enhancing the color difference through color space conversion to obtain image enhancement data, and binarizing the image using an adaptive threshold method to obtain the colony growth area.

[0027] The contour structure of the colony growth area is optimized, the colony target area is extracted, and a clear microbial colony image area is obtained.

[0028] As a preferred solution of the present invention, a convolutional neural network is used to construct an AI recognition model, and the pre-processed image of the target area of ​​the microbial colony is trained, including:

[0029] Collect common contaminating microorganisms in food and cosmetics, and construct a colony image dataset containing multiple microorganisms in the microbial colony image area;

[0030] Repeat the experiment for each test sample under the same culture conditions to obtain colony images at different growth stages, create a sample image for each colony image, label the sample image category, and construct a labeled colony training dataset;

[0031] A convolutional neural network is used to take the colony training dataset and the colony image dataset as input training data for the AI ​​recognition model, and a cross-entropy loss function is used to calculate the optimization target value of the input training data;

[0032] Iteratively updating the AI ​​recognition model parameters by adjusting the colony image dataset in real time, analyzing the misjudgment between colonies using a confusion matrix, and adjusting the structure of the AI ​​recognition model in real time;

[0033] The predicted probability of each bacterial species is output through the fully connected layer in the convolutional neural network, and the Softmax classifier is used to map the feature vector to a set of microbial categories based on the predicted probability.

[0034] As a preferred embodiment of the present invention, a training data set containing multiple microbial colonies is extracted from the microbial category set to obtain the types and quantities of microorganisms in the test sample, including:

[0035] Inputting a colony training dataset of multiple colony regions in the microbial category set into the AI ​​recognition model, and establishing a colony classifier by learning the characteristics of each colony category;

[0036] The Faster R-CNN target detection method is used to locate and count each colony in the microbial category set, and the microbial category to which each colony belongs and its confidence are obtained;

[0037] When the confidence level is set higher than a certain threshold, the colony is judged to belong to a specific type;

[0038] The number of independent colonies was counted by the FasterR-CNN target detection method, and the concentration of microorganisms in the original sample was estimated by combining the MPN method to obtain the types of microorganisms contained in the microbial category set, the number of each colony, and the total number of bacteria.

[0039] As a preferred solution of the present invention, a classification model evaluation index is established based on the types and quantities of the microorganisms, and the parameters of the AI ​​recognition model are adjusted in real time, including:

[0040] Based on the types and quantities of microorganisms, a multi-dimensional classification model evaluation index is constructed, including the recognition accuracy I Accuracy , recall rate I Recall , colony type specificity I SP And the harmonic mean of precision and recall I F1-score, whose expression is:

[0041]

[0042] Among them, TP is true positive, which means the positive samples are correctly predicted by the model; TN is true negative, which means the negative samples are correctly predicted; FP is false positive, which means the positive samples are incorrectly predicted by the model; FN is false negative, which means the negative samples are incorrectly predicted by the model;

[0043] The sample training set is randomly divided into a training set and a test set in a ratio of 8:2 and input into the AI ​​recognition model. The AI ​​recognition model is randomly trained multiple times with different model combinations, and the classification model evaluation index is obtained through cross-validation;

[0044] According to the classification model evaluation index, the number of learning and training times of the convolutional neural network is dynamically adjusted, the sample weight of specific easily confused bacterial species is increased, and the parameters of the AI ​​recognition model are adaptively adjusted.

[0045] As a preferred embodiment of the present invention, by Accuracy , I Recall , I SP and I F1-score The indicator sets performance thresholds as a criterion for determining whether the AI ​​recognition model needs to be optimized:

[0046] If the recognition accuracy of multiple consecutive batches of samples is lower than 93%, the model adaptive update is triggered;

[0047] If the recall rate of a certain type of bacteria is lower than 90%, the samples of this type will be trained with enhanced focus;

[0048] If the harmonic mean of precision and recall is lower than 95%, the model is considered ready for deployment; otherwise, the model is returned to optimize model parameters or retrain.

[0049] If the colony class-specific error is higher than 3%, local optimization of the backend counting algorithm or instance segmentation module is performed.

[0050] As a preferred solution of the present invention, the model performance is evaluated by testing the training data set, combining the preset microbial limit standard threshold to determine whether the test sample is microbially contaminated, and generating a visual analysis report, including:

[0051] Testing the dataset in the microbial category set using the AI ​​recognition model to perform classification prediction and quantity estimation on each test sample;

[0052] Set the maximum allowable limit of different types of microorganisms as the threshold, and use the threshold as the basis for contamination judgment;

[0053] Comparing the microbial species and corresponding quantities output by the AI ​​recognition model with the threshold value to determine whether they exceed the limit, and automatically determining whether the test sample is contaminated by microorganisms;

[0054] When the entire testing process is completed, the report generation is automatically triggered to show the changes in microbial contamination trends.

[0055] A second aspect of the present invention provides an AI-based identification system for identifying microbial contamination in food and cosmetics, comprising:

[0056] The sample collection and processing module accurately collects representative samples from the food or cosmetics to be tested, prepares a homogenous sample solution through a ten-fold gradient dilution, and uses a microscopic imaging device to perform high-definition imaging of microbial colonies;

[0057] The sample screening module uses the maximum probable number counting method and tunable semiconductor laser absorption spectroscopy equipment to monitor changes in carbon dioxide concentration generated during the cultivation process and evaluate the growth status of microorganisms;

[0058] The AI ​​recognition optimization module uses a convolutional neural network to train a microbial colony image dataset and dynamically adjusts AI recognition parameters based on real-time evaluation results to adapt to emerging microbial types or mutations.

[0059] A contamination judgment module automatically determines whether microbial contamination exists based on the type and quantity of microorganisms output by the AI ​​recognition model and the preset microbial limit standard threshold;

[0060] The user interface provides an intuitive and easy-to-use operation interface, allowing users to enter sample information, start the detection process, and view real-time progress and final results.

[0061] Compared with the prior art, the present invention has the following beneficial effects:

[0062] The present invention uses a convolutional neural network to construct an AI recognition model to train images of target areas of microbial colonies, ensuring the diversity and representativeness of the training data set, enabling the model to learn broader and more representative features, thereby improving performance on unseen data. The use of the cross-entropy loss function as the optimization target value helps to accurately measure the gap between the model prediction results and the actual labels, guiding the update of model parameters to minimize the gap, thereby improving classification accuracy and realizing intelligent classification of different microbial species.

[0063] By combining the trained AI recognition model with the FasterR-CNN target detection method, accurate classification and quantitative statistics of microbial species can be achieved, and the MPN method is combined to estimate the microbial concentration in the original sample. Not only can each colony be classified and identified with high precision, but it can also be accurately located and independently counted. The category, confidence level and quantity information of each colony can be output simultaneously to form a complete microbial contamination analysis report, which improves the accuracy and scientificity of the final identification results. The adaptive adjustment mechanism enables the model to automatically optimize in different application scenarios and adapt to the ever-changing data distribution and detection needs. The entire process requires almost no human intervention, reducing human errors and improving detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other implementation drawings based on the provided drawings without inventive effort.

[0065] Figure 1 A flow chart of a method for identifying microbial contamination in food and cosmetics based on AI recognition provided in an embodiment of the present invention;

[0066] Figure 2 Block diagram of the AI-based identification system for microbial contamination in food and cosmetics provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0067] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0068] like Figure 1 and Figure 2 As shown, the present invention provides a method for identifying microbial contamination in food and cosmetics based on AI recognition, comprising the following steps:

[0069] Collect food or cosmetics to be tested as test samples, use the maximum probable number (MPN) counting method combined with tunable semiconductor laser spectroscopy (TDLAS) to detect the carbon dioxide concentration in the sample culture bottle, and obtain the colony growth status of the microorganisms in the test sample;

[0070] In this embodiment, the MPN method is combined with TDLAS carbon dioxide concentration monitoring to achieve rapid initial screening of the microbial growth status, avoiding the disadvantage of the traditional culture method that requires a long time to wait for colonies to be visible. The entire AI recognition model can perform analysis and judgment in the early stage of colony formation, greatly shortening the entire detection cycle.

[0071] Acquire a microbial growth image of the test sample in the culture dish using a microscopic imaging device according to the colony growth state, pre-process the microbial growth image, and acquire a target area of ​​the microbial colony;

[0072] In this embodiment, a combination of microscopic imaging + image preprocessing + deep learning CNN model is used to effectively improve the recognition ability of complex backgrounds, similar colors, and adherent colonies. Through pre-training and continuous optimization mechanisms, the system can identify a variety of common contaminating microorganisms, including pathogenic bacteria, spoilage bacteria, indicator bacteria, etc., and has good generalization and anti-interference capabilities.

[0073] A convolutional neural network is used to construct an AI recognition model, which is trained on the preprocessed image of the target area of ​​the microbial colony to obtain a training data set containing multiple microbial colonies, and the types and quantities of microorganisms in the test sample are obtained;

[0074] The parameters of the AI ​​recognition model are adjusted in real time according to the types and quantities of the microorganisms. The model performance is evaluated by testing the training data set. Combined with the preset microbial limit standard threshold, it is determined whether the test sample is microbially contaminated and a visual analysis report is generated.

[0075] In this embodiment, an online feedback mechanism and a model parameter adaptive adjustment strategy are introduced into the AI ​​recognition model, so that the AI ​​recognition model can be continuously optimized according to new sample data or expert correction information, and supports incremental learning and transfer learning, ensuring the long-term stable operation of the system and adaptability to new contaminating microorganisms.

[0076] Collect food or cosmetics to be tested as test samples, use the maximum probable number (MPN) counting method combined with tunable semiconductor laser spectroscopy (TDLAS) to detect the carbon dioxide concentration in the sample culture bottle, and obtain the colony growth status of microorganisms in the test sample, including:

[0077] Collect a test sample from the food or cosmetic to be tested, perform a ten-fold gradient dilution on the test sample, and obtain six homogenous solutions of the gradient dilution samples;

[0078] In this embodiment, by performing a ten-fold gradient dilution and selecting six dilution degrees, a wide range of microbial concentrations from high to low can be covered, thereby avoiding detection blind spots caused by excessively high or low microbial density in the original sample and improving the adaptability and sensitivity of the system.

[0079] The maximum probable number (MPN) counting method is used to estimate the number of viable bacteria in each sample solution, and the carbon dioxide concentration in each sample solution culture bottle is monitored in real time by tunable semiconductor laser spectroscopy (TDLAS) to obtain the number of microbial flora at different concentrations.

[0080] In this embodiment, the most probable number (MPN) counting method is used to count the microbial flora, which can estimate the approximate number of live bacteria in the sample based on the probability of a positive reaction, thereby achieving a quantitative estimation of the number of live bacteria.

[0081] In this embodiment, tunable semiconductor laser absorption spectroscopy has the advantages of high sensitivity, high selectivity and fast response speed. It can monitor CO2 concentration changes in real time and continuously without destroying the culture environment, thereby reflecting the metabolic activity and growth dynamics of microorganisms, avoiding the contamination risks and operational errors caused by traditional methods such as opening the lid for sampling and staining microscopy.

[0082] According to the curve of the change of carbon dioxide concentration over time, the growth rate of microorganisms at different dilution concentrations is obtained, and the colony growth state of microorganisms is obtained.

[0083] In this embodiment, the rate at which microbial metabolism produces carbon dioxide is closely related to the type, quantity, and growth stage. By analyzing the curve of carbon dioxide concentration changes over time, key growth parameters such as the lag phase, logarithmic growth phase, and plateau phase of the microorganisms can be extracted, which helps to predict the reproduction potential and pollution risk of microorganisms.

[0084] Extracting test samples from the culture dishes corresponding to the microbial flora at different concentrations, detecting harmful ions in the samples through the chemical structure of the probes, and obtaining structural information of the corresponding probes;

[0085] The structural information of the corresponding probe is converted into InChIKey format by using ChemDes to obtain the structural data of the fluorescent molecular probe;

[0086] In this embodiment, the SMILES format of the original probe structure is uniformly converted into the InChIKey format to ensure the standardization of molecular structure expression, facilitate comparison, retrieval and model migration in public databases, and enhance the openness and sharing of data.

[0087] constructing four binary classification sub-datasets for the fluorescent molecular probe structure data, deleting the fluorescent molecular probe structure data with the most duplicate data, and obtaining a harmful ion selective data set;

[0088] performing sampling optimization on the harmful ion selective dataset by generating an adversarial network, identifying molecular descriptors of compound molecules in the harmful ion selective dataset, and constructing a molecular feature set based on the molecular descriptors;

[0089] In this embodiment, microbial contamination is often accompanied by the release of toxic metabolites or harmful substances such as heavy metal ions. Detecting harmful ions through the chemical structure of the probe can supplement the results of microbial species identification from a chemical perspective, achieve multi-dimensional risk assessment of contamination in microorganisms and chemical molecules, and improve the comprehensiveness and accuracy of the detection system.

[0090] Recursive cross-validation of the descriptor features of the molecular feature set using a random forest algorithm is performed, and the molecular feature set is optimized by recursively selecting features one by one to obtain a sample training set;

[0091] In this embodiment, constructing multiple binary classification sub-datasets helps to distinguish different categories of harmful ions, delete duplicate structural data, avoid model overfitting, and improve training efficiency and prediction accuracy;

[0092] In this embodiment, molecular data related to harmful ions are usually scarce. The generative adversarial network can generate virtual samples with chemical rationality, increase the number and diversity of minority class samples in the data set, and alleviate the bias problem caused by data imbalance.

[0093] Acquiring a microbial growth image of the test sample in the culture dish using a microscopic imaging device according to the colony growth state, preprocessing the microbial growth image, and acquiring a target area of ​​the microbial colony, including:

[0094] Using a microscopic imaging device to image the microbial colonies in the culture dish to obtain an original microbial growth image containing multiple colonies;

[0095] Using Gaussian filtering on the original microbial growth image to remove random noise in the image, and obtaining a colony growth image with edge detail data;

[0096] Adopting an adaptive histogram equalization algorithm to enhance the local contrast of the colony growth image, enhancing the color difference through color space conversion to obtain image enhancement data, and binarizing the image using an adaptive threshold method to obtain the colony growth area.

[0097] In this embodiment, Gaussian filtering is used to remove random noise, retain the details of the colony edge, and avoid misidentification due to noise interference. Adaptive histogram equalization is used to enhance the local contrast of the image, making the colony boundary clearer, facilitating subsequent contour extraction, and improving classification distinguishability.

[0098] The contour structure of the colony growth area is optimized, the colony target area is extracted, and a clear microbial colony image area is obtained.

[0099] In this embodiment, morphological operations are performed on the colony contours to eliminate small noise points and fill holes. Connected domain analysis is used to solve the problem of segmenting adherent colonies, achieve accurate positioning and extraction of individual colonies, and output clear and independent images of the colony target area, providing high-quality sample data for AI model training.

[0100] An AI recognition model is constructed using a convolutional neural network to train the pre-processed image of the target area of ​​the microbial colony, including:

[0101] Collect common contaminating microorganisms in food and cosmetics, and construct a colony image dataset containing multiple microorganisms in the microbial colony image area;

[0102] Repeat the experiment for each test sample under the same culture conditions to obtain colony images at different growth stages, create a sample image for each colony image, label the sample image category, and construct a labeled colony training dataset;

[0103] In this example, by repeating the experiment and collecting colony images at different growth stages, the diversity and representativeness of the training dataset were ensured, enabling the model to learn broader and more representative features, thereby improving performance on unseen data.

[0104] A convolutional neural network is used to take the colony training dataset and the colony image dataset as input training data for the AI ​​recognition model, and a cross-entropy loss function is used to calculate the optimization target value of the input training data;

[0105] In this embodiment, the use of the cross-entropy loss function as the optimization target value helps to accurately measure the gap between the model prediction results and the actual labels, guide the update of the model parameters to minimize this gap, and thus improve the classification accuracy. The use of confusion matrix analysis can clearly show the misclassification between each colony, help to adjust the model structure or parameters in a targeted manner, and reduce the misclassification between specific categories.

[0106] Iteratively updating the AI ​​recognition model parameters by adjusting the colony image dataset in real time, analyzing the misjudgment between colonies using a confusion matrix, and adjusting the structure of the AI ​​recognition model in real time;

[0107] The predicted probability of each bacterial species is output through the fully connected layer in the convolutional neural network, and the Softmax classifier is used to map the feature vector to a set of microbial categories based on the predicted probability.

[0108] In this embodiment, the convolutional neural network can automatically extract complex features from the input image without the need for manually designed feature extraction algorithms, greatly simplifying the model development process while improving the effectiveness of feature extraction. The Softmax classifier is used to map feature vectors to a set of microbial categories based on the predicted probability, thereby realizing intelligent classification of different microbial species.

[0109] In this embodiment, during the AI ​​recognition model training process, the AI ​​recognition model parameters are adjusted in real time, and the optimal solution is gradually approached through continuous iterative updates, thereby ensuring the learning efficiency and final performance of the model.

[0110] Extracting a training data set containing multiple microbial colonies from the microbial category set to obtain the types and quantities of microorganisms in the test sample includes:

[0111] Inputting a colony training dataset of multiple colony regions in the microbial category set into the AI ​​recognition model, and establishing a colony classifier by learning the characteristics of each colony category;

[0112] The Faster R-CNN target detection method is used to locate and count each colony in the microbial category set, and the microbial category to which each colony belongs and its confidence are obtained;

[0113] In this embodiment, the FasterR-CNN target detection algorithm is used to not only classify and identify each colony with high precision, but also accurately locate and independently count it. The system can simultaneously output the category, confidence level, and quantity information of each colony to form a complete microbial contamination analysis report.

[0114] When the confidence level is set higher than a certain threshold, the colony is judged to belong to a specific type;

[0115] In this embodiment, the confidence threshold is set to 90%. Only when the confidence of the AI ​​recognition model is higher than this threshold is it determined to be a specific bacterial species. This can filter out low-quality images or uncertain prediction results and improve the accuracy of the final recognition result.

[0116] The number of independent colonies was counted by the FasterR-CNN target detection method, and the concentration of microorganisms in the original sample was estimated by combining the MPN method to obtain the types of microorganisms contained in the microbial category set, the number of each colony, and the total number of bacteria.

[0117] In this embodiment, based on the constructed microbial category set, the system can identify multiple common contaminating bacteria at one time, meeting the comprehensive detection needs of multiple pathogenic bacteria and hygiene indicator bacteria in the food and cosmetics industry.

[0118] Establishing classification model evaluation indicators based on the types and quantities of microorganisms, and adjusting the parameters of the AI ​​recognition model in real time, including:

[0119] Based on the types and quantities of microorganisms, a multi-dimensional classification model evaluation index is constructed, including the recognition accuracy I Accuracy , recall rate I Recall , colony type specificity I SP And the harmonic mean of precision and recall I F1-score , whose expression is:

[0120]

[0121] Among them, TP is true positive, which means the positive samples are correctly predicted by the model; TN is true negative, which means the negative samples are correctly predicted; FP is false positive, which means the positive samples are incorrectly predicted by the model; FN is false negative, which means the negative samples are incorrectly predicted by the model;

[0122] In this embodiment, multi-dimensional evaluation indicators such as recognition accuracy, recall rate, precision and F1-score are constructed to comprehensively reflect the performance of the AI ​​recognition model in different aspects. The colony category specificity further measures the model's ability to exclude non-target bacteria species, ensuring high-precision classification.

[0123] The sample training set is randomly divided into a training set and a test set in a ratio of 8:2 and input into the AI ​​recognition model. The AI ​​recognition model is randomly trained multiple times with different model combinations, and the classification model evaluation index is obtained through cross-validation;

[0124] In this embodiment, the sample training set is randomly divided into a training set and a test set in a ratio of 8:2, and the classification model evaluation index is obtained through multiple random training and cross-validation. This method can not only evaluate the model performance more comprehensively, but also effectively reduce the risk of overfitting and improve the model generalization ability.

[0125] According to the classification model evaluation index, the number of learning and training times of the convolutional neural network is dynamically adjusted, the sample weight of specific easily confused bacterial species is increased, and the parameters of the AI ​​recognition model are adaptively adjusted.

[0126] In this embodiment, increasing the sample weight or performing focused enhanced training for easily confused strains can effectively improve the recognition accuracy of these strains. By dynamically adjusting the learning rate or other hyperparameters of the convolutional neural network, it is ensured that the model can still maintain good performance in the face of complex situations.

[0127] By means of the I Accuracy , I Recall , I SP and I F1-scoreThe indicator sets performance thresholds as a criterion for determining whether the AI ​​recognition model needs to be optimized:

[0128] If the recognition accuracy of multiple consecutive batches of samples is lower than 93%, the model adaptive update is triggered;

[0129] If the recall rate of a certain type of bacteria is lower than 90%, the samples of this type will be trained with enhanced focus;

[0130] If the harmonic mean of precision and recall is lower than 95%, the model is considered ready for deployment; otherwise, the model is returned to optimize model parameters or retrain.

[0131] If the colony class-specific error is higher than 3%, local optimization of the backend counting algorithm or instance segmentation module is performed.

[0132] In this embodiment, by setting clear performance thresholds, an automated self-assessment and optimization mechanism of the model is implemented. This mechanism helps to promptly discover and correct potential problems in the model, avoiding performance degradation caused by long-term operation.

[0133] The model performance is evaluated by testing the training data set, and combined with the preset microbial limit standard threshold, it is determined whether the test sample is microbially contaminated, and a visual analysis report is generated, including:

[0134] Testing the dataset in the microbial category set using the AI ​​recognition model to perform classification prediction and quantity estimation on each test sample;

[0135] Set the maximum allowable limit of different types of microorganisms as the threshold, and use the threshold as the basis for contamination judgment;

[0136] Comparing the microbial species and corresponding quantities output by the AI ​​recognition model with the threshold value to determine whether they exceed the limit, and automatically determining whether the test sample is contaminated by microorganisms;

[0137] When the entire testing process is completed, the report generation is automatically triggered to show the changes in microbial contamination trends.

[0138] In this embodiment, the maximum allowable limits of microorganisms published by authorities, such as GB4789, ISO standards, and CFDA cosmetics specifications, are used as the basis for contamination judgment, so that the output results of the AI ​​recognition system have regulatory adaptability and regulatory acceptance. The system can not only determine whether the total bacterial count exceeds the standard, but also set limits for specific pathogens, avoiding the subjectivity and inefficiency brought about by traditional manual interpretation, and speeding up the feedback speed of test results.

[0139] Second embodiment: A system for identifying microbial contamination in food and cosmetics based on AI recognition, comprising:

[0140] The sample collection and processing module accurately collects representative samples from the food or cosmetics to be tested, prepares a homogenous sample solution through a ten-fold gradient dilution, and uses a microscopic imaging device to perform high-definition imaging of microbial colonies;

[0141] The sample screening module uses the maximum probable number counting method and tunable semiconductor laser absorption spectroscopy equipment to monitor changes in carbon dioxide concentration generated during the cultivation process and evaluate the growth status of microorganisms;

[0142] The AI ​​recognition optimization module uses a convolutional neural network to train a microbial colony image dataset and dynamically adjusts AI recognition parameters based on real-time evaluation results to adapt to emerging microbial types or mutations.

[0143] A contamination judgment module automatically determines whether microbial contamination exists based on the type and quantity of microorganisms output by the AI ​​recognition model and the preset microbial limit standard threshold;

[0144] The user interface provides an intuitive and easy-to-use operation interface, allowing users to enter sample information, start the detection process, and view real-time progress and final results.

[0145] In this embodiment, the sample collection and processing module ensures the representativeness and uniformity of the sample, reduces errors caused by sample unevenness, and can cover microorganisms in different concentration ranges through gradient dilution. It is suitable for various sample types. The entire process requires almost no human intervention, reduces human errors, and improves detection efficiency. Different limit values ​​can be set according to different types of microorganisms to achieve graded and classified early warning.

[0146] The present invention uses a convolutional neural network to construct an AI recognition model to train images of target areas of microbial colonies, ensuring the diversity and representativeness of the training data set, enabling the model to learn broader and more representative features, thereby improving performance on unseen data. The use of the cross-entropy loss function as the optimization target value helps to accurately measure the gap between the model prediction results and the actual labels, guiding the update of model parameters to minimize the gap, thereby improving classification accuracy, realizing intelligent classification of different microbial species, and improving recognition accuracy.

[0147] By combining the trained AI recognition model with the FasterR-CNN target detection method, accurate classification and quantitative statistics of microbial species can be achieved, and the MPN method is combined to estimate the microbial concentration in the original sample. Not only can each colony be classified and identified with high precision, but it can also be accurately located and independently counted. The category, confidence level and quantity information of each colony can be output simultaneously to form a complete microbial contamination analysis report, which improves the accuracy and scientificity of the final identification results. The adaptive adjustment mechanism enables the model to automatically optimize in different application scenarios and adapt to the ever-changing data distribution and detection needs. The entire process requires almost no human intervention, reducing human errors and improving detection efficiency.

[0148] The above embodiments are merely exemplary embodiments of the present application and are not intended to limit the scope of the present application. The scope of protection of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and scope of protection of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the scope of protection of the present application.

Claims

1. A method for identifying microbial contamination in food and cosmetics based on AI recognition, characterized in that: The following steps are involved: Collect food or cosmetics to be tested as test samples, use the maximum probable number (MPN) counting method combined with tunable semiconductor laser spectroscopy (TDLAS) to detect the carbon dioxide concentration in the sample culture bottle, and obtain the colony growth status of the microorganisms in the test sample; Acquire a microbial growth image of the test sample in the culture dish using a microscopic imaging device according to the colony growth state, pre-process the microbial growth image, and acquire a target area of ​​the microbial colony; Convolutional neural networks are used to build an AI recognition model, which is trained on the preprocessed images of the target area of ​​the microbial colony to obtain a training data set containing multiple microbial colonies, and the types and quantities of microorganisms in the test sample are obtained; The parameters of the AI ​​recognition model are adjusted in real time according to the types and quantities of the microorganisms. The model performance is evaluated by testing the training data set. Combined with the preset microbial limit standard threshold, it is determined whether the test sample is microbially contaminated and a visual analysis report is generated.

2. The method for identifying microbial contamination in food and cosmetics based on AI recognition according to claim 1, characterized in that: Collect food or cosmetics to be tested as test samples, use the maximum probable number (MPN) counting method combined with tunable semiconductor laser spectroscopy (TDLAS) to detect the carbon dioxide concentration in the sample culture bottle, and obtain the colony growth status of microorganisms in the test sample, including: Collect a test sample from the food or cosmetic to be tested, perform a ten-fold gradient dilution on the test sample, and obtain six homogenous solutions of the gradient dilution samples; The maximum probable number (MPN) counting method is used to estimate the number of viable bacteria in each sample solution, and the carbon dioxide concentration in each sample solution culture bottle is monitored in real time by tunable semiconductor laser spectroscopy (TDLAS) to obtain the number of microbial flora at different concentrations. According to the curve of the change of carbon dioxide concentration over time, the growth rate of microorganisms at different dilution concentrations is obtained, and the colony growth state of microorganisms is obtained.

3. The method for identifying microbial contamination in food and cosmetics based on AI recognition according to claim 2, characterized in that: include: Extracting test samples from the culture dishes corresponding to the microbial flora at different concentrations, detecting harmful ions in the samples through the chemical structure of the probes, and obtaining structural information of the corresponding probes; The structural information of the corresponding probe is converted into InChIKey format by using ChemDes to obtain the fluorescent molecular probe structural data; constructing four binary classification sub-datasets for the fluorescent molecular probe structure data, deleting the fluorescent molecular probe structure data with the most duplicate data, and obtaining a harmful ion selective data set; performing sampling optimization on the harmful ion selective dataset by generating an adversarial network, identifying molecular descriptors of compound molecules in the harmful ion selective dataset, and constructing a molecular feature set based on the molecular descriptors; The descriptor features of the molecular feature set are recursively cross-validated using the features of the random forest algorithm, and the molecular feature set is optimized by recursively selecting features one by one to obtain a sample training set.

4. The method for identifying microbial contamination in food and cosmetics based on AI recognition according to claim 2, characterized in that: Acquiring a microbial growth image of the test sample in the culture dish using a microscopic imaging device according to the colony growth state, preprocessing the microbial growth image, and acquiring a target area of ​​the microbial colony, including: Using a microscopic imaging device to image the microbial colonies in the culture dish, obtaining an original microbial growth image containing multiple colonies; Using Gaussian filtering on the original microbial growth image to remove random noise in the image, and obtaining a colony growth image with edge detail data; Adopting an adaptive histogram equalization algorithm to enhance the local contrast of the colony growth image, enhancing the color difference through color space conversion to obtain image enhancement data, and binarizing the image using an adaptive threshold method to obtain the colony growth area. The contour structure of the colony growth area is optimized, the colony target area is extracted, and a clear microbial colony image area is obtained.

5. The method for identifying microbial contamination in food and cosmetics based on AI recognition according to claim 4, characterized in that: An AI recognition model is constructed using a convolutional neural network to train the pre-processed image of the target area of ​​the microbial colony, including: Collecting common contaminating microorganisms in food and cosmetics, and constructing a colony image dataset containing multiple microorganisms in the microbial colony image area; Repeat the experiment for each test sample under the same culture conditions to obtain colony images at different growth stages, create a sample image for each colony image, label the sample image category, and construct a labeled colony training dataset; A convolutional neural network is used to take the colony training dataset and the colony image dataset as input training data for the AI ​​recognition model, and a cross-entropy loss function is used to calculate the optimization target value of the input training data; Iteratively updating the AI ​​recognition model parameters by adjusting the colony image dataset in real time, analyzing the misjudgment between colonies using a confusion matrix, and adjusting the structure of the AI ​​recognition model in real time; The predicted probability of each bacterial species is output through the fully connected layer in the convolutional neural network, and the Softmax classifier is used to map the feature vector to a set of microbial categories based on the predicted probability.

6. The method for identifying microbial contamination in food and cosmetics based on AI recognition according to claim 5, characterized in that: Extracting a training data set containing multiple microbial colonies from the microbial category set to obtain the types and quantities of microorganisms in the test sample includes: Inputting a colony training dataset of multiple colony regions in the microbial category set into the AI ​​recognition model, and establishing a colony classifier by learning the characteristics of each colony category; The Faster R-CNN target detection method is used to locate and count each colony in the microbial category set, and the microbial category to which each colony belongs and its confidence are obtained; When the confidence level is set higher than a certain threshold, the colony is judged to belong to a specific type; The number of independent colonies was counted by the FasterR-CNN target detection method, and the concentration of microorganisms in the original sample was estimated by combining the MPN method to obtain the types of microorganisms contained in the microbial category set, the number of each colony, and the total number of bacteria.

7. The method for identifying microbial contamination in food and cosmetics based on AI recognition according to claim 6, characterized in that: Establishing classification model evaluation indicators based on the types and quantities of microorganisms, and adjusting the parameters of the AI ​​recognition model in real time, including: Based on the types and quantities of microorganisms, a multi-dimensional classification model evaluation index is constructed, including the recognition accuracy I Accuracy , recall rate I Recall , colony type specificity I SP And the harmonic mean of precision and recall I F1-score , whose expression is: Among them, TP is true positive, which means the positive samples are correctly predicted by the model; TN is true negative, which means the negative samples are correctly predicted; FP is false positive, which means the positive samples are incorrectly predicted by the model; FN is false negative, which means the negative samples are incorrectly predicted by the model; The sample training set is randomly divided into a training set and a test set in a ratio of 8:2 and input into the AI ​​recognition model. The AI ​​recognition model is randomly trained multiple times with different model combinations, and the classification model evaluation index is obtained through cross-validation; According to the classification model evaluation index, the number of learning and training times of the convolutional neural network is dynamically adjusted, the sample weight of specific easily confused bacterial species is increased, and the parameters of the AI ​​recognition model are adaptively adjusted.

8. The method for identifying microbial contamination in food and cosmetics based on AI recognition according to claim 7, characterized in that: By means of the I Accuracy , I Recall , I SP and I F1-score The indicator sets performance thresholds as a criterion for determining whether the AI ​​recognition model needs to be optimized: If the recognition accuracy of multiple consecutive batches of samples is lower than 93%, the model adaptive update is triggered; If the recall rate of a certain type of bacteria is lower than 90%, the samples of this type will be trained with enhanced focus; If the harmonic mean of precision and recall is lower than 95%, the model is considered ready for deployment; otherwise, the model is returned to optimize model parameters or retrain. If the colony class-specific error is higher than 3%, local optimization of the backend counting algorithm or instance segmentation module is performed.

9. The method for identifying microbial contamination in food and cosmetics based on AI recognition according to claim 7, characterized in that: The model performance is evaluated by testing the training data set, and combined with the preset microbial limit standard threshold, it is determined whether the test sample is microbially contaminated, and a visual analysis report is generated, including: Testing the dataset in the microbial category set using the AI ​​recognition model to perform classification prediction and quantity estimation on each test sample; Set the maximum allowable limit of different types of microorganisms as the threshold, and use the threshold as the basis for contamination judgment; Comparing the microbial species and corresponding quantities output by the AI ​​recognition model with the threshold value to determine whether they exceed the limit, and automatically determining whether the test sample is contaminated by microorganisms; When the entire testing process is completed, the report generation is automatically triggered to show the changes in microbial contamination trends.

10. An AI-based identification system for microbial contamination in food and cosmetics, characterized by: include: The sample collection and processing module accurately collects representative samples from the food or cosmetics to be tested, prepares a homogenous sample solution through a ten-fold gradient dilution, and uses a microscopic imaging device to perform high-definition imaging of microbial colonies; The sample screening module uses the maximum probable number counting method and tunable semiconductor laser absorption spectroscopy equipment to monitor changes in carbon dioxide concentration generated during the cultivation process and evaluate the growth status of microorganisms; The AI ​​recognition optimization module uses a convolutional neural network to train a microbial colony image dataset and dynamically adjusts AI recognition parameters based on real-time evaluation results to adapt to emerging microbial types or mutations. A contamination judgment module automatically determines whether microbial contamination exists based on the type and quantity of microorganisms output by the AI ​​recognition model and the preset microbial limit standard threshold; The user interface provides an intuitive and easy-to-use operation interface, allowing users to enter sample information, start the detection process, and view real-time progress and final results.

Citation Information

Cited By

  • Beverage total colony count real-time early warning system based on impedance microbiological diagnosis

    CN120820597A

  • Image super-resolution reconstruction method for hypha topological structure

    CN120976025A

  • A mycelium topology-oriented image super-resolution reconstruction method

    CN120976025B

  • Life health management method and system for HR3C material

    CN121122529A

  • A method and system for life health management of HR3C materials

    CN121122529B