Cereal classification method and device based on spiking neural network, and electronic equipment

Through the grain classification method based on pulse neural network, pulse sequence and incremental learning model are used to solve the problem that artificial visual inspection is difficult to achieve efficient and accurate classification, and the rapid and accurate classification of large-scale grains is achieved.

CN119295817AInactive Publication Date: 2025-01-10PEKING UNIV

Patent Information

Application Number
CN202411360948.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-01-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, grain classification depends on manual visual inspection, and it is difficult to achieve large-scale, high-efficiency and high-precision classification, which is limited by human factors and environmental conditions.

Method used

Using the grain classification method based on pulse neural network, the grain species prediction model obtained by obtaining the pulse sequence corresponding to the image of the grain to be predicted is used to determine the grain species through the output layer of the pulse neural network, combining Poisson encoding and burst Touch weight adjustment to realize automated classification.

Benefits of technology

It significantly improves the classification speed and accuracy, reduces errors caused by manual intervention and factors, and achieves rapid and accurate classification of large-scale grains.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295817A_ABST
    Figure CN119295817A_ABST
Patent Text Reader

Abstract

The invention provides a cereal classification method and device based on a pulse neural network, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence. The grain classification method based on the pulse neural network comprises the steps of obtaining a first pulse sequence corresponding to an image of to-be-predicted grains; according to the first pulse sequence, utilizing a grain type prediction model to obtain the type of the to-be-predicted grain; wherein the grain type prediction model is a pulse neural network which is obtained through incremental learning and is used for predicting grain types. According to the invention, the cereals can be classified efficiently and accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a grain classification method, device and electronic equipment based on a pulse neural network. Background Art

[0002] As the cornerstone of human diet, cereals come in many varieties, including wheat, corn, rice, barley, oats, etc. Each type of cereal differs in nutritional content, growing conditions, processing uses, and market value. Therefore, accurate cereal classification is not only the basis of agricultural management, but also the key to ensuring the efficient operation of the food industry and meeting the diverse needs of consumers. In addition, in terms of scientific research and environmental protection, cereal classification is also an important prerequisite for promoting crop genetic improvement and achieving sustainable agricultural development.

[0003] In related technologies, grain classification mainly relies on manual visual inspection. Although this method is intuitive, it is limited by human experience and subjective judgment, and is easily affected by factors such as fatigue and lighting conditions. It is difficult to achieve large-scale, high-efficiency and high-precision classification.

[0004] Therefore, how to classify grains efficiently and accurately is a technical problem that needs to be solved urgently. Summary of the invention

[0005] In view of the above problems existing in the prior art, the present invention provides a grain classification method, device and electronic equipment based on a pulse neural network, which can realize efficient and accurate grain classification.

[0006] The present invention provides a grain classification method based on pulse neural network, comprising the following steps.

[0007] Acquire a first pulse sequence corresponding to an image of the grain to be predicted; obtain the type of the grain to be predicted using a grain type prediction model based on the first pulse sequence; wherein the grain type prediction model is a pulse neural network obtained through incremental learning and used to predict grain types.

[0008] According to a grain classification method based on a pulse neural network provided by the present invention, the output layer of the grain type prediction model includes neurons of multiple categories; wherein each category of the neurons corresponds to a type of grain; the type of grain to be predicted is obtained by using the grain type prediction model according to the first pulse sequence, comprising: inputting the first pulse sequence into the grain type prediction model, obtaining the number of pulses generated by each neuron in the output layer in response to the first pulse sequence; determining the average number of pulses emitted by each category of neurons in the output layer according to the number of pulses generated by each neuron in the output layer in response to the first pulse sequence; and obtaining the type of grain to be predicted according to the category of the neuron corresponding to the maximum average value.

[0009] According to a grain classification method based on a pulse neural network provided by the present invention, the grain type prediction model is obtained in the following manner: using a first training data set, an initial pulse neural network is trained to obtain a pre-trained grain type prediction model; wherein the first training data set includes first sample data, and the first sample data is an image of at least one grain carrying type information taken under a first shooting condition; using a second training data set, the pre-trained grain type prediction model is incrementally trained to obtain the grain type prediction model; wherein the second training data set includes the first sample data and second sample data, and the second sample data is an image of the at least one grain carrying type information taken under a second shooting condition.

