Acessibilidade / Reportar erro

Research on consumers' perception of food risk based on LSTM sentiment classification

Abstract

One of the most pressing challenges in people's life is food safety. While many people prefer to purchase meals online since the dawn of the Internet era, regulating food safety online confronts numerous obstacles. A set of food safety evaluation data on violations and dangers was generated by analyzing feedback data from third-party operating systems. A distributed long-term and short-term memory network model was proposed to estimate trader risk values, and a quick warning system for or network attractors was constructed to find the association between opinion data and the amount of online food dangers. Using LSTM-based group learning, this research provides a method for categorizing food safety papers (long-term and short-term memory). First, due to the high cost of human annotation, the food safety document set only comprises one layer of the sample, and food safety document classification based on such a set is a one-layer classification. We propose an automatic body expansion strategy based on a large number of unlabelled web news reports (documents unrelated to food safety) and a binary-based food safety document collection. Select an LSTM-based group learning algorithm for document classification. Food safety documents can be automatically detected from high-performance websites using document classification algorithms based on LSTM-based group learning algorithms.

Keywords:
LSTM; food safety; violations and dangers; group learning

1 Introduction

The risk is the probability of negative health consequences and the severity of these effects as a result of the existence of a hazard or hazards in food (Hardy et al., 2018Hardy, A., Benford, D., Halldorsson, T., Jeger, M. J., Knutsen, H. K., More, S., Naegeli, H., Noteborn, H., Ockleford, C., Ricci, A., Rychen, G., Schlatter, J. R., Silano, V., Solecki, R., Turck, D., Younes, M., Chaudhry, Q., Cubadda, F., Gott, D., Oomen, A., Weigel, S., Karamitrou, M., Schoonjans, R., & Mortensen, A. (2018). Guidance on risk assessment of the application of nanoscience and nanotechnologies in the food and feed chain: part 1, human and animal health. EFSA Journal, 16(7), e05327. PMid:32625968.; Membré & Boué, 2018Membré, J.-M., & Boué, G. (2018). Quantitative microbiological risk assessment in food industry: theory and practical application. Food Research International, 106, 1132-1139. http://dx.doi.org/10.1016/j.foodres.2017.11.025. PMid:29579908.
http://dx.doi.org/10.1016/j.foodres.2017...
; Zeaki et al., 2019Zeaki, N., Johler, S., Skandamis, P. N., & Schelin, J. (2019). The role of regulatory mechanisms and environmental parameters in staphylococcal food poisoning and resulting challenges to risk assessment. Frontiers in Microbiology, 10, 1307. http://dx.doi.org/10.3389/fmicb.2019.01307. PMid:31244814.
http://dx.doi.org/10.3389/fmicb.2019.013...
; Zheng et al., 2020aZheng, S., Wang, Q., Yuan, Y., & Sun, W. (2020a). Human health risk assessment of heavy metals in soil and food crops in the Pearl River Delta urban agglomeration of China. Food Chemistry, 316, 126213. http://dx.doi.org/10.1016/j.foodchem.2020.126213. PMid:32045811.
http://dx.doi.org/10.1016/j.foodchem.202...
). HACCP is a food safety management system that was first employed by Pillsbury in 1959 and has subsequently undergone numerous revisions. The HACCP standard is crucial for adhering to national and international food safety regulations. This standard serves as a risk management tool that complements other food industry management system standards like ISO 22000. HACCP is a food safety system that identifies good production methods and is important for international trade. This standard is notably beneficial to manufacturers, processors, and food service providers. Despite the fact that HACCP is merely a concept and not a standard, it is still the most widely utilized food safety management model in the world. HACCP stands for "Hazard Analysis Critical Control Point," and it is a food safety management method. HACCP is a control system that is used across the food chain to ensure the sanitary quality of food processes and is one of the practical solutions in furthering the aims of food hygiene. HACCP addresses all elements of food safety (Certa et al., 2018Certa, A., Enea, M., Galante, G. M., Izquierdo, J., & Fata, C. M. L. (2018). Food safety risk analysis from the producers’ perspective: prioritisation of production process stages by HACCP and TOPSIS. International Journal of Management and Decision Making, 17(4), 396-414. http://dx.doi.org/10.1504/IJMDM.2018.095720.
http://dx.doi.org/10.1504/IJMDM.2018.095...
; Girardon et al., 2019Girardon, P., Gabard, F., & Peyer, H. (2019). Food Safety Management System—HACCP—Risk Assessment. In R. Cachon, P. Girardon, & A. Voilley (Eds.), Gases in agro-food processes (pp. 105-107). Amsterdam: Elsevier. http://dx.doi.org/10.1016/B978-0-12-812465-9.00009-8.
http://dx.doi.org/10.1016/B978-0-12-8124...
; Hull-Jackson, 2019Hull-Jackson, C. (2019). Food safety and tourism in Barbados: Risk assessment and characterisation of bacterial pathogens (PhD thesis). University of the West Indies, Saint Augustine. ; Kang et al., 2018Kang, Y. M., Cha, J. W., Lee, S. G., Lee, J. H., & Kim, J.-S. (2018). Risk assessment and work in field for HACCP system construction of canned seasoned Broughton’s Ribbed Ark Scapharca broughtonii. Korean Journal of Fisheries and Aquatic Sciences, 51(5), 524-534.).

