Tea producing area identification method and device, storage medium and electronic equipment

By calculating the covariance matrix, mean and posterior probability of tea samples, a multivariate recognition function is obtained, which solves the problem of slow detection of tea origin in the prior art, and achieves fast and accurate identification of origin.

CN120030356AInactive Publication Date: 2025-05-23WUHAN POLYTECHNIC UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510511717.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-05-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing tea origin detection methods rely on the training set. Although they perform well in accuracy, they have obvious shortcomings in detection speed and cannot meet the needs of rapid response.

Method used

By obtaining the training sample set, the covariance matrix, mean and posterior probability of each place of origin are calculated, and the multivariate recognition function of each place of origin is obtained, and these functions are used to quickly determine the origin of the tea sample.

Benefits of technology

The calculation process is simplified, the detection efficiency is improved, and the origin of tea can be quickly and accurately identified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120030356A_ABST
    Figure CN120030356A_ABST
Patent Text Reader

Abstract

The invention provides a tea producing area identification method and device, a storage medium and electronic equipment, and relates to the field of data processing. The electronic equipment obtains a training sample set; wherein the tea information in the training sample set is from tea samples from at least two producing areas; obtaining a covariance matrix, a mean value and a posterior probability of each producing area according to the training sample set; obtaining a multivariate recognition function of each producing area according to the covariance matrix, the mean value and the posterior probability of each producing area; and according to the calculation result of the tea information of the to-be-identified tea according to the multivariate identification function of each production place, determining a target production place to which the to-be-identified tea belongs. Therefore, by utilizing the covariance matrix, the mean value and the posterior probability of each producing area, an original producing area identification method needing complex calculation is converted into a multivariate identification function, so that the calculation process is simplified, and the detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and more specifically, to a method, device, storage medium and electronic device for identifying the origin of tea. Background Art

[0002] As an indispensable drink in people's daily life, tea has been widely loved and paid attention to. Many tea lovers have a special liking for tea from a specific origin. Therefore, it is particularly important to quickly and accurately detect the origin of tea. In recent years, methods for tea origin detection have been continuously explored and improved, and various detection technologies have emerged. However, most of the current tea origin detection methods rely on training sets and are judged through machine learning algorithms. However, in practice, it was found that although this method performed well in terms of accuracy, it had obvious shortcomings in detection speed and could not meet the needs of rapid response. Summary of the invention

[0003] In order to overcome at least one of the deficiencies in the prior art, the present application provides a method, device, storage medium and electronic device for identifying the origin of tea, specifically including: In a first aspect, the present application provides a method for identifying the origin of tea leaves, the method comprising: Acquire a training sample set, wherein the tea information in the training sample set comes from tea samples from at least two origins; According to the training sample set, a covariance matrix, a mean value and a posterior probability of each of the production areas are obtained; Obtaining a multivariate identification function of each of the origins according to the covariance matrix, mean, and posterior probability of each of the origins; The target origin of the tea to be identified is determined according to the calculation result of the multivariate identification function of each origin on the tea information of the tea to be identified.

[0004] In a second aspect, the present application further provides a tea origin identification device, the device comprising: A sample acquisition module, used to acquire a training sample set, wherein the tea information in the training sample set comes from tea samples from at least two origins; A sample processing module, used to obtain the covariance matrix, mean and posterior probability of each of the origins according to the training sample set; A function construction module, used to obtain a multivariate identification function of each of the origins according to the covariance matrix, mean and posterior probability of each of the origins; The origin recognition module is used to determine the target origin of the tea to be identified according to the calculation result of the multivariate recognition function of each origin on the tea information of the tea to be identified.

[0005] In a third aspect, the present application also provides a storage medium, wherein the storage medium stores a computer program, and the computer program implements the method for identifying the origin of tea leaves when executed by a processor.

[0006] In a fourth aspect, the present application further provides an electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program implements the method for identifying the origin of tea leaves when executed by the processor.

