Raspberry PI for kill mosquitoes by laser

More than 700 thousand human deaths from mosquito bites are observed annually in the world. It is more than 2 times the number of aannual murders in the world. In this regard, the invention of new more effective methods of protection against mosquitoes is necessary. 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
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 were described by Fouet et al [1], Vijayakumar et al. [2], Fernandes et al. [3], Schwab, et al. [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 by Cheng et al. [5], Halbach, et al. [6], Volohonsky, et al. [7], Islam et al. [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. Raman, et al. [9] presented the implementation of an acoustic insect flight detector, which was constructed from a noise reduction system. 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 presented by Alam et al. [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.
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: 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 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.
Syed et al. [12] described the effect of mosquitoes on odor. Cortez et al. [13] presented mosquito flight formulas, which are calculated considering the presence of CO2. The speed of a mosquito was determined by a deterministic formula: where Smax, Sminthe 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: where (xn, yn) -the position of the mosquito at time step n. Number d is a direction vector that varies between tracking and tracing, Vwind speed.
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.5 Ghz it is almost impossible to use the deep neural networks (ResNet> 100 MB, AlexNet> 200 MB). In an attempt to use SqueezeNet, using a new use of convolutions of 1 × 1 and 3 × 3, we managed to obtain a model with a weight of 5 MB, but the result of image processing for the presence of the desired object was approximately 1 second.
Real-time detection with R-CNN, Faster R-CNN, YoloV3,4,5, 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 described by Barros et al. [14]. In natural habitat due to the versatility of color, the effectiveness of this method is close to 0. The big focus of the camera will not improve the situation, because the mosquito itself does not have a single-color gamut, it is mean that for search in the program, it need expand the color ranges. In the end, it increases the noise.
Using optical flow like frame difference at high-resolution cameras can track the flight of a mosquito.
In 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 datathe 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. Image data can be used in classification problems, the author using convolutional neural networks obtained a classification accuracy of the order -95%. For classification, a convolutional neural

network (CNN) was created. It consists of 8 layers of layers Convolution_2D and MaxPooling2D
after the second and fourth convolution. On all layers except the output fully connected layer, the ReLU activation function is used, the last level uses softmax. To streamline our model, a Dropout layer was used after each subsample layer and the first fully linked layer.
The network was trained on a stationary computer with an AMD Ryzen 5 3600 processor and a 6 GB GIGABYTE GTX1060 graphics card. The result obtained allows us to conclude that, in terms of classification, finding a mosquito in the images and calculating its exact coordinates is not difficult, but it takes time -more than 1 second. Classification can help in the case of the destruction of mosquitoes, which are not in motion since there is enough time in this case. But in this study, the task of neutralizing mosquitoes in dynamics is set.
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 we developed the next installation device, 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.
The developed prototype in this paper has a limited range of actions. But at the same time, the results of this work proved the possibility of using lasers to destroy mosquitoes. In the future, to increase the damaging ability, it is necessary to increase the accuracy of the laser operation.
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 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. neutralizing mosquitoes with using in Raspberry PI -library OpenCV with function cv2.TrackerCSRT_createm.

Funding: None
Ethical Approval: Not required