Another factor that contributes to the relevance of risk evaluation is the rise in global commerce, which has resulted in increased concerns for food safety and quality. In terms of food quality and health, newer methods have been developed to determine the risk of transmission of infectious and hazardous agents across the borders of countries and to determine the problems related to the quality and emerging diseases of contaminated food (Beltran-Alcrudo et al., 2019Beltran-Alcrudo, D., Falco, J. R., Raizman, E., & Dietze, K. (2019). Transboundary spread of pig diseases: the role of international trade and travel. BMC Veterinary Research, 15(1), 64. http://dx.doi.org/10.1186/s12917-019-1800-5. PMid:30795759.
http://dx.doi.org/10.1186/s12917-019-180...
; Eriksson et al., 2019Eriksson, D., Kershen, D., Nepomuceno, A., Pogson, B. J., Prieto, H., Purnhagen, K., Smyth, S., Wesseler, J., & Whelan, A. (2019). A comparison of the EU regulatory approach to directed mutagenesis with that of other jurisdictions, consequences for international trade and potential steps forward. The New Phytologist, 222(4), 1673-1684. http://dx.doi.org/10.1111/nph.15627. PMid:30548610.
http://dx.doi.org/10.1111/nph.15627...
; Tam & Jones, 2019Tam, K., & Jones, K. (2019). MaCRA: a model-based framework for maritime cyber-risk assessment. WMU Journal of Maritime Affairs, 18(1), 129-163. http://dx.doi.org/10.1007/s13437-019-00162-2.
http://dx.doi.org/10.1007/s13437-019-001...
).

Food will always be exposed to several hazards along the food supply chain, resulting in numerous issues for downstream processes and end consumers. We all eat vegetables, fruits, meat, dairy products, bread, and other foods on a regular basis, and the health and safety of these foods have a direct impact on our health (Molina-Besch et al., 2019Molina-Besch, K., Wikström, F., & Williams, H. (2019). The environmental impact of packaging in food supply chains—does life cycle assessment of food provide the full picture? The International Journal of Life Cycle Assessment, 24(1), 37-50. http://dx.doi.org/10.1007/s11367-018-1500-6.
http://dx.doi.org/10.1007/s11367-018-150...
; Noya et al., 2018Noya, L. I., Vasilaki, V., Stojceska, V., Gonzalez-García, S., Kleynhans, C., Tassou, S., Moreira, M. T., & Katsou, E. (2018). An environmental evaluation of food supply chain using life cycle assessment: a case study on gluten free biscuit products. Journal of Cleaner Production, 170, 451-461. http://dx.doi.org/10.1016/j.jclepro.2017.08.226.
http://dx.doi.org/10.1016/j.jclepro.2017...
).

Have you ever considered the potential dangers of unhealthy or seemingly unhealthy foods? Are you aware of the dangers of chemicals such as toxins, pesticides, and some preservatives or pathogenic microbes in the food you eat daily? Which agency or organization is in charge of guaranteeing food safety and health?

Answering above questions requires analysis and review of risks in food safety. Many nations across the globe are working to develop a system for managing food safety hazards in order to offer safe and nutritious food. For this purpose, guidelines and rules have been set that indicate how to use scientific expertise in risk analysis (Cope et al., 2010Cope, S., Frewer, L. J., Houghton, J., Rowe, G., Fischer, A. R. H., & de Jonge, J. (2010). Consumer perceptions of best practice in food risk communication and management: implications for risk analysis policy. Food Policy, 35(4), 349-357. http://dx.doi.org/10.1016/j.foodpol.2010.04.002.
http://dx.doi.org/10.1016/j.foodpol.2010...
; Rekha et al., 2006Rekha, N., Naik, S. N., & Prasad, R. (2006). Pesticide residue in organic and conventional food-risk analysis. Journal of Chemical Health and Safety, 13(6), 12-19. http://dx.doi.org/10.1016/j.chs.2005.01.012.
http://dx.doi.org/10.1016/j.chs.2005.01....
; Samimi & Samimi, 2020Samimi, A., & Samimi, M. (2020). Investigation of Risk Management in Food Industry. International Journal of Advanced Studies in Humanities and Social Science, 9(3), 195-204.).

1.1 Objectives of risk analysis

The goal of risk analysis is to objectively analyze the negative health impacts of possible food hazards, including hazard identification, hazard nature, risk assessment (components of risk assessment). In a way that the product of activities leads to:

  • Risk analysis including risk management, risk assessment, and information interaction;

  • Reviewing and determining alternative policies for accepting, minimizing, or reducing the assessed risks, selecting and implementing appropriate options (Risk Management);

  • Exchange information and theory of risk assessors, risk managers, and stakeholders (Risk Communication)

1.2 Food safety risk analysis

One of the key difficulties in both rich and developing nations is ensuring food safety in order to preserve public health and economic prosperity. In recent decades, there have been several advancements in food safety measures. The risk analysis method, which is based totally on science and extensive risk analysis, is one of these contemporary approaches for food safety (Baker, 2003Baker, G. A. (2003). Food safety and fear: factors affecting consumer response to food safety risk. International Food and Agribusiness Management Review, 6(1), 1-11.; Lammerding, 1997Lammerding, A. M. (1997). An overview of microbial food safety risk assessment. Journal of Food Protection, 60(11), 1420-1425. http://dx.doi.org/10.4315/0362-028X-60.11.1420. PMid:31207791.
http://dx.doi.org/10.4315/0362-028X-60.1...
).

This technique, as its name indicates, is a series of steps that, when completely implemented and realized, encompass a created system of competence and abilities in the field of management and food safety.

Framework for Risk Analysis: A method of gathering, analyzing, and systematically evaluating data from both scientific and non-scientific sources on physical, biological, or chemical dangers connected with food in order to determine the optimum risk management approach.