[0007] Compared with the prior art, this application has the following beneficial effects: The present application provides a method, device, storage medium and electronic device for identifying the origin of tea. The electronic device obtains a training sample set; the tea information in the training sample set comes from tea samples from at least two origins; the covariance matrix, mean and posterior probability of each origin are obtained according to the training sample set; the multivariate identification function of each origin is obtained according to the covariance matrix, mean and posterior probability of each origin; the target origin of the tea to be identified is determined according to the calculation result of the multivariate identification function of each origin on the tea information of the tea to be identified. In this way, the origin identification method that originally required complex calculations is converted into a multivariate identification function by using the covariance matrix, mean and posterior probability of each origin, thereby simplifying the calculation process and improving the detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0009] Figure 1 A schematic diagram of a method for identifying the origin of tea leaves provided in an embodiment of the present application; Figure 2 One of the detailed schematic diagrams of the method for identifying the origin of tea provided in the embodiment of the present application; Figure 3 A second detailed schematic diagram of the method for identifying the origin of tea provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of a tea origin identification device provided in an embodiment of the present application; Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0010] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0011] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0012] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0013] In the description of the present application, it should be noted that the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance. In addition, the terms "comprise", "include" 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 includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0014] Based on the above statement, as introduced in the background technology, most of the current tea origin detection methods rely on training sets and make judgments through machine learning algorithms. However, in practice, it is found that although this method performs well in terms of accuracy, it has obvious shortcomings in detection speed and cannot meet the needs of rapid response.

[0015] In this regard, it should be understood that, firstly, the preparation of the training set requires the collection and annotation of a large amount of sample data for each tea origin test to form a comprehensive training set. Secondly, the computational complexity of the machine learning algorithm is relatively high. When conducting a test, the algorithm needs to perform complex calculations and comparisons on each new sample to determine its most likely origin. This complex calculation process consumes a lot of computing resources and time, especially when the number of samples is large, the computational complexity increases significantly, resulting in a significant reduction in detection efficiency.

[0016] Therefore, the Bayesian discriminant method is proposed in the relevant technology. Although it can reduce the amount of calculation to a certain extent, it is necessary to recalculate the overall covariance, mean and posterior probability of all tea samples for each test, and perform complex matrix operations. Especially when the number of samples is large, the calculation complexity increases significantly, resulting in a significant reduction in detection efficiency.

[0017] Based on the discovery of the above technical problems, the inventors have proposed the following technical solutions to solve or improve the above problems through creative work. It should be noted that the defects in the solutions in the above prior art are the results obtained by the inventors after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed in the embodiments of the present application for the above problems below should all be the contributions made by the inventors to the present application in the process of invention and creation, and should not be understood as technical contents known to those skilled in the art.

[0018] The study found that the training set for tea origin detection is not frequently updated over a long period of time, so the corresponding multivariate measurement function remains relatively unchanged. This means that as long as the training set does not change, the origin determination of the tea sample depends entirely on the calculation results of the existing multivariate measurement function. The use of multivariate measurement functions for origin detection has significant efficiency advantages. By simply providing a fully trained multivariate measurement function, the origin of the tea sample can be quickly determined, thereby significantly improving the detection speed.

[0019] In view of this, the embodiment of the present application (hereinafter referred to as the present embodiment) provides a method for identifying the origin of tea. Figure 1 As shown, the method includes: S1, obtain the training sample set.

[0020] Among them, the tea information in the training sample set comes from tea samples from at least two origins.

[0021] S2, based on the training sample set, obtain the covariance matrix, mean and posterior probability of each origin.

[0022] S3, based on the covariance matrix, mean and posterior probability of each origin, obtain the multivariate identification function of each origin.

[0023] S4, determining the target origin of the tea to be identified according to the calculation result of the multivariate identification function of each origin on the tea information of the tea to be identified.

[0024] In this way, the covariance matrix, mean and posterior probability of each origin are used to convert the origin identification method that originally required complex calculations into a multivariate identification function, thereby simplifying the calculation process and improving detection efficiency.

[0025] In this embodiment, the electronic device implementing the method for identifying the origin of tea leaves may be, but is not limited to, a mobile terminal, a tablet computer, a laptop computer, a desktop computer, and a server, etc. The server may be a single server or a server group. The server group may be centralized or distributed (for example, the server may be a distributed system). In some embodiments, the server may be local or remote relative to the user terminal. In some embodiments, the server may be implemented on a cloud platform; as an example only, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an inter-cloud, a multi-cloud, etc., or any combination thereof. In some embodiments, the server may be implemented on an electronic device having one or more components.

