An automated food safety diagnosis system and method based on artificial intelligence
Through an automated food safety diagnosis system based on artificial intelligence, combined with historical text data and image recognition technology, the problem of inaccurate food safety diagnosis in the existing technology is solved, and the accuracy of food safety judgment and the robustness of the system are improved.
Patent Information
- Application Number
- CN202411046097.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2044-08-01
AI Technical Summary
The existing food safety diagnostic technology has the risk of misjudgment and has failed to effectively consider the impact of social events and the behavior of inspectors on food safety.
Using an automated food safety diagnosis system based on artificial intelligence, a collection of characteristic vocabulary and food safety verification items is generated by acquiring and preprocessing historical social text data and business text data, and using image recognition technology to analyze the violations of inspectors, calculate the abnormal scores of food samples to judge food safety.
It improves the accuracy of food safety judgments, reduces the impact of social events on enterprises, and reduces the risk of food sample contamination by analyzing the violations of inspectors.
Smart Images

Figure CN118918639B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of food safety diagnosis, and in particular to an artificial intelligence-based automated food safety diagnosis system and method. Background Art
[0002] With the advancement of modern technology and the improvement of living standards, more and more people choose to choose processed food. The processed food here refers to the addition of various chemical additives and artificially synthesized ingredients during the production and manufacturing process, so that the food can maintain a good taste and appearance during processing and storage, and can also increase the nutrition and shelf life of the food.
[0003] However, at the same time, it also brings about the safety issues of processed foods. In the existing food safety diagnosis, fixed food safety verification items preset by the enterprise are often used, without considering real-time changing social events, which can easily lead to inaccurate food safety diagnosis. In addition, the enterprise does not consider the impact of verification personnel on food safety diagnosis during food safety diagnosis.
[0004] Therefore, the present invention discloses an artificial intelligence-based food safety automated diagnosis system and method to solve the above problems. Summary of the invention
[0005] The purpose of the present invention is to provide an artificial intelligence-based food safety automated diagnosis system and method to solve the problems raised in the above-mentioned background technology.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: an artificial intelligence-based automated food safety diagnosis method, the method comprising the following steps:
[0007] S1: Obtain the historical social text data and historical business text data related to food safety of the enterprise, and perform data preprocessing on the historical social text data and historical business text data;
[0008] S2: Analyze the preprocessed data to generate feature words, select features based on the feature words to form a feature sequence, and form a total food safety verification item set based on the feature sequence;
[0009] S3: Conduct food safety verification on food samples according to the total food safety verification item set, use image recognition technology to identify the inspectors in the inspection area and the inspectors' behavior records, and analyze the inspectors' violations;
[0010] S4: Calculate the abnormal score of the food sample according to the verification results of the food safety verification items, and judge the food safety according to the abnormal score of the food sample.
[0011] According to the above scheme, in S1, the system presets a time limit, and obtains historical social text data and historical business text data that are associated with the company's products and related to food safety within the preset time limit, the historical social text data including scientific literature text data, research report text data and news article text data; the historical business text data including supervision and inspection text data, product sampling text data, guarantee supervision text data and complaint and reporting text data; data preprocessing is performed on the historical social text data and historical business text data related to food safety, and the data preprocessing includes text cleaning, word segmentation, stop word removal, stem extraction and part of speech restoration; after preprocessing the historical social text data, a historical social text word sequence is generated, and after preprocessing the historical business text data, a historical business text word sequence is generated; different historical business text word sequences are integrated to form a total historical business text word sequence.
[0012] According to the above scheme, in S2, the following steps are included:
[0013] S201: Generate N-grams as feature words from the historical social text word sequence and the historical business text total word sequence generated after preprocessing according to a preset n value, count the frequency of each feature word in the sequence to which it belongs, and arrange the feature words in the respective historical social text word sequence and the historical business text total word sequence in descending order according to the frequency of occurrence to form a historical social text arranged word sequence and a historical business text arranged word sequence respectively;
[0014] S202: setting a frequency threshold for the frequency of occurrence of characteristic words in the historical business text arrangement word sequence, extracting characteristic words whose occurrence frequency is greater than or equal to the set frequency threshold to form the historical business text characteristic word sequence, and discarding characteristic words whose frequency is less than the set frequency threshold; the arrangement order of the characteristic words in the historical business text characteristic word sequence is consistent with the arrangement order of the historical business text arrangement word sequence;
[0015] S203: extracting characteristic words in sequence according to the arrangement order of characteristic words in the characteristic word sequence of the historical business text, recording the extracted characteristic words as comparison words, searching for characteristic words identical to the comparison words in the arranged word sequence of the historical social text, recording the characteristic words identical to the comparison words as comparison words;
[0016] Calculate the standard deviation of the occurrence frequency of all characteristic words in the historical social text arrangement word sequence to which the compared word belongs; if the occurrence frequency of the compared word is greater than or equal to the standard deviation, extract the characteristic words whose occurrence frequency is greater than or equal to the occurrence frequency of the compared word in the historical social text arrangement word sequence to which the compared word belongs, and form the extracted characteristic words into a first historical social text characteristic word sequence; otherwise, discard the entire historical social text arrangement word sequence;
[0017] S204: Integrate all the characteristic words in the first historical social text characteristic word sequence and the characteristic words in the historical business text arrangement word sequence extracted in step S203 to form a second historical social text characteristic word sequence; compare and search the characteristic words in the second historical social text characteristic word sequence with the food safety verification item database to generate a food safety verification item set, and generate a total food safety verification item set based on the food safety verification item set and the enterprise's preset food safety verification items; the total food safety verification item set includes food safety verification items in food safety testing; the food safety verification item database includes all food safety verification items available on the market.
[0018] Extracting characteristic words from real-time changing social events, analyzing the problems existing in social events and the related food safety verification items, and adding the related food safety verification items to the company's inherent food safety verification items can improve the accuracy of food safety judgments and reduce the impact of social events on the company.
[0019] According to the above scheme, in S3, analyzing the inspector's violation behavior includes the following steps:
[0020] S301: Obtain the behavior records of each inspector in the inspection area, screen out the inspectors whose violation record time is not zero and whose current location is in the verification impact area, and mark them; obtain the historical violation records of each marked inspector, and count the number of historical violation records as D; the violation records include not wearing a mask and not wearing gloves; the verification impact area is a circular area with a preset impact radius with the food sample as the center;
[0021] S302: Obtain the violation record of the day and the current time of each marked inspector, and record the total number of violation records of the day as d; calculate the duration between the current time and the end time of the latest violation record as s, and if the violation record of the day is zero, then the time from the end time of the last second violation record to the start time of the last second violation record in the violation record of the previous day is taken as the latest violation time; calculate the time interval of the violation record of each marked inspector respectively, and take the average value of the time interval as sv, and calculate the violation score VS of each marked inspector. The specific calculation formula is as follows;
[0022] VS=(1+d÷D)×[ln(d+1)+s÷sv];
[0023] S303: Sum the violation scores of all marked inspectors in the inspection area. If the summed violation score is greater than the summed violation score threshold, it is determined that the food sample has a contamination risk; if it is less than or equal to the summed violation score threshold, there is no contamination risk.
[0024] There are many factors that influence the inspection of food samples by inspectors. If inspectors violate regulations during work, it is easy to cause contamination of food samples, and then the subsequent food safety judgment is wrong. The present invention analyzes the violations of inspectors and can improve the accuracy of food safety judgment.
[0025] According to the above scheme, in S4, the verification results of the food safety verification items of the same batch of food samples without contamination risks are extracted, the concentration average value of the verification results of each food safety verification item is calculated, and the food sample abnormality score is calculated based on the concentration average value and the preset weight coefficient for the food safety verification item. If the food sample abnormality score is greater than or equal to the food sample abnormality score threshold, the food sample is unsafe; if the food sample abnormality score is less than the food sample abnormality score threshold, the food sample is safe.
[0026] Another aspect of the present application provides an artificial intelligence-based food safety automated diagnosis system, which is applied to the above-mentioned artificial intelligence-based food safety automated diagnosis method implementation, and the system includes a data acquisition preprocessing module, a feature analysis model building module, a violation behavior analysis module, and a food safety judgment module;
[0027] The data acquisition preprocessing module is used to obtain the historical social text data and historical business text data related to food safety of the enterprise, and perform data preprocessing on the historical social text data and historical business text data;
[0028] The feature analysis model building module is used to analyze the pre-processed data to generate feature words, perform feature selection based on the feature words to form a feature sequence, and form a total food safety verification item set based on the feature sequence;
[0029] The violation behavior analysis module is used to perform food safety verification on food samples according to the total food safety verification item set, identify the inspectors in the inspection area and the behavior records of the inspectors by using image recognition technology, and analyze the violations of the inspectors;
[0030] The food safety judgment module calculates the food sample abnormality score according to the verification results of the food safety verification items, and judges the food safety according to the food sample abnormality score.
[0031] According to the above scheme, the data acquisition and preprocessing module includes a text data acquisition unit and a data preprocessing unit;
[0032] The text data collection unit is used to collect historical social text data and historical business text data related to food safety of the enterprise; the historical social text data includes scientific literature text data, research report text data and news article text data; the historical business text data includes supervision and inspection text data, product sampling text data, guarantee supervision text data and complaint and report text data;
[0033] The data preprocessing unit is used to perform data preprocessing on historical social text data and historical business text data; the data preprocessing includes text cleaning, word segmentation, stop word removal, stem extraction and part-of-speech restoration; after preprocessing the historical social text data, a historical social text word sequence is generated, and after preprocessing the historical business text data, a historical business text word sequence is generated; different historical business text word sequences are integrated to form a total historical business text word sequence.
[0034] According to the above scheme, the feature analysis model construction module includes a text feature analysis unit and a food safety verification total item set construction unit;
[0035] The text feature analysis unit is used to analyze the historical social text word sequence and the historical business text total word sequence to generate feature words, and to analyze the historical social text arrangement word sequence and the historical business text arrangement word sequence to generate a first historical social text feature word sequence;
[0036] The food safety verification total item set construction unit is used to integrate all characteristic words in the first historical social text characteristic word sequence and the characteristic words in the historical business text arrangement word sequence to form a second historical social text characteristic word sequence, and generate a food safety verification total item set based on the characteristic words in the second historical social text characteristic word sequence and the food safety verification item database.
[0037] According to the above scheme, the illegal behavior analysis module includes an image recognition unit and a behavior analysis unit;
[0038] The image recognition unit is used to identify the inspectors in the inspection area and the behavior records of the inspectors using image recognition technology;
[0039] The behavior analysis unit is used to analyze the violation records in the behavior records of the inspectors, calculate and mark the violation scores of the inspectors, and determine whether there is a contamination risk in the food samples.
[0040] Compared with the prior art, the beneficial effects achieved by the present invention are: extracting characteristic words from real-time changing social events, analyzing the problems existing in social events and the related food safety verification items, and adding the related food safety verification items to the enterprise's inherent food safety verification items, which can improve the accuracy of food safety judgments and reduce the impact of social events on enterprises; there are high influencing factors in the inspection of food samples by inspectors. If the inspectors violate regulations during work, it is easy to cause contamination of food samples, and then the subsequent food safety judgment is incorrect. The present invention analyzes the violations of inspectors and can improve the accuracy of food safety judgments. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0042] Figure 1 It is a flow chart of an artificial intelligence-based automated food safety diagnosis method of the present invention;
[0043] Figure 2 It is a structural schematic diagram of an artificial intelligence-based food safety automated diagnosis system of the present invention. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention.
[0045] See also Figure 1 The present invention provides a technical solution: an artificial intelligence-based automated food safety diagnosis method, the method comprising the following steps:
[0046] S1: Obtain the historical social text data and historical business text data related to food safety of the enterprise, and perform data preprocessing on the historical social text data and historical business text data;
[0047] According to the above scheme, in S1, the system presets a time limit and obtains historical social text data and historical business text data that are associated with the company's products and related to food safety within the preset time limit, the historical social text data include scientific literature text data, research report text data and news article text data; the historical business text data include supervision and inspection text data, product sampling text data, guarantee supervision text data and complaint and reporting text data; data preprocessing is performed on the historical social text data and historical business text data related to food safety, and the data preprocessing includes text cleaning, word segmentation, stop word removal, stem extraction and part of speech restoration; after the historical social text data is preprocessed, a historical social text word sequence is generated, and after the historical business text data is preprocessed, a historical business text word sequence is generated; different historical business text word sequences are integrated to form a total historical business text word sequence.
[0048] S2: Analyze the preprocessed data to generate feature words, select features based on the feature words to form a feature sequence, and form a total food safety verification item set based on the feature sequence;
[0049] According to the above scheme, in S2, the following steps are included:
[0050] S201: Generate N-grams as feature words from the historical social text word sequence and the historical business text total word sequence generated after preprocessing according to a preset n value, count the frequency of each feature word in the sequence to which it belongs, and arrange the feature words in the respective historical social text word sequence and the historical business text total word sequence in descending order according to the frequency of occurrence to form a historical social text arranged word sequence and a historical business text arranged word sequence respectively;
[0051] S202: setting a frequency threshold for the frequency of occurrence of characteristic words in the historical business text arrangement word sequence, extracting characteristic words whose occurrence frequency is greater than or equal to the set frequency threshold to form the historical business text characteristic word sequence, and discarding characteristic words whose frequency is less than the set frequency threshold; the arrangement order of the characteristic words in the historical business text characteristic word sequence is consistent with the arrangement order of the historical business text arrangement word sequence;
[0052] S203: extracting characteristic words in sequence according to the arrangement order of characteristic words in the characteristic word sequence of the historical business text, recording the extracted characteristic words as comparison words, searching for characteristic words identical to the comparison words in the arranged word sequence of the historical social text, recording the characteristic words identical to the comparison words as the compared words;
[0053] Calculate the standard deviation of the frequency of all characteristic words in the historical social text arrangement word sequence to which the compared words belong; if the frequency of the compared words is greater than or equal to the standard deviation, extract the characteristic words whose frequency of appearance is greater than or equal to the frequency of appearance of the compared words in the historical social text arrangement word sequence to which the compared words belong, and form the first historical social text characteristic word sequence with the extracted characteristic words; otherwise, discard the entire historical social text arrangement word sequence;
[0054] S204: Integrate all the characteristic words in the first historical social text characteristic word sequence and the characteristic words in the historical business text arrangement word sequence extracted in step S203 to form a second historical social text characteristic word sequence; compare and search the characteristic words in the second historical social text characteristic word sequence with the food safety verification item database to generate a food safety verification item set, and generate a total food safety verification item set based on the food safety verification item set and the enterprise's preset food safety verification items; the total food safety verification item set includes food safety verification items in food safety testing; the food safety verification item database includes all food safety verification items available on the market.
[0055] S3: Conduct food safety verification on food samples according to the total food safety verification item set, use image recognition technology to identify the inspectors in the inspection area and the inspectors' behavior records, and analyze the inspectors' violations;
[0056] According to the above scheme, in S3, analyzing the inspector's violation behavior includes the following steps:
[0057] S301: Obtain the behavior records of each inspector in the inspection area, screen out the inspectors whose violation record time is not zero and whose current location is in the verification impact area, and mark them; obtain the historical violation records of each marked inspector, and count the number of historical violation records as D; violation records include not wearing a mask and not wearing gloves; the verification impact area is a circular area with a preset impact radius and a food sample as the center;
[0058] S302: Obtain the violation record of the day and the current time of each marked inspector, and record the total number of violation records of the day as d; calculate the duration between the current time and the end time of the latest violation record as s, and if the violation record of the day is zero, then the time from the end time of the last second violation record to the start time of the last second violation record in the violation record of the previous day is taken as the latest violation time; calculate the time interval of the violation record of each marked inspector respectively, and take the average value of the time interval as sv, and calculate the violation score VS of each marked inspector. The specific calculation formula is as follows;
[0059] VS=(1+d÷D)×[ln(d+1)+s÷sv];
[0060] Example 1: In this example, the number of historical violation records is 100, the total number of violation records on the day is 5, the duration between the end time of the latest violation record is 1 hour, and the time interval between marking the violation records of the inspector is 2 hours; substitute into the calculation formula:
[0061] VS=(1+5÷100)×[ln(5+1)+1÷2]≈2.41;
[0062] S303: Sum the violation scores of all marked inspectors in the inspection area. If the summed violation score is greater than the summed violation score threshold, it is determined that the food sample has a contamination risk; if it is less than or equal to the summed violation score threshold, there is no contamination risk.
[0063] Example 2: The set of violation scores of all marked inspectors in the inspection area is {2.41, 2.59, 3};
[0064] VS 总 =2.41+2.59+3=8;
[0065] In this embodiment, the violation score threshold is set to 5, then the above VS 总 >5, the food sample in this embodiment is at risk of contamination.
[0066] S4: Calculate the abnormal score of the food sample according to the verification results of the food safety verification items, and judge the food safety according to the abnormal score of the food sample.
[0067] According to the above scheme, in S4, the verification results of the food safety verification items of the same batch of food samples without contamination risks are extracted, the concentration average value of the verification results of each food safety verification item is calculated, and the food sample abnormality score is calculated based on the concentration average value and the preset weight coefficient for the food safety verification item. If the food sample abnormality score is greater than or equal to the food sample abnormality score threshold, the food sample is unsafe; if the food sample abnormality score is less than the food sample abnormality score threshold, the food sample is safe.
[0068] See also Figure 2 , the present invention provides a technical solution: another aspect of the present application provides an artificial intelligence-based food safety automated diagnosis system, the system is applied to the above-mentioned artificial intelligence-based food safety automated diagnosis method implementation, the system includes a data acquisition preprocessing module, a feature analysis model building module, a violation behavior analysis module and a food safety judgment module;
[0069] The data collection and preprocessing module is used to obtain the historical social text data and historical business text data related to food safety of the enterprise, and perform data preprocessing on the historical social text data and historical business text data;
[0070] The feature analysis model building module is used to analyze the preprocessed data to generate feature words, select features according to the feature words to form a feature sequence, and form a total food safety verification item set according to the feature sequence;
[0071] The violation analysis module is used to perform food safety verification on food samples according to the total food safety verification item set, use image recognition technology to identify the inspectors in the inspection area and the inspectors' behavior records, and analyze the inspectors' violations;
[0072] The food safety judgment module calculates the food sample abnormality score according to the verification results of the food safety verification items, and judges the food safety according to the food sample abnormality score.
[0073] According to the above scheme, the data acquisition and preprocessing module includes a text data acquisition unit and a data preprocessing unit;
[0074] The text data collection unit is used to collect the historical social text data and historical business text data related to food safety of enterprises; the historical social text data includes scientific literature text data, research report text data and news article text data; the historical business text data includes supervision and inspection text data, product sampling text data, guarantee supervision text data and complaint and report text data;
[0075] The data preprocessing unit is used to perform data preprocessing on historical social text data and historical business text data; data preprocessing includes text cleaning, word segmentation, stop word removal, stem extraction and part-of-speech restoration; after preprocessing the historical social text data, a historical social text word sequence is generated, and after preprocessing the historical business text data, a historical business text word sequence is generated; different historical business text word sequences are integrated to form a total historical business text word sequence.
[0076] According to the above scheme, the feature analysis model construction module includes a text feature analysis unit and a food safety verification total item set construction unit;
[0077] The text feature analysis unit is used to analyze the historical social text word sequence and the historical business text total word sequence to generate feature words, and to analyze the historical social text arrangement word sequence and the historical business text arrangement word sequence to generate a first historical social text feature word sequence;
[0078] The food safety verification total item set construction unit is used to integrate all the characteristic words in the first historical social text characteristic word sequence and the characteristic words in the historical business text arrangement word sequence to form a second historical social text characteristic word sequence, and generate a food safety verification total item set based on the characteristic words in the second historical social text characteristic word sequence and the food safety verification item database.
[0079] According to the above scheme, the illegal behavior analysis module includes an image recognition unit and a behavior analysis unit;
[0080] The image recognition unit is used to identify the inspectors in the inspection area and the behavior records of the inspectors by using image recognition technology;
[0081] The behavior analysis unit is used to analyze the violation records in the behavior records of the inspectors, calculate the violation scores of the marked inspectors, and determine whether there is a risk of contamination in the food samples.
[0082] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0083] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An automated food safety diagnosis method based on artificial intelligence, characterized in that: The method comprises the following steps: S1: Obtain the historical social text data and historical business text data related to food safety of the enterprise, and perform data preprocessing on the historical social text data and historical business text data; S2: Analyze the preprocessed data to generate feature words, select features according to the feature words to form a feature sequence, and form a total food safety verification item set according to the feature sequence; S3: Conduct food safety verification on food samples according to the total food safety verification item set, use image recognition technology to identify the inspectors in the inspection area and the inspectors' behavior records, and analyze the inspectors' violations; S4: Calculate the abnormal score of the food sample according to the verification results of the food safety verification items, and judge the food safety according to the abnormal score of the food sample; In S2, the following steps are included: S201: Generate N-grams as feature words from the historical social text word sequence and the historical business text total word sequence generated after preprocessing according to a preset n value, count the frequency of each feature word in the sequence to which it belongs, and arrange the feature words in the respective historical social text word sequence and the historical business text total word sequence in descending order according to the frequency of occurrence to form a historical social text arranged word sequence and a historical business text arranged word sequence respectively; S202: setting a frequency threshold for the frequency of occurrence of characteristic words in the historical business text arrangement word sequence, extracting characteristic words whose occurrence frequency is greater than or equal to the set frequency threshold to form the historical business text characteristic word sequence, and discarding characteristic words whose frequency is less than the set frequency threshold; the arrangement order of the characteristic words in the historical business text characteristic word sequence is consistent with the arrangement order of the historical business text arrangement word sequence; S203: extracting characteristic words in sequence according to the arrangement order of characteristic words in the characteristic word sequence of the historical business text, recording the extracted characteristic words as comparison words, searching for characteristic words identical to the comparison words in the arranged word sequence of the historical social text, recording the characteristic words identical to the comparison words as comparison words; Calculate the standard deviation of the occurrence frequency of all characteristic words in the historical social text arrangement word sequence to which the compared word belongs; if the occurrence frequency of the compared word is greater than or equal to the standard deviation, extract the characteristic words whose occurrence frequency is greater than or equal to the occurrence frequency of the compared word in the historical social text arrangement word sequence to which the compared word belongs, and form the extracted characteristic words into a first historical social text characteristic word sequence; otherwise, discard the entire historical social text arrangement word sequence; S204: Integrate all the characteristic words in the first historical social text characteristic word sequence and the characteristic words in the historical business text arrangement word sequence extracted in step S203 to form a second historical social text characteristic word sequence; compare and search the characteristic words in the second historical social text characteristic word sequence with the food safety verification item database to generate a food safety verification item set, and generate a total food safety verification item set based on the food safety verification item set and the enterprise's preset food safety verification items; the total food safety verification item set includes food safety verification items in food safety testing; the food safety verification item database includes all food safety verification items available on the market.
2. The method for automated food safety diagnosis based on artificial intelligence according to claim 1, characterized in that: In S1, the system presets a time limit and obtains historical social text data and historical business text data that are associated with the company's products and related to food safety within the preset time limit, the historical social text data including scientific literature text data, research report text data and news article text data; the historical business text data including supervision and inspection text data, product sampling text data, guarantee supervision text data and complaint and reporting text data; data preprocessing is performed on the historical social text data and historical business text data related to food safety, and the data preprocessing includes text cleaning, word segmentation, stop word removal, stem extraction and part of speech restoration; after preprocessing the historical social text data, a historical social text word sequence is generated, and after preprocessing the historical business text data, a historical business text word sequence is generated; different historical business text word sequences are integrated to form a total historical business text word sequence.
3. The method for automated food safety diagnosis based on artificial intelligence according to claim 2, characterized in that: In S3, the analysis of the inspector's violations includes the following steps: S301: Obtain the behavior record of each inspector in the inspection area, filter out the inspectors whose violation record time is not zero and whose current location is in the inspection impact area, and mark them; Obtain the historical violation records of each marking inspector, and count the number of historical violation records as D; the violation records include not wearing a mask and not wearing gloves; the verification impact area is a circular area with a preset impact radius and a food sample as the center; S302: Obtain the violation record of the day and the current time of each marked inspector, and record the total number of violation records of the day as d; calculate the duration between the current time and the end time of the latest violation record as s, and if the violation record of the day is zero, then the time from the end time of the last second violation record to the start time of the last second violation record in the violation record of the previous day is taken as the latest violation time; calculate the time interval of the violation record of each marked inspector respectively, and take the average value of the time interval as sv, and calculate the violation score VS of each marked inspector. The specific calculation formula is as follows; VS=(1+d÷D)×[ln(d+1)+s÷sv]; S303: Sum the violation scores of all marked inspectors in the inspection area. If the summed violation score is greater than the summed violation score threshold, it is determined that the food sample has a contamination risk; if it is less than or equal to the summed violation score threshold, there is no contamination risk.
4. The method for automated food safety diagnosis based on artificial intelligence according to claim 3, characterized in that: In S4, the verification results of the food safety verification items of the same batch of food samples without contamination risks are extracted, the concentration average value of the verification results of each food safety verification item is calculated, and the food sample abnormality score is calculated based on the concentration average value and the preset weight coefficient of the food safety verification item. If the food sample abnormality score is greater than or equal to the food sample abnormality score threshold, the food sample is unsafe; if the food sample abnormality score is less than the food sample abnormality score threshold, the food sample is safe.
5. An artificial intelligence-based automated food safety diagnosis system, the system being applied to the artificial intelligence-based automated food safety diagnosis method according to any one of claims 1 to 4, characterized in that: The system includes a data collection preprocessing module, a feature analysis model building module, a violation behavior analysis module and a food safety judgment module; The data acquisition preprocessing module is used to obtain the historical social text data and historical business text data related to food safety of the enterprise, and perform data preprocessing on the historical social text data and historical business text data; The feature analysis model building module is used to analyze the pre-processed data to generate feature words, perform feature selection based on the feature words to form a feature sequence, and form a total food safety verification item set based on the feature sequence; The violation behavior analysis module is used to perform food safety verification on food samples according to the total food safety verification item set, identify the inspectors in the inspection area and the behavior records of the inspectors by using image recognition technology, and analyze the violations of the inspectors; The food safety judgment module calculates the food sample abnormality score according to the verification results of the food safety verification items, and judges the food safety according to the food sample abnormality score.
6. The food safety automated diagnosis system based on artificial intelligence according to claim 5, characterized in that: The data acquisition and preprocessing module includes a text data acquisition unit and a data preprocessing unit; The text data collection unit is used to collect historical social text data and historical business text data related to food safety of the enterprise; the historical social text data includes scientific literature text data, research report text data and news article text data; the historical business text data includes supervision and inspection text data, product sampling text data, guarantee supervision text data and complaint and report text data; The data preprocessing unit is used to perform data preprocessing on historical social text data and historical business text data; the data preprocessing includes text cleaning, word segmentation, stop word removal, stem extraction and part-of-speech restoration; after preprocessing the historical social text data, a historical social text word sequence is generated, and after preprocessing the historical business text data, a historical business text word sequence is generated; different historical business text word sequences are integrated to form a total historical business text word sequence.
7. The food safety automated diagnosis system based on artificial intelligence according to claim 5, characterized in that: The feature analysis model construction module includes a text feature analysis unit and a food safety verification total item set construction unit; The text feature analysis unit is used to analyze the historical social text word sequence and the historical business text total word sequence to generate feature words, and to analyze the historical social text arrangement word sequence and the historical business text arrangement word sequence to generate a first historical social text feature word sequence; The food safety verification total item set construction unit is used to integrate all characteristic words in the first historical social text characteristic word sequence and the characteristic words in the historical business text arrangement word sequence to form a second historical social text characteristic word sequence, and generate a food safety verification total item set based on the characteristic words in the second historical social text characteristic word sequence and the food safety verification item database.
8. The food safety automated diagnosis system based on artificial intelligence according to claim 5, characterized in that: The illegal behavior analysis module includes an image recognition unit and a behavior analysis unit; The image recognition unit is used to identify the inspectors in the inspection area and the behavior records of the inspectors using image recognition technology; The behavior analysis unit is used to analyze the violation records in the behavior records of the inspectors, calculate and mark the violation scores of the inspectors, and determine whether there is a contamination risk in the food samples.
Citation Information
Patent Citations
Environment monitoring method and device based on artificial intelligence, equipment and storage medium
CN110166741A
Food safety intelligent management method and system based on big data
CN111879772A