[0010] According to a grain classification method based on a pulse neural network provided by the present invention, the second training data set is used to perform incremental training on the pre-trained grain type prediction model to obtain the grain type prediction model, including: The second pulse sequence generated according to the sample data in the second training data set is input into the pre-trained grain type prediction model. At each time step of the pre-trained grain type prediction model processing the second pulse sequence, the value of the synaptic weight in the pre-trained grain type prediction model is updated in the following manner: in response to a pulse emitted by a pre-synaptic neuron corresponding to the synaptic weight, which is earlier than a pulse emitted by a post-synaptic neuron corresponding to the synaptic weight, the amplitude is increased according to a preset synaptic weight, and the current value of the synaptic weight is adjusted; in response to a pulse emitted by a pre-synaptic neuron corresponding to the synaptic weight, which is later than a pulse emitted by a post-synaptic neuron corresponding to the synaptic weight, the amplitude is reduced according to a preset synaptic weight, and the current value of the synaptic weight is adjusted; and the grain type prediction model is obtained based on the pre-trained grain type prediction model after the synaptic weight is adjusted.

[0011] According to a grain classification method based on a pulse neural network provided by the present invention, the method also includes: for the synaptic weights of neurons in the input layer corresponding to zero pixels in the sample data, at each time step, adjusting the current value of the synaptic weight according to a preset weight decay amount.

[0012] According to a grain classification method based on a pulse neural network provided by the present invention, the method also includes: inputting the third pulse sequences corresponding to the multiple sample data in the first training data set into the pre-trained grain type prediction model respectively; for each neuron in the output layer of the pre-trained grain type prediction model, performing the following operations: obtaining the average value of the number of pulses generated by the neuron for the same type of sample data in the multiple sample data; and using the type of the sample data corresponding to the maximum average value as the category label of the neuron.

[0013] The present invention also provides a grain classification device based on a pulse neural network, comprising the following modules: The first acquisition module is used to acquire a first pulse sequence corresponding to an image of the grain to be predicted; the second acquisition module is used to obtain the type of the grain to be predicted based on the first pulse sequence using a grain type prediction model; wherein the grain type prediction model is a pulse neural network obtained through incremental learning and used to predict grain types.