[0026] To make the solution provided by this embodiment clearer, the following uses a server as an electronic device for implementing the method for identifying the origin of tea leaves. Figure 1 Each step of the method shown is described in detail. However, it should be understood that the operations of the flowchart may not be implemented in order, and steps without logical contextual relationship may be reversed or implemented simultaneously. In addition, those skilled in the art may add one or more other operations to the flowchart, or remove one or more operations from the flowchart under the guidance of the content of this application. Therefore, continue to refer to Figure 1 , the method comprising: S1, obtain the training sample set.

[0027] The tea information in the training sample set comes from tea samples from at least two origins. The tea information of each tea sample includes the content of various chemical components in the tea. For example, it may include mineral elements (such as iron Fe, cobalt Co, zinc Zn); or it may include mineral elements (such as iron Fe, cobalt Co, zinc Zn), organic compounds (such as tea polyphenols, caffeine, etc.) and other chemicals that may affect the quality of tea.

[0028] For example, tea is the most widely used beverage in the world. In this example, 24 tea samples were selected from Jiangxi, Yunnan, Fujian, and Guangdong. The contents of mineral elements Fe, Co, and Zn were tested in random order (unit: ), the test results are shown in Table 1. Four tea samples were selected to verify the effect of the tea origin identification method.

[0029]

[0030] Table 1 Based on the description of the training sample set in step S1 in the above embodiment, see Figure 1, the step S2 in the figure is described below: S2, based on the training sample set, obtain the covariance matrix, mean and posterior probability of each origin.

[0031] In this embodiment, the covariance matrix is ​​used to describe the relationship and degree of variation between the chemical components or characteristic variables of each origin in the training sample set. It can be understood that by calculating the covariance matrix between the tea information in each origin, the complex interdependence between the chemical components can be captured, thereby helping to construct a more accurate recognition function to distinguish teas from different origins.

[0032] The posterior probability refers to the probability that a sample belongs to a specific origin given the observed data (i.e., chemical composition and characteristics). This embodiment is calculated using the Bayesian formula based on the prior probability (i.e., the initial probability distribution of each origin when there is no observed data) and the likelihood (i.e., the probability of the observed data appearing under different origin conditions). By calculating the posterior probability of each origin, it is possible to determine which origin is most likely to produce a specific tea information.

[0033] For example, suppose there are two Overall tea production in Wei They have probability density functions , and set The prior probability of occurrence is:

[0034] In the formula, For a new tea sample, its tea information is represented as According to the Bayesian formula, we can get The expression of the posterior probability is:

[0035] Therefore, the Bayesian discriminant criterion for the two tea populations is:

[0036] Based on the description of the covariance matrix, mean and posterior probability in step S2 in the above implementation mode, the following is a description of the covariance matrix, mean and posterior probability in step S2. Figure 1 Step S3 in the following is described: S3, based on the covariance matrix, mean and posterior probability of each origin, obtain the multivariate identification function of each origin.

[0037] In this embodiment, different methods are used to obtain the multivariate identification function of each origin according to the number of origins in the training sample set. Specifically, this embodiment is divided into two cases: there are only two origins and there are more than two origins. Therefore, if Figure 2As shown, optional implementations of step S3 may include: S3-1A, if the training sample set includes only two origins, determine whether the covariance matrices of the two origins are equal.

[0038] If yes, execute S3-2A, otherwise execute S3-4A.

[0039] As an optional implementation, the server may determine whether the two origins simultaneously meet the following conditions:

[0040] In the formula, Indicates that from The amount of tea information obtained from each origin, represents the mixed sample covariance, Indicates The covariance of the origins, Represents the dimension of each piece of tea information, which also represents the number of variables in the subsequent multivariate recognition function. represents the critical value of the chi-square distribution, Indicates the data in brackets Find the trace of a matrix.

[0041] If so, the covariance matrices of the two origins are determined to be equal; If not, it is determined that the covariance matrices of the two origins are not equal.

[0042] S3-2A, based on the covariance matrix, mean and posterior probability of the two origins, obtain two sets of first values ​​of the unknown coefficients in the first function.

