A fruit fly trapping analysis system and recognition method
By designing a fruit fly trap analysis system, using an automated warehouse door and sensor-controlled fruit fly trapping device, combined with image processing and recognition models, the efficient capture and accurate identification of fruit fly is solved, real-time species analysis and monitoring are realized.
Patent Information
- Application Number
- CN202210030665.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-12
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2042-01-12
AI Technical Summary
The prior art is difficult to efficiently capture and accurately identify fruit fly, especially when preventing the spread and invasion of high-risk pests in international trade, and lacks convenient methods for trapping and identifying fruit fly.
A fruit fly trap analysis system is designed, including a capture channel, a shooting bin and a collection bin. The automatic opening and closing bin door and sensor control shooting device is used to realize automated image acquisition and species recognition of fruit fly, combined with fruit fly attractants and repelling devices, and accurate analysis is performed using image processing and recognition models.
It realizes efficient trapping and high-definition image acquisition of real flies, reduces noise, supports real-time species recognition, has positioning, parameter setting and real-time monitoring functions, and improves quarantine efficiency.
Smart Images

Figure CN114387185B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of fruit fly capture and identification, and in particular relates to a fruit fly trapping analysis system and an identification method. Background Art
[0002] Fruit flies are herbivorous insects, and their larvae are all lurking feeders, harming all parts of plants, from the roots, stems, leaves, flowers to fruits, and are crop pests. Among them, the Mediterranean fruit flies, apple fruit flies, and cherry fruit flies are all world-famous for harming fruits. Many species are crop pests, among which the species that harm fruits are particularly important, such as the Mediterranean fruit fly (Ceratitis capiata WiedGman), apple fruit flies, and cherry fruit flies are all world-famous. These species are all world quarantine objects and are important pests that harm fruits and vegetables such as citrus, pears, and melons, mainly including citrus fruit flies, citrus fruit flies, melon fruit flies, and wolfberry fruit flies. In order to protect the safety of agricultural production, countries have implemented strict animal and plant inspection and quarantine to prevent the spread and invasion of high-risk harmful organisms. However, with the continuous improvement of the degree of free trade between countries and the continuous growth of trade volume, the inspection and quarantine of various plants and their products has become a serious problem. Summary of the invention
[0003] The technical problem solved by the present invention is to provide a fruit fly trapping and analysis system and an identification method that are easy to capture and can perform accurate image acquisition and analysis.
[0004] Technical solution: In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0005] A fruit fly trapping and analysis system comprises a capturing channel, a shooting chamber and a collecting chamber which are interconnected. Automatically opening and closing chamber doors are arranged between the capturing channel and the shooting chamber, and between the shooting chamber and the collecting chamber. The capturing channel is connected with the outside world to trap fruit flies. Fruit flies enter the shooting chamber through the capturing channel, the capturing chamber door is automatically closed, and a sensor starts a shooting device. The shooting chamber collects images of fruit flies and uploads the images to an analysis system for identification. After the shooting is completed, the collecting chamber automatically opens the collecting chamber door to collect the photographed fruit flies. The analysis system controls the trap and identifies the species of fruit flies.
[0006] Preferably, a fruit fly attractant is provided in the shooting chamber, and a driving device is provided. After the image is shot, the driving device is started and the collecting chamber door is opened to allow the fruit flies to enter the collecting chamber.
[0007] Preferably, the shooting device includes a camera and a fill light. After the sensor senses that a fruit fly has entered the shooting chamber, the camera and the fill light are activated to collect images, and the images are uploaded to the analysis system in real time.
[0008] Preferably, both the capture chamber door and the collection chamber door are flap mechanisms controlled automatically.
[0009] Preferably, bell mouths are respectively arranged on both sides of the capture channel. The wide-caliber openings of the bell mouths are connected to the outside, and the narrow-aperture openings are connected to the capture channel.
[0010] Preferably, the sensor is a transmissive laser sensor. After the sensor detects that the fruit fly enters the shooting chamber, the control system controls the collection chamber door to close and starts the camera to shoot the image of the fruit fly.
[0011] A method for trapping and identifying fruit flies traps fruit flies and collects images, and transmits the images to an analysis system; the analysis system controls the fruit fly trapping device, identifies and analyzes the images collected by the trap, and outputs species identification information; the specific steps for identifying the collected image information include:
[0012] (1) Collect a large amount of fruit fly data, establish an identification model, train, test and evaluate the model, and then use the model to identify fruit flies;
[0013] (2) Preprocess the image, convert it to grayscale and remove noise;
[0014] (3) Extract the gradient of the image:
[0015] (4) Further denoise: Considering the pores in the image, first use a low-pass filter to smooth the image, which will help smooth the high-frequency noise in the image;
[0016] (5) Perform morphological image processing and detail description;
[0017] (6) Find the contour of the insect area and draw the contour.
[0018] (7) Intercept multiple insect images at different positions through the contour;
[0019] (8) Use the identification model to identify the species of each intercepted image.
[0020] Preferably, in step (2), the preprocessing of the image includes: converting to grayscale and removing noise, and the denoising is performed by filtering with a mean filter, a Gaussian filter, a median filter or a bilateral filter.
[0021] Preferably, in step (3), the gradients in the x and y directions are calculated with the Sobel operator, and then the gradient in the x direction is subtracted from the gradient in the y direction. Through this subtraction, the image area with a high level of gradient and a low vertical gradient is left.
[0022] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0023] (1) The trapping channel of the present invention is separately arranged from the shooting chamber, and a capture chamber door that automatically opens and closes is arranged between the shooting channel and the shooting chamber. The separate arrangement can ensure that the shooting chamber is not disturbed, which is conducive to obtaining accurate images. The capture chamber door automatically opens and closes under the control of a sensor, and the entire device can achieve unmanned automatic operation.
[0024] (2) The present invention is provided with a collection chamber door at the bottom of the shooting chamber, and a driving device is arranged in the collection chamber. The driving device can be linked with the collection chamber door, and when the collection chamber is opened, the driving device drives the fruit flies towards the collection chamber.
[0025] (3) The present invention can collect high-definition fruit fly images with few noise points and upload them to the analysis system in real time. The analysis system analyzes the species information of the fruit flies, and the analysis system uniformly controls the operation of the trapping device to achieve functions such as positioning, parameter setting, and real-time monitoring.
[0026] (4) The fruit fly analysis method of the present invention: Generally, machine recognition identifies and analyzes the individuals to be recognized from three aspects: size, shape, and color. For a computer, without a reference coordinate, there is no concept of size. The general size of fruit flies is similar, so the analysis and identification of fruit flies can only place the weight on shape and color. Fruit flies all have wings, and the wing veins and the color patterns of the wings of different fruit flies are different, which is an important identification and recognition feature of fruit flies. In terms of shape, the external shapes of different species of fruit flies also vary greatly. Some bodies are oval, and some are long strip-shaped. The head features and colors of fruit flies are also different. Through these differences in color, pattern, and shape features, by collecting a large number of pictures and letting machine learning perform individual inspections between different species, the species identification and analysis of the trapped fruit flies can be achieved. Description of the Drawings
[0027] Figure 1 is the overall structural schematic diagram of the fruit fly trapping and analysis system;
[0028] Figure 2 is the internal structural schematic diagram of the capture channel of the fruit fly trapping and analysis system;
[0029] Figure 3 is the partial structural schematic of the fruit fly trapping and analysis system Figure 1 ;
[0030] Figure 4 is the partial structural schematic of the fruit fly trapping and analysis system Figure 2 ;
[0031] Figure 5 is the internal structural schematic diagram of the shooting chamber of the fruit fly trapping and analysis system;
[0032] Figure 6 is the structural schematic diagram of the shooting device of the fruit fly trapping and analysis system;
[0033] Figure 7 It is a partial structural schematic diagram after the installation of the shell of the fruit fly trapping and analysis system;
[0034] Figure 8 It is the circuit schematic diagram of the main control chip and communication part of the fruit fly trapping and analysis system;
[0035] Figure 9 It is the circuit schematic diagram of the PWM signal output and external signal trigger part of the fruit fly trapping and analysis system;
[0036] Figure 10 It is the circuit schematic diagram of the power conversion part of the fruit fly trapping and analysis system;
[0037] Figure 11 It is the circuit schematic diagram of the external power control output part of the fruit fly trapping and analysis system. Specific embodiments
[0038] The following combines specific embodiments to further clarify the present invention. The embodiments are implemented on the premise of the technical solution of the present invention. It should be understood that these embodiments are only used to illustrate the present invention and not to limit the scope of the present invention.
[0039] As Figures 1-7 shown, the present application discloses a fruit fly trapping and analysis system, which includes a capture channel 1, a shooting chamber 2 and a collection chamber 3. The capture channel 1, the shooting chamber 2 and the collection chamber 3 are interconnected with each other. Automatic opening and closing doors are provided between the capture channel 1 and the shooting chamber 2 and between the shooting chamber 2 and the collection chamber 3, which are the capture chamber door 4 and the collection chamber door 6 respectively.
[0040] The shooting chamber 2 is the main device for trapping and collecting fruit fly images. The shooting chamber 2 is a square cabin. A camera 7 and a supplementary light 8 are provided on the top of the shooting chamber 2. One side of the shooting chamber 2 is connected to the capture channel 1. A capture chamber door 4 communicating with the capture channel 1 is provided on the side wall of the shooting chamber 2. A collection chamber door 6 communicating with the collection chamber 3 is provided at the bottom of the shooting chamber 2. The inner wall of the shooting chamber 2 uses a single color and a light-colored background board. Interference items such as gaps are avoided on the background board to facilitate noise reduction in image analysis and accurately separate fruit fly images.
[0041] The shooting device includes a camera 7 and a supplementary light 8. The camera 7 uses a macro lens. The camera can upload the captured pictures to the cloud platform through the communication module. An inductor is provided in the shooting chamber. The inductor is realized by an optocoupler circuit and is used to sense whether there is a fruit fly entering. The inductor 5 can use a transmissive laser inductor 5 or other types of inductors. After the inductor 5 detects that a fruit fly enters the shooting chamber 2, the control system controls the collection chamber door 6 to close and starts the camera 7 and the supplementary light 8 to shoot fruit fly images, and uploads the images to the cloud platform in real time for analysis and species identification through the analysis system.
[0042] A fruit fly attractant is arranged in the shooting chamber 2, and the attractant adopts a sex attractant. The sex attractant mainly utilizes the principle that the sexual pheromone released by the adult insects when they are sexually mature attracts the adult insects of the opposite sex, and artificially synthesizes the sex pheromone compound of the insects, and reduces the number of fertilized eggs by interfering with the mating of males and females, so as to achieve the purpose of controlling the target pests. A driving device is also arranged in the shooting chamber 2, and the driving device is controlled by linkage. After the image shooting is completed, the control system automatically starts the driving device and opens the collection chamber door 6 to allow the fruit flies to enter the collection chamber 3.
[0043] The capture chamber door 4 and the collection chamber door 6 are both automatically controlled flapping mechanisms. The flapping mechanism of the capture chamber door 4 includes a first motor 10, a first connecting rod 11 and the capture chamber door 4. The output shaft of the first motor 10 is connected to one end of the first connecting rod 11, and the other end of the first connecting rod 11 is fixedly connected to one end of the capture chamber door 4. The flapping mechanism of the collection chamber door 6 is the same as that of the capture chamber door, including a second motor 12, a second connecting rod 13 and the collection chamber door 6. The output shaft of the second motor 12 is connected to one end of the second connecting rod 13, and the other end of the second connecting rod 13 is fixedly connected to one end of the collection chamber door 6. The motor adopts a stepping motor, which drives the connecting rod to swing, so that the chamber door is opened and closed. The motor is connected to the control system and is linked to other devices for control.
[0044] In order to make the fruit flies after the image is collected enter the collection chamber 3, a driving device is set in the shooting chamber 2, such as Figure 4 As shown, it is a schematic diagram of the internal structure of the shooting chamber 2. The driving device can use a scraper 14. The lower end of the scraper 14 is fixed to the collecting chamber door 6, and the scraper and the collecting chamber door 9 are at a 90-degree angle. When the collecting chamber door 6 is closed, the scraper 14 is tightly attached to the inner wall of the shooting chamber. The scraper 14 is set on the inner wall opposite to or adjacent to the capturing chamber door 4. The scraper 14 and the collecting chamber door 6 can be controlled by the first motor 10 at the same time. When the collecting chamber door 6 is opened, it rotates downward and drives the scraper 14 to rotate in the same direction. At this time, the collecting chamber door 6 opens downward, and the scraper 14 drives the fruit flies in the shooting chamber downward into the collecting chamber 3. Figure 3 As shown, the scraper 14 can also be driven by a third motor 15 alone. In this case, the scraper 14 is independently provided from the collecting bin door 6. Figure 5As shown in the figure, the driving device can also adopt an air injection device. The air injection device is arranged at the upper part of the shooting bin 2 and is arranged to avoid the camera 7 (for example, arranged around the camera). The air injection device can adopt a fan 16 or other air generating devices, such as a general air injector that uses normal-pressure air as the medium, which sucks air or other gases by generating a low pressure at the nozzle outlet and then compresses and discharges it. The nozzle of the air injector is arranged towards the direction of the collection bin door 6 and the collection bin 3. So that one or more jets of air blow the fruit flies into the collection bin 5 in the direction towards the collection bin. The present invention can also adopt the simultaneous use of an air injection device and a scraper 14 to improve the driving effect.
[0045] Flared openings 9 are respectively arranged on both sides of the capture channel 1. The wide-caliber opening of the flared opening 9 is connected to the outside, and the narrow-aperture opening is connected to the capture channel 1. The entire trapping device is arranged inside the upper part of a box body 17 made of stainless steel. A control circuit board is arranged inside the box body. The outer edge of the flared opening 9 is stuck on the through hole 16, and a sealing ring is arranged to prevent rainwater from entering the box body 17. A solar panel 18 is arranged outside the top of the box body 17. The connection between the solar panel 18 and the box body 17 is sealed to prevent rainwater from entering the box body 17. The solar panel 18 continuously supplies power to facilities such as the circuit board, camera, supplementary light, and motor.
[0046] The capture channel 1 communicates with the outside to realize the trapping of fruit flies. The shooting bin 2 realizes the acquisition of fruit fly images and uploads the images to the analysis system for identification; the fruit flies enter the shooting bin 2 through the capture channel 1, the capture bin door 4 automatically closes, and the sensor 5 activates the shooting device. After shooting, the collection bin 3 automatically opens the collection bin door 6 to collect the fruit flies that have been shot; the analysis system realizes the control of the trap and conducts the species identification of the fruit flies.
[0047] The control system of the present invention includes a main control chip and a communication part, a PWM signal output and an external signal trigger part, an external power control output part, and a power conversion part.
[0048] As Figure 8 As shown in the figure, the main control chip and the communication part include a single-chip microcomputer, a MAX232 chip, and indicator lights LED1 - LED4. The MAX232 chip realizes the mutual conversion between RS232 level and TTL level. The signal output by the PC is a communication protocol called RS232 composed of +12V and -12V, and the signal output by the single-chip microcomputer is a TTL level of +5V and 0V. The single-chip microcomputer adopts the STC15F2K60S2 single-chip microcomputer. The single-chip microcomputer realizes the control of the camera (anzhou), supplementary light (ledpower), ultraviolet trapping lamp (light), servo drive module, light sensor (GX signal), rain sensor (FS signal), etc.
[0049] As Figure 9As shown in the figure, the PWM signal output and external signal triggering part includes a servo driver module and an optocoupler circuit. When the fruit fly enters and triggers the optocoupler to output a signal, the single-chip microcomputer drives motors such as the first motor, the second motor, and the third motor through the servo driver module to realize the actions of the capture bin door 4, the collection bin door 6, and the scraper 14. The number of PWM signal output channels is set according to actual needs. The servo driver module includes a PCA9685PW chip and its peripheral circuit. This new product is connected to the single-chip microcomputer. PCA9685PW is a 16-bit LED controller with an I 2 2C bus interface. Each LED can output an independent PWM controller with a 12-bit resolution (4096 levels) and a fixed frequency. Each motor is driven by outputting PWM.
[0050] As Figure 10 shown in the figure, the power conversion part includes a voltage stabilization circuit, a voltage regulation circuit, and a circuit for supplying power to the rain sensor and the light sensor. The voltage stabilization circuit is a switching power supply composed of LM2576, etc. This circuit is a common circuit structure. The 12v power supply is converted into voltages such as 5v required by each component of the system. The voltage regulation circuit is composed of an XL4005E1 chip and its external circuit. The circuit for supplying power to the rain sensor and the light sensor is composed of an LM393AD chip and its peripheral circuit.
[0051] As Figure 11 shown in the figure, the external power control output part includes a power control output module (S-393) for the rain sensor, a power control output module (light) for the ultraviolet trap lamp, a power control output module (LEDPOWER) for the supplementary light, etc.
[0052] The present invention also discloses a method for trapping and identifying fruit flies, which traps fruit flies, collects images, and transmits the images to the analysis system; the analysis system realizes the control of the fruit fly trapping device, identifies and analyzes the images collected by the trap, and outputs species identification information; the specific steps for identifying the collected image information include:
[0053] (1) Collect a large amount of fruit fly data, establish an identification model, train, test, and evaluate the model, and then use the model to identify fruit flies;
[0054] (2) Preprocess the image, convert it to grayscale and remove noise;
[0055] Noise removal is performed using a mean filter, a Gaussian filter, a median filter, or a bilateral filter. Preferably, a Gaussian filter is used to achieve a better noise removal effect.
[0056] (3) Extract the gradient of the image: Calculate the gradients in the x and y directions using the Sobel operator, and then subtract the gradient in the y direction from the gradient in the x direction. Through this subtraction, the image regions with high horizontal gradients and low vertical gradients are left.
[0057] (4) Further denoise: Considering the pores in the image, first use a low-pass filter to smooth the image, which will help smooth the high-frequency noise in the image. The goal of the low-pass filter is to reduce the rate of change of the image. For example, replace each pixel with the mean value of the pixels around it, so that the regions with obvious intensity changes can be smoothed and replaced. Binarize the blurred image. As the name implies, it is to divide the image values into two values with a certain boundary;
[0058] (5) Perform morphological image processing and detail characterization;
[0059] There is detail loss in the image after further denoising, which will interfere with the subsequent detection of the insect contour. They need to be expanded. Perform morphological erosion and dilation 4 times respectively for detail characterization.
[0060] (6) Find the contour of the insect region and draw the contour.
[0061] This step uses the cv2.findContours() function and sets the parameters of the function. The first parameter is the binarized image (7) Use the recognition model to identify the species of the processed image. The second parameter is the contour type. Only detect the outer contour and establish two levels of contours. The upper level is the boundary. The detected contours do not establish a hierarchical relationship. Establish a hierarchical tree structure of contours to store all the contour points. The pixel position difference between two adjacent points does not exceed 1. The third parameter: the processing approximation method. For example, a rectangular contour only needs 4 points to save the contour information.
[0062] The above is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A fruit fly trapping and analysis system, characterized in that, include: A control system, a capturing channel (1), a shooting chamber (2) and a collecting chamber (3) which are interconnected; an automatically opening and closing chamber door is provided between the capturing channel (1) and the shooting chamber (2) and between the shooting chamber (2) and the collecting chamber (3); the capturing channel (1) is connected to the outside world to trap fruit flies; the fruit flies enter the shooting chamber (2) through the capturing channel (1); the capturing chamber door (4) is automatically closed, and a sensor (5) triggers the start of a shooting device; the shooting chamber (2) captures images of the fruit flies and uploads the images to an analysis system for identification; after the shooting is completed, the collecting chamber (3) automatically opens the collecting chamber door (6) to collect the fruit flies that have been shot; the analysis system controls the trap and identifies the species of the fruit flies; The shooting chamber (2) is a main device for trapping and collecting fruit fly images. The shooting chamber (2) is a square chamber. A shooting device is arranged on the top of the shooting chamber (2): a camera (7) and a fill light (8). One side of the shooting chamber (2) is connected to the capture channel (1). A capture chamber door 4 connected to the capture channel 1 is arranged on the side wall of the shooting chamber (2). A collection chamber door (6) connected to the collection chamber (3) is arranged at the bottom of the shooting chamber (2). The inner wall of the shooting chamber (2) adopts a single color and a light-colored background board. The background board avoids setting gap interference items, so as to facilitate denoising in image analysis and accurately separate the fruit fly image. The capture bin door (4) and the collection bin door (6) are both automatically controlled flap mechanisms; A fruit fly attractant is arranged in the photographing chamber (2), and a driving device is arranged. After the image is photographed, the driving device is activated and the collecting chamber door (6) is opened to allow the fruit flies to enter the collecting chamber (3); The driving device adopts a scraper (14), the lower end of which is fixed to the collecting bin door (6), and the scraper and the collecting bin door (6) form an angle of 90 degrees. When the collecting bin door (6) is closed, the scraper (14) is closely attached to the inner wall of the shooting bin. The scraper (14) is arranged on the inner wall opposite to or adjacent to the capturing bin door (4). The scraper (14) and the collecting bin door (6) can be controlled by the first motor 10 at the same time. When the collecting bin door (6) is opened, it rotates downward, and at the same time drives the scraper (14) to rotate in the same direction. At this time, the collecting bin door (6) opens downward, and at the same time, the scraper (14) drives the fruit flies in the shooting bin downward into the collecting bin (3); The sensor (5) is a through-beam laser sensor. After the sensor (5) detects that a fruit fly has entered the photographing chamber (2), the control system controls the collecting chamber door (6) to close and activates the camera (7) to photograph an image of the fruit fly.
2. The fruit fly trapping and analysis system according to claim 1, wherein: The shooting device comprises a camera (7) and a fill light (8); after the sensor (5) senses that a fruit fly has entered the shooting chamber (2), the camera (7) and the fill light (8) are activated to collect images, and the images are uploaded to the analysis system in real time.
3. The fruit fly trapping and analysis system according to claim 1, wherein: Bell mouths (9) are respectively arranged on both sides of the capture channel (1); the wide aperture opening of the bell mouth (9) is connected to the outside, and the narrow aperture opening is connected to the capture channel (1).
4. An identification method implemented by using the fruit fly trapping analysis system according to any one of claims 1 to 3, characterized in that: Trapping fruit flies and collecting images, and transmitting the images to an analysis system; the analysis system controls the fruit fly trapping device, identifies and analyzes the images collected by the trap, and outputs species identification information; The specific steps for identifying the collected image information include: (1) Collect a large amount of fruit fly data, establish an identification model, train, test and evaluate the model, and then use the model to identify fruit flies; (2) Preprocess the image, convert the grayscale and remove noise; (3) Extract the gradient of the image: (4) Further denoising: Considering the pores of the image, the image is first smoothed using a low-pass filter, which will help smooth out the high-frequency noise in the image; (5) Perform morphological image processing and detailed characterization; (6) Find the outline of the insect area and draw the outline; (7) Capture multiple insect images at different positions by contouring; (8) Use the recognition model to identify the species of each captured image.
5. The fruit fly recognition method according to claim 4, characterized in that: Image preprocessing includes: grayscale conversion and denoising, denoising using a mean filter, Gaussian filter, median filter or bilateral filter to perform filtering, and contour interception of multiple insect images.
6. The fruit fly identification method according to claim 5, characterized in that: In step 2, the gradients in the x and y directions are calculated using the Sobel operator, and then the gradient in the y direction is subtracted from the x direction. Through this subtraction, image regions with high horizontal gradients and low vertical gradients are left.
Citation Information
Patent Citations
Cotton pest identification and classification method and device
CN109102004A
Forest pest trapping and intelligent identification device
CN212212444U