Risk communication, Risk assessment, and risk management are the three elements of risk analysis, according to the Codex rules. New information or data, as well as changes in the food content concerns, should prompt a review of risk analysis, which is a dynamic and highly repeated interaction program. To perform risk analysis successfully, countries must have a food safety system that works well in which all stakeholders, including the government, industry, academics, and consumers, are involved. Risk analysis is based on available scientific facts, costs, environmental variables, information, cultural and other considerations (Demortain, 2012Demortain, D. (2012). Enabling global principle-based regulation: the case of risk analysis in the Codex Alimentarius. Regulation & Governance, 6(2), 207-224. http://dx.doi.org/10.1111/j.1748-5991.2012.01144.x.
http://dx.doi.org/10.1111/j.1748-5991.20...
).

1.3 Execution method of food safety risk analysis

In this process, a structural model and method are used, which are used step by step to identify, select and measure specific measures to control food safety risk. The most important advantage of this process is its effective help to food safety managers to properly and timely inform the real food risk to ensure the public health and access to useful information to make principled decisions to promote community health (Luning et al., 2008Luning, P. A., Bango, L., Kussaga, J., Rovira, J., & Marcelis, W. J. (2008). Comprehensive analysis and differentiated assessment of food safety control systems: a diagnostic instrument. Trends in Food Science & Technology, 19(10), 522-534. http://dx.doi.org/10.1016/j.tifs.2008.03.005.
http://dx.doi.org/10.1016/j.tifs.2008.03...
).

1.4 Components of food safety risk analysis system

To be aware of this process, it is necessary to be familiar with its components. These components are as follows (Jia & Jukes, 2013Jia, C., & Jukes, D. (2013). The national food safety control system of China–a systematic review. Food Control, 32(1), 236-245. http://dx.doi.org/10.1016/j.foodcont.2012.11.042.
http://dx.doi.org/10.1016/j.foodcont.201...
; Food and Agriculture Organization of the United Nations, 2006Food and Agriculture Organization of the United Nations – FAO. World Health Organization – WHO. (2006). Food safety risk analysis: a guide for national food safety authorities. Rome: FAO/WHO.):

Risk assessment

This parameter is based on a scientific process that includes the following components: 1) Hazard characteristics, 2) Hazard identification, 3) Risk characteristics, 4) Evaluation and exposure.

Risk management

This parameter encompasses the process of assessing different criteria, such as risk evaluation and other variables influencing consumer health and encouraging fair trade, as well as, if required, the selection of appropriate preventative and control techniques to ensure food safety.

Risk communication

Information and opinions exchanged during the procedure for risk analysis on risk factors, and risk characteristics between risk-related individuals, including consumers, risk managers, etc.

There is a continuous confrontation between risk assessors and risk managers about risk in food risk and safety analysis. It is worth noting that USDA (United States Department of Agriculture) and FDA (US Food and Drug Administration) are two completely separate organizations under the US Department of Health and Welfare Services. Both organizations are responsible for food safety, but their case studies are different (Pape, 2004).

USDA is responsible for risk assessment of agricultural goods, and FDA is tasked with risk assessment in the food and food additives and medical devices industry. It should also be noted that EFSA (European Food Safety Authority) is primarily tasked with EU risk evaluation in food safety matters. Risk assessment is carried out fully independently of risk management in the European food safety system. EFSA examines the risk cases completely scientifically, and then the cases are referred to the European Union for standardization and legislation.

1.5 Examples of food safety risk analysis in general

  • Continuous risk analysis is necessary.

  • The analysis must be completely transparent and clearly documented.

  • Analysis should be performed based on completely scientific principles.

  • The analysis should be re-examined and assessed whenever new facts and research become available.

  • Components of risk analysis should be written in a complete and systematic way. All documents should be made available to food safety groups as needed.

1.6 Benefits and benefits of food safety risk analysis

  • Ability to estimate food safety risk

  • Consumer trust in the availability of diverse food items

  • Facilitate safety assessment of new foods

  • Impact on community health and food safety programs

  • Creating scientific methods and principles for creating instructions and developing standards

  • Supporting domestic and international trade

1.7 Duties of managers and assessors in risk assessment

In general, there needs to be an extensive and continuous exchange of information between managers and risk assessors, but their operating environment must be completely independent. Risk managers are responsible for initiating the risk analysis process, and tracking whether the risk analysis process is complete or not is in their job description (Davies, 2010Davies, H. (2010). A role for “omics” technologies in food safety assessment. Food Control, 21(12), 1601-1610. http://dx.doi.org/10.1016/j.foodcont.2009.03.002.
http://dx.doi.org/10.1016/j.foodcont.200...
). On the other hand, risk assessors are scientific professionals who understand scientific problems well and can assess risk according to scientific principles. Therefore, anyone who is somehow involved in the risk analysis process could be responsible for communication and correspondence.

1.8 First steps in food risk analysis

The first step is to set up a risk profile. In this case, it is worth mentioning the following:

  • Managing risk profiles enables risk managers to conduct a thorough risk evaluation of the potential for safety of food.

  • The risk profile identifies a clear status of food safety risk and answers the questions that risk managers face in order to effectively review and address food safety

  • The risk profile is frequently regarded as an appropriate model for emphasizing safety of food since it decides if a risk assessment is required in general and whether the issue in the context of food safety can be handled promptly or not.

1.9 Who prepares the risk profile?