[0043] S3-3A, based on the two groups of first values, obtain the multivariate identification function of the two origins.

[0044] For example, we continue to use the above expression of posterior probability as an example and assume that there are two origins The tea information satisfies the normal distribution. Since the covariance matrices of the two are equal, they can be expressed as . And the probability density functions of the two are expressed as:

[0045] Then, the probability density function is substituted into the above expression of posterior probability, and the logarithm operation is performed on the expression of posterior probability, that is, , thus obtaining the equivalent function, the expression of the equivalent function is:

[0046] Since a negative sign is added when taking the logarithm, the Bayesian discriminant criterion based on the overall posterior probability of the two tea producing areas changes to:

[0047] Continue to refer to the above two equivalent functions:

[0048]

[0049] After expanding the above two equivalent functions, the expression changes to:

[0050]

[0051] Since the covariance matrices of the two origins are equal, when comparing, we only need to focus on the different parts of the expressions of the two. Therefore, we can get the first function in the form of a linear function, whose expression is:

[0052] In the formula, , represent the unknown coefficients in the first function, Indicates The average value of the origin, Indicates The posterior probability of the origin is represents the covariance matrix of any of the two origins, Indicates that the first function has variables.

[0053] As the calculation expressions of the above undetermined coefficients are not difficult to see, by substituting the covariance matrix, mean and posterior probability of the two origins into the calculation, two sets of first values ​​can be obtained. Then, the respective multivariate identification functions can be obtained based on the two sets of first values.

[0054] S3-4A, based on the covariance matrix, mean and posterior probability of the two origins, obtain two sets of second values ​​of the undetermined coefficients in the second function.

[0055] For example, let's continue to take the expression after the above two equivalent functions are expanded as an example:

[0056]

[0057] Since the covariance matrices of the two origins are not equal, it is necessary to pay attention to each part of the expression when comparing. Therefore, the second function in the form of a quadratic function can be obtained, and its expression is:

[0058] In the formula, , , represent the unknown coefficients in the second function, Indicates The average value of the origin, Indicates The posterior probability of the origin is Indicates The covariance matrix of the origins; Indicates that the second function has variables.

[0059] As the calculation expression of the above undetermined coefficients is not difficult to see, by substituting the covariance matrix, mean and posterior probability of the two origins into the calculation, two sets of second values ​​can be obtained. Then, the respective multivariate identification functions can be obtained based on the two sets of second values.

[0060] S3-5A, based on the two groups of second values, obtain the multivariate identification function of the two origins respectively.

[0061] The above embodiment describes the case where the training sample set includes only two production areas. The following describes the case where the training sample set includes more than three production areas. Figure 3 As shown, another optional implementation of step S3 may include: S3-1B, if the training sample set includes multiple origins, determine whether the covariance matrices between the multiple origins are equal.

[0062] Wherein, the number of the multiple production places is greater than 2; if so, this executes step S3-2B, if not, this executes S3-4B.

[0063] As an optional implementation, when the number of the multiple production places is greater than 2, the server determines whether the multiple production places simultaneously meet the following conditions:

[0064]

[0065]

[0066]

[0067]

[0068]

[0069] In the formula, Indicates that from The amount of tea information obtained from each origin, represents the total amount of tea information in the training sample set, represents the mixed sample covariance, Indicates The covariance of the origins, Represents the dimension of each piece of tea information, represents the degrees of freedom, Indicates the number of origins, represents the critical value of the chi-square distribution.

[0070] If so, the covariance matrices of multiple origins are determined to be equal; If not, it is determined that the covariance matrices of the multiple origins are not equal.

[0071] Continue to see Figure 3 , step S3 further includes: S3-2B, obtaining multiple sets of third values ​​of the undetermined coefficients in the third function according to the covariance matrices, means and posterior probabilities of the multiple origins.

[0072] S3-3B, based on the multiple groups of third values, obtain the multivariate identification function of the multiple origins.

[0073] For example, since more than three origins are involved at this time, Indicates the number of origins, which can be understood as A positive integer. In this case, the expression of the equivalent function is:

