RaspberryPI for mosquito neutralization by power laser

In this article for the first time, comprehensive studies of mosquito neutralization using machine vision and a 1 W power laser are considered. Developed laser installation with Raspberry Pi that changing the direction of the laser with a galvanometer. We developed a program for mosquito tracking in real. The possibility of using deep neural networks, Haar cascades, machine learning for mosquito recognition was considered. We considered in detail the classification problems of mosquitoes in images. A recommendation is given for the implementation of this device based on a microcontroller for subsequent use as part of an unmanned aerial vehicle. Any harmful insects in the fields can be used as objects for control.


Introduction
In the next papers used the developed device for remote mosquito control [15], for pest control [16] and for weed control [17] The relevance of this work is the need to identify the presence of a mosquito in place and determine its position for subsequent destruction because mosquitoes carry a great danger because mosquitoes are carriers of diseases such as malaria, from which more than 200 million people in the world directly infect from mosquitoes. The danger and methods necessary to combat mosquitoes are described in the following articles [1,2,3,4].
In this paper, we propose to use machine vision, neural networks, and a 1-watt laser to neutralize mosquitoes. It is a new direction for control mosquitoes. For the first time, the idea of using a laser to protect against insects was expressed in the early 1980s by American astrophysicist Lowell Wood. But at the same time, due to the complexity of the technical implementation of this project, this idea has not yet found practical application. In the last decade, the rapid development of artificial intelligence technology, machine learning, and computer vision has provided an opportunity for the implementation of many ideas conceived decades earlier. Including the use of modern technology to combat mosquitoes.
The use of traditional methods such as nets, lotions, creams of various kinds, traps is especially popular as individual defense. Especially interesting works are [5,6,7,8]. A common disadvantage of all these methods that they are not autonomy.
As methods against mosquitoes, there are hundreds of different creams, devices, and other devices. But because of the analysis carried out, given that the problem with mosquitoes from year to year it becomes more and more relevant to conclude that no effective solution has yet been found to eliminate this problem. As a result, automating the process of neutralizing mosquitoes gives a favorable forecast for the expediency of using the method proposed in this paper.
In the past decade, the following methods have been proposed for mosquito control. In the article [9], the implementation of an acoustic insect flight detector, which was constructed from a noise reduction system, is presented, the response error was 6.5%. In our study, this detector can be used as an auxiliary method for determining the approximate area for the camera for work with mosquitoes. In the research [10], the classification of certain species of flying insects according to the frequency of beating of the wings is presented.
The following study is the most approximate in the topic of our work, where the results of mosquito detection using the camera are presented [11]. In this case, only one method was considered for detecting absolute difference estimation -and the results on determining the position of z are not presented.
It is worth adding that the Bill & Melinda Gates Foundation sponsored research on the implementation of laser mosquito neutralization technology as a promising method for combating malaria. As a result, company Photonic Sentry was created, information about this from the official site of the company was used. For several years of company operation, a demonstration video was presented on the neutralization of mosquitoes without a description of the installation.
The main advantage when using a laser to neutralize mosquitoes over known methods to combat mosquitoes are the following: -ability to use in open areas, even in the presence of wind; -the ability to create a given safe territory, which is protected from mosquitoes, around houses, or when traveling to nature around the camp; -potentially -a large area of coverage; -in the perspective, to protect a group of moving people who have left a safe territory, by mounting on an unmanned aerial vehicle or on the human body.

Materials and method
The equipment that was used in the research: -From box with mosquitoes to laser system distance -300 mm.
The size of a mosquito can vary from 1 mm to 5 mm, this is the main criterion for the method of detection and retrieval of mosquito coordinates. When monitoring the position of the mosquito with ultrasound, it is necessary to use several sensors in different places and processing their information to calculate the location, which theoretically is suitable only for detecting one mosquito, but if there are several mosquitoes, the device will not work correctly. The temperature of the body of a mosquito due to its cold blood is like the temperature of the environment. With a very high resolution of the thermal imager, the mosquito temperature will differ insignificantly against the background -on the order of 0.1 C. The use of sonar has several difficulties when working in open areas where it is necessary to use sonar with a narrow beam and a narrow radiation pattern.
Following the analysis, in the present study, it was decided to use a camera to detect and determine the coordinates of the mosquito. After the camera detects a mosquito, to increase the likelihood of a laser being affected it is necessary to predict the position of the mosquito in advance (by more than 0.2 s).
Therefore, is necessary to research the factors affecting the behavior of the mosquito during flight.
This paper describes the effect of mosquitoes on odor [12]. In the paper [13], mosquito flight formulas are presented, which are calculated considering the presence of CO2. The speed of a mosquito was determined by a deterministic formula: (1) where the maximum and minimum speed of a mosquito, F is a ramp function that takes values between 0 and 1.
In operation, the flight direction and speed of each mosquito are updated every △T time units. The updated position of mosquitoes is calculated by the formula: (2) where (xn, yn) -the position of the mosquito at time step n. Number d is a direction vector that varies between tracking and tracing.
Considering the detection of a mosquito with the help of a camera, tracking it and using mathematical formulas to predict its further flight, the probability of positive control is increased.
To use a pre-trained deep learning network on the Raspberry Pi for the process of monitoring mosquitoes, initially, deep learning methods were considered to implement. But due to the limited RAM on the Raspberry Pi 3 (1 GB) and even the maximum configuration of the Raspberry Pi 4 (4 GB) and due to the low processor speed of 1. Real-time detection with R-CNN, Fast R-CNN, Faster R-CNN, Yolo, RetinaNet has the same problem with speed of recognition. The solution may be to use -NVIDIA Jetson TX1 and TX2 -the special platform for computing neural networks. The main disadvantage, which is the high cost. Therefore, we focused on methods that can be implemented on the Raspberry PI, which allows you to create an economical and compact device.One of the most frequent ways to detect moving objects is the difference of frames, background subtraction, and analysis of the field of optical flow. Details about the advantages and disadvantages of these methods are written in paper [14].
Using the Hara cascade, you can train a model to track an object, the accuracy is determined largely by Description of which are available on the website of the library developer. We have checked all the parameters. In the best way using -tracker = cv2.TrackerCSRT_create. The advantage of tracking is that it runs faster than detection. Since when an object that was detected in the previous frame is tracked, the program knows the initial data -the appearance of the object, the location, speed and direction of its movement. Fig. 1 shows the tracking of a mosquito with various methods, for mosquitoes size 2-4 mm. since with a sharp change of flight path the speed of the camera is not enough to fix the shape of a mosquito. Therefore, this moment all methods lose the mosquito from the field of view. Fig.1.e for the optical method with mosquitoes showed and many noises.
Using the image preprocessing function can significantly increase the readability of images for machine vision.
In Fig. 2 results in photo processing by Thresholding function-OpencV with different parameters. To determine the distance to the object was used the stereo vision OpenCV function. At the same time, the depth value is inversely proportional to the displacement pixel, and the relationship between disparity and display depth of the mosquito, fig.3. The relationship between the camera and the object is described by the following formula:

Experimental research
For experimental research, the installation was developed, Fig.4.  Boxing with mosquitoes stands at a distance of 300 mm from the laser system. The camera finds the mosquito and transmits the data to the galvanometer, which puts the mirrors in the correct position, and then the laser is turned on.
The algorithm working installation is shown in fig.6. To implement tracking in the Python language, various algorithms were written, both with tracking at each moment of only one mosquito and using the multithreading function and transmitting data on the position of mosquitoes using an array to the galvanometer. The success of the experiment can be enhanced by using a more powerful laser, which will make it possible to neutralize more than 2 mosquitoes in one second. Since considering the speed of the galvanometer, which allows you to change the thousandths of a position in seconds, we are limited in speed to neutralizing mosquitoes only by the power of the laser and the power of the central processor. The number of tracking mosquitoes at the same time depends on the processing power of the processor.

Discussion and conclusions
One of the factors limiting the use of laser technology to neutralize mosquitoes is the small allowable lesion area. The possibility of using a telephoto lens to monitor the position of mosquitoes was analyzed.
In fig.7 prototype for remote monitoring of mosquito's present. At the same time, the use of a microcontroller instead of a single-board computer will significantly reduce power consumption by several watts. It is worth considering various programming languages, for example, a program on C will be more efficient, than python language.
As drivers for motors, it is recommended to use drivers based on SMD components. Like a rechargeable battery, for example, Thunder Power Adrenaline Weight not more than 179.69g and capacity 1100mAh This will significantly reduce the dimensions of the device and reduce its weight to 450 grams.
What ultimately increases the efficiency of the device, because it will be possible to use the device using an autonomous aircraft. Nowadays many companies specialize in the production of an apart capable of bearing the burden and fly significant distance without recharging.
The results of these works will be fully disclosed in subsequent research.
In the future necessary to use a laser with focusing. In this research, due to the insignificant distance between the laser and the mosquito box, the pre-configured focus of the laser did not play a big role, since the box width was 70 mm. The lesion area on the near side of the box exceeded the mosquito damage area by 2% by the distant side in the view. But it can be of the general error, in this research we do not focus on this.
It is advisable to consider replacing the audio sensors that were used to demonstrate the ability to neutralize mosquitoes over considerable distances. As a device for determining the distance can be used a laser rangefinder with a high data rate, where for an interface to use SPI. Since the mirrors can change position within milliseconds, monitoring with a laser rangefinder from technical implementation does not carry any difficulties.
Due to the mosquito's flight speed, 1 meter per second, with increasing distance from 15 meters the rotation speed along the z-axis with a servomotor greatly affects the result. Given this, recommend using the algorithm is implemented in such a way that after identification, mosquitoes are assigned numbers, if the mosquito has left the camera's observation area, its coordinate is calculated using the mathematical model and the laser focus is transferred to the calculated coordinates In this case, this will give a significant increase in time. Otherwise since due to the mosquito leaving the observation zone, to determine the exact position, it is necessary to process the entire picture from the camera once again after turning along the z-axis, which is very expensive from time.
The use of neural networks to predict the position of a mosquito will lead to the installation of an additional microcontroller, which will lead to a 2-fold increase in the mass of equipment and the consumption of electrical energy.
In this research the idea of using a galvanometer with a powerful laser to neutralize mosquitoes was first realized. The system can neutralize 2 mosquitos per sec and this result can be easily improved.
Experimentally proved the feasibility of using a laser for the destruction of mosquitoes. Developed a laser unit that changes the direction of the laser with a galvanometer. A program has been developed for the monitoring of mosquitoes in real-time. Calculations and results of experimental studies are given.
Experimental research various techniques for mosquitoes and selected the best option for neutralizing mosquitoes with using in Raspberry PI -library OpenCV with function cv2.TrackerCSRT_createm.

Funding Statement
The authors received no funding from an external source.