In the analysis of this case, it is worth mentioning the following:

  • Risk profiles are usually prepared by experts and scientific consultants with expertise in solving food safety problems.

  • Risk profile includes sufficient and reliable information and details to support risk managers for final decisions.

  • The Food Safety Working Group plays an important role in preparing suitable situations for creating risk profiles as well as categorizing various topics and topics in the field of food safety.

  • Successful implementation of risk analysis in different countries requires having a proper and ongoing food safety structure and systems.

1.10 Success factors in the implementation of food safety risk analysis system

  • Full awareness of risk analysis and knowledge of its value to maintaining public health at the level of government decision-makers

  • Ability to implement and evaluate risk at the national level

  • Cooperation at the national level between the main body of public health protection (Ministry of Health) with other relevant bodies such as the standard organization, nutrition institute, universities, and industrial institutions, etc.

1.11 The main achievements of the systematic implementation of the risk analysis process

  • Reducing food safety risk according to risk prioritization and grading

  • Increasing national trust and public health in the food sector and improving the economy and trade

Sentiment analysis may be used at many levels of the domain, including sentence, document, and aspect. Sentiment analysis of the document surface is used to identify the whole sentiment of the text. Its sentence level is used to determine a one-sentence feeling, while aspect/dimension level sentiment analysis is used to identify each aspect of each entity used in a sentence. For example: "I really like Apple products, but the latest version of the iPhone is not so great!" There is a positive feeling about Apple products, but there is a negative opinion about the latest iPhone.

Although attribution extraction from documents plays an important role in task classification, most sentiment analysis research uses traditional machine learning methods. These methods must manually extract attributes from data. Some of these techniques include New Biz (NB), Support Vector Machine (SVM), and Logistic Regression. On the other hand, text inputs must be properly given to neural networks. BOW is a popular method that introduces each sentence in a way that is suitable for machine learning. This method is quite simple and effective but ignores the word order in the document, which can lead to a significant problem in sentiment analysis for two sentences with a different set of words and sentiments. BOW also does not consider the semantic similarity between words.

There are several ways to provide a suitable word for feeding machine learning algorithms, such as N-gram and binary features. At present, with the exception of a few studies in Chinese and Hindi, most research has been done on English text.

CNN is well suited for extracting local features from the text. RNN is used for sequential data processing. The LSTM is a kind of RNN that can learn long-term dependencies. It can also solve the problem of gradient fading and gradient explosion.

LSTM also learns long-term dependencies. On the other hand, instead of displaying each word using our index in the dictionary, we use Word2vec as an embedding algorithm, which is the key to the proposed neural network architecture results. In this study, two data sets are introduced. They have about 9,000 and 3,000 sentences, respectively, which are labeled positive, negative, and neutral.

2 Material and methods

In theory, a conventional recursive neural network should be able to produce sequences of unlimited complexity, however in fact, we discover that this network is unable of retaining information linked to previous inputs for lengthy periods of time. This amnesia exposes these sorts of networks to instability during sequence creation, in addition to reducing the network's capacity to simulate long-term structures (Le & Zuidema, 2014Le, P., & Zuidema, W. (2014). The inside-outside recursive neural network model for dependency parsing. In A. Moschitti (Ed.), Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP) (p. 729-739). Doha: Association for Computational Linguistics. http://dx.doi.org/10.3115/v1/D14-1081.
https://doi.org/ ...
; Qian et al., 2015Qian, Q., Tian, B., Huang, M., Liu, Y., Zhu, X., & Zhu, X. (2015). Learning tag embeddings and tag-specific composition functions in recursive neural network. In C. Zong & M. Strube (Ed.), Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (p. 1365–1374). Beijing: Association for Computational Linguistics. http://dx.doi.org/10.3115/v1/P15-1132. ). The problem (which is common to all conditional production models, of course) is that if the network predictions depend only on a few recent inputs and these inputs are generated by the network itself, and there is very little chance of correction, the network makes past mistakes.

Possessing an extended recollection has a stabilizing impact since it allows the network to fulfill its forecast by looking back even if it doesn't comprehend its recent past. The problem of instability is especially acute when dealing with decimal data because forecasts can distance themselves from the manifold on which the training data is placed. One solution proposed for conditional models is to inject noise into the predictions made by the network before feeding them to the next time step. This strengthens the network against unexpected inputs. Nevertheless, a better memory is a much better and more effective solution. Long-term memory, or LSTM for short, is a recursive NN architecture that stores and accesses data more efficiently than the standard version (Zhang et al., 2018Zhang, J., Zhu, Y., Zhang, X., Ye, M., & Yang, J. (2018). Developing a Long Short-Term Memory (LSTM) based model for predicting water table depth in agricultural areas. Journal of Hydrology, 561, 918-929. http://dx.doi.org/10.1016/j.jhydrol.2018.04.065.
http://dx.doi.org/10.1016/j.jhydrol.2018...
).

Unlike a typical recursive NN, which rewrites material throughout each stage, an LSTM recursive NN may determine whether or not to preserve existing recollection by using the introduced gateways. Assume the LSTM unit discovers a significant characteristic in the input sequence during the early stages. In such scenario, it can readily transfer the data across a great distance, allowing it to receive and sustain long-term dependencies.