[0074] Based on the expression of the above equivalent function, since the covariance matrices of multiple origins are equal, when comparing, we only need to focus on the different parts of the expressions of multiple origins. Therefore, we can get the third function in the form of a linear function, and its expression is:

[0075] In the formula, , represent the unknown coefficients in the third function, Indicates The average value of the origin, Indicates The posterior probability of the origin is Indicates The covariance matrix of the origins, Represents the dimension of each piece of tea information, Indicates the third function variables, Indicates the quantity of multiple origins.

[0076] As the calculation expressions of the above undetermined coefficients show, by substituting the covariance matrix, mean and posterior probability of multiple origins into the calculation, multiple sets of third values ​​can be obtained. Then, the respective multivariate identification functions can be obtained according to the multiple sets of third values.

[0077] S3-4B, obtaining multiple sets of fourth values ​​of the undetermined coefficients in the fourth function according to the covariance matrix, mean and posterior probability of multiple origins.

[0078] For example, since more than three origins are involved at this time, Indicates the number of origins, which can be understood as A positive integer. In this case, the expression of the equivalent function is:

[0079] Based on the expression of the above equivalent function, since the covariance matrices of multiple origins are not equal, when comparing, we only need to focus on each part of the expressions of multiple origins. Therefore, we can get the fourth function in the form of a quadratic function, whose expression is:

[0080] In the formula, , , represent the unknown coefficients in the fourth function, Indicates The average value of the origin, Indicates The posterior probability of the origin is Indicates The covariance matrix of the origins, Represents the dimension of each piece of tea information, Indicates the number of multiple origins, Indicates the fourth function variables, Indicates the fourth function variables.

[0081] As can be seen from the calculation expressions of the above undetermined coefficients, by respectively substituting the covariance matrix, mean value and posterior probability of multiple origins into the calculation, multiple sets of fourth values ​​can be obtained. Then, the respective multivariate identification functions can be obtained according to the multiple sets of fourth values.

[0082] S3-5B, obtaining the multivariate identification function of each of the multiple origins according to the multiple groups of fourth values.

[0083] Based on the description of step S3 in the above embodiment, see Figure 1 , step S4 in the figure is explained below.

[0084] S4, determining the target origin of the tea to be identified according to the calculation result of the multivariate identification function of each origin on the tea information of the tea to be identified.

[0085] In summary, in order to detect tea samples The origin of tea leaves can be determined by substituting them into the multivariate identification function set In this way, we get Function value .if , then the tea sample is judged From tea producing areas .

[0086] Exemplarily, continuing to take the data in Table 1 above as an example, since there are 4 origins in total; and after calculation, it is found that the covariance matrices of the 4 origins are equal, therefore, the following 4 multivariate identification functions in the form of linear functions are obtained, which are the multivariate identification functions of Jiangxi, Yunnan, Fujian, and Guangdong respectively:

[0087]

[0088]

[0089]

[0090] In the above expression Respectively represent the content of Fe, Co, and Zn elements in tea information. There are 4 samples in Table 1, and the following is an example of sample 1 in Table 1. Substituting the content of Fe, Co, and Zn elements in sample 1 into the above 4 multivariate identification functions, the calculation results of each are as follows:

[0091]

[0092]

[0093]

[0094] Since the result calculated by the multivariate identification function of Yunnan is the smallest, it can be determined that sample 1 comes from Yunnan. The same is true for other samples, which will not be described in detail in this embodiment.

[0095] Based on the same inventive concept as the tea origin identification method provided in this embodiment, this embodiment also provides a tea origin identification device, which includes at least one software function module that can be stored in a memory or fixed in an electronic device in the form of software. The processor in the electronic device is used to execute the executable module stored in the memory. For example, the software function module and computer program included in the device. Please refer to Figure 4 , from a functional perspective, the device may include: The sample acquisition module 11 is used to acquire a training sample set, wherein the training sample set includes tea information from at least two origins; The sample processing module 12 is used to obtain the covariance matrix, mean value and posterior probability of each origin according to the training sample set; A function construction module 13 is used to obtain a multivariate identification function of each origin according to the covariance matrix, mean and posterior probability of each origin; The origin recognition module 14 is used to determine the target origin of the tea to be identified according to the calculation result of the multivariate recognition function of each origin on the tea information of the tea to be identified.