[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a grain classification method based on a pulse neural network as described above is implemented.

[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the grain classification methods based on pulse neural networks as described above.

[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the grain classification method based on a pulse neural network as described above is implemented.

[0017] The grain classification method, device and electronic device based on pulse neural network provided by the present invention obtain the type of grain to be predicted by using the grain type prediction model according to the first pulse sequence corresponding to the image of the grain to be predicted. Compared with manual visual inspection, the grain classification using pulse neural network can significantly improve the classification speed, and the automated process reduces human intervention, making large-scale rapid classification of grains possible. In addition, through learning and training, the pulse neural network can more accurately identify the characteristics of grains, reduce classification errors caused by human factors (such as experience, subjective judgment, fatigue, etc.), and thus improve classification accuracy. Therefore, grains can be classified efficiently and accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 It is a schematic flow chart of the grain classification method based on pulse neural network provided by the present invention.

[0020] Figure 2 It is a schematic flow chart of the training method of the grain variety prediction model provided by the present invention.

[0021] Figure 3 It is a structural schematic diagram of the grain variety prediction model provided by the present invention.

[0022] Figure 4 It is a schematic diagram of the first training data set and the second training data set provided by the present invention.

[0023] Figure 5 It is a schematic diagram of the process of data playback when performing incremental learning on the pre-trained grain variety prediction model provided by the present invention.

[0024] Figure 6 It is a schematic diagram of the effect of the relative timing of pulse firing of presynaptic and postsynaptic neurons on changes in synaptic connections between neurons.

[0025] Figure 7 It is a schematic diagram comparing the learning results of the grain variety prediction model provided by the present invention using weight decay and not using weight decay.

[0026] Figure 8 It is a schematic diagram of the training process of the grain variety prediction model provided by the present invention.

[0027] Fig. 9It is a schematic diagram of the structure of a grain classification device based on a pulse neural network provided by the present invention.

[0028] Fig.10 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] Combine the following Figure 1-Figure 8 The grain classification method based on pulse neural network of the present invention is described.

[0031] Figure 1 is a schematic diagram of the process of the grain classification method based on the pulse neural network provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 101: Obtain a first pulse sequence corresponding to an image of grain to be predicted.

[0032] The to-be-predicted cereals are cereals whose types need to be predicted. For example, the to-be-predicted cereals may be cereals such as wheat, barley, or oats.

[0033] In some embodiments, the image of the to-be-predicted grain may be Poisson encoded to obtain a first pulse sequence.

[0034] Poisson encoding is a method of converting input data (such as the pixel values ​​of an image) into a pulse train that conforms to a Poisson process. Just as an example, for an image to be predicted for grain, the steps of Poisson encoding are as follows: Normalize the pixel values ​​of the image of the grain to be predicted to the interval [0,1] so that the pixel value is used as the probability of pulse emission; select a total time T, which will be used to simulate the pulse emission process; at each time step, calculate the probability of each pixel generating a pulse based on the normalized pixel value. The higher the pixel value, the greater the probability of generating a pulse; based on the probability of each pixel generating a pulse, determine whether each pixel generates a pulse at each time step, thereby generating the first pulse sequence.

[0035] Step 102: According to the first pulse sequence, using the grain type prediction model, obtain the type of grain to be predicted.

[0036] The grain variety prediction model is a spiking neural network obtained through incremental learning and used to predict grain varieties.

[0037] For the training method of the grain type prediction model, see Figure 2 The relevant content in will not be repeated here.

[0038] In the specific implementation process, the first pulse sequence generated by Poisson coding in step 101 is input as input data into the grain type prediction model. The input layer of the grain type prediction model includes multiple neurons, which have a one-to-one correspondence with each pixel point of the grain image to be predicted.

[0039] In each time step of the first pulse sequence processed by the grain type prediction model, the neurons in its input layer receive pulse signals according to Poisson coding. For example, if a pixel in the image of the grain to be predicted generates a pulse at this time step, the corresponding input layer neuron will receive a pulse signal; otherwise, it will not receive it.

[0040] The output layer of the grain type prediction model includes multiple categories of neurons, each category of neurons corresponds to a type of grain.

[0041] After the first pulse sequence is input into the grain type prediction model, the number of pulses generated by each neuron in the output layer for the first pulse sequence is obtained; according to the number of pulses generated by each neuron in the output layer for the first pulse sequence, the average number of pulses emitted by each type of neuron in the output layer is determined; according to the type of neuron corresponding to the maximum average value, the type of grain to be predicted is obtained. k Category The calculation formula is as follows.

[0042] (1)

[0043] (2)

[0044] in, Is the category c A collection of neurons; Is the category c Neurons j Cereals to be forecasted k The pulse sequence fired under the stimulation of the image; The output layer of the grain variety prediction model j The type of neurons; Is the category c The number of neurons; n The time step of the prediction model for the cereal species.

[0045] The spiking neural network is a leaky integrate-and-fire (LIF) model. At each time step when the grain variety prediction model processes the first pulse sequence of the input, each neuron performs the operation shown in the following formula.

[0046] (3)

[0047] (4)

[0048] in, is the membrane potential of neuron j at time t, is the spike train from the presynaptic neuron, It's a neuron i and neurons j The synaptic weights between is the leakage term. When the membrane potential reaches the threshold When the neuron fires a pulse, the membrane potential is reset to .

[0049] In some embodiments, a cereal variety prediction model can be constructed based on a competitive spiking neural network. Figure 3 As shown in the figure, the network has two layers, the first layer is the input layer, and the second layer is the output layer. The input layer and the output layer are fully connected for feedforward, and a lateral inhibition connection mechanism is set in the output layer to inhibit "non-winning" neurons, thereby forming a competition mechanism. Lateral inhibition means that when any neuron emits a pulse, a global inhibition signal will be generated to inhibit the pulse emission of all other neurons. If there is no lateral inhibition, all neurons will gradually emit pulses, which will cause all neurons to participate in the learning of the current data sample, which is not conducive to the generation of classification results of specific neurons. Under the lateral inhibition mechanism, only a few neurons can "stand out" and continue to emit pulses, showing a preference for the current data sample, while preventing other neurons from participating in the learning of the data sample.

[0050] Figure 2 is a flow chart of the training method of the grain variety prediction model provided by the present invention, such as Figure 2 As shown, the method includes the following: Step 201: Use the first training data set to train the initial spiking neural network to obtain a pre-trained grain variety prediction model.

[0051] The first training data set includes first sample data, which is an image of at least one type of grain that is taken under first shooting conditions and carries type information.

[0052] In the specific implementation process, the first training data set can be used in a variety of ways to train the initial pulse neural network to obtain a pre-trained grain variety prediction model. For example, the STDP (Spike Timing Dependent Plasticity) algorithm can be sampled to train the grain variety prediction model, which is not limited to the description of this specification.

[0053] When the pre-trained grain variety prediction model processes new grain data, if the data distribution of the new grain is significantly different from the old grain data, the model may encounter the problem of "catastrophic forgetting". This problem manifests itself as the model "forgets" the previously learned old data information while adapting to the new data, resulting in performance degradation.

[0054] In order to overcome "catastrophic forgetting", an intuitive method is to retrain the network using all known data (including new data and old data). Although this method can ensure that the model adapts to the changing data distribution, it is extremely inefficient. Because every time new data is added, the entire model needs to be retrained, which greatly hinders the model's real-time learning ability and rapid adaptation to new data. The embodiment of the present invention uses the following steps to incrementally train the pre-trained grain variety prediction model to solve the above-mentioned "catastrophic forgetting problem".

[0055] Step 202: Use the second training data set to perform incremental training on the pre-trained grain variety prediction model to obtain a grain variety prediction model.

[0056] The second training data set includes first sample data and second sample data, where the second sample data is an image of at least one type of grain that is taken under second shooting conditions and carries type information.

[0057] The shooting conditions may include, but are not limited to: the inclination angle of the grain during shooting, the lighting conditions for shooting, etc. The first shooting condition is different from the second shooting condition.

[0058] In a specific implementation process, the first sample data may be a portion of image data randomly selected from the first training data set, or may be a portion of image data selected from the first training data set according to a preset rule, and is not limited by the description of this specification.

[0059] As an example only, the sample data in the first training data set and the second training data set are both selected from Rice Image Dataset, which contains image data of five kinds of grains obtained under different shooting conditions: Arborio, Basmati, Ipsala, Jasmine and Karacadag. Figure 4As shown, two types of images, Arborio and Basmati, are selected from the data set, totaling 30,000 images, of which the first training data set contains 24,000 images, all of which are used for pre-training of the grain variety prediction model; the second training data set contains 6,500 images, of which 6,000 images are 6,000 images of the 30,000 images selected from the rice image data set, excluding the 24,000 images in the first training data set, and 500 images randomly selected from the first training data set (i.e., the first sample data); the test set contains all the images of the first training data set and the second training data set, totaling 30,000 images.

[0060] like Figure 5 As shown, the pre-trained grain type prediction model is incrementally trained using the first sample data and the second sample data to obtain the grain type prediction model.

[0061] The change in the strength of the synaptic connection between two neurons in a spiking neural network is closely related to the temporal order of the neuronal pulse firing. The relative timing of the pulse firing of the presynaptic neuron and the postsynaptic neuron plays a key role in the polarity and magnitude of the change in the synaptic connection between neurons. Figure 6 As shown in Figure 1, if the postsynaptic neuron fires a pulse after the presynaptic pulse arrives, the synapses between the neurons will experience long-term potentiation (LTP), and the synaptic weights between the neurons will increase. Conversely, if the presynaptic neuron does not fire a pulse, but the postsynaptic neuron fires a pulse, the synapses between the neurons will experience long-term depression (LTD), and the synaptic weights between the neurons will weaken.

[0062] During the specific implementation process, the second pulse sequence generated according to the sample data in the second training data set is input into the pre-trained grain type prediction model. At each time step of the pre-trained grain type prediction model processing the second pulse sequence, the value of the synaptic weight in the pre-trained grain type prediction model is updated in the following way.

[0063] When the pulse emitted by the presynaptic neuron corresponding to the synaptic weight is earlier than the pulse emitted by the postsynaptic neuron corresponding to the synaptic weight, the current value of the synaptic weight is adjusted according to the preset synaptic weight increase amplitude, as shown in the following formula.

[0064] (5)

[0065] in is the current value of the synaptic weight; Add magnitude to synaptic weights; The maximum value of the preset synaptic weight adjustment; is the value of the adjusted synaptic weight.

[0066] When the pulse emitted by the presynaptic neuron corresponding to the synaptic weight is later than the pulse emitted by the postsynaptic neuron corresponding to the synaptic weight, the current value of the synaptic weight is adjusted according to the preset synaptic weight reduction amplitude, as shown in the following formula.

[0067] (6)

[0068] in, is the current value of the synaptic weight; Decrease the magnitude of the synaptic weight; The minimum value for adjusting the preset synaptic weight; is the value of the adjusted synaptic weight.

[0069] Based on the principle of Poisson coding, in the process of encoding the image of the grain to be predicted, the number of pulses corresponding to zero pixels in the image is zero. For the synaptic weights of the neurons in the input layer corresponding to the zero pixels in the sample data, at each time step, the following operations are performed: according to the preset weight decay amount, the current value of the synaptic weight is adjusted, and the formula is expressed as follows.

[0070] (7)

[0071] in, is the value of the adjusted synaptic weight; is the current value of the synaptic weight; , is the weight decay amount.

[0072] like Figure 7 As shown in Figure 1, when the image of the grain to be predicted has zero pixels, if the weight decay mechanism (such as the synaptic weight update method shown in formula (7)) is not used to update the weights, the grain edge will become blurred, as shown in the image reconstructed from the prediction results on the left. After using the weight decay mechanism, the grain edge will become clear, as shown in the image reconstructed from the prediction results on the right, and the learning performance will be significantly better.

[0073] In the specific implementation process, Figure 8 As shown, after adjusting the synaptic weights according to the above method, the adjusted synaptic weights are fixed to obtain a grain type prediction model.

[0074] Since unsupervised learning was used in the above training process, it is difficult to determine which class each neuron of the grain type prediction model belongs to.

[0075] In some embodiments, after pre-training is completed, the third pulse sequences corresponding to the multiple sample data in the first training data set are input into the pre-trained grain type prediction model again; for each neuron in the output layer of the pre-trained grain type prediction model, the following operations are performed: the average value of the number of pulses generated by the neuron for the same type of sample data in the multiple sample data is obtained; the type of sample data corresponding to the maximum average value is used as the category label of the neuron. The formula is as follows.

[0076] (8)

[0077] (9)

[0078] in, For the c A collection of images of cereals. The output layer j The label of the category to which the neuron belongs, It's a neuron j In the c Class Image k The pulse train fired under the stimulation of It is c The number of class images, n The time step of the prediction model for the cereal species.

[0079] In the embodiment provided by the present invention, when the pulse emitted by the presynaptic neuron corresponding to the synaptic weight is earlier than the pulse emitted by the postsynaptic neuron corresponding to the synaptic weight, the amplitude is increased according to the preset synaptic weight, and the current value of the synaptic weight is adjusted; when the pulse emitted by the presynaptic neuron corresponding to the synaptic weight is later than the pulse emitted by the postsynaptic neuron corresponding to the synaptic weight, the amplitude is reduced according to the preset synaptic weight, and the current value of the synaptic weight is adjusted, which can help the network learn new knowledge; for the synaptic weight of the neuron in the input layer corresponding to the zero pixel in the sample data, at each time step, the current value of the synaptic weight is adjusted according to the preset weight decay amount, because by regularly reducing the weight of the inactive connection, the network can better adapt to the new data while retaining the representation of the old data. The first sample data and the second sample data are jointly incrementally trained, and the characteristics of the new data and the old data are further integrated, so that the catastrophic forgetting phenomenon in the grain variety prediction model can be effectively avoided.

[0080] In the specific implementation process, the accuracy of the test set containing all scene images in the first training data set and the second training data set is used. To evaluate the grain variety prediction model provided by the present invention: (10)

[0081] (11)

[0082] in, It is the number of images whose categories the grain type prediction model can correctly predict. When the grain type prediction model performs well on both the first training data set and the second training data set, it means that the "catastrophic forgetting" phenomenon is alleviated and the accuracy is improved. On the contrary, if the grain type prediction model does not perform well on any data set, the accuracy will decrease.

[0083] According to the above test results, the recall rate (Recall), precision (Precision) and F1 score are used to evaluate the performance of the grain type prediction model provided by the present invention. The results are shown in Table 1 below.

[0084] Table 1:

[0085] It can be seen from Table 1 that after the incremental training method provided by the present invention is used to perform incremental training on the pre-trained grain variety prediction model, all indicators are significantly improved.

[0086] The grain classification device based on the pulse neural network provided by the present invention is described below. The grain classification device based on the pulse neural network described below and the grain classification method based on the pulse neural network described above can be referred to each other.

[0087] Fig. 9 Schematic diagram of the structure of the grain classification device based on pulse neural network provided by the present invention. Fig. 9 As shown, the device 900 includes the following modules.

[0088] The first acquisition module 910 is used to acquire a first pulse sequence corresponding to the image of the grain to be predicted.

[0089] The second acquisition module 920 is used to obtain the type of the to-be-predicted grain according to the first pulse sequence using a grain type prediction model; wherein the grain type prediction model is a pulse neural network obtained through incremental learning and used to predict grain types.

[0090] Fig.10 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.10As shown, the electronic device may include: a processor 1010, a communication interface 1020, a memory 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020 and the memory 1030 communicate with each other through the communication bus 1040. The processor 1010 may call the logic instructions in the memory 1030 to execute a grain classification method based on a pulse neural network, the method comprising: obtaining a first pulse sequence corresponding to an image of the grain to be predicted; according to the first pulse sequence, using a grain type prediction model, obtaining the type of the grain to be predicted; wherein the grain type prediction model is a pulse neural network obtained by incremental learning and used to predict the grain type.

[0091] In addition, the logic instructions in the above-mentioned memory 1030 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, 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, and the computer software product is stored in a storage medium, including several 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 method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0092] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the grain classification method based on the pulse neural network provided by the above-mentioned methods, and the method includes: obtaining a first pulse sequence corresponding to an image of the grain to be predicted; according to the first pulse sequence, using a grain type prediction model to obtain the type of the grain to be predicted; wherein the grain type prediction model is a pulse neural network obtained by incremental learning and is used to predict the grain type.

[0093] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the pulse neural network-based grain classification method provided by the above-mentioned methods, the method comprising: obtaining a first pulse sequence corresponding to an image of the grain to be predicted; according to the first pulse sequence, using a grain type prediction model to obtain the type of the grain to be predicted; wherein the grain type prediction model is a pulse neural network obtained through incremental learning and is used to predict the grain type.

[0094] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0095] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A grain classification method based on pulse neural network, characterized in that: include: Acquire a first pulse sequence corresponding to the image of the grain to be predicted; According to the first pulse sequence, the type of the to-be-predicted grain is obtained using a grain type prediction model; wherein the grain type prediction model is a pulse neural network obtained through incremental learning and used for predicting grain types.