As mentioned earlier, the Long Short-Term Memory Unit was first introduced in 1997 by Hochreiter and Schmidt Huber (Hochreiter & Schmidhuber, 1997Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735-1780. http://dx.doi.org/10.1162/neco.1997.9.8.1735. PMid:9377276.
http://dx.doi.org/10.1162/neco.1997.9.8....
). Minor changes have been made to LSTM since then. The basics of training and implementing these types of networks are taken from an article entitled Recurrent Neural Networks for Sequence Generation in 2013 (Grossberg, 2013Grossberg, S. (2013). Recurrent neural networks. Scholarpedia, 8(2), 1888. http://dx.doi.org/10.4249/scholarpedia.1888.
http://dx.doi.org/10.4249/scholarpedia.1...
).

Unlike a traditional recursive neural network that simply adds up the input signals and then sends them via an activation function, each LSTM unit benefits from one memory Ct at a time t. ht or activates LSTM as ht=Γo.tanh(Ct) where the amount of material supplied through memory is controlled by an output gateway Γo. The output gate is calculated using the expression Γo=σ(Wo.[ht1,Xt]+bo) , which σ is the sigmoid activation function. Wo is also an oblique matrix. Ctis the memory cell also has relative forgetting of current memory and adds new memory content as C^t Ct=Γf.Ct1+Γu.C^t is updated where the contents of the new memory are updated via the expression C^t=tanh(WC.[ht1,Xt]+bc) obtained. Γf, the forget-me-not gateway, controls the quantity of existing memory to be forgotten, while the updated gateway handles the volume of extra memory content that has to be introduced to the memory cell. This operation is performed with the following calculations (Equation 1):

Γ f = σ ( W f . [ h t 1 , X t ] + b f ) Γ u = σ ( W u . [ h t 1 , X t ] + b u ) (1)

To do this, before we go into more detail about the LSTM network, let's review the main problem once. The first image you see below (Figure 1) is a standard recursive neural network image (Gori et al., 2003Gori, M., Maggini, M., & Sarti, L. (2003). A recursive neural network model for processing directed acyclic graphs with labeled edges. Proceedings of International Joint Conference on Neural Networks, 2003(2), 1351-1355. http://dx.doi.org/10.1109/IJCNN.2003.1223892.
http://dx.doi.org/10.1109/IJCNN.2003.122...
; Liang et al., 2018Liang, G., Hong, H., Xie, W., & Zheng, L. (2018). Combining convolutional neural network with recursive neural network for blood cell image classification. IEEE Access : Practical Innovations, Open Solutions, 6, 36188-36197. http://dx.doi.org/10.1109/ACCESS.2018.2846685.
http://dx.doi.org/10.1109/ACCESS.2018.28...
). As shown in the picture, in each time step, we receive two inputs, and we can also produce two outputs. We can see that there is no way to move a characteristic from the beginning to the end of the process. There is no mechanism to deal with the issue of gradient blurring!

Figure 1
Standard Retrograde Neural Network.

If the network acquires an important feature at the beginning of the sequence, it will not be able to transfer it to the next steps in a traditional neural network.

In enhanced versions such as GRU and (soon LSTM), we see that we provide this capability to the network by imposing restrictions on the parameter flexibility in the optimization process (Zheng et al., 2020bZheng, Z., Zhang, X., Yu, J., Guo, R., & Zhangzhong, L. (2020b). Deep neural networks for the classification of pure and impure strawberry purees. Sensors, 20(4), 1223. http://dx.doi.org/10.3390/s20041223. PMid:32102254.
http://dx.doi.org/10.3390/s20041223...
). Let's look at an LSTM neural network and open this discussion further. Below we see an LSTM recursive neural network (Figure 2).

Figure 2
LSTM recursive neural network.

We come across new ideas in the LSTM NN that were not present in the classic recursive NN. The data flow inside this network is controlled by three so-called gates:

  • Input gate

  • Output gate

  • Forget gate

A memory cell is also known as a Memory Cell, or C for short, in addition to these three gates. These are new concepts in this network, and in addition to these four new concepts, the network also has a cache input or the same h and input or the same X and produces two outputs (one output is Ct , and the other output is ht, which is split in two).

3 Results and discussion

LSTM blocks are a form of recursive neural network that may learn long-term dependencies in order to solve the gradient issue. Hochreiter and Schmidhuber initially proposed these networks in 1997.

Recall that LSTM networks' default and typical nature is to memorize information for extended periods of time, and their architecture is so that they can absorb extremely distant knowledge effectively, which is a trait that resides in their architecture (Ahmad et al., 2019Ahmad, S., Mahmud, A., Hussain, J., & Javed, K. (2019). Productive performance, egg characteristics and hatching traits of three chicken genotypes under Free-Range, Semi-Intensive, and Intensive Housing Systems. Brazilian Journal of Poultry Science, 21(2), eRBCA-2018-0935. http://dx.doi.org/10.1590/1806-9061-2018-0935.
http://dx.doi.org/10.1590/1806-9061-2018...
; Gonçalves & Zampieri, 2003Gonçalves, J. B., & Zampieri, D. E. (2003). Recurrent neural network approaches for biped walking robot based on zero-moment point criterion. Journal of the Brazilian Society of Mechanical Sciences and Engineering, 25(1), 69-78. http://dx.doi.org/10.1590/S1678-58782003000100010.
http://dx.doi.org/10.1590/S1678-58782003...
).

In LSTM, we do not have a Γr gate. This gate specifies how much memory to include. If it is 0, it completely eliminates the memory effect.

LSTM has more gates than GRU. In LSTM, a gate for forgetting is added and specifies how much to influence the state candidate to rewrite Ct, in other words, how much to remember and how much to forget (Figure 3).

Figure 3
Comparing GRU and LSTM.