[0096] In this embodiment, the sample acquisition module 11 is used to implement Figure 1 In step S1, the sample processing module 12 is used to implement Figure 1 In S2, function building block 13 is used to implement Figure 1 In step S3, the origin identification module 14 is used to implement Figure 1 Therefore, for the detailed description of each of the above modules, please refer to the specific implementation of the corresponding steps, and this implementation will not be repeated.

[0097] It should also be understood that, since the invention concept is the same as that of the above-mentioned method for identifying the origin of tea, the device for identifying the origin of tea can also implement other steps or sub-steps of the method through the above-mentioned modules.

[0098] Optionally, the function construction module 13 is further specifically used for: If the training sample set includes only two origins, determine whether the covariance matrices of the two origins are equal; If the covariance matrices of the two origins are equal, then two sets of first values ​​of the undetermined coefficients in the first function are obtained according to the covariance matrices, means and posterior probabilities of the two origins respectively; According to the two groups of first values, the multivariate identification functions of the two origins are obtained; If the covariance matrices of the two origins are not equal, then two sets of second values ​​of the undetermined coefficients in the second function are obtained according to the covariance matrices, means and posterior probabilities of the two origins respectively; According to the two groups of second values, the multivariate identification functions of the two origins are obtained.

[0099] Optionally, the function construction module 13 is further specifically used for: Determine whether two origins meet the following conditions at the same time:

[0100] In the formula, Indicates that from The amount of tea information obtained from each origin, represents the mixed sample covariance, Indicates The covariance of the origins, Represents the dimension of each piece of tea information, represents the critical value of the chi-square distribution, Indicates the data in brackets Find the trace of a matrix.

[0101] If so, the covariance matrices of the two origins are determined to be equal; If not, it is determined that the covariance matrices of the two origins are not equal.

[0102] Optionally, the expression of the first function is:

[0103] In the formula, , represent the unknown coefficients in the first function, Indicates The average value of the origin, Indicates The posterior probability of the origin is represents the covariance matrix of any of the two origins, Indicates that the first function has variables; The expression of the second function is:

[0104] In the formula, , , represent the unknown coefficients in the second function, Indicates The average value of the origin, Indicates The posterior probability of the origin is Indicates The covariance matrix of the origins; Indicates that the second function has variables.

[0105] Optionally, the function construction module 13 is further specifically used for: If the training sample set includes multiple origins, then determine whether the covariance matrices between the multiple origins are equal, wherein the number of the multiple origins is greater than 2; If the covariance matrices of multiple origins are equal, then multiple sets of third values ​​of the undetermined coefficients in the third function are obtained according to the covariance matrices, means and posterior probabilities of the multiple origins respectively; According to the multiple sets of third values, a multivariate identification function of each of the multiple origins is obtained; If the covariance matrices of the multiple origins are not equal, then multiple sets of fourth values ​​of the undetermined coefficients in the fourth function are obtained according to the covariance matrices, means and posterior probabilities of the multiple origins; According to the multiple groups of fourth values, the multivariate identification functions of the multiple origins are obtained.

[0106] Optionally, the function construction module 13 is further specifically used for: Determine whether multiple origins meet the following conditions at the same time:

[0107]

[0108]

[0109]

[0110]

[0111] In the formula, Indicates that from The amount of tea information obtained from each origin, represents the mixed sample covariance, Indicates The covariance of the origins, Represents the dimension of each piece of tea information, represents the degrees of freedom, Indicates the number of origins, represents the critical value of chi-square distribution; If so, the covariance matrices of multiple origins are determined to be equal; If not, it is determined that the covariance matrices of the multiple origins are not equal.

[0112] Optionally, the expression of the third function is:

[0113] In the formula, , represent the unknown coefficients in the third function, Indicates The average value of the origin, Indicates The posterior probability of the origin is Indicates The covariance matrix of the origins, Represents the dimension of each piece of tea information, Indicates the third function variables, Indicates the number of multiple origins; The expression of the fourth function is:

[0114] In the formula, , , represent the unknown coefficients in the fourth function, Indicates The average value of the origin, Indicates The posterior probability of the origin is Indicates The covariance matrix of the origins, Represents the dimension of each piece of tea information, Indicates the number of multiple origins, Indicates the fourth function variables, Indicates the fourth function variables.

[0115] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0116] It should also be understood that if the above implementation is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present application.

[0117] Therefore, this embodiment further provides a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the method for identifying the origin of tea provided in this embodiment is implemented. The storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0118] This embodiment provides an electronic device for implementing a method for identifying the origin of tea. Figure 5 As shown, the electronic device may include a processor 22 and a memory 21. In addition, the memory 21 stores a computer program, and the processor implements the tea origin identification method provided in this embodiment by reading and executing the computer program corresponding to the above implementation in the memory 21.

[0119] Continue to see Figure 5 The electronic device further includes a communication unit 23. The memory 21, the processor 22 and the communication unit 23 are electrically connected to each other directly or indirectly through a system bus 24 to achieve data transmission or interaction.

[0120] The memory 21 may be an information recording device based on any electronic, magnetic, optical or other physical principle, used to record execution instructions, data, etc. In some embodiments, the memory 21 may be, but is not limited to, a volatile memory, a non-volatile memory, a storage drive, etc.

[0121] In some embodiments, the volatile memory may be a random access memory (RAM); in some embodiments, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), a flash memory, etc.; in some embodiments, the storage drive may be a disk drive, a solid-state drive, any type of storage disk (such as a CD, a DVD, etc.), or a similar storage medium, or a combination thereof, etc.

[0122] The communication unit 23 is used to send and receive data through a network. In some embodiments, the network may include a wired network, a wireless network, a fiber optic network, a telecommunication network, an intranet, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a wide area network (WAN), a public switched telephone network (PSTN), a Bluetooth network, a ZigBee network, or a near field communication (NFC) network, or any combination thereof. In some embodiments, the network may include one or more network access points. For example, the network may include a wired or wireless network access point, such as a base station and / or a network switching node, and one or more components of the service request processing system may be connected to the network through the access point to exchange data and / or information.

[0123] The processor 22 may be an integrated circuit chip with signal processing capability, and the processor may include one or more processing cores (e.g., a single-core processor or a multi-core processor). By way of example only, the processor may include a central processing unit (CPU), an application specific integrated circuit (ASIC), an application specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a controller, a microcontroller unit, a reduced instruction set computer (RISC), or a microprocessor, or any combination thereof.

[0124] Understandably, Figure 5The structure shown is for illustration only. The electronic device may also have Figure 5 More or fewer components than shown, or with Figure 5 Different configurations are shown. Figure 5 The components shown may be implemented in hardware, software or a combination thereof.

[0125] It should be understood that the apparatus and method disclosed in the above-mentioned embodiments can also be implemented in other ways. The apparatus embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the apparatus, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0126] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for identifying the origin of tea, characterized in that: The method comprises: Acquire a training sample set, wherein the tea information in the training sample set comes from tea samples from at least two origins; According to the training sample set, a covariance matrix, a mean value and a posterior probability of each of the production areas are obtained; Obtaining a multivariate identification function of each of the origins according to the covariance matrix, mean, and posterior probability of each of the origins; The target origin of the tea to be identified is determined according to the calculation result of the multivariate identification function of each origin on the tea information of the tea to be identified.

2. The method for identifying tea origin according to claim 1, characterized in that: According to the covariance matrix, mean and posterior probability of each of the origins, a multivariate identification function of each of the origins is obtained, including: If the training sample set includes only two production areas, determining whether the covariance matrices of the two production areas are equal; If the covariance matrices of the two origins are equal, then according to the covariance matrices, means and posterior probabilities of the two origins respectively, two sets of first values ​​of the undetermined coefficients in the first function are obtained, wherein the first function is a linear function; According to the two groups of first values, a multivariate identification function of each of the two origins is obtained; If the covariance matrices of the two origins are not equal, two sets of second values ​​of the undetermined coefficients in the second function are obtained according to the covariance matrices, means and posterior probabilities of the two origins, respectively, wherein the second function is a quadratic function; According to the two groups of second values, the multivariate identification functions of the two origins are obtained.

