Insect species identification method and system, and electronic device
By using infrared thermal imaging technology and image processing algorithms, automatic insect identification is achieved, solving the problem of reliance on experts for insect identification, simplifying system construction, and improving identification accuracy and self-learning ability.
Patent Information
- Application Number
- CN202310251074.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-03-15
AI Technical Summary
Current insect identification technologies rely on expert identification, resulting in complex, costly, and low-precision systems that cannot achieve automation and accuracy assessment.
Insect images are acquired using an infrared thermal imager. By processing the target search box and marker dot matrix, the gray value difference is calculated, and the insect species is determined by combining preset thresholds and probabilities, thus achieving automatic identification.
It simplifies the construction of the insect identification system, reduces maintenance difficulty and cost, improves identification accuracy, can evaluate the accuracy of identification results, and has self-learning capabilities.
Smart Images

Figure CN116343182B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of insect species identification technology, specifically to an insect species identification method, system, and electronic device. Background Technology
[0002] Insects are incredibly diverse, forming the largest animal group on Earth, with their presence felt in almost every corner of the world. Many insects can be used as specimens and valuable medicinal materials, representing a valuable resource for humankind. However, some insects are pests, major enemies of crop growth, causing significant damage and incalculable harm to the quality of agricultural products. Therefore, utilizing beneficial insect resources and preventing harmful pests is crucial for human well-being. One prerequisite for this work is accurate insect identification. However, current insect classification and identification work relies primarily on a small number of insect taxonomists, and each taxonomist's identification work is mostly limited to a single order, family, or even genus. Increasing evidence indicates that the growing demand for insect identification is increasingly at odds with the relative scarcity of insect identification experts. Finding alternative solutions to insect identification is therefore of paramount importance.
[0003] Utilizing network technology for automatic insect identification is an effective way to resolve the aforementioned contradictions. However, existing research shows that current insect identification can be achieved through the following methods: sending images to remote experts via the network for identification and subsequent return of results; real-time online discussions between the parties; or inviting remote experts to control a camera for remote insect identification. While these methods solve the difficulty of sending specimens, they still rely on expert identification, and the experts must observe the images online, further increasing the demands on them. Therefore, these methods still do not achieve truly automatic insect identification. Furthermore, current automatic insect identification algorithms are complex, system structures are complex, application and maintenance are difficult and costly, identification accuracy is low, and the accuracy of the identification results cannot be evaluated or described.
[0004] Therefore, existing technologies still need further development. Summary of the Invention
[0005] The purpose of this invention is to overcome the above-mentioned technical deficiencies and provide an insect species identification method, system, and electronic device to solve the problems existing in the prior art.
[0006] To achieve the above-mentioned technical objectives, according to a first aspect of the present invention, the present invention provides a method for insect species identification, comprising:
[0007] S100. Using an infrared thermal imager installed in the insect species identification system, the current frame thermal image of the target area is acquired according to the first acquisition cycle;
[0008] S200: Process and identify the current frame of infrared thermal imaging image, establish a target search box, process the target search box, and establish a marker dot matrix;
[0009] S300. Calculate the total gray value of each marker point in the marker dot matrix, and calculate the actual difference between the total gray value of each marker point in the marker dot matrix and the total gray value of each sample point in the sample dot matrix of various insect samples in the sample database.
[0010] S400: Output a signal indicating the insect species determination result based on the actual difference.
[0011] Specifically, S200 includes:
[0012] Determine whether there are pixels with a grayscale value greater than or equal to a first preset threshold in the current frame of infrared thermal imaging image data. If so, identify the pixel as a target point. Determine the target range based on the target point. The target range needs to include all target points in the current frame of infrared thermal imaging image data. Establish a target search box based on the target range. Calculate the area of the target search box and the current frame of infrared thermal imaging image. Calculate the centroid of the target and expand the area of the target search box to a preset multiple of the area of the current frame of infrared thermal imaging image using the centroid of the target as the base point. Establish a marker dot matrix with a preset number of rows multiplied by a preset number of columns in the expanded target search box.
[0013] Specifically, S300 includes:
[0014] Infrared thermal images of various insect samples are collected using an infrared thermal imager installed in the insect species identification system. The infrared thermal images are processed and identified according to the method described in S200. A sample search box is established, and the sample search box is processed to establish a sample dot matrix. That is, the area of the enlarged sample search box is equal to the area of the enlarged target search box. The preset number of rows and preset number of columns of the sample dot matrix are the same as those of the marker dot matrix.
[0015] Specifically, S400 includes:
[0016] Determine the minimum actual difference between the total gray value of each marker point in the marker dot matrix and the actual difference between the total gray value of each sample point in the sample dot matrix of various insect samples in the sample database, and determine whether the minimum actual difference is greater than or equal to a second preset threshold. If not, output a signal about the species of sample insect used to calculate the minimum actual difference.
[0017] Specifically, S400 further includes:
[0018] If the minimum actual difference is greater than or equal to the second preset threshold, determine whether the minimum actual difference is greater than or equal to the third preset threshold. If not, output a signal indicating the probability that the target insect is the species of the sample insect used to calculate the minimum actual difference is the first preset probability.
[0019] Specifically, S400 further includes:
[0020] If the minimum actual difference is greater than or equal to the third preset threshold, determine whether the minimum actual difference is greater than or equal to the fourth preset threshold. If not, output a signal indicating the probability that the target insect is the species of the sample insect used to calculate the minimum actual difference is the second preset probability.
[0021] Specifically, S400 further includes:
[0022] If the minimum actual difference is greater than or equal to the fourth preset threshold, a signal indicating failure to determine the target insect species is output, and the expanded target search box is stored as a sample search box in the background database. A warning signal is also output regarding the storage time of the sample search box and the insect species that the sample search box refers to.
[0023] Specifically, the method further includes:
[0024] The second preset threshold is less than the third preset threshold, and the first preset probability is greater than the second preset probability.
[0025] According to a second aspect of the present invention, an insect species identification system is provided, comprising:
[0026] The acquisition module is used to acquire the current frame thermal imaging image of the target area;
[0027] The control module is used to process and identify the current frame of infrared thermal imaging image, establish a target search box, process the target search box, and establish a marker dot matrix; it is used to calculate the total gray value of each marker point in the marker dot matrix, and calculate the actual difference between the total gray value of each marker point in the marker dot matrix and the total gray value of each sample point in the sample dot matrix of various insect samples in the sample database.
[0028] This signal is used to control the execution module to output a result related to the insect species determination based on the actual difference.
[0029] The execution module is used to output signals regarding the insect species determination results.
[0030] According to a third aspect of the present invention, an electronic device is provided, comprising: a memory; and a processor, wherein the memory stores computer-readable instructions, which, when executed by the processor, implement the above-described insect species identification method.
[0031] Beneficial effects:
[0032] 1. This invention simplifies the problem of automatic insect identification through ingenious infrared thermal imaging image processing methods and algorithm design. It eliminates the need for complex algorithm modeling, greatly simplifying the construction of the insect identification system, significantly reducing application maintenance difficulty and cost, achieving high identification accuracy, and enabling the evaluation and description of the accuracy of insect species identification results. This significantly expands the application scenarios of this invention.
[0033] 2. This invention further enhances the intelligence and usability of the invention by storing the expanded target search box as a sample search box in the background database and outputting a warning signal regarding the storage time of the sample search box and the insect species to be named. This enables the background database to learn itself and further expands the automation and application scenarios of the invention. Attached Figure Description
[0034] Figure 1 This is a flowchart of the insect species identification method provided in a specific embodiment of the present invention;
[0035] Figure 2 This is a structural diagram of the insect species identification system provided in a specific embodiment of the present invention. Detailed Implementation
[0036] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Based on the embodiments in this application, other similar embodiments obtained by those skilled in the art without creative effort should all fall within the scope of protection of this application. Furthermore, directional terms mentioned in the following embodiments, such as "up," "down," "left," and "right," are only for reference to the directions in the accompanying drawings; therefore, the directional terms used are for illustrative purposes and not for limiting the invention.
[0037] The present invention will be further described below with reference to the accompanying drawings and preferred embodiments.
[0038] Please see Figure 1 This invention provides a method for identifying insect species, comprising:
[0039] S100. The infrared thermal imager installed in the insect species identification system is used to acquire the current frame thermal image of the target area according to the first acquisition cycle.
[0040] It is understood that the target area is the area where the species of the target insect needs to be identified. When the target insect passes through the target area, the infrared thermal imager can acquire the current frame thermal image of the target area containing the target insect.
[0041] It should be noted here that step S100 includes the following:
[0042] The system includes a first preset threshold, a second preset threshold, a third preset threshold, a fourth preset threshold, a first preset probability, and a second preset probability, wherein the second preset threshold is less than the third preset threshold, and the first preset probability is greater than the second preset probability.
[0043] S200: Process and identify the current frame of infrared thermal imaging image, establish a target search box, process the target search box, and establish a marker dot matrix.
[0044] Specifically, S200 includes:
[0045] Determine whether there are pixels with a grayscale value greater than or equal to a first preset threshold in the current frame of infrared thermal imaging image data. If so, identify the pixel as a target point. Determine the target range based on the target point. The target range needs to include all target points in the current frame of infrared thermal imaging image data. Establish a target search box based on the target range. Calculate the area of the target search box and the current frame of infrared thermal imaging image. Calculate the centroid of the target and expand the area of the target search box to a preset multiple of the area of the current frame of infrared thermal imaging image using the centroid of the target as the base point. Establish a marker dot matrix with a preset number of rows multiplied by a preset number of columns in the expanded target search box.
[0046] It should be noted here that, specifically, the calculation of the target centroid coordinates includes:
[0047] The gray values of the original image are piecewise linearly transformed based on the mean and standard deviation of the original image's gray values to obtain the gray values of each point in the 8-bit single-channel image of the current frame image. The target centroid coordinates are then calculated based on the gray values of each point in the 8-bit single-channel image of the current frame image.
[0048] The formula for the piecewise linear change is:
[0049]
[0050] Where μ and σ are the mean and standard deviation of the gray values of the original image, respectively; x is the gray value of each point in the original image; y is the gray value of each point in the 8-bit single-channel image obtained after linear transformation; and y is the floor function.
[0051] The formula for calculating the centroid location is as follows:
[0052]
[0053] Where M and N represent the width and height of the target search box, respectively; (Mmin, Nmin) and (Xmax, Ymax) represent the coordinates of the top-left and bottom-right corners of the target search box, respectively; Iij is the grayscale value of a pixel within the rectangular area; i is the row position of the pixel; j is the column position of the pixel; and (Xc, Yc) represents the centroid coordinates. The area of the target search box is the product of its height and width.
[0054] S300. Calculate the total gray value of each marker point in the marker dot matrix, and calculate the actual difference between the total gray value of each marker point in the marker dot matrix and the total gray value of each sample point in the sample dot matrix of various insect samples in the sample database.
[0055] Specifically, S300 includes:
[0056] Infrared thermal images of various insect samples are collected using an infrared thermal imager installed in the insect species identification system. The infrared thermal images are processed and identified according to the method described in S200. A sample search box is established, and the sample search box is processed to establish a sample dot matrix. That is, the area of the enlarged sample search box is equal to the area of the enlarged target search box. The preset number of rows and preset number of columns of the sample dot matrix are the same as those of the marker dot matrix.
[0057] S400: Output a signal indicating the insect species determination result based on the actual difference.
[0058] Specifically, S400 includes:
[0059] Determine the minimum actual difference between the total gray value of each marker point in the marker dot matrix and the actual difference between the total gray value of each sample point in the sample dot matrix of various insect samples in the sample database, and determine whether the minimum actual difference is greater than or equal to a second preset threshold. If not, output a signal about the species of sample insect used to calculate the minimum actual difference.
[0060] It is understandable that if the target insect is the species of the sample insect used to calculate the minimum actual difference, the minimum actual difference should be within a reasonable range, that is, the minimum actual difference should not be greater than or equal to the second preset threshold. If the minimum actual difference is less than the second preset threshold, it can be determined that the target insect is the species of the sample insect used to calculate the minimum actual difference. At this time, a signal is output regarding the determination that the target insect is the species of the sample insect used to calculate the minimum actual difference. Through the above-mentioned infrared thermal imaging image processing method and algorithm design, this invention simplifies the problem of automatic insect identification, eliminates the need for complex algorithm modeling, greatly simplifies the construction of the insect identification system, greatly reduces the difficulty and cost of application maintenance, and achieves high identification accuracy.
[0061] Specifically, S400 further includes:
[0062] If the minimum actual difference is greater than or equal to the second preset threshold, determine whether the minimum actual difference is greater than or equal to the third preset threshold. If not, output a signal indicating the probability that the target insect is the species of the sample insect used to calculate the minimum actual difference is the first preset probability.
[0063] It is understandable that, since the third preset threshold is greater than the second preset threshold, if the minimum actual difference is greater than the second preset threshold but less than the third preset threshold, it indicates that the minimum actual difference is relatively large. Therefore, it can be inferred that the target insect may not be the species of the sample insect used to calculate the minimum actual difference. In this case, a signal with a first preset probability is output regarding the probability that the target insect is the species of the sample insect used to calculate the minimum actual difference. This achieves the evaluation and description of the accuracy of insect species identification results, greatly expanding the application scenarios of this invention.
[0064] Specifically, S400 further includes:
[0065] If the minimum actual difference is greater than or equal to the third preset threshold, determine whether the minimum actual difference is greater than or equal to the fourth preset threshold. If not, output a signal indicating the probability that the target insect is the species of the sample insect used to calculate the minimum actual difference is the second preset probability.
[0066] It is understandable that, since the fourth preset threshold is greater than the third preset threshold, if the minimum actual difference is greater than the third preset threshold but less than the fourth preset threshold, it indicates that the minimum actual difference is very large. Therefore, it can be inferred that the target insect is likely not the species of the sample insect used to calculate the minimum actual difference. Since the second preset probability is less than the first preset probability, a signal with the second preset probability is output regarding the probability that the target insect is the species of the sample insect used to calculate the minimum actual difference. This achieves the evaluation and description of the accuracy of insect species identification results, greatly expanding the application scenarios of the present invention.
[0067] Specifically, S400 further includes:
[0068] If the minimum actual difference is greater than or equal to the fourth preset threshold, a signal indicating failure to determine the target insect species is output, and the expanded target search box is stored as a sample search box in the background database. A warning signal is also output regarding the storage time of the sample search box and the insect species that the sample search box refers to.
[0069] Understandably, if the minimum actual difference is greater than the fourth preset threshold, it indicates that the minimum actual difference is too large. Therefore, it can be inferred that the target insect is not the species of the sample insect used to calculate the minimum actual difference. In this case, a signal indicating a failure to determine the target insect species is output. This achieves the evaluation and description of the accuracy of insect species identification results, significantly expanding the application scenarios of the invention. Furthermore, by storing the expanded target search box as a sample search box in the background database and outputting the storage time of the sample search box and a warning signal indicating the insect species referred to by the sample search box needs to be named, the invention further improves its intelligence and usability, enabling self-learning of the background database and further expanding its automation and application scenarios.
[0070] Specifically, the method further includes:
[0071] The second preset threshold is less than the third preset threshold, and the first preset probability is greater than the second preset probability.
[0072] It should be noted that this invention simplifies the problem of automatic insect identification through ingenious infrared thermal imaging image processing methods and algorithm design. It eliminates the need for complex algorithm modeling, greatly simplifying the construction of the insect identification system, significantly reducing application maintenance difficulty and cost, achieving high identification accuracy, and enabling the evaluation and description of the accuracy of insect species identification results. This significantly expands the application scenarios of this invention.
[0073] It is understood that this invention also stores the expanded target search box as a sample search box in the background database and outputs warning signals regarding the storage time of the sample search box and the insect species that need to be named by the sample search box. This further improves the intelligence and usability of the invention, enables the background database to learn itself, and further expands the automation and application scenarios of the invention.
[0074] Please see Figure 2 The present invention provides another embodiment, which provides an insect species identification system, the insect species identification system comprising:
[0075] Acquisition module 100 is used to acquire the current frame thermal imaging image of the target area;
[0076] Control module 200 is used to process and identify the current frame of infrared thermal imaging image, establish a target search box, process the target search box, and establish a marker dot matrix; it is used to calculate the total gray value of each marker point in the marker dot matrix, and calculate the actual difference between the total gray value of each marker point in the marker dot matrix and the total gray value of each sample point in the sample dot matrix of various insect samples in the sample database; it is used to control execution module 300 to output a signal related to the insect species judgment result based on the actual difference.
[0077] The execution module 300 is used to output a signal regarding the insect species determination result.
[0078] In a preferred embodiment, this application also provides an electronic device, the electronic device comprising:
[0079] The computer device includes a memory and a processor, wherein the memory stores computer-readable instructions that, when executed by the processor, implement the insect species identification method described herein. The computer device can be broadly categorized as a server, terminal, or any other electronic device with the necessary computing and / or processing capabilities. In one embodiment, the computer device may include a processor, memory, network interface, communication interface, etc., connected via a system bus. The processor of the computer device can be used to provide the necessary computing, processing, and / or control capabilities. The memory of the computer device may include a non-volatile storage medium and internal memory. The non-volatile storage medium may store an operating system, computer programs, etc. The internal memory can provide an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface and communication interface of the computer device can be used to connect and communicate with external devices via a network. When the computer program is executed by the processor, it performs the steps of the method of the present invention.
[0080] This invention can be implemented as a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, causes the steps of the methods of embodiments of the invention to be performed. In one embodiment, the computer program is distributed across multiple network-coupled computer devices or processors, such that the computer program is stored, accessed, and executed in a distributed manner by one or more computer devices or processors. A single method step / operation, or two or more method steps / operations, may be executed by a single computer device or processor or by two or more computer devices or processors. One or more method steps / operations may be executed by one or more computer devices or processors, and one or more other method steps / operations may be executed by one or more other computer devices or processors. One or more computer devices or processors may execute a single method step / operation, or execute two or more method steps / operations.
[0081] Those skilled in the art will understand that the method steps of this invention can be performed by a computer program instructing related hardware, such as a computer device or processor, to perform the steps of this invention when executed. Depending on the context, any references herein to memory, storage, databases, or other media may include non-volatile and / or volatile memory. Examples of non-volatile memory include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state drive, etc. Examples of volatile memory include random access memory (RAM), external cache memory, etc.
[0082] The technical features described above can be combined arbitrarily. Although not all possible combinations of these technical features are described, any combination of these technical features should be considered to be covered by this specification, provided that such combination does not contain contradictions.
[0083] The specific embodiments of the present invention described above do not constitute a limitation on the scope of protection of the present invention. Any other corresponding changes and modifications made in accordance with the technical concept of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A method for identifying insect species, characterized in that, include: S100: Using an infrared thermal imager installed in the insect species identification system, the current frame thermal image of the target area is acquired according to the first acquisition cycle; S200: Process and identify the current frame of infrared thermal imaging image, establish a target search box, process the target search box, and establish a marker dot matrix; S300. Calculate the total gray value of each marker point in the marker dot matrix, and calculate the actual difference between the total gray value of each marker point in the marker dot matrix and the total gray value of each sample point in the sample dot matrix of various insect samples in the sample database. S400: Output a signal related to the insect species determination result based on the actual difference; Specifically, S400 includes: Determine the minimum actual difference between the total gray value of each marker point in the marker dot matrix and the actual difference between the total gray value of each sample point in the sample dot matrix of various insect samples in the sample database, and determine whether the minimum actual difference is greater than or equal to a second preset threshold. If not, output a signal about the species of sample insect used to calculate the minimum actual difference.
2. The insect species identification method according to claim 1, characterized in that, S200 includes: Determine whether there are pixels with a grayscale value greater than or equal to a first preset threshold in the current frame of infrared thermal imaging image data. If so, identify the pixel as a target point. Determine the target range based on the target point. The target range needs to include all target points in the current frame of infrared thermal imaging image data. Establish a target search box based on the target range. Calculate the area of the target search box and the current frame of infrared thermal imaging image. Calculate the centroid of the target and expand the area of the target search box to a preset multiple of the area of the current frame of infrared thermal imaging image using the centroid of the target as the base point. Establish a marker dot matrix with a preset number of rows multiplied by a preset number of columns in the expanded target search box.
3. The insect species identification method according to claim 2, characterized in that, The S300 includes: Infrared thermal images of various insect samples are collected using an infrared thermal imager installed in the insect species identification system. The infrared thermal images are processed and identified according to the method described in S200. A sample search box is established, and the sample search box is processed to establish a sample dot matrix. That is, the area of the enlarged sample search box is equal to the area of the enlarged target search box. The preset number of rows and preset number of columns of the sample dot matrix are the same as those of the marker dot matrix.
4. The insect species identification method according to claim 2, characterized in that, The S400 also includes: If the minimum actual difference is greater than or equal to the second preset threshold, determine whether the minimum actual difference is greater than or equal to the third preset threshold. If not, output a signal indicating the probability that the target insect is the species of the sample insect used to calculate the minimum actual difference is the first preset probability.
5. The insect species identification method according to claim 4, characterized in that, The S400 also includes: If the minimum actual difference is greater than or equal to the third preset threshold, determine whether the minimum actual difference is greater than or equal to the fourth preset threshold. If not, output a signal indicating the probability that the target insect is the species of the sample insect used to calculate the minimum actual difference is the second preset probability.
6. The insect species identification method according to claim 5, characterized in that, The S400 also includes: If the minimum actual difference is greater than or equal to the fourth preset threshold, a signal indicating failure to determine the target insect species is output, and the expanded target search box is stored as a sample search box in the background database. A warning signal is also output regarding the storage time of the sample search box and the insect species that the sample search box refers to.
7. The insect species identification method according to claim 5, characterized in that, The method further includes: The second preset threshold is less than the third preset threshold, and the first preset probability is greater than the second preset probability.
8. An insect species identification system, characterized in that, The insect species identification method according to any one of claims 1-7 includes: The acquisition module is used to acquire the current frame thermal imaging image of the target area according to the first acquisition cycle; The control module is used to process and identify the current frame of infrared thermal imaging image, establish a target search box, process the target search box, and establish a marker dot matrix; it is used to calculate the total gray value of each marker point in the marker dot matrix, and calculate the actual difference between the total gray value of each marker point in the marker dot matrix and the total gray value of each sample point in the sample dot matrix of various insect samples in the sample database. This signal is used to control the execution module to output a result related to the insect species determination based on the actual difference. The execution module is used to output signals regarding the insect species determination results.
9. An electronic device, characterized in that, include: Memory; The memory stores computer-readable instructions that, when executed by the processor, implement the insect species identification method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Power transmission safety guarantee method and system
CN115800193A
Leveraging smart-phone cameras and image processing techniques to classify mosquito genus and species
US20200143202A1