The iteration module in Bidirectional RNN (Figure 4) can be ordinary RNN, LSTM, or GRU. The structure and connections of a two-way RNN are shown in the figure below. There are two types of communication, one of which progresses over time, which helps us learn from previous representations. The other goes backward, which helps us in future representations. For example, we have offline data such as video or text.

Figure 4
Bidirectional RNN.

The initial stage in LSTM is to choose whatever information from the state cell we wish to remove. The forget gate, a sigmoid layer, makes this judgment (Figure 5). Depending on the values ht-1 and xt, this gate will output zero or one for each number in the Ct-1 state cell. A value of one means to completely delete the current value of the state cell (Ct-1) to Ct, and a value of zero means to completely delete the information of the current state cell (Ct-1) and not to value any of it in Ct.

Figure 5
Forget gate.

Let's go to this example, which is a language model in which we tried to guess the next word based on all the previous words. In such a case, the state cell may contain the gender of the present tense, according to which we can determine which pronoun to use. When a new subject appears in a sentence, the gender of the previous subject must be removed.

The following phase is to determine which additional data we want to store in the state cell (Figure 6). There are two elements to this decision. The input gate, for example, is a sigmoid layer that determines how much will be updated. A hyperbolic tangent layer is the next step that takes a vector of values called Ct and adds it to the state cell. In the next step, these two steps are combined to update the state cell value. In the example of the language model we had earlier, we want to add the new subject gender to the state cell to replace the previous subject gender that we decided to forget in the previous step.

Figure 6
Input gate.

Now it's time to upgrade the old state cell, Ct-1, to the new state cell, Ct (Figure 7). In the previous steps, it was decided what to do, and now we only need to implement the decisions that were made. We multiply the previous value of the state cell by ft, which means forgetting the information we decided to forget earlier. Then we add it * ~ Ct. New state cell values ​​are now obtained according to the decisions made earlier. In the example of the language model, this is exactly where we discard the information we had about the previous gender and add new information.

Figure 7
Converting old state cell to new state cell.

Finally, the information decided are going to the output (Figure 8). This output has the same status as the cell value, but it will be filtered. A sigmoid layer comes first that decides the output part of the state cell. Then, the value of state cell (after updating in the previous steps) is given to a layer of hyperbolic tangent (until the values are between ±1) and multiply its value by the output of the previous sigmoid layer so that only the parts that are required would go to the output.

Figure 8
The information that are going to the output are pre-determined.

In the example of the linguistic model, given that it has only seen the subject, it may want to output information about the verb if it wants to guess the next word. For example, it may take the subject, whether singular or plural, to know what form the verb will take.

What has been described so far is a normal LSTM. But not all LSTMs are like this. In fact, every article that uses LSTMs uses slightly different versions of LSTM.

4 Conclusion

LSTM NNs represent a memory cell. They use memory slot to process data. We can see from the examples above that we can consider time delay in RNNs, but LSTM is the way to go if our RNN fails with a lot of relevant data and we want to find the relevant data from it. The LSTM NN, with its sophisticated appearance, contains some interesting and simple ideas. By using LSTM the following could be acchieved:

  • We have long-term memory, and we forget and remember information.

  • We have gates that, like an adjustable valve, control the inlet-outlet flow.

  • We had three gates with letters of forgetfulness gate, input gate, and output gate.

  • The gate of forgetfulness was to forget unnecessary information of the past.

  • The input gate was to check whether the information obtained from the current moment (t) is worth storing in long-term memory

  • The output gate was to not transfer all the information in Ct to the ht output. Take as much as we need to the ht output.

  • The gates always have an output between 0 and 1.

  • The gates are always multiplied by another door-to-door entrance.

  • Each gate has two inputs: xt and ht-1. The two inputs are multiplied by two layers of follicle-connected, then aggregated and finally passed through the sigmoid function.

  • Using a hyperbolic tangent, the information is always between -1 and 1.

  • The LSTM network has four times the parameter and computational cost of the RNN network. It has three gates and a network for calculating memory input (Ct).

  • LSTM is a gateway-based return network.

  • There are several versions of LSTM on the market! Be careful not to be misled by different shapes and formulas. They all involve the idea of gates (forgetting, input, and output).

  • Practical Application: This research proposed a distributed long-term and short-term memory network model and provided a method for categorizing food safety papers using LSTM-based group learning, to estimate trader risk values, and find the association between opinion data and the amount of online food dangers.