3. The method for identifying tea origin according to claim 2, characterized in that: Determine whether the covariance matrices of the two origins are equal, including: Determine whether the two origins meet the following conditions at the same time: In the formula, Indicates that from The amount of tea information obtained from each origin, represents the mixed sample covariance, Indicates The covariance of the origins, Represents the dimension of each piece of tea information, represents the critical value of the chi-square distribution, Indicates the data in brackets Find the trace of a matrix; If so, it is determined that the covariance matrices of the two origins are equal; If not, it is determined that the covariance matrices of the two origins are not equal.

4. The method for identifying tea origin according to claim 2, characterized in that: The expression of the first function is: In the formula, , represent the unknown coefficients in the first function, Indicates The average value of the origin, Indicates The posterior probability of the origin is represents the covariance matrix of any origin, Indicates that the first function has variables; The expression of the second function is: In the formula, , , represent the unknown coefficients in the second function, Indicates The average value of the origin, Indicates The posterior probability of the origin is Indicates The covariance matrix of the origins, Indicates that the second function has variables.

5. The method for identifying tea origin according to claim 1, characterized in that: According to the covariance matrix, mean and posterior probability of each of the origins, a multivariate identification function of each of the origins is obtained, including: If the training sample set includes multiple production areas, determining whether the covariance matrices between the multiple production areas are equal, wherein the number of the multiple production areas is greater than 2; If the covariance matrices of the multiple origins are equal, then obtaining multiple sets of third values ​​of the undetermined coefficients in the third function according to the covariance matrices, means and posterior probabilities of the multiple origins, wherein the third function is a linear function; Obtaining, according to the plurality of groups of third values, a multivariate identification function of each of the plurality of origins; If the covariance matrices of the multiple origins are not equal, then obtaining multiple sets of fourth values ​​of undetermined coefficients in a fourth function according to the covariance matrices, means and posterior probabilities of the multiple origins, wherein the fourth function is a quadratic function; According to the multiple groups of fourth values, a multivariate identification function of each of the multiple origins is obtained.

6. The method for identifying the origin of tea according to claim 5, characterized in that: Determining whether the covariance matrices between the multiple origins are equal includes: Determine whether the multiple origins simultaneously meet the following conditions: In the formula, Indicates that from The amount of tea information obtained from each origin, represents the mixed sample covariance, Indicates The covariance of the origins, Represents the dimension of each piece of tea information, represents the degrees of freedom, represents the number of the plurality of origins, represents the critical value of chi-square distribution; If so, determining that the covariance matrices of the multiple origins are equal; If not, it is determined that the covariance matrices of the multiple origins are not equal.

7. The method for identifying tea origin according to claim 5, characterized in that: The expression of the third function is: In the formula, , represent the unknown coefficients in the third function, Indicates The average value of the origin, Indicates The posterior probability of the origin is Indicates The covariance matrix of the origins, Represents the dimension of each piece of tea information, Indicates the third function variables, indicating the number of the plurality of origins; The expression of the fourth function is: In the formula, , , represent the unknown coefficients in the fourth function, Indicates The average value of the origin, Indicates The posterior probability of the origin is Indicates The covariance matrix of the origins, Represents the dimension of each piece of tea information, represents the number of the plurality of origins, Indicates the fourth function variables, Indicates the fourth function variables.

8. A tea origin identification device, characterized in that: The device comprises: A sample acquisition module, used to acquire a training sample set, wherein the tea information in the training sample set comes from tea samples from at least two origins; A sample processing module, used to obtain the covariance matrix, mean and posterior probability of each of the origins according to the training sample set; A function construction module, used to obtain a multivariate identification function of each of the origins according to the covariance matrix, mean and posterior probability of each of the origins; The origin recognition module is used to determine the target origin of the tea to be identified according to the calculation result of the multivariate recognition function of each origin on the tea information of the tea to be identified.

9. A storage medium, characterized in that: The storage medium stores a computer program, and the computer program, when executed by a processor, implements the method for identifying the origin of tea leaves according to any one of claims 1 to 7.

10. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores a computer program, and the computer program, when executed by the processor, implements the method for identifying the origin of tea according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Machine learning method for identifying origin of Wuyi rock tea automatically

    CN106560700A