2. The grain classification method based on pulse neural network according to claim 1 is characterized in that: The output layer of the grain type prediction model includes multiple categories of neurons; wherein each category of neurons corresponds to a type of grain; The method of obtaining the type of the to-be-predicted grain by using a grain type prediction model according to the first pulse sequence comprises: Inputting the first pulse sequence into the grain type prediction model, and obtaining the number of pulses generated by each neuron in the output layer in response to the first pulse sequence; Determine the average number of pulses emitted by each type of neuron in the output layer according to the number of pulses generated by each neuron in the output layer in response to the first pulse sequence; The type of the grain to be predicted is obtained according to the type of the neuron corresponding to the maximum average value.

3. The grain classification method based on pulse neural network according to claim 1 is characterized in that: The grain type prediction model is obtained by: Using a first training data set, an initial spiking neural network is trained to obtain a pre-trained grain type prediction model; wherein the first training data set includes first sample data, which is an image of at least one grain carrying type information taken under a first shooting condition; The pre-trained grain type prediction model is incrementally trained using a second training data set to obtain the grain type prediction model; wherein the second training data set includes the first sample data and the second sample data, and the second sample data is an image of at least one grain carrying type information taken under second shooting conditions.

4. The grain classification method based on pulse neural network according to claim 3 is characterized in that: The method of using the second training data set to incrementally train the pre-trained grain type prediction model to obtain the grain type prediction model includes: Input the second pulse sequence generated according to the sample data in the second training data set into the pre-trained grain type prediction model, and at each time step of the pre-trained grain type prediction model processing the second pulse sequence, update the value of the synaptic weight in the pre-trained grain type prediction model in the following manner: In response to a pulse emitted by a presynaptic neuron corresponding to the synaptic weight, earlier than a pulse emitted by a postsynaptic neuron corresponding to the synaptic weight, adjusting a current value of the synaptic weight according to a preset synaptic weight increase amplitude; In response to a pulse emitted by a presynaptic neuron corresponding to the synaptic weight, which is later than a pulse emitted by a postsynaptic neuron corresponding to the synaptic weight, adjusting a current value of the synaptic weight according to a preset synaptic weight reduction amplitude; The grain type prediction model is obtained according to the pre-trained grain type prediction model after adjusting the synaptic weights.