References

  • Ahmad, S., Mahmud, A., Hussain, J., & Javed, K. (2019). Productive performance, egg characteristics and hatching traits of three chicken genotypes under Free-Range, Semi-Intensive, and Intensive Housing Systems. Brazilian Journal of Poultry Science, 21(2), eRBCA-2018-0935. http://dx.doi.org/10.1590/1806-9061-2018-0935
    » http://dx.doi.org/10.1590/1806-9061-2018-0935
  • Baker, G. A. (2003). Food safety and fear: factors affecting consumer response to food safety risk. International Food and Agribusiness Management Review, 6(1), 1-11.
  • Beltran-Alcrudo, D., Falco, J. R., Raizman, E., & Dietze, K. (2019). Transboundary spread of pig diseases: the role of international trade and travel. BMC Veterinary Research, 15(1), 64. http://dx.doi.org/10.1186/s12917-019-1800-5 PMid:30795759.
    » http://dx.doi.org/10.1186/s12917-019-1800-5
  • Certa, A., Enea, M., Galante, G. M., Izquierdo, J., & Fata, C. M. L. (2018). Food safety risk analysis from the producers’ perspective: prioritisation of production process stages by HACCP and TOPSIS. International Journal of Management and Decision Making, 17(4), 396-414. http://dx.doi.org/10.1504/IJMDM.2018.095720
    » http://dx.doi.org/10.1504/IJMDM.2018.095720
  • Cope, S., Frewer, L. J., Houghton, J., Rowe, G., Fischer, A. R. H., & de Jonge, J. (2010). Consumer perceptions of best practice in food risk communication and management: implications for risk analysis policy. Food Policy, 35(4), 349-357. http://dx.doi.org/10.1016/j.foodpol.2010.04.002
    » http://dx.doi.org/10.1016/j.foodpol.2010.04.002
  • Davies, H. (2010). A role for “omics” technologies in food safety assessment. Food Control, 21(12), 1601-1610. http://dx.doi.org/10.1016/j.foodcont.2009.03.002
    » http://dx.doi.org/10.1016/j.foodcont.2009.03.002
  • Demortain, D. (2012). Enabling global principle-based regulation: the case of risk analysis in the Codex Alimentarius. Regulation & Governance, 6(2), 207-224. http://dx.doi.org/10.1111/j.1748-5991.2012.01144.x
    » http://dx.doi.org/10.1111/j.1748-5991.2012.01144.x
  • Eriksson, D., Kershen, D., Nepomuceno, A., Pogson, B. J., Prieto, H., Purnhagen, K., Smyth, S., Wesseler, J., & Whelan, A. (2019). A comparison of the EU regulatory approach to directed mutagenesis with that of other jurisdictions, consequences for international trade and potential steps forward. The New Phytologist, 222(4), 1673-1684. http://dx.doi.org/10.1111/nph.15627 PMid:30548610.
    » http://dx.doi.org/10.1111/nph.15627
  • Food and Agriculture Organization of the United Nations – FAO. World Health Organization – WHO. (2006). Food safety risk analysis: a guide for national food safety authorities Rome: FAO/WHO.
  • Girardon, P., Gabard, F., & Peyer, H. (2019). Food Safety Management System—HACCP—Risk Assessment. In R. Cachon, P. Girardon, & A. Voilley (Eds.), Gases in agro-food processes (pp. 105-107). Amsterdam: Elsevier. http://dx.doi.org/10.1016/B978-0-12-812465-9.00009-8
    » http://dx.doi.org/10.1016/B978-0-12-812465-9.00009-8
  • Gonçalves, J. B., & Zampieri, D. E. (2003). Recurrent neural network approaches for biped walking robot based on zero-moment point criterion. Journal of the Brazilian Society of Mechanical Sciences and Engineering, 25(1), 69-78. http://dx.doi.org/10.1590/S1678-58782003000100010
    » http://dx.doi.org/10.1590/S1678-58782003000100010
  • Gori, M., Maggini, M., & Sarti, L. (2003). A recursive neural network model for processing directed acyclic graphs with labeled edges. Proceedings of International Joint Conference on Neural Networks, 2003(2), 1351-1355. http://dx.doi.org/10.1109/IJCNN.2003.1223892
    » http://dx.doi.org/10.1109/IJCNN.2003.1223892
  • Grossberg, S. (2013). Recurrent neural networks. Scholarpedia, 8(2), 1888. http://dx.doi.org/10.4249/scholarpedia.1888
    » http://dx.doi.org/10.4249/scholarpedia.1888
  • Hardy, A., Benford, D., Halldorsson, T., Jeger, M. J., Knutsen, H. K., More, S., Naegeli, H., Noteborn, H., Ockleford, C., Ricci, A., Rychen, G., Schlatter, J. R., Silano, V., Solecki, R., Turck, D., Younes, M., Chaudhry, Q., Cubadda, F., Gott, D., Oomen, A., Weigel, S., Karamitrou, M., Schoonjans, R., & Mortensen, A. (2018). Guidance on risk assessment of the application of nanoscience and nanotechnologies in the food and feed chain: part 1, human and animal health. EFSA Journal, 16(7), e05327. PMid:32625968.
  • Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735-1780. http://dx.doi.org/10.1162/neco.1997.9.8.1735 PMid:9377276.
    » http://dx.doi.org/10.1162/neco.1997.9.8.1735
  • Hull-Jackson, C. (2019). Food safety and tourism in Barbados: Risk assessment and characterisation of bacterial pathogens (PhD thesis). University of the West Indies, Saint Augustine.
  • Jia, C., & Jukes, D. (2013). The national food safety control system of China–a systematic review. Food Control, 32(1), 236-245. http://dx.doi.org/10.1016/j.foodcont.2012.11.042
    » http://dx.doi.org/10.1016/j.foodcont.2012.11.042
  • Kang, Y. M., Cha, J. W., Lee, S. G., Lee, J. H., & Kim, J.-S. (2018). Risk assessment and work in field for HACCP system construction of canned seasoned Broughton’s Ribbed Ark Scapharca broughtonii. Korean Journal of Fisheries and Aquatic Sciences, 51(5), 524-534.
  • Lammerding, A. M. (1997). An overview of microbial food safety risk assessment. Journal of Food Protection, 60(11), 1420-1425. http://dx.doi.org/10.4315/0362-028X-60.11.1420 PMid:31207791.
    » http://dx.doi.org/10.4315/0362-028X-60.11.1420
  • Le, P., & Zuidema, W. (2014). The inside-outside recursive neural network model for dependency parsing. In A. Moschitti (Ed.), Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP) (p. 729-739). Doha: Association for Computational Linguistics. http://dx.doi.org/10.3115/v1/D14-1081.
    » https://doi.org/
  • Liang, G., Hong, H., Xie, W., & Zheng, L. (2018). Combining convolutional neural network with recursive neural network for blood cell image classification. IEEE Access : Practical Innovations, Open Solutions, 6, 36188-36197. http://dx.doi.org/10.1109/ACCESS.2018.2846685
    » http://dx.doi.org/10.1109/ACCESS.2018.2846685
  • Luning, P. A., Bango, L., Kussaga, J., Rovira, J., & Marcelis, W. J. (2008). Comprehensive analysis and differentiated assessment of food safety control systems: a diagnostic instrument. Trends in Food Science & Technology, 19(10), 522-534. http://dx.doi.org/10.1016/j.tifs.2008.03.005
    » http://dx.doi.org/10.1016/j.tifs.2008.03.005
  • Membré, J.-M., & Boué, G. (2018). Quantitative microbiological risk assessment in food industry: theory and practical application. Food Research International, 106, 1132-1139. http://dx.doi.org/10.1016/j.foodres.2017.11.025 PMid:29579908.
    » http://dx.doi.org/10.1016/j.foodres.2017.11.025
  • Molina-Besch, K., Wikström, F., & Williams, H. (2019). The environmental impact of packaging in food supply chains—does life cycle assessment of food provide the full picture? The International Journal of Life Cycle Assessment, 24(1), 37-50. http://dx.doi.org/10.1007/s11367-018-1500-6
    » http://dx.doi.org/10.1007/s11367-018-1500-6
  • Noya, L. I., Vasilaki, V., Stojceska, V., Gonzalez-García, S., Kleynhans, C., Tassou, S., Moreira, M. T., & Katsou, E. (2018). An environmental evaluation of food supply chain using life cycle assessment: a case study on gluten free biscuit products. Journal of Cleaner Production, 170, 451-461. http://dx.doi.org/10.1016/j.jclepro.2017.08.226
    » http://dx.doi.org/10.1016/j.jclepro.2017.08.226
  • Pape, S. M., Rubin, P. D., & Kim, H. (2004). Food security would be compromised by combining the Food and Drug Administration and the US Department of Agriculture into a single food agency. Food and Drug Law Journal, 59(3), 405-416. PMid:15586990.
  • Qian, Q., Tian, B., Huang, M., Liu, Y., Zhu, X., & Zhu, X. (2015). Learning tag embeddings and tag-specific composition functions in recursive neural network. In C. Zong & M. Strube (Ed.), Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (p. 1365–1374). Beijing: Association for Computational Linguistics. http://dx.doi.org/10.3115/v1/P15-1132.
  • Rekha, N., Naik, S. N., & Prasad, R. (2006). Pesticide residue in organic and conventional food-risk analysis. Journal of Chemical Health and Safety, 13(6), 12-19. http://dx.doi.org/10.1016/j.chs.2005.01.012
    » http://dx.doi.org/10.1016/j.chs.2005.01.012
  • Samimi, A., & Samimi, M. (2020). Investigation of Risk Management in Food Industry. International Journal of Advanced Studies in Humanities and Social Science, 9(3), 195-204.
  • Tam, K., & Jones, K. (2019). MaCRA: a model-based framework for maritime cyber-risk assessment. WMU Journal of Maritime Affairs, 18(1), 129-163. http://dx.doi.org/10.1007/s13437-019-00162-2
    » http://dx.doi.org/10.1007/s13437-019-00162-2
  • Zeaki, N., Johler, S., Skandamis, P. N., & Schelin, J. (2019). The role of regulatory mechanisms and environmental parameters in staphylococcal food poisoning and resulting challenges to risk assessment. Frontiers in Microbiology, 10, 1307. http://dx.doi.org/10.3389/fmicb.2019.01307 PMid:31244814.
    » http://dx.doi.org/10.3389/fmicb.2019.01307
  • Zhang, J., Zhu, Y., Zhang, X., Ye, M., & Yang, J. (2018). Developing a Long Short-Term Memory (LSTM) based model for predicting water table depth in agricultural areas. Journal of Hydrology, 561, 918-929. http://dx.doi.org/10.1016/j.jhydrol.2018.04.065
    » http://dx.doi.org/10.1016/j.jhydrol.2018.04.065
  • Zheng, S., Wang, Q., Yuan, Y., & Sun, W. (2020a). Human health risk assessment of heavy metals in soil and food crops in the Pearl River Delta urban agglomeration of China. Food Chemistry, 316, 126213. http://dx.doi.org/10.1016/j.foodchem.2020.126213 PMid:32045811.
    » http://dx.doi.org/10.1016/j.foodchem.2020.126213
  • Zheng, Z., Zhang, X., Yu, J., Guo, R., & Zhangzhong, L. (2020b). Deep neural networks for the classification of pure and impure strawberry purees. Sensors, 20(4), 1223. http://dx.doi.org/10.3390/s20041223 PMid:32102254.
    » http://dx.doi.org/10.3390/s20041223

Publication Dates

  • Publication in this collection
    25 Oct 2021
  • Date of issue
    2022

History

  • Received
    13 June 2021
  • Accepted
    29 June 2021
Sociedade Brasileira de Ciência e Tecnologia de Alimentos Av. Brasil, 2880, Caixa Postal 271, 13001-970 Campinas SP - Brazil, Tel.: +55 19 3241.5793, Tel./Fax.: +55 19 3241.0527 - Campinas - SP - Brazil
E-mail: revista@sbcta.org.br