Mountain top butterfly dynamic monitoring method
By setting up monitoring equipment on the top of the mountain and using deep learning models and artificial intelligence identification systems, efficient and intelligent monitoring of butterflies is achieved, and the problem of poor adaptability of existing technologies in mountainous environments is solved, the accuracy and universality of monitoring are improved, and more in-depth biodiversity monitoring research is supported.
Patent Information
- Application Number
- CN202510113183.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-16
AI Technical Summary
The existing butterfly monitoring methods are poorly adaptable in mountainous environments, making it difficult to effectively monitor the dynamic changes of butterflies. The high labor investment, high cost, and the results are easily affected by the monitor's experience and recognition ability.
By setting up monitoring equipment on the top of a mountain with high butterfly aggregation and activity, butterfly videos are obtained, and real-time identification and classification are achieved using deep learning models and artificial intelligence recognition systems, generating butterfly species screenshot recognition sets, and dynamic monitoring is performed.
It has achieved efficient and intelligent monitoring of butterflies on the top of the mountain, reduced artificial investment, improved the accuracy and universality of monitoring, and can deeply analyze the dynamic changes of butterflies every day, month and year, and supports research on climate change biology, conservation biology and biodiversity monitoring.
Smart Images

Figure CN120014671A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical fields of ecology, conservation biology and biodiversity monitoring, and in particular relates to a method for dynamically monitoring butterflies on a mountain top. Background Art
[0002] Butterflies are highly sensitive to environmental changes. Monitoring data from many places show that butterflies are one of the fastest declining biological groups in the world, and the loss of butterfly diversity is attracting much attention. Mountains are key hotspots for butterfly diversity, especially many large species that are well-loved by people (such as the swallowtail butterfly family) rely on mountain forest ecosystems to survive and reproduce. There, the complex terrain, diverse microclimate conditions and rich plant resources meet their survival needs such as single food choices and specific habitat requirements. At present, under the influence of global warming, frequent extreme climates, and declining habitat quality (such as fragmentation), the survival status and changing trends of these rare mountain butterflies urgently need scientific answers.
[0003] However, the current field monitoring methods for butterflies were originally established mainly for flat and hilly terrains, and have poor adaptability to undulating mountain environments. For example, the commonly used "Pollard Walk" transect method was first applied to the UK Butterfly Monitoring Program (UKBMS) in 1976. By walking at a constant walking speed on a selected fixed transect, the length of about 2km is extended across the same or different habitats. During this period, the types and numbers of butterflies encountered (witnessed or judged after netting) within 2.5m to the left and right and 5m above are recorded. This method requires the monitor to conduct long-term artificial monitoring at a certain frequency (such as once a week), and finally divide the transect into small sections (such as 50m / section) to statistically analyze the diversity of butterflies in the transect and its changing trends. Obviously, the monitors responsible for each fixed transect need to invest a lot of manpower and time periodically, and the monitors' field experience and butterfly identification ability have a great impact on the results; moreover, affected by the fixed limited range and its location, this method inevitably misses those butterfly species that are active outside the fixed range or in other specific areas; and in mountain forest habitats with large elevation differences, the implementation process is difficult to meet the requirements of constant walking speed, fixed field of vision, and designated inspection time, especially under the influence of the changeable mountain climate. Moreover, at gathering points with many butterfly species and long activity time, it is obviously not enough to rely on short (<10min) walking counts. Relatively speaking, the direct counting method (Checklist) may be more suitable for butterfly monitoring at these gathering points. In fact, this method is mainly carried out in butterfly breeding grounds, habitats, courtship grounds, etc. The monitors stay at the point for a long time (such as 1-2h), and may record some rare butterfly species missed by the transect method. However, the counting results of this method are more easily affected by the monitor's field experience and butterfly identification ability, and the settings such as the number of sample points in each area are often inconsistent, making it impossible to conduct in-depth data analysis and the comparison results of each area are not convincing.
[0004] The trap cage method is another butterfly sampling point monitoring method. It uses bait (mostly rotten fruits) to attract butterflies to feed. With the help of the flying characteristics of butterflies, they often take off upwards or forwards after feeding, gradually entering the gauze cage above the bait and not coming out. Therefore, when the bait is replaced regularly by humans, the types and numbers of butterflies in the cage are collected and recorded. This method is not limited by working hours and is often used in areas with high butterfly diversity, especially in tropical areas, but is rarely used in other areas with low diversity. However, the trap cage method has obvious bias in the butterfly groups that can be trapped. It has a good trapping effect on the Nymphalidae, the Eyed Butterfly, the Beaked Butterfly, the Clam Butterfly, etc., and the number of butterfly species is relatively large, while the capture rate may be zero for groups such as the Swallowtail, the White Butterfly, and the Gray Butterfly. Therefore, this method can be used as a supplement to the line sampling method, but it is not suitable for comprehensive investigation and monitoring of regional butterfly communities.
[0005] As one of the most sensitive indicator biological groups to environmental changes, how to collect records and data on butterfly occurrence in the wild, combine it with environmental change data such as regional climate, analyze the daily, monthly, and annual dynamics and changes of butterflies, make predictions on recent and future trends, and propose mitigation measures is urgently needed to cope with the challenges currently faced by environmental protection, biodiversity maintenance, and human development. Therefore, it is urgent to study and develop field butterfly dynamic monitoring technology focusing on both field butterfly groups and their occurrence dynamics. Summary of the invention
[0006] In order to solve the above technical problems, the present invention proposes a method for dynamic monitoring of butterflies on mountain tops to solve the problems existing in the above prior art.
[0007] To achieve the above object, the present invention provides a method for dynamically monitoring butterflies on a mountain top, comprising:
[0008] According to the preliminary investigation results of butterfly mountaintop behavior, mountaintops that meet the conditions of butterfly aggregation and activity are selected as monitoring points, and monitoring equipment is set up in the hot spots of butterfly mountaintop flight activities on the monitoring points;
[0009] Acquire a mountaintop butterfly video through monitoring equipment, and obtain a modeling training set based on the mountaintop butterfly video; construct a butterfly classification model, and train the butterfly classification model based on the modeling training set to obtain an optimal butterfly classification model;
[0010] Decomposing the mountaintop butterfly video by frames and performing time reading to obtain a labeled butterfly atlas, using the labeled butterfly atlas to train a deep learning model to obtain an artificial intelligence butterfly recognition system;
[0011] Based on the artificial intelligence butterfly recognition system, the mountaintop butterfly video acquired in real time is decomposed frame by frame and the butterfly image is identified, and the optimal butterfly classification model is used to identify the species of the identified butterfly images to generate a butterfly species screenshot identification set;
[0012] Dynamic monitoring of the mountaintop butterflies is achieved based on the butterfly species screenshot identification set.
[0013] Optionally, the process of obtaining a modeling training set includes:
[0014] The mountaintop butterfly video is decomposed into several pictures by frame and invalid pictures are removed to obtain an original picture set; the pictures in the original picture set are enlarged and saved separately according to categories to obtain multiple biological clusters; a butterfly biological cluster is selected from the multiple biological clusters, and the butterfly biological cluster is split based on the butterfly species to obtain multiple species atlases; the pictures in each species atlas are numbered in numerical order to obtain a modeling training set.
[0015] Optionally, the process of building a butterfly classification model includes: using the InceptionV3 algorithm in deep learning as a basic model, introducing a global average pooling layer and a fully connected layer with a softmax activation function, and randomly generating pre-trained weights through a Gaussian probability function.
[0016] Optionally, the process of training the butterfly classification model based on the modeling training set includes:
[0017] The modeling training set is renamed and the images in each species atlas are mixed; the processed modeling training set is divided into a training set and a test set; the training set is subjected to data enhancement processing, the butterfly classification model is trained, and the trained model weights are saved; the test set is rescaled, the trained model weights are loaded to test the model, the confusion matrix and the area under the ROC curve are calculated according to the test data, the model is evaluated according to the calculation results, and the optimal butterfly classification model is obtained.
[0018] Optionally, the data enhancement processing includes but is not limited to rescaling, rotation, width / height translation, shearing, scaling, horizontal flipping and nearest neighbor filling mode.
[0019] Optionally, the process of obtaining a labeled butterfly atlas includes: reading each frame of the video stream, decomposing the video stream into multiple frames and removing invalid images to obtain the original frame atlas; introducing an optical recognition library to crop the date in the upper right corner of each frame in the original frame atlas and save a screenshot; reading the cropped date screenshot, binarizing and pixel inverting it; identifying the screenshot date and time, and converting it into a string; based on the string, time-labeling the images in the original frame atlas and labeling the butterfly species to obtain a labeled butterfly atlas.
[0020] Optionally, based on the artificial intelligence butterfly recognition system, the real-time mountaintop butterfly video is decomposed frame by frame and the butterfly image is identified, the site identification and frame extraction are performed, and the image is cropped into a single picture; the cropped image is used to expand the test set to obtain an expanded butterfly test set; the optimal butterfly classification model is used to perform species identification on the expanded butterfly test set to generate a butterfly species screenshot identification set.
[0021] Optionally, the images in the butterfly species screenshot identification set are named based on shooting date and species name.
[0022] Optionally, read the file name information of the uniformly named butterfly species screenshot identification set, save the read information to Excel, generate a raw data file, and process and organize the raw data according to the needs of dynamic analysis.
[0023] Compared with the prior art, the present invention has the following advantages and technical effects:
[0024] The present invention discloses a method for dynamic monitoring of mountaintop butterflies. First, a monitoring area is selected and analyzed according to the historical activity data of butterflies to obtain a hot spot area of butterfly flight activity. Monitoring equipment is set in the hot spot area of butterfly flight activity to obtain a video of butterfly activity on the mountaintop. Then, a modeling training set is obtained based on the butterfly video on the mountaintop, and a classification model is trained to obtain an optimal butterfly classification model. Thirdly, the butterfly video on the mountaintop is decomposed by frame, and time is read and annotated. A deep learning model is trained through the annotated images to obtain an artificial intelligence butterfly recognition system. The real-time mountaintop butterfly video is decomposed by frame and butterfly images are identified through the artificial intelligence butterfly recognition system. The identified butterfly images are identified by the optimal butterfly classification model to generate a butterfly species screenshot recognition set. Finally, dynamic monitoring of mountaintop butterflies is realized based on the butterfly species screenshot recognition set. According to the obtained butterfly daily, monthly, and annual activity record data sets, a dynamic analysis of butterfly occurrence is completed to realize long-term dynamic monitoring of various butterfly individuals and populations active on mountaintops in the wild. The present invention can effectively solve the problems of high labor input, high professional requirements, and high cost operation in the current wild butterfly monitoring. It has the characteristics of intelligence and high universality, which can significantly improve the current level of wild butterfly monitoring, meet the needs of accurate monitoring of all butterfly groups, and promote the development of climate change biology, conservation biology and biodiversity monitoring research with butterflies as the object. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0026] Figure 1 A flow chart of a dynamic monitoring technology according to an embodiment of the present invention;
[0027] Figure 2 Schematic diagram of the performance of the binary classification model of Papilio chrysotoptera and other butterflies in an embodiment of the present invention; (A) is a confusion matrix diagram, and (B) is a ROC curve and AUC area diagram.
[0028] Figure 3 The flight period diagram of the spring and summer generations of the Jiulianshan population of the golden-spotted swallowtail butterfly in 2023 and the mountaintop behavior and activity regularity diagram of the Jiulianshan population of the golden-spotted swallowtail butterfly in the embodiment of the present invention, (A) is a flight frequency change diagram, and (B) is a mountaintop behavior and activity regularity diagram;
[0029] Figure 4 This is a comparison of the time distribution of the present invention and the line sample method applied to the mountaintop monitoring of the golden-spotted swallowtail butterfly in an embodiment of the present invention, and the number of individuals encountered and the encounter rate per day during the spring flight period. (A) is the time distribution of the present invention and the line sample method applied to the mountaintop monitoring of the golden-spotted swallowtail butterfly, (B) is a comparison chart of the number of individuals encountered and the encounter rate per day in 2023, and (C) is a comparison chart of the number of individuals encountered and the encounter rate per day in 2024. DETAILED DESCRIPTION
[0030] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0031] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0032] Embodiment 1
[0033] like Figure 1 As shown, this embodiment provides a method for dynamically monitoring butterflies on a mountain top, including:
[0034] Based on the preliminary investigation results of butterfly mountaintop behavior, mountaintops with high butterfly concentration and active circling flight were selected as monitoring points, and monitoring equipment was set up in the hot spots of butterfly mountaintop flight activity at the monitoring points; >3 species of butterflies were seen gathering at the monitoring points; during the gathering period, >3 species of butterflies were seen flying around and chasing each other at the point, and the behavior occurred frequently during the observation period.
[0035] Acquire a mountaintop butterfly video through monitoring equipment, and obtain a modeling training set based on the mountaintop butterfly video; construct a butterfly classification model, and train the butterfly classification model based on the modeling training set to obtain an optimal butterfly classification model;
[0036] Decomposing the mountaintop butterfly video by frames and performing time reading to obtain a labeled butterfly atlas, using the labeled butterfly atlas to train a deep learning model to obtain an artificial intelligence butterfly recognition system;
[0037] Based on the artificial intelligence butterfly recognition system, the real-time mountaintop butterfly video is decomposed frame by frame and the butterfly image is identified, and the optimal butterfly classification model is used to identify the species of the identified butterfly images to generate a butterfly species screenshot identification set.
[0038] Dynamic monitoring of the mountaintop butterflies is achieved based on the butterfly species screenshot identification set.
[0039] Take the dynamic monitoring of the mountain top of Teinopalpus aureus as an example:
[0040] Mountaintop monitoring deployment: During the period of the golden-spotted swallowtail butterfly outbreak in Jiulian Mountain, the implementation site, we surveyed along the mountain ridges and selected mountaintops where golden-spotted swallowtail butterflies and other butterflies (especially large swallowtail butterflies) gathered and flew around actively as monitoring points. We first measured the range and area of the butterfly activity area at the point to determine the monitoring installation location, and then selected appropriate monitoring cameras, poles, solar panels and controllers based on the shooting distance, coverage, angle and resolution requirements (5 million pixels or above), assembled the monitoring equipment at the determined point, and selected accessories such as WIFI signal transmitter amplifiers based on the signal distribution on the mountaintop.
[0041] Monitoring settings: Based on the previous investigation and research on the flight activities and habits of the local Swallowtail and other butterflies on the mountain top, set the monitoring to record from 5:30 to 18:00 every day, set the video bit rate, ensure that the video resolution reaches 2560×1920 or above), and set the duration of each monitoring video file (such as 600 seconds / file). After turning on the monitoring, if a zoom camera is used, it is necessary to first preset the monitoring screen in place according to the actual situation on the mountain top, so that it will automatically return to the original position every time it is powered on and restarted, ensuring that the same monitoring screen is used to collect information every day.
[0042] Monitoring and operation and maintenance: During the monitoring operation, use the APP or computer client to check the picture, video quality, signal stability, working status, human activities, data storage status, etc. from time to time, and remotely adjust and operate the preset picture, video resolution, data storage, etc. If the remote operation and maintenance fails, go to the site in time, check the operating status of the monitoring components on site, observe and judge the problem, find the cause, and respond in time, including equipment reset, operation and debugging, inspection and maintenance (power supply, battery, camera, solar panel, timer, lithium battery, signal line, power line, memory card / SD card, etc.), restoration to the original position and other maintenance contents. In order to meet the needs of continuous operation of the equipment, accessories should be replaced and tested on site according to actual conditions;
[0043] Data collection: During monitoring, use the App or computer client to remotely check the remaining storage on the SD card, download videos remotely regularly, or go to the site regularly to download via network cable, or directly replace a blank SD card on site to bring the video data back for collection. For some abnormal SD cards, use Disk Recovery Wizard, DiskGenius, etc. to recover the data before reading.
[0044] As a specific implementation method, the process of obtaining the modeling training set includes:
[0045] The mountaintop butterfly video is decomposed into several pictures by frame and invalid pictures are removed to obtain an original picture set; the pictures in the original picture set are enlarged and saved separately according to categories to obtain multiple biological clusters; a butterfly biological cluster is selected from the multiple biological clusters, and the butterfly biological cluster is split based on the butterfly species to obtain multiple species atlases; the pictures in each species atlas are numbered in numerical order to obtain a modeling training set.
[0046] Specifically, the video information reading includes: decomposing the mountaintop butterfly video by frame, converting it into pictures, and then using manual interpretation and recognition methods to remove blank or invalid pictures to establish a mountaintop butterfly activity original picture set. Enlarge the original picture, take a single screenshot of the butterflies, birds, dragonflies, bees, etc. in a square frame, save them to a new folder according to the identification group, and name them with the group name to establish multiple biological clusters. Open each screenshot from the butterfly cluster in sequence, and after manual interpretation and recognition, save them to their respective species name folders according to the species name (such as Swallowtail, Broadband Blue Swallowtail, Two-tailed Nymphalidae, Paris Papilio, etc.), and number all the screenshots in the folder in numerical order as the subsequent modeling training set. At the same time, randomly select the above screenshots, mix and copy them into another folder, and also number them in numerical order as the modeling test set.
[0047] As a specific implementation method, the process of building a butterfly classification model includes: using InceptionV3 without the top layer as the basic model, introducing a global average pooling layer and a fully connected layer with a softmax activation function, and loading the pre-trained weights of the ImageNet atlas.
[0048] As a specific implementation, the process of training the butterfly classification model based on the modeling training set includes:
[0049] The modeling training set is renamed and the images in each species atlas are mixed; the processed modeling training set is divided into a training set and a test set; the training set is subjected to data enhancement processing, the butterfly classification model is trained, and the trained model weights are saved; the test set is rescaled, the model weights after training are loaded to test the model, the confusion matrix and the area under the ROC curve are calculated according to the test data, and the model is evaluated according to the calculation results to obtain the optimal butterfly classification model. The data enhancement processing includes but is not limited to rescaling, rotation, width / height translation, shearing, scaling, horizontal flipping and nearest neighbor filling mode.
[0050] Specifically, the model construction and verification process includes: binary classification (such as Swallowtail and other butterflies) or multi-classification (such as Swallowtail, Wide-banded Blue Swallowtail, etc.) model construction, mainly in the following steps:
[0051] a. Model construction. Use InceptionV3 without the top layer as the base model, load the pre-trained weights of ImageNet, add a global average pooling layer and a fully connected layer with a softmax activation function for classification. Compile the model using the Adam optimizer, classification cross entropy loss function, and accuracy as indicators;
[0052] b. Processing of original image data: According to the classification target, the image data sets in the modeling training set and the modeling test set are shuffled using Gaussian random function, and the five-fold cross-validation method is used to split the data sets into training set and test set at a ratio of 4:1;
[0053] c. Model training. During the model training process, use the ImageDataGenerator function to perform data augmentation, including rescaling, rotation, width / height translation, shearing, scaling, horizontal flipping, and nearest neighbor filling mode. Use the augmented data for training and save the weights in the file directory;
[0054] d. Model validation. Rescale the test set data, load the trained model weights, and make predictions on the test set. Calculate the confusion matrix and the AUC (area under the curve) of the ROC curve to evaluate the model performance.
[0055] As a specific implementation method, the process of obtaining a labeled butterfly atlas includes: reading each frame of a video stream, decomposing the video stream into multiple frame images, removing invalid images, and obtaining an original frame atlas; introducing an optical recognition library to crop the date in the upper right corner of each frame image in the original frame atlas and taking a screenshot to save it; reading the cropped date screenshot, binarizing it and performing pixel inversion processing; identifying the screenshot date and time, and converting them into a character string; based on the character string, time-marking the images in the original frame atlas and marking the butterfly species, and obtaining a labeled butterfly atlas.
[0056] As a specific implementation method, based on the artificial intelligence butterfly recognition system, the real-time mountaintop butterfly video is decomposed frame by frame and the butterfly image is identified, the site identification and frame extraction are performed, and it is cropped into a single picture; the cropped picture is used to expand the test set to obtain an expanded butterfly test set; the optimal butterfly classification model is used to identify the species of the expanded butterfly test set to generate a butterfly species screenshot identification set.
[0057] As a specific implementation, the pictures in the butterfly species screenshot identification set are named based on the shooting date and species name.
[0058] Specifically, the process of butterfly video machine recognition includes: decomposing the mountaintop butterfly video stream, converting it into images, and using the established deep learning model for prediction and recognition applications. Specifically, it includes the following contents and steps:
[0059] a. Video decomposition: Use the opencv library and the read function of the VideoCapture object to read each frame of the video stream, decompose the video frame by frame, convert it into n frame images, and remove invalid images to obtain the original frame image set.
[0060] b. Read the shooting time. Introduce the tesserocr optical recognition library, crop the date in the upper right corner of each frame, take a screenshot and save it; read the cropped date screenshot, perform binarization and pixel inversion processing; use the image_to_text function of tesserocr to identify the screenshot date and time, and convert them into a string.
[0061] c. Identification of Papilio chrysotoptera. The deep learning InceptionV3 algorithm was introduced to manually label and pre-train the Papilio chrysotoptera and other butterfly atlases collected in the early stage as "Papilio chrysotoptera" or "other butterflies", and an artificial intelligence recognition system for Papilio chrysotoptera was established. The input image of the system is the single image decomposed from the video in a. For each butterfly (Papilio chrysotoptera or other butterflies) appearing in each image, the site is identified and framed, and then cropped into a single image to further expand the butterfly atlas;
[0062] d. Model recognition application. Using the expanded butterfly atlas as the test set, the constructed Swallowtail butterfly binary or multi-classification model is applied to predict and identify species, and the screenshot identification sets of Swallowtail butterfly and other species are generated respectively. The generated atlas identification sets are manually interpreted and reviewed, and the wrong identification results are corrected and removed to obtain the corrected identification sets, which are added to the existing butterfly training set library to further expand the training data, greatly improve the generalization ability of the model, and promote the iterative upgrade of the model.
[0063] e. Data preservation. Combine the above steps b, c, and d, and name the pictures with the butterfly species name and the read shooting time. The format is unified as "shooting date + species name + serial number";
[0064] As a specific implementation method, the file name information of the uniformly named butterfly species screenshot identification set is read, the read information is saved to Excel, a raw data file is generated, and the raw data is processed and organized according to the needs of dynamic analysis.
[0065] Specifically, the dynamic analysis of mountaintop butterflies includes: using the listdir function of the os module in the Python language to extract the butterfly species and activity time information from the uniformly named butterfly atlas file name, and then using the cell function in the workbook class under the openpyxl library to save the extracted information as an Excel file, including the butterfly species name column and the activity time column. Afterwards, according to the needs of dynamic analysis, the activity time column is further processed and sorted according to the analysis needs. For example, the frequency of butterfly activities at each time interval (such as every 10 minutes) is counted, and the daily dynamics are analyzed to obtain the daily activity rhythm; or the cumulative frequency of butterfly activities or the number of active individuals is counted on a daily basis, and the monthly dynamics are analyzed to reveal the flight period (first flight day, peak day, and last flight day). In addition, in addition to a single species, dynamic analysis can also be further expanded to the inter-species (such as closely related species), inter-genus, and community levels, to compare and analyze dynamic changes, and to grasp the mountaintop behavioral characteristics and adaptability of different butterflies. It should also be combined with mountaintop climate monitoring data to carry out association and coupling research to obtain the climate adaptability of butterflies and their response characteristics.
[0066] In all the above modeling and analysis steps of this embodiment, unless the software name is clearly stated, they are all performed or completed in Python language.
[0067] Effect verification
[0068] The embodiment is carried out on the top of a mountain where the Swallowtail Butterfly and other various butterflies gather in Jiulian Mountain. Dynamic monitoring of the Swallowtail Butterfly population of this rare and large protected species is carried out on the top of the mountain. Based on the latest video materials, video information reading, model construction and verification, machine recognition and dynamic analysis are carried out to verify the effect of the present invention.
[0069] (1) Model validation results: The confusion matrix and the AUC (area under the curve) of the ROC curve were calculated to evaluate the performance of the binary classification model for Papilio chinensis and other butterflies. The rows of the confusion matrix represent the predicted labels and the columns represent the true labels. Figure 2 (A) The confusion matrix shows the change in the number of classifications. The upper part of the matrix shows the classification results of the true labels (such as Swallowtail butterfly and other butterflies). It can be seen that the number of successful predictions is extremely high, while the number of wrong predictions is extremely low. The lower part of the matrix shows the classification results of the true labels, which also shows that the number of successful predictions is extremely high, while the number of wrong predictions is extremely low. This means that the model has good performance in the two-class classification (Swallowtail butterfly / non-Swallowtail butterfly).
[0070] ROC curve and AUC area diagram Figure 2 As shown in (B), the horizontal axis represents sensitivity, that is, the true positive rate (TPR), which represents the proportion of samples that are correctly identified as positive among all samples that are actually positive; the vertical axis represents specificity, that is, the proportion of samples that are correctly identified as negative among all samples that are actually negative. The dark gray curve represents the classification performance of "Swallowtail butterfly", and the light gray curve represents the classification performance of "other butterflies". The dotted line in the figure represents the classification performance of random guessing. The points on the curve represent the sensitivity and specificity of the model under different binary classification thresholds, and the higher the value, the better. The area under the curve AUC is used to quantify the overall performance of the model. The figure shows that the AUC values of the two curves are both greater than 0.99, which also shows that the model has excellent binary classification performance.
[0071] (2) Butterfly video machine recognition: Decompose the mountaintop butterfly video stream and convert it into images, and then use the above two-classification model for prediction and recognition applications. The specific content and steps are as follows:
[0072] a. Video decomposition: Use the opencv library and the read function of the VideoCapture object to read each frame of the video stream, decompose the video frame by frame, convert it into n frame images, and remove invalid images to obtain the original frame image set.
[0073] b. Read the shooting time. Introduce the tesserocr optical recognition library, crop the date in the upper right corner of each frame, take a screenshot and save it; read the cropped date screenshot, perform binarization and pixel inversion processing; use the image_to_text function of tesserocr to identify the screenshot date and time, and convert them into a string.
[0074] c. Identification of Papilio chrysotoptera. In the early stages, a large amount of butterfly image data was collected, including Papilio chrysotoptera and other butterflies. By introducing the deep learning InceptionV3 algorithm, these butterfly atlases were manually annotated with Papilio chrysotoptera and other butterflies, and pre-trained, thus establishing a comprehensive artificial intelligence butterfly recognition system. The input image of this system is the single image decomposed from the video in a. These images contain a large number of butterflies. For each butterfly that appears in the image, the site is identified and framed, and then cropped into images to build a larger butterfly atlas;
[0075] d. Model recognition application. Using the butterfly atlas as the test set, the constructed Swallowtail butterfly binary or multi-classification model is used for prediction and recognition, and the Swallowtail butterfly and other butterfly screenshot recognition sets are generated respectively. The generated atlas recognition sets are manually interpreted and reviewed, and the wrong recognition results are corrected and removed to obtain the corrected recognition sets, which are added to the existing training set library to further expand the training data, improve the generalization ability of the model, and promote the iterative upgrade of the model.
[0076] e. Data preservation: Combine steps b, c, and d above, and name the pictures using the butterfly species name (Swallowtail or other butterfly) and the read shooting time. The format is unified as "shooting date + species name + serial number".
[0077] (3) Dynamic analysis of butterflies on the mountaintop: Use the listdir function of the os module in the Python language to program, extract the information of the golden-spotted swallowtail butterfly and the activity time from the butterfly atlas file name uniformly named above, and then use the cell function in the workbook class under the openpyxl library to save the extracted information as an Excel file, including columns such as activity date and activity time, and perform dynamic analysis based on this. For example, count the activity frequency of the golden-spotted swallowtail butterfly at each time unit interval (such as every 10 minutes), analyze the daily dynamics, and obtain the daily activity rhythm, including the daily activity time (start to end time) and peak time. This method invention was used to extract the daily mountaintop flight time and frequency data of the golden-spotted swallowtail butterfly in Jiulian Mountain, Figure 3 It shows the occurrence dynamics of this large rare swallowtail butterfly in 2023. It can be seen that the local golden-spotted swallowtail butterfly has two mountaintop flight periods throughout the year, from April 9 to May 4 (spring generation: 25 days) and from August 8 to August 30 (autumn generation: 22 days). The spring generation has a maximum daily flight frequency of 95 times, but the peak distribution is not obvious, and the overall frequency is less than that of the autumn generation; the latter has a maximum daily frequency of 195 times, and the flight frequency shows a bimodal distribution, such as Figure 3 (A) shows that. In addition, the daily occurrence dynamics of the spring and autumn generations are also inconsistent. The daily mountaintop behavior of the spring generation occurs from 05:30 to 11:30, with a peak at 9:08; while the daily mountaintop behavior of the autumn generation occurs from 05:30 to 10:00, ending 1.5 hours earlier than the spring generation, and the peak time is 6:40, nearly 2.5 hours earlier than the spring generation. Figure 3 (B) shown.
[0078] From the examples, it can be seen that Figure 1 ), the present invention can completely collect the dynamic data of the adult occurrence of the golden-spotted swallowtail butterfly, establish an iterative and upgradeable classification model, use the machine to identify the video material of the golden-spotted swallowtail butterfly, and read the data such as the date and time of the butterfly's activities, and completely reveal the field year, month, and day occurrence dynamics of this large and rare species. Therefore, the present invention has excellent verification effect and can provide technical support for the dynamic monitoring of butterflies on mountaintops.
[0079] Comparative Example:
[0080] Field monitoring of Teinopalpus aureus in Jiulian Mountain based on line transect method:
[0081] (1) Collection at known points: In Jiulian Mountain, the occurrence points of adults of the golden-spotted swallowtail butterfly encountered in the local area were collected through literature and interview methods, including encounter points such as mountaintop behavior, water absorption behavior, and corpse remains;
[0082] (2) Random survey: During the period when adults of the Papilio chrysotoptera occur (April-May and August-September), randomly survey multiple routes from the foot of the mountain to the top of the mountain >1000 m, and try to cover the known occurrence points in step (1). While verifying these occurrence points, we also try to add more field records of Papilio chrysotoptera;
[0083] (3) Selecting fixed sample lines: From the random lines in step (2), select 2-3 random lines with high encounter rates of Papilio chrysotoptera adults as fixed sample lines and carry out butterfly sample line monitoring;
[0084] (4) Butterfly line monitoring: Refer to the method of "Technical Guidelines for Biodiversity Observation - Butterflies" (HJ 710.9-2014) and arrange for dedicated personnel to conduct regular line monitoring:
[0085] a. Form a butterfly transect monitoring team consisting of senior professional technicians (team leaders) and other professional technicians with field work experience, local forest rangers, graduate students, etc. Before the implementation of the monitoring, the team leader will conduct butterfly monitoring training in the form of reports and on-site guidance, including butterfly monitoring methods, relevant standards and specifications, record content, locator operation, butterfly species identification, biological characteristics of the golden-spotted swallowtail butterfly, etc.;
[0086] b. The team leader shall arrange 1-2 trained personnel to perform monitoring tasks at each fixed sample line according to the actual situation. They shall be required to conduct surveys along the foot of the mountain to the top of the mountain (>1000m) 1-2 times a week on cloudy or sunny days, record the types and numbers of butterflies encountered within 2.5m to the left and right and 5m above the line, and locate them at the same time;
[0087] c. For butterflies that cannot be identified immediately, you can use an insect net to catch them as needed, and release them on the spot after the species name is determined. For some butterflies that cannot be identified on the spot, you can take photos from multiple angles first, and then check or consult to complete it.
[0088] (5) Data collation and analysis: Divide the sample line into multiple sample sections according to the habitat type, with each sample section of 100 m. Count the number of butterfly species, individuals, encounter dates, etc. in each sample section, calculate the diversity index, and compare the differences in different habitat types and environmental gradients (such as altitude). At the same time, data on specific species such as the golden-spotted swallowtail butterfly can also be extracted separately to understand their occurrence characteristics (habitat type, population status, etc.).
[0089] The monitoring data of Papilio chrysotoptera obtained in the comparative example are compared and verified with those in the embodiment:
[0090] (1) Comparative verification of the mountain top monitoring time. Using the mountain top monitoring technology of the present invention, the mountain top monitoring time of the embodiment starts at 5:30 every day, and then can continue to work constantly until 18:00, although the data reading of the golden-spotted swallowtail butterfly can end at 14:00 (thereafter blank data). However, using the sample line method, the mountain top monitoring time of the comparative example does not start until 6:00 at the earliest. Moreover, from the distribution of the time when the manual inspection reaches the mountain top, it can be seen that most of the mountain top monitoring times of the sample line method are after 10:00 (the peak value is 10:01, see Figure 4 The embodiment reveals that the peak time of the mountain-top behavior of the Jiulianshan Golden Spotted Swallowtail Butterfly in spring is 9:08, which is nearly 1 hour late; the peak time of the mountain-top behavior in autumn is 6:40, which is 3.35 hours late (see Figure 3 (B) with Figure 4 (A));
[0091] (2) Comparative verification of the number of individuals encountered by the golden-spotted swallowtail butterfly. The monitoring records of the spring generation period of the golden-spotted swallowtail butterfly in 2023 (10 days) and 2024 (13 days) were collected for comparative verification. Figure 4 It shows that by applying the technology of the present invention, the embodiment recorded the behavior activities of individuals of the golden-spotted swallowtail butterfly on the mountain top in both 2023 and 2024. Among them, the encounter rate in 2023 was 40% (see Figure 4 (B)) The encounter rate in 2024 is 46.2% (see Figure 4 (C)); however, using the transect method, no individuals were recorded in 2023, with an encounter rate of 0, and although individuals were recorded in 2024, the encounter rate was only 15.4%.
[0092] Therefore, comparative verification shows that applying the technology of the present invention to mountaintop monitoring of rare large mountain butterflies such as the Papilio chrysotoxum can make up for the defects of the traditional line sample method and solve the problems exposed when the line sample method is applied in mountain environments, including that monitoring implementation is easily subject to artificial restrictions, monitoring time varies greatly, and monitoring results are often questioned.
[0093] The technical solution of the present invention has the following advantages: (1) Compared with the existing "Pollard Walk" sample line method, the present invention can better adapt to the mountain environment, and requires less manpower input. Monitoring is not limited by working hours, but can cover the entire butterfly occurrence period; (2) Compared with the existing direct counting method, this technical invention is not affected by the subjectivity and recognition ability of the monitor, and can use artificial intelligence to identify active butterflies on the top of the mountain, complete data reading in a short time, and the entire process is standardized and standard. The data is consistent and can be deeply mined and analyzed, especially in combination with environmental variables such as climate; (3) Compared with the existing trapping monitoring methods such as the trapping cage method, the present invention has no group bias and can monitor the complete butterfly community active on the top of the mountain, completely making up for the lack of monitoring of rare large swallowtail butterflies, white butterflies and other groups by the trapping method, and can truly and comprehensively reflect the occurrence and dynamics of butterflies in the wild; (4) The present invention has high universality. In the promotion and application, with the help of further expansion of field monitoring data, the algorithm can be continuously improved and iteratively upgraded to gradually improve its adaptability to butterfly monitoring in different regions and locations. More importantly, except for the monitoring installation that requires manual labor, the monitoring data collection invented by this method can be downloaded remotely or completed with the help of SD card replacement, and butterfly identification is completed by artificial intelligence. Therefore, there is no need for special training for monitoring personnel. It has the advantages of simple method, easy operation, and reliable results.
[0094] The invention of this method integrates the latest monitoring and artificial intelligence technologies, can get rid of artificial restrictions, can be applied and promoted in mountain butterfly occurrence areas (such as nature reserves), meet the current needs of wild butterfly monitoring, and improve the monitoring level and biodiversity protection quality; the invention of this method integrates hardware technologies such as monitoring equipment selection, installation, and setting with software technologies such as monitoring point selection, data reading, intelligent recognition algorithm establishment, and upgrading, forming a complete monitoring technology for wild mountain butterfly monitoring and dynamic analysis and reporting, which can be used as a standard in the relevant field to regulate current wild butterfly monitoring behavior; the software technology part of the invention of this method is expected to be made into an identification chip in an algorithm-built-in manner, to create a butterfly monitoring intelligent product, and iteratively upgraded to meet the current urgent precise monitoring requirements; the invention of this method can solve the problems of discontinuity and high cost of artificial mountain operations, and high dependence on the expertise of specific butterfly species, and provide field monitoring solutions for rare and endangered butterflies such as the Papilio chrysotoptera, to learn about their survival status, dynamics and trends, and provide scientific support for current rescue protection. The hardware part of the technology of the present invention is small in size and occupies a small area when installed in the field. It can be integrated with the natural environment with the help of protective color. It is an environmentally friendly technology and can further improve the benefits of protecting wildlife resources and biodiversity in various places.
[0095] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for dynamic monitoring of butterflies on a mountain top, characterized in that: The following steps are involved: According to the preliminary investigation results of butterfly mountaintop behavior, mountaintops that meet the conditions of butterfly aggregation and activity are selected as monitoring points, and monitoring equipment is set up in the hot spots of butterfly mountaintop flight activities on the monitoring points; Acquire a mountaintop butterfly video through a monitoring device, and obtain a modeling training set based on the mountaintop butterfly video; Constructing a butterfly classification model, training the butterfly classification model based on a modeling training set, and obtaining an optimal butterfly classification model; Decomposing the mountaintop butterfly video by frames and performing time reading to obtain a labeled butterfly atlas, using the labeled butterfly atlas to train a deep learning model to obtain an artificial intelligence butterfly recognition system; Based on the artificial intelligence butterfly recognition system, the mountaintop butterfly video acquired in real time is decomposed frame by frame and the butterfly image is identified, and the optimal butterfly classification model is used to identify the species of the identified butterfly images to generate a butterfly species screenshot identification set; Dynamic monitoring of the mountaintop butterflies is achieved based on the butterfly species screenshot identification set.
2. The method for dynamic monitoring of mountaintop butterflies according to claim 1, characterized in that: The process of obtaining a modeling training set includes: The mountaintop butterfly video is decomposed into several pictures by frame and invalid pictures are removed to obtain an original picture set; the pictures in the original picture set are enlarged and saved separately according to categories to obtain multiple biological clusters; a butterfly biological cluster is selected from the multiple biological clusters, and the butterfly biological cluster is split based on the butterfly species to obtain multiple species atlases; the pictures in each species atlas are numbered in numerical order to obtain a modeling training set.
3. The method for dynamic monitoring of mountaintop butterflies according to claim 1, characterized in that: The process of building a butterfly classification model includes: using the InceptionV3 algorithm in deep learning as the basic model, introducing a global average pooling layer and a fully connected layer with a softmax activation function, and randomly generating pre-trained weights through a Gaussian probability function.
4. The method for dynamic monitoring of mountaintop butterflies according to claim 2, characterized in that: The process of training the butterfly classification model based on the modeling training set includes: The modeling training set is renamed and the images in each species atlas are mixed; the processed modeling training set is divided into a training set and a test set; the training set is subjected to data enhancement processing, the butterfly classification model is trained, and the trained model weights are saved; the test set is rescaled, the trained model weights are loaded to test the model, the confusion matrix and the area under the ROC curve are calculated according to the test data, the model is evaluated according to the calculation results, and the optimal butterfly classification model is obtained.
5. The method for dynamic monitoring of mountaintop butterflies according to claim 4, characterized in that: The data augmentation processing includes but is not limited to rescaling, rotation, width / height translation, shearing, scaling, horizontal flipping, and nearest neighbor filling mode.
6. The method for dynamic monitoring of mountaintop butterflies according to claim 1, characterized in that: The process of obtaining the annotated butterfly atlas includes: reading each frame of the video stream, decomposing the video stream into multiple frames and removing invalid images to obtain the original frame atlas; introducing the optical recognition library to crop the date in the upper right corner of each frame in the original frame atlas and save it by taking a screenshot; reading the cropped date screenshot, binarizing it and inverting the pixels; identifying the screenshot date and time, and converting them into a string; based on the string, time-marking the images in the original frame atlas and marking the butterfly species to obtain the annotated butterfly atlas.
7. The method for dynamic monitoring of butterflies on mountain tops according to claim 4, characterized in that: Based on the artificial intelligence butterfly recognition system, the real-time mountaintop butterfly video is decomposed frame by frame and the butterfly image is identified, the site identification and frame extraction are performed, and the image is cropped into a single picture; the cropped image is used to expand the test set to obtain an expanded butterfly test set; the optimal butterfly classification model is used to identify the species of the expanded butterfly test set to generate a butterfly species screenshot identification set.
8. The method for dynamic monitoring of mountaintop butterflies according to claim 6, characterized in that: The images in the butterfly species screenshot identification set are named based on the shooting date and species name.
9. The method for dynamic monitoring of mountaintop butterflies according to claim 1, characterized in that: Read the file name information of the uniformly named butterfly species screenshot identification set, save the read information to Excel, generate the original data file, and process and organize the original data according to the needs of dynamic analysis.