A method and device for adjusting a mosquito-killing lamp
By collecting environmental data and images, a pest identification model is established to identify pest classifications and behavioral patterns. Combined with density change curves, the parameters of the mosquito-killing lamp are adjusted, solving the problem that mosquito-killing lamps cannot flexibly cope with complex environments and pest activity patterns, and achieving efficient trapping and energy saving.
Patent Information
- Application Number
- CN202510206434.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-02-25
AI Technical Summary
Existing mosquito-killing lamps cannot flexibly adapt to complex and ever-changing natural environments and pest activity patterns, resulting in low trapping efficiency, especially when pest density fluctuates greatly or behavior patterns change frequently, making it difficult to achieve efficient trapping.
By collecting environmental data and images, a pest identification model is established to identify pest classifications and behavioral patterns. Combined with pest density change curves, the parameters of mosquito-killing lamps are adjusted to improve trapping efficiency.
It improves the trapping efficiency of mosquito-killing lamps, reduces the impact on non-target organisms, and allows parameters to be adjusted in advance to cope with seasonal and diurnal changes, thus enhancing the flexibility and response speed of mosquito-killing lamps.
Smart Images

Figure CN120036290B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agriculture and pest management, and in particular to a method and apparatus for adjusting a mosquito-killing lamp. Background Technology
[0002] Mosquito lamps, as an effective pest control tool, have been widely used in households and agriculture in recent years. Traditional mosquito lamps mainly rely on a fixed light source and physical trapping mechanisms, such as ultraviolet light, to attract, capture, or kill pests.
[0003] While existing smart mosquito killer lamp technology has made some progress, it still faces many limitations in practical applications. First, most mosquito killer lamps can only adjust light intensity and wavelength based on preset schedules or simple changes in environmental parameters, failing to flexibly adapt to complex and ever-changing natural environments and pest activity patterns. Second, existing mosquito killer lamps lack in-depth recognition of pest behavior patterns, often overlooking the different response characteristics of pests to light and audio signals under different behavioral patterns. This leads to low trapping efficiency, especially when pest density fluctuates significantly or behavioral patterns change frequently, making it difficult to achieve efficient trapping. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, the present invention provides a method for adjusting mosquito-killing lamps to solve the problem that mosquito-killing lamps cannot flexibly cope with complex and ever-changing natural environments and pest activity patterns.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides a method for adjusting a mosquito-killing lamp, comprising,
[0008] Collect environmental data and images, and perform preprocessing;
[0009] Based on the preprocessed environmental images, a pest identification model is established to obtain pest classification and pest behavior patterns.
[0010] The calculation is based on the preprocessed environmental data, and the output is a curve of pest density change.
[0011] Based on pest classification, pest behavior patterns, and pest density change curves, adjust the mosquito killer lamp;
[0012] Record the capture rate after each adjustment and evaluate the adjustment effect.
[0013] As a preferred embodiment of the mosquito-killing lamp adjustment method of the present invention, the environmental data includes temperature, humidity and light intensity;
[0014] The environmental images include images of the pest control and monitoring area.
[0015] As a preferred embodiment of the mosquito-killing lamp adjustment method of the present invention, the preprocessing includes using the OpenCV library to perform preliminary quality detection on the environmental image;
[0016] For qualified environmental images, LabelImg is used to mark the location and type of various pests;
[0017] Convert the labeled environmental images and data into a standardized format.
[0018] As a preferred embodiment of the mosquito-killing lamp adjustment method of the present invention, the method includes: establishing a pest identification model based on the preprocessed environmental image to obtain pest classification and pest behavior patterns, specifically including the following steps.
[0019] The preprocessed environmental images are divided into a training set and a validation set;
[0020] ResNet50 was chosen as the basic framework for the pest identification model, and a fully connected layer was added on top of ResNet50.
[0021] We define a cross-entropy loss function to measure the error in pest classification, and define a bounding box regression loss function to measure the error in locating pests.
[0022] The weighted average of the cross-entropy loss function and the bounding box regression loss function is used to obtain the comprehensive loss error.
[0023] The Adam optimizer is used to optimize the pest identification model based on the training set until the comprehensive loss error converges, thus completing the construction of the pest identification model.
[0024] The pest identification model was tested using a validation set, and the classification results of the pests were output using the softmax activation function.
[0025] The fully connected layer of the pest identification model simultaneously outputs the coordinates of the top left corner and the bottom right corner of the bounding box, and uses inverse normalization to obtain the actual bounding box coordinates.
[0026] The bounding box coordinates represent the position of the pest in the environmental image.
[0027] The obtained pest classification and location results are arranged and combined into continuous frames according to the timestamp order. The movement path and aggregation of pests are obtained from the continuous frames.
[0028] Clustering algorithms are used to cluster pests based on their movement paths and aggregation patterns to obtain their behavioral patterns.
[0029] The results of pest classification and pest behavior patterns are recorded in the central database.
[0030] As a preferred embodiment of the mosquito-killing lamp adjustment method of the present invention, the method includes the following steps: calculating and outputting a pest density change curve based on preprocessed environmental data.
[0031] The Gaussian kernel function is used to extract the temperature, humidity and light intensity features of the environmental data, and a weighted summation method is used to form a comprehensive feature value.
[0032] Based on comprehensive eigenvalues, a time decay factor is introduced, and through integral calculation, the cumulative contribution of environmental data to pest density changes over the past time and the periodic fluctuations in pest density changes caused by environmental data are obtained.
[0033] The pest density is obtained based on the calculated cumulative contribution and periodic fluctuations.
[0034] Based on the obtained pest density, Matplotlib was used to convert the pest density into a pest density change curve.
[0035] As a preferred embodiment of the mosquito-killing lamp adjustment method of the present invention, the adjustment of the mosquito-killing lamp based on pest classification, pest behavior patterns, and pest density change curves specifically includes the following steps.
[0036] A pest behavior database is formed by piecing together typical behavioral patterns of different types of pests and their corresponding effective trapping methods.
[0037] The similarity between pest classification and pest behavior patterns and the pest behavior database is obtained using Euclidean distance. Based on the results with the highest similarity, pest trapping strategies corresponding to the pest behavior patterns are obtained.
[0038] The pest trapping strategy involves adjusting the values of the mosquito-killing lamp parameters based on the pest's behavior patterns.
[0039] Based on the pest density change curve, set the pest threshold;
[0040] Define a time window H in advance. When the pest density reaches the pest threshold, adjust the parameters of the mosquito killer lamp gradually based on the time window H and the pest trapping strategy obtained by comparing with the pest behavior database.
[0041] As a preferred embodiment of the mosquito-killing lamp adjustment method of the present invention, the following steps are included: recording the capture rate after each adjustment and evaluating the adjustment effect.
[0042] After each adjustment of the mosquito-killing lamp parameters, the number of pests captured that day is recorded.
[0043] Define a capture efficiency index, and evaluate the day's regulation effect based on the capture efficiency index at the end of each day;
[0044] Regularly analyze the trend of the capture efficiency index to find the optimal parameter combination, and update the pest behavior database at the same time.
[0045] Secondly, the present invention provides a mosquito-killing lamp adjustment device, comprising,
[0046] The preprocessing module collects environmental data and images and performs preprocessing.
[0047] The identification module establishes a pest identification model based on the preprocessed environmental images to obtain pest classification and pest behavior patterns.
[0048] The density module calculates based on the preprocessed environmental data and outputs a curve showing the change in pest density.
[0049] The adjustment module adjusts the mosquito killer lamp based on pest classification, pest behavior patterns, and pest density change curves.
[0050] The evaluation module records the capture rate after each adjustment and evaluates the adjustment effect.
[0051] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein the computer program, when executed by the processor, implements any step of the mosquito-killing lamp adjustment method as described in the first aspect of the present invention.
[0052] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the mosquito-killing lamp adjustment method as described in the first aspect of the present invention.
[0053] The beneficial effects of this invention are as follows: by using environmental images and deep learning technology to establish a pest identification model, it is possible to accurately identify pest species and analyze their behavioral patterns, which not only improves the trapping efficiency but also reduces the impact on non-target organisms; in addition, by accurately predicting changes in pest density, the parameters of the mosquito killer lamp can be adjusted in advance before the pest density reaches its peak, maximizing the trapping effect. This prediction method can better cope with seasonal and diurnal changes, improving the flexibility and response speed of the mosquito killer lamp. Attached Figure Description
[0054] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a flowchart of the mosquito-killing lamp adjustment method in Example 1.
[0056] Figure 2 This is a schematic diagram of the conditional mosquito killer lamp in Example 1. Detailed Implementation
[0057] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0058] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0059] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0060] Example 1, referring to Figure 1 and Figure 2 This is the first embodiment of the present invention, which provides a method for adjusting a mosquito-killing lamp, including the following steps:
[0061] S1. Collect environmental data and images, and perform preprocessing.
[0062] Specifically, the steps include the following:
[0063] Within the pest control monitoring area, eight high-definition cameras with night vision capabilities are installed according to a grid-like, evenly distributed pattern to ensure coverage of the entire monitoring area. The field of view of each camera should overlap by approximately 10% to eliminate blind spots.
[0064] An environmental sensor (such as a DHT22 temperature and humidity sensor and a BH1750 light intensity sensor) is installed near each high-definition camera to collect temperature, humidity and light environment parameters.
[0065] S1.1 Develop a Python script to call the OpenCV library for preliminary image quality inspection. OpenCV is an open-source library widely used in computer vision, providing various image processing functions. This script utilizes OpenCV's ability to remove blurry and severely distorted frames. For example, high-quality images can be selected by calculating image sharpness metrics (such as the result of the Laplacian operator).
[0066] For qualified environmental images, the LabelImg tool can be used to manually or automatically mark the location and type of various pests. LabelImg is a graphical image annotation tool that supports multiple output formats. During the annotation process, it is necessary to record the specific location (boundary box coordinates) and category label of each pest in detail.
[0067] Standardize the size of the marked environment images and adjust their color space (e.g., convert RGB to grayscale).
[0068] Environmental data is normalized to ensure consistency across all input data.
[0069] S2. Based on the preprocessed environmental images, establish a pest identification model to obtain pest classification and pest behavior patterns.
[0070] Specifically, the steps include the following:
[0071] The preprocessed environmental images are divided into training and validation sets, typically using an 80% (training set) and 20% (validation set) ratio to ensure that the distribution of the two sets of data is as consistent as possible, thus avoiding overfitting or underfitting of the pest identification model.
[0072] ResNet50 was chosen as the foundational framework for the pest identification model. ResNet50 is a deep residual network widely used in image classification tasks due to its excellent generalization and transfer learning capabilities, making it suitable for multi-species insect identification. A fully connected layer was added on top of the ResNet50 layer for bounding box regression, outputting the location of the pest in the environmental image. This achieves the goal of simultaneously obtaining pest classification and pest behavior patterns.
[0073] Define the cross-entropy loss function to measure the error in pest classification. The cross-entropy loss function calculates the difference between the predicted probability distribution and the true label.
[0074] Define the bounding box regression loss function The smooth L1 function is used to measure the error in locating pests and obtain the difference between the predicted bounding box coordinates and the true bounding box coordinates. The smooth L1 function combines the advantages of L1 loss and L2 loss, using squared error (smoother) in the small error range and absolute error (more stable) in the large error range.
[0075] The obtained cross-entropy loss function and bounding box regression loss function are weighted and averaged to obtain the comprehensive loss error. To ensure that the pest identification model can not only correctly classify insect types but also accurately predict the location of insects, its expression is:
[0076] ;
[0077] ;
[0078] ;
[0079] in, Represents the cross-entropy loss function. This represents the true label vector, which contains the true category information for each sample. This represents the predicted probability distribution vector, which contains the predicted probability of each sample belonging to each class. Indicates the number of samples involved in the calculation. The index variable representing the sample. Indicates the first The true label vector of each sample Indicates the first The predicted probability that a sample belongs to its true class. This represents the bounding box regression loss function. Represents the true bounding box coordinate vector. This represents the predicted bounding box coordinate vector. This indicates the number of bounding boxes in the environmental image, i.e., how many individual insects are detected in each image. This parameter determines the number of iterations in the summation operation. This variable represents the index of the bounding box, used to iterate through all bounding boxes. Represents a smooth L1 function. Indicates the first The true coordinate vector of the i-th bounding box, referring to the i-th bounding box The actual location of each individual pest in the image. This indicates that the pest identification model is for the first... The predicted coordinate vector of an individual pest. Indicates the overall loss error. This represents the composite true label vector. This represents the combined predicted probability distribution vector. This represents the weight between classification loss and localization loss.
[0080] Specifically, The value range is [0,1], used to balance the contribution between pest classification and location loss, and is generally selected as... =0.7, because pest classification is more important, but the accuracy of positioning cannot be ignored. The value can be customized according to the usage scenario and actual needs;
[0081] Using the Adam optimizer accelerates the training process. First, each image in the training set is input into the pest recognition model, and the predicted output (the pest's classification probability distribution and the pest's bounding box coordinates) is calculated based on a comprehensive loss function. Using the backpropagation algorithm, the comprehensive loss function is obtained. The Adam optimizer is used to update the pest identification model parameters based on the gradients obtained from the gradients, in order to minimize the overall loss error. When the overall loss function... If the performance no longer decreases significantly, the pest identification model is complete. Using the Adam optimizer ensures the pest identification model reaches optimal performance in a short time.
[0082] The validation set is data that is not used in the training process of the pest identification model. It is used to evaluate the generalization ability and performance of the pest identification model. The validation set is input into the constructed pest identification model for testing, and the softmax activation function is used to output the classification result of the pest. Its expression is:
[0083] ;
[0084] in, This indicates the classification results of pests. This represents the Softmax function. This indicates that the output vector is not activated. This represents the currently computed inactive output vector. The One element, Indicates the total number of categories. Indicates the inactive output vector The One element;
[0085] For example, suppose there are three insects: mosquitoes, flies, and bees. After the softmax transformation, a probability distribution is output, [0.67, 0.24, 0.09]. This indicates that the pest recognition model believes that the most likely insect in the image is a mosquito, followed by flies and bees.
[0086] The fully connected layer of the pest identification model will output four values simultaneously, corresponding to the coordinates of the top left and bottom right corners of the bounding box. These coordinates are normalized values relative to the size of the environment image and need to be denormalized to obtain the actual coordinates; the bounding box coordinates are the position of the pest in the environment image.
[0087] For each individual environmental image frame, the pest identification model outputs the pest classification result and its location information in that frame. When multiple environmental images taken consecutively (e.g., one image taken every second to form a time series) are fed into the pest identification model, a series of continuous prediction results can be obtained. These prediction results include not only the presence or absence of pests at each time point, but also their location and movement trajectory.
[0088] By analyzing these consecutive frames, the movement paths and aggregation patterns of pests over a period of time can be observed. Clustering algorithms can then be used to deduce the pests' behavioral patterns based on these patterns. Clustering analysis is an unsupervised learning method used to group data points into different clusters, ensuring that data points within the same cluster are similar, while data points between different clusters are significantly different. In pest behavior pattern recognition, clustering analysis is used to classify the movement paths and aggregation patterns of pests, identifying different behavioral patterns. For example, input data includes the movement trajectories and aggregation patterns of pests, and output is the pest behavior pattern. Specific pest behavior patterns include foraging behavior, mating behavior, and escape behavior. For instance, if several consecutive frames show a group of mosquitoes gradually gathering in the same area, and clustering is performed, it indicates that they are preparing to mate.
[0089] Furthermore, by analyzing consecutive frames, we can gain a deeper understanding of the behavioral patterns of pests, thereby enabling us to develop more refined trapping strategies.
[0090] S3. Calculate based on the preprocessed environmental data and output a curve of pest density change.
[0091] Specifically, the steps include the following:
[0092] The Gaussian kernel function can map the original data to a high-dimensional space and capture more complex nonlinear relationships. Therefore, the Gaussian kernel function is used to extract the temperature, humidity and light intensity features of environmental data, and the extraction results of the Gaussian kernel function are combined linearly and weighted to form a comprehensive feature value.
[0093] Based on the obtained comprehensive feature values, a time decay factor is introduced. The time decay factor is used to simulate the phenomenon that the influence of past environmental data on the current pest density gradually weakens over time, thereby enhancing the dynamism and realism of the prediction.
[0094] The cumulative contribution of environmental data to changes in pest density over time is obtained through integral calculation.
[0095] To further explain, by calculating the cumulative contribution through integration, the long-term impact of environmental conditions on pest density can be fully considered, thus improving the comprehensiveness of the prediction.
[0096] Calculating the periodic fluctuations in pest density caused by environmental data can identify regular patterns in pest density changes, such as seasonal peaks or diurnal rhythms, thus enhancing the accuracy of predictions.
[0097] Based on the cumulative contribution and periodic fluctuations calculated by integration, the time... The pest density at a location is expressed as:
[0098] ;
[0099] in, Indicates time Pest density in the area. Represents the comprehensive eigenvalue. Indicates time from the past At every point in time, Indicates time Temperature value at that time Indicates time The humidity value at that time Indicates time The light intensity value at that time, Indicates the time decay factor. Indicates the number of periods. Indicates the first The influence weight of each period This indicates the length of a complete cycle. Represents the sine function;
[0100] Through calculation, it is possible to accurately predict changes in pest density over time, providing reliable data support for the intelligent adjustment of mosquito-killing lamps.
[0101] Matplotlib is a powerful plotting library that can generate intuitive and easy-to-understand charts for easy user comprehension and analysis. Based on the calculated pest density, Matplotlib can be used to convert it into a pest density change curve, which intuitively shows the trend of pest density changes over time, including peak and trough periods, as well as periodic fluctuations.
[0102] S4. Adjust the mosquito killer lamp based on pest classification, pest behavior patterns, and pest density change curves.
[0103] Specifically, the steps include the following:
[0104] The Pest Behavior Database is a comprehensive information repository containing a wealth of data on the typical behavioral characteristics of different pest species under various environmental conditions, along with their corresponding most effective trapping methods. This includes pest classification information, pest behavioral patterns, and the most effective trapping methods for each pest. Research findings and historical data from fields such as entomology and ecology are uniformly stored in this database to form a unified pest behavior database.
[0105] First, the real-time pest classification results (such as mosquitoes and flies) and behavioral patterns (such as foraging, mating, and resting) are compared with a pre-established pest behavior database. This database contains typical behavioral models of different pest species under various environmental conditions and their corresponding effective trapping strategies.
[0106] For newly acquired pest classifications and pest behavior patterns by the pest identification model, Euclidean distance is used to calculate their similarity with existing records in the pest behavior database. The record with the highest similarity is selected as the most suitable trapping strategy for the current situation.
[0107] For example, if a certain type of pest is detected foraging, the intensity of UV light may need to be increased to attract more pests; if it is mating behavior, the color wavelength of the light source can be adjusted or a specific audio signal can be emitted to simulate mating signals and attract more pests; for resting behavior, the intensity of UV light can be reduced to avoid unnecessary energy consumption.
[0108] Using the generated pest density change curve, the trend of pest density changes over a future period can be predicted. Particular attention should be paid to time periods when pest density is about to reach its peak. A pest threshold is set based on the number of pests, such as when the pest density per unit area is expected to reach more than 5 pests per square meter. H (1-2) hours before the pest density reaches the threshold, the mosquito killer lamps are gradually adjusted to ensure they are in optimal working condition before the peak pest density arrives.
[0109] For example, on a summer evening, a group of male Culex mosquitoes were detected mating by taking environmental images and using a pest identification model. After comparing with a pest behavior database, it was found that during mating, male Culex mosquitoes are particularly sensitive to ultraviolet light (UV-A) of a specific wavelength and respond to sound signals of certain frequencies. Since these sounds mimic the wing vibration frequencies of females, the trapping strategy at this time is to increase the intensity of the UV-A light source and emit sound signals that mimic the wing vibration of female Culex mosquitoes, thereby attracting more male Culex mosquitoes to approach and be captured. As night falls, the temperature drops and the humidity rises. According to the calculated pest density change curve, the pest density will reach the pest threshold around 8 pm. Two hours before the expected pest threshold is reached (i.e., 6 pm), the parameters of the mosquito killer lamp are gradually adjusted to ensure that the equipment is in optimal working condition before the peak pest density arrives. Specifically, the UV light intensity is gradually increased to 70% of the maximum power to adapt to the visual sensitivity of Culex mosquitoes at dusk; the wavelength of the light source color is adjusted to be closer to the twilight lighting conditions in the natural environment, further enhancing the trapping effect; the sound frequency is also dynamically adjusted to better mimic the audio characteristics of Culex mosquitoes during mating to attract more pests; and the fan speed is also appropriately increased over time to help capture pests attracted by the light source or sound.
[0110] Thanks to advance preparation, mosquito-killing lamps can achieve maximum effectiveness during peak pest density periods, improving trapping efficiency while avoiding resource waste.
[0111] S5. Record the capture rate after each adjustment and evaluate the adjustment effect.
[0112] Specifically, the steps include the following:
[0113] S5.1 After each adjustment of the mosquito killer lamp parameters (such as UV light intensity, light source color wavelength, sound frequency, etc.), immediately begin recording the number of pests captured that day. By recording the capture amount in real time, immediate feedback after each adjustment can be obtained quickly, providing accurate data support for subsequent evaluation.
[0114] Define a capture efficiency index, which comprehensively considers factors such as the number of insects captured, the insect density per unit area, and energy consumption. Its expression is:
[0115] ;
[0116] in, This indicates the capture efficiency index.
[0117] At the end of each day, the effectiveness of the regulation is assessed based on the Capture Efficiency Index (CEI). A high CEI indicates efficient pest capture with low energy consumption, while a low CEI suggests the need for further optimization.
[0118] To further explain, the capture efficiency index provides a quantitative evaluation standard, enabling an objective assessment of the effectiveness of each adjustment and facilitating subsequent optimization. Furthermore, by comprehensively considering the number of insects captured, pest density, and energy consumption, the CEI not only focuses on trapping effectiveness but also emphasizes resource utilization efficiency, achieving the goal of energy conservation and efficiency improvement.
[0119] S5.2. Regularly (e.g., weekly or monthly) analyze the trend of the CEI (Catch Efficiency Index) and plot a graph of CEI changes over time. This helps identify long-term effective trapping strategies and potential problems.
[0120] Based on the trend analysis results, identify the optimal parameter combination. For example, if it is found that the CEI is highest under a certain combination of UV light intensity and audio signal during a certain time period (such as dusk), this combination can be set as the default setting.
[0121] The newly discovered optimal parameter combinations and corresponding pest behavior patterns are updated into the pest behavior database, greatly enriching the database's content.
[0122] To further explain, through regular analysis and optimization, it can continuously improve itself, ensuring long-term, efficient pest management. Furthermore, based on trend analysis of the capture efficiency index, it can make more scientific and rational decisions, thus improving the level of intelligence.
[0123] This embodiment also provides a mosquito-killing lamp adjustment device, including:
[0124] The preprocessing module collects environmental data and images and performs preprocessing.
[0125] The identification module establishes a pest identification model based on the preprocessed environmental images to obtain pest classification and pest behavior patterns.
[0126] The density module calculates based on the preprocessed environmental data and outputs a curve showing the change in pest density.
[0127] The adjustment module adjusts the mosquito killer lamp based on pest classification, pest behavior patterns, and pest density change curves.
[0128] The evaluation module records the capture rate after each adjustment and evaluates the adjustment effect.
[0129] This embodiment also provides a computer device applicable to the mosquito-killing lamp adjustment method, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the mosquito-killing lamp adjustment method proposed in the above embodiment.
[0130] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0131] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the mosquito-killing lamp adjustment method proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0132] In summary, this invention utilizes environmental imagery and deep learning technology to establish a pest identification model, which can accurately identify pest species and analyze their behavioral patterns. This not only improves trapping efficiency but also reduces the impact on non-target organisms. Furthermore, by accurately predicting changes in pest density, the parameters of the mosquito-killing lamp can be adjusted in advance before the pest density reaches its peak, maximizing the trapping effect. This prediction method can better cope with seasonal and diurnal variations, improving the flexibility and response speed of the mosquito-killing lamp.
[0133] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method of adjusting a mosquito killer lamp, the method comprising: Comprising, Collecting environmental data and environmental images, and preprocessing; Based on the preprocessed environmental images, a pest recognition model is established to obtain pest classification and pest behavior patterns; According to the calculation of the preprocessed environmental data, the output pest density change curve is obtained, which specifically includes the following steps, Using Gaussian kernel function to extract temperature value, humidity value and light intensity value characteristics of environmental data, and using weighted summation method to form comprehensive characteristic value; Based on the comprehensive characteristic value, a time decay factor is introduced, and through integral calculation, the cumulative contribution of environmental data to pest density change in the past time and the periodic fluctuation of pest density change caused by environmental data are obtained; According to the calculated cumulative contribution and periodic fluctuation, the pest density is obtained; According to the obtained pest density, the pest density is converted into pest density change curve by using Matplotlib; Based on pest classification and pest behavior patterns, and pest density change curve, adjust the mosquito lamp, specifically including the following steps, Typical behavior patterns of pests containing different types of pests and their corresponding effective trapping methods are spliced to form a pest behavior database; The similarity of pest classification and pest behavior patterns to the pest behavior database is obtained by using Euclidean distance, and the pest trapping strategy corresponding to the pest behavior pattern is obtained based on the highest similarity result; The pest trapping strategy is to adjust the value of the mosquito lamp parameter according to the pest behavior pattern; Based on the pest density change curve, set the pest threshold; Define a time window H in advance, when the pest density reaches the pest threshold, adjust the parameters of the mosquito lamp gradually based on the time window H and the pest trapping strategy obtained by comparing with the pest behavior library; Record the capture rate after each adjustment to evaluate the adjustment effect.
2. The mosquito lamp adjusting method of claim 1, wherein: The environmental data includes temperature, humidity and light; The environmental image includes the image of the pest prevention monitoring area.
3. The mosquito lamp adjusting method of claim 2, wherein: The preprocessing includes using OpenCV library to perform preliminary quality detection on the environmental image; For qualified environmental images, LabelImg is used to mark the position and type of each type of pest; Convert the marked environmental image and environmental data into standardized format.
4. The mosquito lamp adjusting method of claim 3, wherein: Based on the preprocessed environmental images, a pest recognition model is established to obtain pest classification and pest behavior patterns, specifically including the following steps, Divide the preprocessed environmental images into training set and validation set; Select ResNet50 as the basic framework of the pest recognition model, and add a fully connected layer at the top of ResNet50; Define cross entropy loss function to measure the error of pest classification, and define boundary box regression loss function to measure the error of positioning pest position using smooth L1 function; Weighted average of cross entropy loss function and boundary box regression loss function is obtained; Using Adam optimizer, the pest recognition model is optimized based on the training set until the comprehensive loss error converges, and the construction of the pest recognition model is completed; Test the pest recognition model using the validation set, and use the softmax activation function to output the classification result of the pest; The full connection layer of the pest recognition model outputs the left upper corner coordinate and the right lower corner coordinate of the boundary box respectively, and the actual boundary box coordinate is obtained by using the inverse normalization; The boundary box coordinate is the position of the pest in the environment image; The obtained pest classification and pest position results are arranged and combined into continuous frames in the order of time stamp, and the movement path and aggregation of the pest are obtained according to the continuous frames; The clustering algorithm is used to cluster according to the movement path and aggregation of the pest, and the behavior mode of the pest is obtained; The obtained pest classification and pest behavior mode are recorded to the central database.
5. The mosquito lamp adjusting method of claim 4, wherein: The capture rate after each adjustment is recorded, and the adjustment effect is evaluated, including the following steps, After adjusting the parameters of the mosquito killer lamp each time, the amount of pests captured on the same day is counted; The capture efficiency index is defined, and the adjustment effect on the same day is evaluated according to the capture efficiency index at the end of each day; The trend of the capture efficiency index is analyzed regularly to find the optimal parameter combination, and the pest behavior database is updated.
6. A mosquito killer lamp adjusting device based on the mosquito killer lamp adjusting method according to any one of claims 1 to 5, characterized by: It includes, A preprocessing module acquires environment data and environment images and performs preprocessing; An identification module establishes a pest recognition model based on the preprocessed environment images, obtains pest classification and pest behavior mode; A density module calculates based on the preprocessed environment data and outputs a pest density change curve; An adjustment module adjusts the mosquito killer lamp based on the pest classification and pest behavior mode and the pest density change curve; An evaluation module records the capture rate after each adjustment and evaluates the adjustment effect. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is characterized in that: The processor executes the computer program to realize the steps of the mosquito killer lamp adjustment method of any one of claims 1-5.
8. A computer readable storage medium having stored thereon a computer program, characterized in that: The computer program is executed by the processor to realize the steps of the mosquito killer lamp adjustment method of any one of claims 1-5.
Citation Information
Patent Citations
Crop disease and pest intelligent detection method based on deep learning
CN109919239A
High-altitude trapping lamp control method based on pest trapping
CN119024752A