5. The grain classification method based on pulse neural network according to claim 4 is characterized in that: The method further comprises: For the synaptic weights of neurons in the input layer corresponding to the zero pixels in the sample data, at each time step, the current values ​​of the synaptic weights are adjusted according to a preset weight decay amount.

6. The grain classification method based on pulse neural network according to claim 3 is characterized in that: The method further comprises: Inputting the third pulse sequences corresponding to the plurality of sample data in the first training data set into the pre-trained grain variety prediction model respectively; For each neuron in the output layer of the pre-trained grain variety prediction model, perform the following operations: Obtaining an average value of the number of pulses generated by the neuron for the same type of sample data among the multiple sample data; The type of the sample data corresponding to the maximum average value is used as the category label of the neuron.

7. A grain classification device based on a pulse neural network, characterized in that: include: A first acquisition module is used to acquire a first pulse sequence corresponding to the image of the grain to be predicted; The second acquisition module is used to obtain the type of the to-be-predicted grain according to the first pulse sequence using a grain type prediction model; wherein the grain type prediction model is a pulse neural network obtained through incremental learning and used to predict grain types.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the grain classification method based on the pulse neural network as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the grain classification method based on pulse neural network as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the grain classification method based on pulse neural network as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method for learning and recognizing image pulse data space-time information based on Spike cube SNN

    CN110210563A

  • Time series classification method based on improved spiking neural network

    CN110633741A

  • Target identification method, electronic equipment and computer readable medium

    CN113269264A

  • Sound source localization method and system based on spiking neural network

    CN117784010A

  • Image recognition method and device based on spiking neural network, equipment and medium

    CN118587552A

Cited By

  • Emotion analysis method and device, medium and program product

    CN119622665A