A forest pest image recognition method based on edge computing

CN123033108APending Publication Date: 2026-11-03Zhangjiajie University
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611101926.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-23
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing forest pest and disease inspection terminals suffer from excessive power consumption due to continuous acquisition of invalid background images, coordinate deviations in heterogeneous camera view mapping, and image transmission delay bottlenecks in forest areas with weak network conditions, all of which affect the real-time performance and reliability of pest and disease monitoring.

Method used

By collecting spectral images and spatial absolute coordinate data through edge computing terminals, constructing joint triggering conditions, extracting suspected vegetation anomaly areas, generating visible light image masks using pose compensation matrix mapping, identifying pest and disease categories using lightweight networks, generating communication data packets through adaptive dimensionality reduction encoding, and reconstructing pest and disease areas in the cloud.

Benefits of technology

It reduced terminal power consumption, improved the accuracy of disease area segmentation, solved the data transmission delay in weak network environments in forest areas, and enhanced the real-time performance and reliability of pest and disease monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123033108A_ABST
    Figure CN123033108A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of image recognition and discloses a forest pest image recognition method based on edge computing, which comprises the following steps: a patrol terminal collects a spectral image, absolute coordinates and attitude quaternions, sends an interrupt signal to turn on power supply when a trigger condition is met; a microcontroller extracts attitude incremental quaternions to construct a pose compensation homography matrix, generates a visible light binary mask to extract a cut image matrix; the cut image matrix is input into a segmentation network to obtain a disease label and a contour point set, and a vertex weight score is calculated; the maximum number of vertices is measured and calculated, adaptive dimension reduction coding is performed in combination with the score to generate a communication data packet for sending; the cloud end is decoded and inversely transformed to form a vertex sequence, and an interpolation algorithm and a prior texture library are used to perform rasterization rendering. The application converts an image into a vector vertex through adaptive dimension reduction coding, transmits the vector vertex and reconstructs the vector vertex on the cloud end, reduces weak network transmission delay, eliminates equipment motion deviation in combination with a pose compensation homography matrix and improves regional cutting precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, specifically to a method for recognizing forest pests and diseases based on edge computing images. Background Technology

[0002] In forest pest and disease monitoring, using drones or portable inspection terminals equipped with multiple sensors and edge computing units for image acquisition and analysis is a common technical approach. However, existing monitoring methods still have many technical shortcomings in practical applications.

[0003] When existing inspection terminals are in operation, each acquisition sensor and computing unit is in a working mode of continuous operation and real-time image processing. This method causes the equipment to acquire and process a large number of invalid background area images that do not contain vegetation anomalies. This not only consumes computing resources, but also increases the overall power consumption of the terminal equipment, shortening the battery life and effective working radius of the inspection equipment.

[0004] In multi-camera collaborative operation scenarios, the system needs to combine multispectral images to identify suspected disease areas and further utilize high-resolution visible light cameras for detailed local analysis. Because the inspection equipment is in continuous motion within the external environment, there is a time difference between the acquisition of multispectral images and the readiness of the visible light cameras. Existing technologies, when processing image mapping between heterogeneous cameras, do not accurately consider the changes in the three-dimensional spatial pose of the equipment during this time difference, resulting in spatial coordinate deviations and consequently, lower accuracy in cropping disease areas from the full-resolution visible light image.

[0005] Forest areas are mostly located in remote regions with weak wireless communication network coverage and severely limited available bandwidth for communication links. Existing edge computing solutions, after identifying diseased areas, transmit large-volume cropped images or high-dimensional pixel features to the cloud platform. This transmission method is highly dependent on communication bandwidth and is prone to data transmission delay bottlenecks in the weak network environment at the edge of forest areas, or even data transmission interruptions. As a result, the cloud cannot obtain the on-site situation in a timely manner and perform effective visualization reconstruction, reducing the real-time performance and reliability of pest and disease monitoring. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a forest pest and disease image recognition method based on edge computing. This method solves the problems of excessive power consumption caused by continuous acquisition of invalid backgrounds in existing forest pest and disease inspection terminals, low cropping accuracy of disease areas due to coordinate deviations in heterogeneous camera view mapping caused by continuous device movement, and latency bottlenecks in the transmission of large-volume images in forest areas with weak network conditions.

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] This invention provides a forest pest and disease image recognition method based on edge computing, comprising the following steps:

[0009] The edge computing inspection terminal continuously collects spectral images, spatial absolute coordinate data, and three-dimensional pose quaternions. Based on the spectral images and spatial absolute coordinate data, it determines the joint triggering conditions. When the joint triggering conditions are met, it extracts the set of two-dimensional discrete connected domain boundary coordinates of the suspected vegetation anomaly area and sends a hardware interrupt signal.

[0010] The power management module connects the power supply current of the edge computing unit and the visible light camera according to the hardware interrupt signal. The edge computing unit combines the three-dimensional pose quaternion and the spatial absolute coordinate data to construct a pose compensation homography matrix, and maps the two-dimensional discrete connected domain boundary coordinate set to generate a visible light binary mask. The visible light binary mask is used to extract and crop the image matrix from the full-resolution visible light image.

[0011] The edge computing unit inputs the cropped image matrix into the lightweight instance segmentation network to obtain the pest and disease category labels and the initial two-dimensional discrete geometric contour point set, and calculates the comprehensive weight score of each contour vertex.

[0012] The edge computing unit calculates the maximum number of vertices, performs adaptive dimensionality reduction encoding based on the maximum number of vertices and the comprehensive weight score, and generates a communication data packet containing the set of vertices to be transmitted, pest category labels, position and pose data and geometric encoding pattern, which is then sent by the microcontroller.

[0013] The cloud platform receives and decodes the communication data packets, performs inverse coordinate transformation calculations on the set of vertices to be transmitted in conjunction with the position and pose data to form a global discrete vertex sequence, reconstructs the target geometric boundary according to the geometric encoding mode, and performs semantic rasterization rendering based on the pest and disease category labels and the prior pest and disease feature library.

[0014] Preferably, based on the spectral image and the spatial absolute coordinate data, a joint triggering condition is determined. When the joint triggering condition is met, the set of two-dimensional discrete connected domain boundary coordinates of the suspected vegetation anomaly area is extracted and a hardware interrupt signal is sent, including:

[0015] The microcontroller downsamples the spectral image to obtain an image matrix, calculates a normalized vegetation index matrix based on the image matrix, and constructs a vegetation foreground mask by combining the near-infrared intensity lower limit threshold and the vegetation foreground threshold.

[0016] The vegetation foreground mask is multiplied element-wise with the normalized vegetation index matrix to generate an effective vegetation index matrix, and a binary anomaly mask is generated based on the effective vegetation index matrix.

[0017] The three-dimensional linear displacement is obtained by calculating the difference between the spatial absolute coordinate data at the current sampling time and the previous triggering time.

[0018] When the total pixel area of ​​the independent connected domains in the binary anomaly mask is not less than a preset area threshold, and the three-dimensional linear displacement is not less than a preset displacement threshold, the joint triggering condition is determined to be met, the boundary coordinates of the corresponding independent connected domains are extracted as the set of boundary coordinates of the two-dimensional discrete connected domains, and the hardware interrupt signal is sent.

[0019] Preferably, the edge computing unit combines the three-dimensional pose quaternion with the spatial absolute coordinate data to construct a pose compensation homography matrix, including:

[0020] Record the trigger time of the hardware interrupt signal and the ready time of the visible light camera, extract the three-dimensional attitude quaternion at the trigger time and the three-dimensional attitude quaternion at the ready time, and calculate the attitude increment quaternion.

[0021] Extract the absolute spatial coordinate data at the triggering time and the absolute spatial coordinate data at the ready time, and calculate the spatial translation vector;

[0022] The attitude increment quaternion is converted into an increment rotation matrix, and the spatial translation vector is converted to the visible light camera coordinate system to obtain the relative translation component;

[0023] The pre-stored dual-camera static extrinsic matrix, visible light camera intrinsic matrix, and approximate depth parameters are retrieved, and the pose compensation homography matrix is ​​constructed by combining the incremental rotation matrix and the relative translation component.

[0024] Preferably, the set of two-dimensional discrete connected domain boundary coordinates of the suspected vegetation anomaly region is mapped to generate a visible light binary mask, and the visible light binary mask is used to extract a cropped image matrix from the full-resolution visible light image, including:

[0025] The set of boundary coordinates of the two-dimensional discrete connected domain is converted into a three-dimensional homogeneous coordinate vector, multiplied by the pose compensation homography matrix and normalized to reduce the dimension, and mapped to two-dimensional pixel coordinates in the visible light image matrix coordinate system.

[0026] The visible light binary mask is generated by performing a polygon region scan line filling algorithm in a two-dimensional matrix space based on the two-dimensional pixel coordinates.

[0027] The region of interest is extracted by performing a Hadamard product operation on the full-resolution visible light image and the visible light binary mask. A local sub-image is then cropped from the region of interest based on the minimum bounding rectangle of the non-zero region in the visible light binary mask, which is used as the cropped image matrix.

[0028] Preferably, the edge computing unit inputs the cropped image matrix into a lightweight instance segmentation network to obtain pest and disease category labels and an initial two-dimensional discrete geometric contour point set, including:

[0029] Perform bilinear interpolation and pixel value normalization on the cropped image matrix to generate three-dimensional tensor data;

[0030] The three-dimensional tensor data is input into the lightweight instance segmentation network to obtain classification confidence scores, predicted bounding box coordinates, and binary segmentation masks.

[0031] The pest / disease category label is saved when the classification confidence score is not less than the preset classification confidence threshold.

[0032] The binary segmentation mask is restored to the full-resolution visible light image coordinate system to generate a global lesion binary mask. After performing morphological opening and closing operations, the edges are obtained, and the outermost closed contour with the largest area value is extracted as the initial two-dimensional discrete geometric contour point set.

[0033] Preferably, the calculation of the comprehensive weight score for each contour vertex includes:

[0034] Extract the multidimensional spatial features of each contour vertex in the initial two-dimensional discrete geometric contour point set, including the spatial gradient magnitude of the vegetation index, local geometric curvature, and chord deviation distance;

[0035] The minimum value of the corresponding feature in the initial two-dimensional discrete geometric contour point set is subtracted from the feature value of the current contour vertex, and then divided by the difference between the maximum and minimum values ​​of the corresponding feature in the initial two-dimensional discrete geometric contour point set. The extreme value normalization process is then performed to obtain the normalized vegetation index spatial gradient magnitude, normalized geometric curvature, and normalized chord deviation distance.

[0036] The comprehensive weight score is obtained by weighting and fusing the normalized vegetation index spatial gradient magnitude, the normalized geometric curvature, and the normalized chord deviation distance with the fusion weight coefficient.

[0037] Preferably, the edge computing unit calculates the maximum number of vertices, including:

[0038] To assess the payload of the wireless communication link, obtain the maximum application layer payload parameters corresponding to the current communication protocol, and calculate the net payload bytes after deducting the number of bytes occupied by the fixed fields of the basic message.

[0039] When the maximum application layer payload parameter is greater than the number of bytes occupied by the fixed field, the maximum number of vertices that can be accommodated in a single physical communication is obtained by combining the net payload byte number with the fixed storage space occupied by a single vertex and rounding down.

[0040] Preferably, adaptive dimensionality reduction encoding is performed based on the maximum number of vertices and the comprehensive weight score to generate a communication data packet containing the vertex set to be transmitted, pest category labels, position and pose data, and geometric encoding pattern, which is then sent via the microcontroller, including:

[0041] When the total number of contour vertices in the initial two-dimensional discrete geometric contour point set is not greater than the maximum number of vertices, all vertices are retained as the vertex set to be transmitted and assigned a full contour encoding mode.

[0042] When the maximum number of vertices is not less than the topology dimensionality reduction switching threshold and is less than the total number of contour vertices, the maximum number of contour vertices are truncated in descending order according to the comprehensive weight score, and the spatial connectivity is restored by rearranging them in ascending order according to the original index number as the vertex set to be transmitted and assigned the dimensionality reduction contour encoding mode.

[0043] When the maximum number of vertices is not less than the value of two and less than the topology dimensionality reduction switching threshold, and the maximum number of vertices is less than the total number of contour vertices, the outer convex hull of the initial two-dimensional discrete geometric contour point set is extracted to generate the vertex set to be transmitted and a convex hull encoding mode is assigned, or the outer bounding box is extracted to generate the vertex set to be transmitted and a bounding box encoding mode is assigned.

[0044] When the maximum number of vertices is less than two, an empty set without geometric coordinates is generated as the vertex set to be transmitted, and a point alarm mode or a no-geometric-coding mode is assigned.

[0045] The communication data packet is generated by concatenating and encapsulating the vertex set to be transmitted, the pest and disease category label, the currently acquired position and pose data, and the corresponding geometric encoding pattern. The data packet is then written into the asynchronous retransmission queue by the microcontroller and sent through the communication module.

[0046] Preferably, the inverse coordinate transformation calculation is performed on the set of vertices to be transmitted using the position and pose data to form a global discrete vertex sequence, including:

[0047] The two-dimensional pixel coordinates, camera calibration configuration ID, approximate depth parameters, and spatial absolute coordinates and three-dimensional pose quaternions at the acquisition time, which serve as the position and pose data, are extracted from the communication data packet.

[0048] Read the visible light camera intrinsic parameter matrix and dual-camera static extrinsic parameter matrix associated with the camera calibration configuration ID, and use the digital elevation model data of the forest area geographic information system in combination with the approximate depth parameters to extract the canopy reference elevation surface;

[0049] Using the inverse perspective projection transformation matrix, the absolute spatial coordinates at the acquisition time, and the three-dimensional pose quaternion at the acquisition time, combined with the geometric intersection constraints formed by the canopy reference elevation surface, the coordinates of each two-dimensional pixel are subjected to inverse coordinate transformation calculation, which is mapped to absolute latitude and longitude coordinates in the global reference coordinate system, thus forming the global discrete vertex sequence.

[0050] Preferably, the target geometric boundary is reconstructed according to the geometric encoding pattern, and semantic rasterization rendering is performed based on the pest and disease category labels combined with a prior pest and disease feature library, including:

[0051] When the geometric encoding mode indicates a contour type, cyclic expansion assignment is performed on the first and last ends of the global discrete vertex sequence, and interpolation points are generated to form a continuous closed polygon boundary under the constraint of continuously changing interpolation step size parameters using the uniform Catmull-Rom spline interpolation algorithm.

[0052] When the geometric encoding mode indicates a convex hull type, the global discrete vertex sequence is directly connected to form a polygon boundary;

[0053] When the geometric encoding mode indicates a bounding box type, the two-dimensional pixel coordinates of the two extreme vertices separated by decoding are used to generate the pixel corner coordinates of four orthogonal rectangles. Then, the inverse coordinate transformation calculation is performed on the pixel corner coordinates of the four orthogonal rectangles respectively, and they are connected to form a polygon boundary.

[0054] In the main interface of the visualization management system, the target rendering area is defined based on the reconstructed polygon boundaries;

[0055] The disease and pest category labels obtained from the decoding are extracted and matched with the target texture mapping field in the prior disease and pest feature library. The color pixels of the target texture mapping field are mapped point-to-point to the base map raster points in the target rendering area. The semantic rasterization rendering is achieved by performing transparency attenuation blending operation within the boundary buffer distance threshold.

[0056] This invention provides a forest pest and disease image recognition method based on edge computing, which has the following beneficial effects:

[0057] 1. This invention constructs a joint triggering mechanism by combining a microcontroller with a normalized vegetation index matrix and a three-dimensional linear displacement. When the effective vegetation area and the device movement distance simultaneously meet the set threshold, a hardware interrupt signal is sent and the power supply to the visible light camera is turned on. By utilizing the dual constraints of spectral features and spatial displacement, image acquisition and processing of invalid background areas are avoided, and the overall power consumption of the edge computing inspection terminal is reduced.

[0058] 2. This invention extracts three-dimensional pose quaternions and spatial absolute coordinate data by recording the trigger and readiness times, calculates the pose increment quaternion and constructs a pose compensation homography matrix. By calculating the spatial pose changes generated by different cameras during the time difference of acquisition, the view mapping between heterogeneous cameras is dynamically compensated, eliminating the spatial coordinate deviation generated by the inspection terminal during continuous movement, and improving the accuracy of cropping the disease area in full-resolution visible light images.

[0059] 3. This invention calculates the maximum number of vertices based on the effective load of the communication link in the edge computing unit, performs adaptive dimensionality reduction encoding on the contour point set in combination with feature weight scores, and reconstructs the visualization area in the cloud using a parameterized interpolation algorithm and a prior pest and disease feature library. By converting large-volume images into small-volume vector vertex sequences for transmission, the dependence on communication bandwidth is reduced, and the bottleneck of data transmission delay in the weak network environment at the edge of forest areas is solved. Attached Figure Description

[0060] Figure 1 This is a hardware architecture diagram of the forest pest and disease image recognition system based on edge computing according to the present invention;

[0061] Figure 2 This is a flowchart of the forest pest and disease image recognition method based on edge computing according to the present invention;

[0062] Figure 3 This is a flowchart illustrating the low-power cruise acquisition and abnormal wake-up triggering phases of the present invention;

[0063] Figure 4 This is a flowchart of the stage in the present invention for waking up the edge computing unit and the visible light camera and extracting the region of interest based on pose compensation;

[0064] Figure 5 This is a flowchart of the stage in the present invention where the neural network is used to identify the target and calculate the contour vertex weight score.

[0065] Figure 6 This is a flowchart illustrating the process of evaluating communication link capacity and performing adaptive dimensionality reduction coding and transmission stages in this invention.

[0066] Figure 7 This is a flowchart of the vector feature restoration and visualization reconstruction rendering stage on the cloud platform in this invention;

[0067] Figure 8 This is a diagram showing the distribution of the comprehensive weight score of the contour vertices and the dimensionality reduction and preservation results of this invention.

[0068] Figure 9 This is a comparison chart of the parametric interpolation reconstruction rendering effects of the present invention. Detailed Implementation

[0069] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0070] See attached document Figure 1 This invention provides a forest pest and disease image recognition system based on edge computing. The hardware architecture of the system includes a microcontroller, an image processor, a power management module, a multispectral camera, a visible light camera, a positioning and orientation module, an edge computing unit, and a communication module.

[0071] A multispectral camera is connected to an image processor to continuously acquire spectral images of the target forest area and send these images to the image processor. The image processor is connected to a microcontroller to perform hardware-level downsampling on the spectral images, generating downsampled red-band image matrices and downsampled near-infrared-band image matrices, and then transmitting these matrices to the microcontroller.

[0072] The positioning and attitude determination module is connected to the microcontroller and continuously outputs the spatial absolute coordinate data and three-dimensional attitude quaternions of the edge computing inspection terminal at a fixed frequency to the microcontroller. The microcontroller maintains a low-power operating state, receives the image matrix, spatial absolute coordinate data, and three-dimensional attitude quaternions, and calculates the effective vegetation index matrix and three-dimensional linear displacement. The microcontroller also sends a hardware interrupt signal when the joint triggering condition is met and extracts the attitude increment quaternions within the wake-up time window.

[0073] The power management module is connected to the microcontroller, edge computing unit, and visible light camera, respectively. It receives hardware interrupt signals and switches the power supply to the edge computing unit and visible light camera based on these signals, thus achieving hierarchical power management. The visible light camera is connected to the edge computing unit and is used to acquire full-resolution visible light images after receiving power and send them to the edge computing unit.

[0074] The edge computing unit incorporates a neural network accelerator to construct a pose-compensated homography matrix based on pose increment quaternions, generate a visible light binary mask, and perform region-of-interest masking and local image cropping operations on the full-resolution visible light image. The edge computing unit also runs a lightweight instance segmentation network, outputting an initial two-dimensional discrete geometric contour point set of lesions, calculating the comprehensive weight score for each contour vertex, and performing adaptive dimensionality reduction encoding and transmission operations.

[0075] The communication module connects to the microcontroller to monitor link connectivity signals and evaluate the payload of the wireless communication link, and sends the communication data packets temporarily stored by the microcontroller to the cloud platform.

[0076] In a preferred embodiment, the edge computing inspection terminal of the present invention adopts a lightweight hardware design. Structurally, the entire device is encased in an IP65-rated waterproof and shockproof lightweight shell, enabling it to adapt to complex outdoor environments and facilitating portable operation in forest areas or direct mounting on a drone platform. At the core computing level, the edge computing unit uses a Raspberry Pi 4B edge computing core as the core processor to balance computing power and energy consumption. In the image acquisition module, the visible light camera is specifically a high-definition Universal Serial Bus (USB) camera, and the multispectral camera is a lightweight drone multispectral camera.

[0077] To ensure long-term operational endurance in the field, the system's power supply is achieved through a power management module combined with low-power solar panels and lithium batteries. Through the aforementioned tiered power management mechanism, the overall average power consumption of the system can be controlled below 10W. The positioning and attitude determination module employs a navigation module that integrates BeiDou-3 single-point positioning (SPP) with an inertial measurement unit (IMU) to provide high-precision absolute coordinates and attitude increments. The communication module integrates a BeiDou short message communication module and a 4G IoT module. The microcontroller can control automatic switching between the two links based on the current network coverage in the forest area. Furthermore, the system is equipped with a dedicated local offline data storage unit (such as a high-capacity flash memory card or solid-state storage chip) to securely store detection data in the asynchronous retransmission queue during network outages where both 4G and BeiDou signals are limited, and automatically transmit the data back once communication is restored.

[0078] See attached document Figure 2 This invention provides a forest pest and disease image recognition method based on edge computing, comprising the following steps:

[0079] S100 performs low-power cruise data acquisition and abnormal wake-up triggering. The edge computing inspection terminal enters cruise mode, the power management module cuts off the power supply current to the edge computing unit and the visible light camera, and uses the multispectral camera and positioning and attitude determination module to continuously acquire spectral images, spatial absolute coordinate data and three-dimensional attitude quaternions. The microcontroller calculates the effective vegetation index matrix and three-dimensional linear displacement, and sends a hardware interrupt signal when the joint triggering condition is met.

[0080] S200 wakes up the edge computing unit and the visible light camera and extracts the region of interest based on pose compensation. The power management module connects the power supply current to the edge computing unit and the visible light camera according to the hardware interrupt signal. The microcontroller extracts the pose increment quaternion within the wake-up time window. The edge computing unit constructs the pose compensation homography matrix based on this, and completes the mapping of multispectral spatial coordinates to visible light space to generate a visible light binary mask and performs region of interest mask processing and local image cropping on the full-resolution visible light image.

[0081] S300 runs a neural network to identify targets and calculate contour vertex weight scores. The edge computing unit inputs the cropped image matrix into a pre-set lightweight instance segmentation network to obtain pest and disease category labels, binary segmentation masks, and an initial two-dimensional discrete geometric contour point set. It extracts the vegetation index spatial gradient magnitude, local geometric curvature, and chord deviation distance of each contour vertex, performs normalization processing, and calculates the comprehensive weight score.

[0082] The S400 assesses the communication link capacity and performs adaptive dimensionality reduction coding and transmission. The edge computing unit evaluates the effective payload of the wireless communication link through the communication module and calculates the maximum number of vertices that a single physical communication can accommodate. Based on the maximum number of vertices, it dynamically performs topology order-preserving rearrangement dimensionality reduction, extraction of circumscribed convex hull or circumscribed bounding box dimensionality reduction, generates communication data packets, and sends or writes them to the asynchronous retransmission queue. The microcontroller controls the edge computing unit to power off and takes over the asynchronous retransmission queue.

[0083] The S500 performs vector feature reconstruction and visualization rendering on a cloud platform. The cloud platform receives and decodes communication data packets, performs inverse coordinate transformation calculations on the coordinates of each two-dimensional pixel based on the pose parameters and encoding mode in the data packets to form a global discrete vertex sequence, and generates continuous boundary equations through a parametric interpolation algorithm. Combined with a prior pest and disease feature library, semantic rasterization rendering is performed under the constraints of the continuous boundary equations.

[0084] To enable those skilled in the art to better understand the present invention, the following will elaborate on the technical details and specific implementation logic of the above-mentioned system operation and method execution process.

[0085] See attached document Figure 3 This invention provides a forest pest and disease image recognition method based on edge computing. The specific implementation method in the low-power cruise acquisition and abnormal wake-up triggering stage is as follows.

[0086] S101, the microcontroller controls the edge computing inspection terminal to perform low-power cruise data acquisition tasks and continuously read underlying hardware data. When the edge computing inspection terminal enters cruise mode, the power management module cuts off the power supply to the edge computing unit and the visible light camera. The microcontroller and image processor maintain low-power operation, and the multispectral camera continuously acquires spectral images of the physical environment and outputs them to the image processor. The image processor uses the pixel binning technology of the image sensor to perform hardware-level downsampling operations on the spectral images.

[0087] The system uses a unified time base for time synchronization. The microcontroller is equipped with a circular buffer to store in real time the downsampled image matrix and the corresponding positioning and attitude data, which include at least the current sampling time, the previous time, and several subsequent time points.

[0088] The image processor outputs a downsampled red band image matrix to the microcontroller. With the downsampled near-infrared band image matrix .in, The x-coordinate in the image matrix The vertical coordinate is the image coordinate, and together they represent the two-dimensional spatial position of the pixel within the image matrix. The localization and orientation module continuously outputs the edge computing inspection terminal's position at the current sampling time at a fixed frequency. Spatial absolute coordinate data With 3D pose quaternions .

[0089] S102, the microcontroller calculates the normalized vegetation index (NVI) and constructs a vegetation foreground mask based on the downsampled image matrix. The microcontroller receives the image matrix and calculates the corresponding NVI matrix. The formula for calculating the NVI matrix is:

[0090] ;

[0091] in, Represents the normalized vegetation index matrix; Represents the near-infrared band image matrix; Represents the image matrix in the red band; The x-coordinate in the image matrix The vertical coordinate is the ordinate in the image matrix, and together they represent the two-dimensional spatial position of the pixel in the image matrix; This represents the minimum floating-point constant set to 10. -6 By introducing this constant into the denominator of the underlying division operation, the division-to-zero overflow anomaly caused by the sum of pixels in the near-infrared band and the red band being zero can be avoided.

[0092] The microcontroller combines a preset near-infrared intensity lower limit threshold with a vegetation foreground threshold to construct a vegetation foreground mask. This vegetation foreground mask is used to filter out non-vegetation background interference caused by forest shadows, bare soil, and dead branches.

[0093] The mathematical calculation rules for constructing a vegetation foreground mask are as follows:

[0094] ;

[0095] in, Indicates a foreground mask for vegetation; The x-coordinate in the image matrix; The vertical coordinate is the ordinate in the image matrix, and together they represent the two-dimensional spatial position of the pixel in the image matrix; This represents the near-infrared band image matrix after downsampling; This represents the lower limit threshold of near-infrared intensity after downsampling; Represents the normalized vegetation index matrix; Indicates the vegetation foreground threshold; This indicates that the action will be executed when the subsequently set conditions are met. This represents a logical AND operation, indicating that the conditions on both ends must be met simultaneously. This indicates other situations where the above-mentioned conditions are not met; numerical values. This indicates that the data corresponding to this two-dimensional spatial location is retained as the foreground target, and the numerical value... This indicates that the data corresponding to the two-dimensional spatial location is identified as background and removed.

[0096] Among them, when the near-infrared band image matrix The lower threshold of near-infrared intensity when output from a multispectral camera after radiometric correction. Specifically, this refers to the dimensionless lower limit of near-infrared reflectance corresponding to the radiometrically corrected data; when the system allows direct processing of unradiographically corrected raw grayscale data, this near-infrared intensity lower limit threshold is... Specifically, this refers to a pre-calibrated grayscale threshold corresponding to the grayscale values ​​of the image. Vegetation foreground threshold. The requirement is that it be less than the subsequently set healthy vegetation threshold. This is to prevent diseased areas from being prematurely removed due to low vegetation index.

[0097] Regarding the lower limit threshold of near-infrared intensity With vegetation foreground threshold The value of can be determined by statistical analysis of multispectral image samples of the target forest area collected in advance. In actual forestry scenarios, when represented in the form of reflectance, the lower limit threshold of near-infrared intensity is... The value ranges from 0.2 to 0.3, representing the vegetation foreground threshold. The value ranges from 0.4 to 0.6.

[0098] S103, the microcontroller uses a vegetation foreground mask to filter out non-vegetated background areas and generate an effective vegetation index matrix. The microcontroller will then use the generated vegetation foreground mask... Effects on the normalized vegetation index matrix The effective vegetation index matrix is ​​generated through element-wise matrix multiplication. This operation filters out all pixel data that do not meet the foreground vegetation characteristics, retaining only the exponential feature distribution of the effective canopy area.

[0099] Subsequently, the microcontroller generates a binary anomaly mask based on the effective vegetation index matrix, calculated using the following formula:

[0100] ;

[0101] in, Indicates a binary anomaly mask; The healthy vegetation threshold is determined by subtracting a set tolerance from the statistical mean of the NDVI of healthy tree canopy samples. The set tolerance ranges from 0.05 to 0.15. The actual value range is configured to be 0.6 to 0.85 to ensure effective differentiation between healthy tree canopies and diseased tissues.

[0102] S104, the microcontroller synchronously reads the spatial absolute coordinate data output by the positioning and attitude determination module to calculate the three-dimensional linear displacement. The microcontroller synchronously reads the data output by the positioning and attitude determination module and calculates the three-dimensional linear displacement. The microcontroller calculates the difference in spatial absolute coordinates between the current sampling time and the previous triggering time. The formula for calculating the three-dimensional linear displacement is:

[0103] ;

[0104] in, Represents three-dimensional linear displacement; Indicates the current sampling time; This indicates the previous trigger time, i.e., the time when the system generates a hardware interrupt signal; during system initial startup or reset, the previous trigger time is... The default initialization time is the sampling moment when the edge computing inspection terminal first obtains valid positioning data; Indicates the current sampling time Recorded absolute spatial coordinate data; Indicates the time at the previous trigger moment Recorded absolute spatial coordinate data; This represents the L2 norm operation for solving vectors, used to calculate the physical distance between lines in three-dimensional space.

[0105] The microcontroller uses the previous trigger moment As a benchmark, the linear displacement of the edge computing inspection terminal from the last time it performed a disease identification operation to the current sampling time is calculated.

[0106] S105, the microcontroller determines the triggering condition based on the connected component characteristics of the effective vegetation index matrix and the three-dimensional linear displacement. The microcontroller operates within a binary anomaly mask. The algorithm for labeling connected components is executed, and the total pixel area and average pixel value of each independent connected component are calculated. If the total pixel area of ​​a connected component is greater than or equal to a preset area threshold, then the process is complete. The system identifies areas suspected of having vegetation anomalies. If none of the connected components in the binary anomaly mask meet the above conditions, it determines that there are no suspected vegetation anomalies within the current field of view. The microcontroller then clears the currently buffered image data and waits for input from the next sampling cycle.

[0107] Preset area threshold The specific values ​​are determined by converting the minimum physical area of ​​concern for the target forestry disease to the ground spatial resolution of the multispectral camera at the current inspection height, and the unit of measurement is pixel.

[0108] The microcontroller determines whether the combined triggering condition is met. The combined triggering condition requires a three-dimensional linear displacement. Greater than or equal to the preset displacement threshold Simultaneously, suspected vegetation anomaly areas meeting the above conditions were detected in the effective vegetation index matrix. Preset displacement threshold. The value is determined based on the physical coverage width of the ground field of view of the visible light camera at the current cruising altitude. It is set to 50% to 70% of the physical coverage width. By controlling the spatial overlap rate of two adjacent acquisitions, the high-power module is not repeatedly woken up for the same lesion area when the edge computing inspection terminal hovers or stays in the same spatial position.

[0109] When the joint triggering condition is met, the microcontroller locks the current trigger frame and its corresponding connected component boundary coordinates and positioning and orientation data in the circular buffer to prevent them from being overwritten by subsequent sampling data. At this time, the microcontroller sends a hardware interrupt signal to the power management module, ending the current sleep cycle and entering the pest and disease target identification and processing flow. If the joint triggering condition is not met, the microcontroller does not send a hardware interrupt signal, clears the current data buffer, and the edge computing inspection terminal continues to maintain the current low-power cruise state.

[0110] See attached document Figure 4 This invention provides a forest pest and disease image recognition method based on edge computing. The specific implementation of the step of activating the edge computing unit and the visible light camera and extracting the region of interest based on pose compensation is as follows.

[0111] S201, the power management module responds to a hardware interrupt signal to wake up the edge computing unit and the visible light camera, and records the system's wake-up time window. The power management module receives the hardware interrupt signal from the microcontroller, closes its internal power supply control circuit, and connects the power supply current to the edge computing unit and the visible light camera. After receiving power, the edge computing unit and the visible light camera perform power-on initialization operations. The microcontroller records the trigger time of sending the hardware interrupt signal. The edge computing unit waits for the visible light camera to complete its initialization and output the first valid image frame to the edge computing unit. When the visible light camera completes initialization and outputs the first valid image frame to the edge computing unit, the edge computing unit sends a ready signal to the microcontroller, which records this as the ready moment. The microcontroller then transmits the locked trigger frame-related data to the dedicated memory of the edge computing unit. Ready time The duration between these intervals is defined as the system's wake-up time window.

[0112] S202, the microcontroller extracts the attitude increment quaternion within the wake-up time window based on data from the positioning and attitude determination module. During the wake-up time window, the edge computing inspection terminal experiences physical displacement and attitude deflection, resulting in a spatial deviation between the field of view of the multispectral camera recording suspected vegetation anomalies and the field of view of the visible light camera when it is ready. To eliminate this spatial deviation, the microcontroller extracts data from the data cache of the positioning and attitude determination module for the corresponding moment. The microcontroller obtains the trigger time. 3D pose quaternion and ready time 3D pose quaternion .

[0113] The microcontroller calculates the attitude increment quaternion and spatial translation vector within the wake-up time window. The formula for calculating the attitude increment quaternion is:

[0114] ;

[0115] in, Represents the attitude increment quaternion; Indicates the trigger time of the hardware interrupt signal; This indicates the ready time for the first frame of a visible light camera; The quaternion representing the three-dimensional attitude at the trigger moment; A quaternion representing the three-dimensional attitude at the ready moment; This represents quaternion multiplication. It represents the inverse quaternion of the three-dimensional attitude quaternion at the trigger moment.

[0116] The formula for calculating the spatial translation vector is:

[0117] ;

[0118] in, This represents the spatial translation vector within the wake-up time window; Indicates the ready time Recorded absolute spatial coordinate data; Indicates the time when the hardware interrupt signal is triggered. The recorded spatial absolute coordinate data. This attitude increment quaternion, together with the spatial translation vector, characterizes the three-dimensional rotation and translation changes that occur in the edge computing inspection terminal within the wake-up time window.

[0119] S203, the edge computing unit constructs a pose compensation homography matrix based on the attitude increment quaternion. The microcontroller then processes the calculated attitude increment quaternion. The data is transmitted to the edge computing unit, which then processes the attitude increment quaternion. Convert to the corresponding incremental rotation matrix For specific conversion operations from quaternions to rotation matrices, the standard conversion relations between quaternions and rotation matrices can be used. The edge computing unit translates the spatial translation vector. Transform to the camera coordinate system to obtain the relative translation component. .

[0120] The edge computing unit reads a pre-calibrated dual-camera static extrinsic matrix from its internal non-volatile memory. This matrix characterizes the relative translation and rotation relationships between the multispectral and visible light cameras within the physical mounting structure. The edge computing unit then combines this with an incremental rotation matrix... Approximate depth parameters And the intrinsic parameter matrix of the visible light camera, to construct the pose compensation homography matrix. .

[0121] The formula for calculating the pose compensation homography matrix is:

[0122] ;

[0123] in, Represents the pose compensation homography matrix; This represents the intrinsic parameter matrix of a visible light camera; Represents the incremental rotation matrix; This represents the rotation component matrix in the dual-camera static extrinsic matrix; This represents the translation component vector in the dual-camera static extrinsic matrix; Indicates the relative translation component; This represents the transpose of the unit normal vector of the plane containing the target. In a vertical top-down inspection scenario, it is preset to a vertically downward unit vector, i.e., set to [0, 0, 1]. Represents an approximate depth parameter; This represents the inverse of the multispectral camera intrinsic parameter matrix. Approximate depth parameters. It is calculated using the following formula:

[0124] ;

[0125] in Elevation coordinate data, For digital elevation model data, This eliminates projection errors introduced by approximating the target plane as the ground surface, using pre-configured canopy height model data or prior tree height data of the target forest area.

[0126] S204, the edge computing unit uses a pose compensation homography matrix to map multispectral spatial coordinates to visible light space, generating a visible light binary mask. The edge computing unit extracts the set of two-dimensional discrete connected domain boundary coordinates for the suspected vegetation anomaly areas identified in the preceding steps. For any two-dimensional coordinate point in this set... The edge computing unit adds a constant 1 to the end to transform it into a three-dimensional homogeneous coordinate vector. The edge computing unit multiplies the 3D homogeneous coordinate vector by the pose compensation homography matrix. To obtain the intermediate vector Subsequently, the edge computing unit divides the first two components of the intermediate vector by the third scalar component. After normalization and dimensionality reduction, two-dimensional pixel coordinates mapped to the visible light image matrix coordinate system are obtained. .

[0127] Edge computing unit calculates the two-dimensional pixel coordinates An out-of-bounds detection mechanism is implemented. If the x-coordinate or y-coordinate exceeds the pixel width and height boundaries of the full-resolution visible light image, the edge computing unit performs a Sutherland-Hodgman polygon clipping algorithm on the mapped polygon and the rectangular boundary of the full-resolution visible light image to obtain the intersection polygon within the effective range of the image, thus avoiding memory addressing out-of-bounds overflow errors caused by subsequent filling operations. This homogeneous mapping and boundary clipping process is used to correct the spectral parallax caused by the physical installation of the multispectral camera and the visible light camera, as well as the rotation error caused by system wake-up delay.

[0128] Based on the mapped boundary coordinate set, the edge computing unit performs a polygon region scan line filling algorithm in a two-dimensional matrix space of the same size as the full-resolution visible light image to generate a visible light binary mask. ,in, The x-coordinate in the visible light image matrix, This represents the ordinate in the visible light image matrix. In the visible light binary mask... In the diagram, the value of the mapping area inside the polygon is set to 1, and the value of the outer background area is set to 0.

[0129] S205, the edge computing unit uses a visible light binary mask to perform region-of-interest masking and local image cropping operations on the full-resolution visible light image. The visible light camera sends the full-resolution visible light image it acquired at the ready time to the edge computing unit. Edge computing units will process full-resolution visible light images. With visible light binary mask Perform the Hadamard product operation. Extract the region of interest containing features of the actual lesions.

[0130] The formulas for calculating region of interest masking and local image cropping are as follows:

[0131] ;

[0132] in, This represents the cropped image matrix generated after extracting the region of interest; It represents a full-resolution visible light image, and its data format is a color image matrix containing three channels: red, green, and blue. This represents a visible light binary mask, which is pre-broadcast and copied into a three-channel matrix along the channel dimension during the Hadamard product. The x-coordinate in the visible light image matrix, The vertical coordinate in the visible light image matrix; This represents the Hadamard product operator.

[0133] when When the value is 0, the pixel values ​​of all three channels at the corresponding position in the full-resolution visible light image are set to 0; when When the value is 1, the corresponding real image pixel data is retained. After completing the Hadamard product operation, the edge computing unit extracts the minimum bounding rectangle of the non-zero region in the visible light binary mask, and based on this minimum bounding rectangle, it crops a real local sub-image from the Hadamard product image, recording the absolute coordinates of the upper left corner anchor point of this local sub-image in the full-resolution visible light image. The edge computing unit uses this local sub-image as the cropped image matrix. It is loaded into the dedicated memory of its built-in neural network accelerator to prepare the basic input data for the subsequent lightweight instance segmentation network inference stage.

[0134] See attached document Figure 5 This invention provides a forest pest and disease image recognition method based on edge computing. The specific implementation method in the stage of running a neural network to identify targets and calculate contour vertex weight scores is as follows.

[0135] S301, the edge computing unit extracts the cropped image matrix, performs data preprocessing, and configures the lightweight instance segmentation network. The edge computing unit reads the cropped image matrix loaded into its internal dedicated memory. This matrix is ​​a two-dimensional color image data containing red, green, and blue channels. The edge computing unit performs bilinear interpolation on this cropped image matrix to scale its spatial resolution to the fixed input size required by the network structure. ,in, This represents the height pixel value of the input feature of the lightweight instance segmentation network. This represents the width in pixels of the input features of the lightweight instance segmentation network. The specific values ​​of these two parameters are configured based on the pre-selected underlying structure design of the lightweight instance segmentation network; for example, both can be set to 640. Subsequently, a pixel value normalization operation is performed, linearly mapping the original value range from 0 to 255 to between 0 and 1, generating three-dimensional tensor data as the network's input features.

[0136] The internal structure of the lightweight instance segmentation network includes: a lightweight backbone feature extraction module for extracting multi-scale image features, a multi-scale feature fusion module for fusing shallow structural details and deep semantic information, and a decoupled prediction head module that independently and in parallel computes classification tasks, bounding box regression tasks, and mask segmentation tasks.

[0137] In this embodiment, the lightweight instance segmentation network adopts existing conventional lightweight instance segmentation models, such as the YOLOv8-seg nanometer-scale network architecture, to adapt to the computing power limitations of edge computing units. Specifically, the input tensor format of this network is as follows: The four-dimensional tensor has a lightweight backbone feature extraction module that adopts a cross-stage local network structure, outputting multi-scale feature maps with downsampling ratios of 8, 16, and 32 times.

[0138] The multi-scale feature fusion module adopts a path aggregation network structure, receives multi-scale feature maps, and performs feature concatenation and fusion through top-down upsampling and bottom-up downsampling paths. The fused features are input into the decoupled prediction head module, which contains independent branch structures. The classification branch outputs the confidence vector of the target category, the regression branch outputs the coordinate offset tensor of the predicted bounding box, and the mask segmentation branch outputs the mask coefficient tensor composed of multiple prototype mask vectors. Finally, the output tensor of the network contains the classification result, position information and pixel-level binary segmentation mask of the corresponding target candidate box.

[0139] Before being deployed to the edge computing unit, the network underwent supervised training on the server side using a set of manually collected and labeled forest disease sample images. The training sample set included category labels for real lesions, pixel coordinates of bounding boxes surrounding the targets, and pixel-level ground truth masks. The training process employed the Adam optimizer combined with backpropagation to update the network weight parameters. For classification tasks, a focal loss function was used to reduce the penalty weights on easily classified negative samples, while for regression tasks, a full intersection-over-union loss function was used to improve the localization accuracy of the bounding boxes. The model weight file after training convergence was permanently stored in the non-volatile memory of the edge computing unit.

[0140] S302, the edge computing unit runs a lightweight instance segmentation network to perform forward inference and process the prediction results. The edge computing unit inputs the preprocessed 3D tensor data into the lightweight instance segmentation network for forward inference calculation. The network output generates the predicted probabilities of multiple candidate targets, the corresponding predicted bounding box coordinates, and local segmentation masks. The edge computing unit extracts the maximum predicted probability as the classification confidence score of the current target and obtains the corresponding pest / disease category label.

[0141] The edge computing unit determines whether the classification confidence score is greater than or equal to a preset classification confidence threshold. The preset classification confidence threshold is configured to range from 0.6 to 0.85, determined by balancing the tolerance for false negatives and false positives in specific forestry protection operations. If the classification confidence score is lower than the preset classification confidence threshold, it is determined that the current cropped image matrix does not contain valid disease features. The edge computing unit stops subsequent calculations, clears memory data, and maintains a low-power state, waiting for the next sampling cycle to be triggered. If the classification confidence score is greater than or equal to the threshold, it is determined that a specific lesion has been found. The edge computing unit saves the disease / pest category label and extracts the corresponding predicted bounding box coordinates and local segmentation mask to enter the contour analysis process.

[0142] S303, the edge computing unit extracts an initial two-dimensional discrete geometric contour point set of lesions based on the predicted bounding box. The edge computing unit performs image boundary constraint operations on the extracted predicted bounding box coordinates, forcibly clipping coordinate values ​​exceeding the physical pixel boundaries of the full-resolution visible light image to the maximum or minimum legal pixel index boundaries. Based on the absolute coordinates of the upper-left anchor point, the edge computing unit restores the local segmentation mask output by the network to the full-resolution visible light image coordinate system, generating a global lesion binary mask. The edge computing unit performs morphological opening and closing operations on this global lesion binary mask to remove local holes and isolated noise points, and uses the Suzuki contour search algorithm to find the edges. This is a well-known image processing technique in the field and will not be described in detail here.

[0143] To eliminate pores and local noise interference within the lesions, the edge computing unit calculates the contour area of ​​all identified contours and extracts the outermost closed contour with the largest area as the effective boundary. After edge tracking, the edge computing unit obtains the initial two-dimensional discrete geometric contour point set of the lesions. The two-dimensional pixel coordinates of this point set All are absolute 16-bit pixel coordinates relative to the origin of the full-resolution visible light image. This represents the total number of contour vertices contained in the closed contour. Represents the first point in the point set. Each contour vertex, whose corresponding two-dimensional pixel coordinates in a full-resolution visible light image are represented as follows: All contour vertices in the point set are arranged in an ordered manner according to their spatial adjacency along the boundary, either clockwise or counterclockwise, such that the contour vertices... The vertices of the precursor contour are The subsequent contour vertices are .

[0144] S304, the edge computing unit extracts the multi-dimensional spatial features corresponding to the contour vertices and performs extreme value normalization processing. The edge computing unit targets the initial two-dimensional discrete geometric contour point set. Each contour vertex in Calculate the geometric and spatial features in three dimensions.

[0145] The first feature is the spatial gradient magnitude of the vegetation index. The edge computing unit calculates its inverse matrix using the pose compensation homography matrix established in the preceding steps. The edge computing unit extracts the vertices of the contour. Two-dimensional pixel coordinates After converting it to three-dimensional homogeneous coordinates, multiply it by the inverse matrix on the left. Then, a dimensionality reduction mapping is performed, that is, dividing by the third scalar component of the transformed vector to obtain two-dimensional coordinates mapped to the multispectral image spatial coordinate system. Edge computing units are located within the effective vegetation index matrix. In this study, bilinear interpolation was used to obtain the vegetation index values ​​at the mapped locations.

[0146] The edge computing unit uses the Sobel operator to calculate the vegetation index differential gradient components in the horizontal and vertical directions at that location, and then calculates the root mean square of the sum of the squares of the two components, which is used as the spatial gradient magnitude of the vegetation index at that contour vertex. The spatial gradient magnitude of this vegetation index represents the rate of spatial variation of the lesion edge along the vegetation index distribution.

[0147] The second feature is local geometric curvature. Edge computing units extract contour vertices. and its adjacent precursor contour vertices With subsequent contour vertices Construct from the current contour vertices Pointing to the apex of the precursor profile The first direction vector, and the vector formed by the current contour vertex. Point to the successor contour vertex The second direction vector. The edge computing unit calculates the dot product of the first and second direction vectors and divides it by the product of the magnitudes of the two vectors to obtain the cosine of the angle between the two line segments. The edge computing unit uses this cosine value to characterize the local geometric curvature of the contour vertex. The curvature reflects the degree of local concavity, convexity, and angular deformation of the target boundary.

[0148] The third characteristic is the chord deviation distance. Edge computing units connect to the vertices of the predecessor contour. With subsequent contour vertices Construct a straight line segment and calculate the current contour vertices. Two-dimensional pixel coordinates The vertical pixel distance to this line segment is used as the chord offset distance. This distance measures the structural weight of preserving the current contour vertices in maintaining the local geometric features of the original polygon.

[0149] After completing the feature calculations for all contour vertices, the edge computing unit searches for the maximum and minimum values ​​of each of the three features within the entire contour point set. It then subtracts the minimum value of the corresponding feature in the initial two-dimensional discrete geometric contour point set from the feature value of the current contour vertex, and divides this result by the difference between the maximum and minimum values ​​of the corresponding feature in the initial two-dimensional discrete geometric contour point set. Through this linear extremum scaling operation, the edge computing unit maps the feature data of each contour vertex to a dimensionless interval of 0 to 1, aligning the data distributions of different physical dimensions.

[0150] To avoid anomalies caused by consistent eigenvalues, the normalization calculation formula is uniformly set as follows:

[0151] ;

[0152] in, This represents the normalized feature result; This represents the original numerical value of the basic input features; and These represent the maximum and minimum values ​​of the feature within the entire set of contour points, respectively. This is a very small floating-point constant set to prevent overflow errors caused by a zero denominator. The edge computing unit uses this rule to obtain the normalized vegetation index spatial gradient magnitude for each contour vertex. Normalized geometric curvature and normalized chord deviation distance .

[0153] S305, the edge computing unit constructs a vertex-preserving weighted scoring function through multi-dimensional spatial feature fusion and calculates the score. The edge computing unit combines the above three normalized feature indicators and uses a predefined weighted fusion model to calculate the comprehensive weight score for each contour vertex.

[0154] The formula for calculating the weighted scoring function is:

[0155] ;

[0156] in, Represents the first point in the set. The overall weight score of each contour vertex; This represents the spatial gradient magnitude of the normalized vegetation index; Represents normalized geometric curvature; Indicates the deviation distance from the normalized chord; , as well as These represent the fusion weight coefficients for each corresponding feature. The three fusion weight coefficients satisfy the mathematical constraints. .

[0157] The specific numerical configuration of the fusion weighting coefficients is set based on the morphological and phenotypic characteristics of the target forestry diseases. For diseases that mainly exhibit obvious chlorosis or spectral reflectance decay at the boundary, The value is set to be higher than and The numerical value; for diseases where the lesion boundaries themselves exhibit complex serrated or irregular perforation patterns, and The value is adjusted accordingly. The edge computing unit sequentially calculates the comprehensive weight score of all initial contour vertices. The initial set of two-dimensional discrete geometric contour points with score labels is stored in the internal system cache and used as the data basis for subsequent simplification, compression and matching calculations.

[0158] See attached document Figure 6 This invention provides a forest pest and disease image recognition method based on edge computing. The specific implementation method in the stages of evaluating communication link capacity and performing adaptive dimensionality reduction encoding and transmission is as follows.

[0159] S401, the edge computing unit evaluates the payload of the wireless communication link and calculates the remaining bytes. The edge computing unit queries the underlying hardware register status of the internal communication module to obtain the maximum application layer payload parameter corresponding to the current communication protocol. This parameter defines the maximum total number of bytes that a single application layer message can carry.

[0160] Since the communication data packets typically contain fixed information such as the device physical address, data acquisition timestamp, geometric encoding mode, and spatial absolute coordinates and 3D pose quaternions at the acquisition time (as position and attitude data), camera calibration configuration ID, approximate depth parameters, number of vertices, pest and disease category labels, and cyclic redundancy check codes, the edge computing unit subtracts the number of bytes occupied by the fixed fields of the aforementioned basic messages from the maximum application layer payload parameters to obtain the net payload bytes available for transmitting geometric coordinate data. The number of bytes occupied by the fixed fields is a preset fixed constant based on the communication protocol format set by the system, with its actual value ranging from 64 bytes to 128 bytes.

[0161] After calculating the net payload in bytes, the edge computing unit determines whether the maximum application layer payload parameter is greater than the number of bytes occupied by the fixed field. If the maximum application layer payload parameter is less than or equal to the number of bytes occupied by the fixed field, the current channel is determined to be in a congested or abnormal configuration state. The edge computing unit directly determines that the maximum number of vertices that a single physical communication can accommodate is 0, triggers the point alarm mode, and skips the subsequent capacity calculation process.

[0162] S402, the edge computing unit calculates the maximum number of 2D pixel coordinates that can be accommodated in a single physical communication. If the maximum application layer payload parameter is greater than the number of bytes occupied by the fixed field, the edge computing unit will use the 2D pixel coordinates of a single contour vertex. The numerical values ​​are converted to an unsigned 16-bit integer format. Based on this format conversion, the edge computing unit determines that the coordinates of a single vertex occupy a fixed 4 bytes of storage space, with the x-coordinate and y-coordinate each occupying 2 bytes.

[0163] The edge computing unit combines the net payload bytes with the fixed storage space occupied by a single vertex to calculate the maximum number of vertices that can be accommodated in a single physical communication. The formula for calculating the maximum number of vertices is:

[0164] ;

[0165] in, This indicates the maximum number of vertices that can be accommodated in a single physical communication. Indicates the maximum application layer payload; Indicates the number of bytes occupied by a fixed field; The fixed number of bytes used to represent the two-dimensional pixel coordinates of a single contour vertex is configured to 4; This represents the floor function. The maximum number of vertices reflects the maximum transmission capacity of the current narrowband channel for the geometric details of the defect within a single transmission cycle.

[0166] S403, the edge computing unit performs dimensionality reduction by directly preserving or topologically order-preserving rearrangement based on the maximum number of vertices. The edge computing unit compares the total number of contour vertices contained in the initial two-dimensional discrete geometric contour point set. With the maximum number of vertices The size relationship between the contour vertices. If the total number of contour vertices... Less than or equal to the maximum number of vertices The current channel capacity is determined to be sufficient. The edge computing unit directly retains all vertices in the initial two-dimensional discrete geometric contour point set as the vertex set to be transmitted and assigns them a full contour encoding mode, maintaining their original clockwise or counterclockwise spatial adjacency order.

[0167] If the maximum number of vertices satisfy The edge computing unit performs a polygon topology-preserving rearrangement operation. The preset topology dimensionality reduction switching threshold is typically configured to be between 8 and 15, depending on the minimum discriminative requirement of the reconstructed polygons. In this operation, the edge computing unit reads the combined weight score of all vertices from its internal system cache. Sort the results in descending order of numerical value, and then select the top-scoring results. A contour vertex.

[0168] To avoid topological anomalies such as line segment intersections and self-intersections when reconstructing polygon boundaries based on discrete coordinates at the receiving end, the edge computing unit needs to restore the spatial connectivity of the aforementioned high-resolution vertices. The edge computing unit extracts this... The original index numbers of the contour vertices in the initial point set are used to rearrange the retained vertices in ascending order based on the original index numbers, restoring their ordered connection relationships in physical space as the vertex set to be transmitted and assigning them a dimension-reduced contour encoding mode. The edge computing unit performs line segment intersection detection on adjacent non-connected edges of the rearranged polygon. If self-intersection is detected, the connection topology is adjusted using a local two-way exchange method until the self-intersection is eliminated; if it still cannot be eliminated, it is directly downgraded to performing circumscribed convex hull dimension reduction operation.

[0169] S404, edge computing units should perform convex hull extraction or bounding box dimensionality reduction in situations with severely limited channel access. (The maximum number of vertices is likely an error and can be omitted.) satisfy If the channel capacity is limited, the edge computing unit extracts the circumscribed convex hull from the initial two-dimensional discrete geometric contour point set. The calculation of the circumscribed convex hull of the two-dimensional discrete point set can be performed using the Graham scan algorithm, which is a well-known technique in the field and will not be elaborated upon here. If the number of vertices contained in the extracted circumscribed convex hull is less than or equal to the maximum number of vertices... The edge computing unit directly uses all the vertices of the outer convex hull as the set of vertices to be transmitted and assigns them the convex hull encoding mode.

[0170] If the number of vertices contained in the extracted circumcircle is still greater than the maximum number of vertices. The edge computing unit performs dimensionality reduction of the bounding box, extracting the orthogonal bounding box that encloses the initial point set. The edge computing unit traverses the two-dimensional pixel coordinates of all vertices in the initial point set, extracting the minimum and maximum values ​​of the x-coordinate and y-coordinate. The minimum x-coordinate and minimum y-coordinate are combined to generate the top-left extreme vertex, and the maximum x-coordinate and maximum y-coordinate are combined to generate the bottom-right extreme vertex. The orthogonal bounding box consists only of these two extreme vertices, thus generating a constant set of two vertices to be transmitted and assigning them a bounding box encoding mode.

[0171] If the maximum number of vertices If the value is less than 2, it is determined that the current channel payload cannot transmit any polygon vertex data. The edge computing unit discards all geometric coordinate data, generates only an empty set without coordinates as the vertex set to be transmitted, and sets the geometric encoding mode to point alarm or no geometry mode to ensure the continuity of subsequent data packet assembly logic when the channel quality is poor.

[0172] S405, the edge computing unit executes a data packaging and asynchronous retransmission queue management mechanism. The edge computing unit concatenates and encapsulates the aforementioned geometric encoding pattern, the absolute spatial coordinates of the acquisition time (serving as position and attitude data), the 3D attitude quaternions at the acquisition time, the camera calibration configuration ID, approximate depth parameters, number of vertices, pest / disease category labels, data acquisition timestamp, device physical address, and the 2D pixel coordinates of the vertex set to be transmitted, according to a predetermined communication protocol serialization format, generating a complete communication data packet. After assembly, the edge computing unit sends this communication data packet to the microcontroller via the internal bus, whereby the microcontroller writes it into the asynchronous retransmission queue in its associated non-volatile memory. Subsequently, the microcontroller controls the power management module to cut off the power supply to the edge computing unit, and the edge computing unit enters a power-off sleep state.

[0173] During operation, the microcontroller operates independently and continuously monitors the link connectivity status signal fed back by the communication module via its internal bus. When the link connectivity status signal indicates that the network channel is idle and the physical layer connection is successful, the microcontroller reads the oldest temporarily stored communication data packet from the head of the asynchronous retransmission queue and drives the communication module to send radio frequency signals to the cloud platform.

[0174] If a network interruption causes a connection timeout, or if the receiver returns a failure acknowledgment signal due to a verification error, the microcontroller immediately terminates the current transmission process, retaining the communication data packet in the asynchronous retransmission queue. Once the communication module re-enters the network and updates the link connectivity signal, the microcontroller automatically resumes the queue retrieval logic and initiates the retransmission of the backlogged historical communication data packets in sequence. This mechanism is used to prevent the loss of monitoring data during network offline periods when a network connection is interrupted, and to automatically synchronize historical data after communication is restored.

[0175] See attached document Figure 7 This invention provides a forest pest and disease image recognition method based on edge computing. The specific implementation method for vector feature restoration and visualization reconstruction rendering stage on the cloud platform is as follows.

[0176] The S501 cloud platform parses communication data packets and performs inverse coordinate transformation of the global reference coordinate system. The cloud platform receives radio frequency signals sent by the edge computing unit, demodulates and extracts the communication data packets, and performs deserialization decoding according to a predetermined communication protocol. From the decoded data, it separates the device physical address, data acquisition timestamp, geometric encoding mode, and the absolute spatial coordinates and 3D pose quaternions at the acquisition time (as position and attitude data), camera calibration configuration ID, approximate depth parameters, number of vertices, pest / disease category labels, and the 2D pixel coordinate sequence of the vertex set to be transmitted. The cloud platform uses a cyclic redundancy check (CRC) code to verify the data integrity. If the verification fails, a retransmission command is sent to the corresponding device; if the verification succeeds, the coordinate restoration process begins.

[0177] The two-dimensional pixel coordinates uploaded by the edge computing unit are absolute pixel coordinates with the top-left corner of the full-resolution visible light image as the origin. The horizontal and vertical coordinates are represented by 16-bit unsigned integers. The cloud platform no longer relies on preset fixed monitoring station locations but directly reads the decoded camera calibration configuration ID to query the internal database and obtain the visible light camera intrinsic parameter matrix and dual-camera static extrinsic parameter matrix of the edge computing inspection terminal. The cloud platform calls the digital elevation model data from the forest area geographic information system, combines it with approximate depth parameters to extract the current canopy reference elevation surface, and uses the inverse perspective projection transformation matrix, the absolute spatial coordinates at the acquisition time, and the three-dimensional attitude quaternions at the acquisition time, combined with the geometric intersection constraints formed by the canopy reference elevation surface, to perform inverse coordinate transformation calculations on each two-dimensional pixel coordinate.

[0178] The specific process of performing the inverse coordinate transformation calculation is as follows:

[0179] The three-dimensional attitude quaternion at the acquisition time is combined with the static extrinsic matrix of the two cameras to convert it into the global camera rotation matrix, and the spatial absolute coordinates at the acquisition time are converted into the three-dimensional coordinates of the optical center of the global camera.

[0180] The two-dimensional pixel coordinates to be transformed are converted into homogeneous coordinate vectors, and then multiplied by the inverse of the visible light camera intrinsic parameter matrix (i.e., the inverse perspective projection transformation matrix) to obtain the ray direction vector in the camera coordinate system. The global camera rotation matrix is ​​then used to transform the ray direction vector to the global reference coordinate system to obtain the global ray direction vector.

[0181] A three-dimensional spatial ray equation is constructed, starting from the three-dimensional coordinates of the global camera optical center and taking the global ray direction vector as the direction. The vertical elevation component of the ray equation is equal to the elevation value of the canopy reference elevation surface as a geometric intersection constraint condition. The intersection point of the ray and the elevation surface is calculated, and the global Cartesian three-dimensional spatial coordinates of the intersection point are obtained.

[0182] Using an Earth ellipsoid reference model (such as the WGS84 model), the global Cartesian three-dimensional spatial coordinates obtained through inverse transformation are mapped to absolute latitude and longitude coordinates in a global reference coordinate system, forming a global discrete vertex sequence.

[0183] In S502, the cloud platform uses a parametric interpolation algorithm to generate a continuous, smooth curve from the global discrete vertex sequence. The cloud platform then determines the required reconstruction logic based on the parsed geometric encoding pattern and the number of vertices contained in the global discrete vertex sequence.

[0184] When the geometric coding mode indicates an empty set or a single-point alarm, the cloud platform only marks the disease event at the corresponding spatial absolute coordinates on the map and does not perform polygon generation.

[0185] When the geometric encoding mode is indicated as convex hull type (i.e. convex hull encoding mode), the cloud platform directly connects the global discrete vertex sequence to form the polygon boundary;

[0186] When the geometric encoding mode is indicated as bounding box type (i.e. bounding box encoding mode) and the decoded two-dimensional pixel coordinate sequence contains two extreme vertices, the cloud platform uses the two-dimensional pixel coordinates of these two extreme vertices to generate the coordinates of the four pixel corners of an orthogonal rectangle. Then, the aforementioned inverse coordinate transformation calculation is performed on these four pixel corner coordinates respectively, and they are connected in sequence to generate the quadrilateral projection boundary in the global reference coordinate system.

[0187] When the geometric coding pattern indicates a contour type (i.e., a full contour or reduced-dimensional contour coding pattern, and the sequence contains more than 2 vertices), the cloud platform uses a uniform Catmull-Rom spline interpolation algorithm to perform continuous curve smoothing on discrete vertices in order to reconstruct the continuous closed polygonal boundary of the lesion.

[0188] To ensure the boundary closure of the reconstructed polygons and the legality of the algorithm's addressing, the cloud platform performs cyclic expansion assignments on both ends of the global discrete vertex sequence. The original sequence is set to contain... There are vertices, whose index subscripts are . The value ranges from 1 to The cloud platform will index it as The vertex coordinate data of vertex 0 is copied and added to the beginning of the sequence as the 0th virtual vertex. Simultaneously, the vertex coordinate data of vertices with indices 1 and 2 are copied and added to the end of the sequence as the 0th virtual vertex. and A virtual vertex.

[0189] Let the four consecutive adjacent control vertices in the global discrete vertex sequence be defined as follows: At the central vertex and Interpolation points that generate a smooth transition between them are calculated using the following formula:

[0190] ;

[0191] in, Indicates the interpolation step size parameter The smooth interpolation point coordinate vector generated under constraints; The interpolation step size parameter represents a continuously changing value, ranging from 0 to 1; These represent the coordinate vectors of the four adjacent discrete control vertices in the global reference coordinate system. The cloud platform traverses all nodes in the global discrete vertex sequence, continuously increasing the interpolation step size parameter. This generates dense interpolation points, producing a continuous boundary equation that passes through all transit vertices.

[0192] After generating the interpolation curve, the cloud platform performs self-intersection detection and boundary crossing detection on the continuous boundaries. If the interpolation curve is detected to have self-intersection or exceed the preset buffer range of the original discrete polygon, the spline curve is discarded and a piecewise straight line is used to connect the global discrete vertices to ensure topological legality.

[0193] S503, the cloud platform calls the prior pest and disease feature library based on the pest and disease category label. The cloud platform pre-builds and maintains a prior pest and disease feature library within the system. This library stores texture mapping field data of various common forest pests and diseases at different disease stages in the form of a mapping matrix, including the color distribution values ​​of the corresponding diseased tissues, the spatial distribution characteristics of necrotic spots, and the dataset of leaf perforation morphology.

[0194] The cloud platform extracts the decoded pest and disease category tags and uses them as the query key to match the corresponding target texture mapping field in the prior pest and disease feature library. Furthermore, the cloud platform combines the data collection timestamp to extract specific texture matrix blocks that conform to the phenological characteristics of the current season from the target texture mapping field and loads them into the video memory of the graphics rendering module as texture source data.

[0195] S504, the cloud platform performs semantic rasterization rendering under the constraints of continuous boundary equations to reconstruct the distribution pattern of diseases. The cloud platform loads the corresponding wide-area forest 2D electronic map base map in the main interface of the visualization management system, and delineates the closed polygonal region to be rendered on the electronic map based on the aforementioned calculated continuous boundary equations.

[0196] For the rasterization enumeration and discretization filling traversal of pixels within a closed polygon region, those skilled in the art can use the polygon horizontal scan line algorithm, which is a well-known graphics technique in this field and will not be elaborated here. During the rasterization process, the cloud platform reads the target texture mapping field data from the video memory and maps the color pixels of the pathological texture point-to-point onto the base map raster points within the closed polygon region.

[0197] At the boundary coordinates of the closed polygon region, the cloud platform performs an opacity attenuation blending operation. The cloud platform sets a boundary buffer distance threshold, which is dynamically calculated based on the rendering level of the current 2D electronic map base map and the screen pixel scaling ratio. For rendered pixels within the buffer distance range, the cloud platform calculates the shortest Euclidean distance from the pixel coordinates to the continuous boundary equation. The cloud platform divides the shortest Euclidean distance by the boundary buffer distance threshold to obtain a linear attenuation coefficient between 0 and 1. The cloud platform uses this attenuation coefficient as the alpha channel value of the target texture mapping field data at the corresponding pixel, resulting in a smooth pixel blending transition between the rendered area and the electronic map base map. This reconstruction operation restores the discrete geometric data transmitted at low bit rates to continuous image pixel surfaces, providing map overlay data for analyzing disaster evolution areas.

[0198] To further illustrate the technical solution and practical application effects of the present invention, a specific application embodiment of the forest pest and disease image recognition method based on edge computing is provided below, in conjunction with the aforementioned calculation formula and operating logic. In this embodiment, the target forest area is set as a Masson pine forest area, and the main disease target monitored is pine wilt disease (manifested as abnormal discoloration and decay of the tree crown).

[0199] A multispectral camera continuously outputs images. Assume that at a certain sampling time, the value of a pixel in the downsampled near-infrared image matrix is... The values ​​of the red band image matrix are .

[0200] The microcontroller uses the formula to calculate the normalized vegetation index matrix:

[0201] ;

[0202] The system presets a lower threshold for near-infrared intensity. Vegetation foreground threshold Since 0.28 ≥ 0.20 and 0.40 ≥ 0.35, this point satisfies the conditions for constructing a vegetation foreground mask. .

[0203] Furthermore, the threshold for healthy vegetation is set as follows: Due to the numerical value of the effective vegetation index matrix. This region was marked as a binary anomaly mask. .

[0204] According to the microcontroller's statistics, the total area of ​​the connected domain in the suspected vegetation anomaly region reached 450 pixels, exceeding the preset area threshold (400 pixels). Simultaneously, the microcontroller, in conjunction with the positioning and attitude determination module, calculated the three-dimensional linear displacement. Exceeding the preset displacement threshold When the combined triggering condition is met, the microcontroller sends a hardware interrupt signal.

[0205] The system enters the wake-up time window, and the microcontroller extracts the pose increment quaternion. The edge computing unit constructs a pose-compensated homography matrix, maps the multispectral spatial coordinates to generate a visible light binary mask, and uses it to perform region of interest masking and local image cropping operations on the full-resolution visible light image, outputting a cropped image matrix containing real lesion features.

[0206] The edge computing unit inputs the cropped image matrix into the lightweight instance segmentation network, outputting a pest / disease category label (pine wilt disease) and an initial two-dimensional discrete geometric contour point set. The boundary of the lesion is then extracted to... A contour vertex.

[0207] Based on the obvious discoloration characteristic of this disease, the feature fusion weighting coefficients were set as follows: , , Substituting edge computing units into the formula Calculate the comprehensive weight score of the 15 vertices (e.g.) Figure 8 (as shown), and cache the scores.

[0208] The edge computing unit queries the communication module to obtain the current maximum application layer payload parameters. Fixed field size in bytes A single vertex occupies .

[0209] Calculate the maximum number of vertices that can be accommodated in a single physical communication. Due to the total number of contour vertices If 9 < 15, the channel is considered limited. The edge computing unit performs a topology order-preserving rearrangement and dimensionality reduction operation, sorting the vertices in descending order according to the comprehensive weight score, extracting and retaining the top 9 contour vertices with the highest scores, and then rearranging them in ascending order according to the original spatial adjacency relationship to avoid self-intersection, generating a set of vertices to be transmitted and encapsulating them into a communication data packet for uploading.

[0210] The cloud platform decodes the received sequence containing 9 vertices and performs an inverse coordinate transformation to form a globally discrete vertex sequence. To smoothly reconstruct the lesion shape, the cloud platform applies a parameterized interpolation algorithm using uniform Catmull-Rom splines to the sequence according to a predetermined formula, generating smoothly transitioning interpolation points between the central vertices and reconstructing a closed, continuous boundary equation (such as...). Figure 9 As shown in the figure, semantic rasterization rendering is finally performed on the electronic map by combining the texture mapping field.

[0211] To verify the communication performance of this invention in a restricted wireless network environment, experiments and data comparisons were conducted on the same hardware platform, with the maximum application layer payload fixed at 100 bytes. If a lossless full-transmission strategy is used, 15 contour vertices would require 124 bytes, exceeding the payload limit and causing message truncation. In this case, the success rate of a single communication approached 0%, and the backend geometric parsing would completely fail.

[0212] If the traditional bounding box transmission strategy is used, only two extreme vertices are transmitted at a time. Due to the small amount of data, the communication success rate can be maintained at a high level (such as above 98%), but the reconstruction geometry fidelity (intersection over union with the real mask) is only 54.3%, which cannot effectively reflect the actual boundary details of the lesions.

[0213] After adopting the adaptive topology order-preserving dimensionality reduction and interpolation reconstruction strategy of this invention, the system dynamically transmits the nine highest-weighted vertices according to the load limit. This method effectively avoids the risk of truncation caused by message overload, keeping the single communication success rate at a stable level of over 98%, while the reconstruction geometry fidelity reaches 89.6%.

[0214] See attached document Figure 8 The horizontal axis of the graph represents the index number of the vertices of the initial two-dimensional discrete geometric contour, ranging from 1 to 15; the vertical axis represents the comprehensive weight score, ranging from 0.1 to 1.0. The black broken line in the graph represents the score distribution trend, showing an overall fluctuating trend.

[0215] This zigzag pattern is determined by the local characteristics of different vertices. The spatial gradient magnitude of the vegetation index, local geometric curvature, and chord deviation distance of each vertex have objective differences. Vertices located at the corners of lesions or at color abrupt changes receive higher comprehensive scores, while vertices located at gentle edges receive relatively lower scores.

[0216] In the diagram, the hollow circles at the lower positions represent contour vertices that trigger dimensionality reduction and culling, while the solid dark gray squares at the higher positions represent vertices to be transmitted and preserved through order-preserving rearrangement. With a maximum of nine vertices allowed per communication, the system performs dimensionality reduction based on scores, extracting the top nine highest-scoring vertices and discarding the remaining six low-scoring vertices. This diagram illustrates the specific execution logic of the system relying on quantized scores to select and retain morphological feature points of lesions when channel capacity is limited.

[0217] See attached document Figure 9 This figure shows the result of restoring the geometric shape of lesions after combining edge computing dimensionality reduction extraction with cloud interpolation reconstruction. The horizontal axis is the global baseline relative to the horizontal axis, and the vertical axis is the global baseline relative to the vertical axis.

[0218] The black dashed lines in the diagram represent the initial true polygonal outline of the lesions. Their direction includes irregular jagged edges and concave / convex corners, indicating the original computational boundary identified locally by the edge device. The dark gray solid squares in the diagram represent the global discrete vertices actually received by the cloud, i.e. Figure 8 The nine vertices that were successfully transmitted after screening are located at key turning points on the original boundary.

[0219] The solid black line in the diagram represents the continuous boundary of the parametric interpolation algorithm, which appears as a continuous, smooth, closed curve. The cloud platform applied the uniform Catmull-Rom spline interpolation algorithm to the nine received discrete vertices, generating transition points between the vertices. This ensures that the solid line passes through all the dark gray solid squares and maintains a similar overall shape to the trend of the black dashed line. Figure 9This indicates that the system, while reducing the amount of data transmitted, restored the outline and coverage of lesions through interpolation algorithms, thus adapting to the bandwidth-constrained monitoring environment in forest areas.

[0220] While specific embodiments of the present invention have been described above, those skilled in the art should understand that these specific embodiments are merely illustrative. Those skilled in the art can omit, substitute, and modify the details of the above methods and systems in various ways without departing from the principles and essence of the present invention. For example, combining the above method steps to perform substantially the same function and achieve substantially the same result using substantially the same method falls within the scope of the present invention.

Claims

1. A forest pest and disease image recognition method based on edge computing, characterized in that, Includes the following steps: The edge computing inspection terminal continuously collects spectral images, spatial absolute coordinate data, and three-dimensional pose quaternions. Based on the spectral images and spatial absolute coordinate data, it determines the joint triggering conditions. When the joint triggering conditions are met, it extracts the set of two-dimensional discrete connected domain boundary coordinates of the suspected vegetation anomaly area and sends a hardware interrupt signal. The power management module connects the power supply current of the edge computing unit and the visible light camera according to the hardware interrupt signal. The edge computing unit combines the three-dimensional pose quaternion with the spatial absolute coordinate data to construct a pose compensation homography matrix, and maps the two-dimensional discrete connected domain boundary coordinate set to generate a visible light binary mask. The visible light binary mask is used to extract and crop the image matrix from the full-resolution visible light image. The edge computing unit inputs the cropped image matrix into the lightweight instance segmentation network to obtain the pest and disease category labels and the initial two-dimensional discrete geometric contour point set, and calculates the comprehensive weight score of each contour vertex. The edge computing unit calculates the maximum number of vertices, performs adaptive dimensionality reduction encoding based on the maximum number of vertices and the comprehensive weight score, and generates a communication data packet containing the set of vertices to be transmitted, pest category labels, position and pose data and geometric encoding pattern, which is then sent by the microcontroller. The cloud platform receives and decodes the communication data packets, performs inverse coordinate transformation calculations on the set of vertices to be transmitted in conjunction with the position and pose data to form a global discrete vertex sequence, reconstructs the target geometric boundary according to the geometric encoding mode, and performs semantic rasterization rendering based on the pest and disease category labels and the prior pest and disease feature library.

2. The forest pest and disease image recognition method based on edge computing according to claim 1, characterized in that, Based on the spectral image and the spatial absolute coordinate data, a joint triggering condition is determined. When the joint triggering condition is met, the set of two-dimensional discrete connected domain boundary coordinates of the suspected vegetation anomaly area is extracted and a hardware interrupt signal is sent, including: The microcontroller downsamples the spectral image to obtain an image matrix, calculates a normalized vegetation index matrix based on the image matrix, and constructs a vegetation foreground mask by combining the near-infrared intensity lower limit threshold and the vegetation foreground threshold. The vegetation foreground mask is multiplied element-wise with the normalized vegetation index matrix to generate an effective vegetation index matrix, and a binary anomaly mask is generated based on the effective vegetation index matrix. The three-dimensional linear displacement is obtained by calculating the difference between the spatial absolute coordinate data at the current sampling time and the previous triggering time. When the total pixel area of ​​the independent connected domains in the binary anomaly mask is not less than a preset area threshold, and the three-dimensional linear displacement is not less than a preset displacement threshold, the joint triggering condition is determined to be met, the boundary coordinates of the corresponding independent connected domains are extracted as the set of boundary coordinates of the two-dimensional discrete connected domains, and the hardware interrupt signal is sent.

3. The forest pest and disease image recognition method based on edge computing according to claim 2, characterized in that, The edge computing unit combines the three-dimensional pose quaternion with the spatial absolute coordinate data to construct a pose compensation homography matrix, including: Record the trigger time of the hardware interrupt signal and the ready time of the visible light camera, extract the three-dimensional attitude quaternion at the trigger time and the three-dimensional attitude quaternion at the ready time, and calculate the attitude increment quaternion. Extract the absolute spatial coordinate data at the triggering time and the absolute spatial coordinate data at the ready time, and calculate the spatial translation vector; The attitude increment quaternion is converted into an increment rotation matrix, and the spatial translation vector is converted to the visible light camera coordinate system to obtain the relative translation component; The pre-stored dual-camera static extrinsic matrix, visible light camera intrinsic matrix, and approximate depth parameters are retrieved, and the pose compensation homography matrix is ​​constructed by combining the incremental rotation matrix and the relative translation component.

4. The forest pest and disease image recognition method based on edge computing according to claim 3, characterized in that, A visible light binary mask is generated by mapping the set of two-dimensional discrete connected domain boundary coordinates of the suspected vegetation anomaly region. The visible light binary mask is then used to extract a cropped image matrix from the full-resolution visible light image, including: The set of boundary coordinates of the two-dimensional discrete connected domain is converted into a three-dimensional homogeneous coordinate vector, multiplied by the pose compensation homography matrix and normalized to reduce the dimension, and mapped to two-dimensional pixel coordinates in the visible light image matrix coordinate system. The visible light binary mask is generated by performing a polygon region scan line filling algorithm in a two-dimensional matrix space based on the two-dimensional pixel coordinates. The region of interest is extracted by performing a Hadamard product operation on the full-resolution visible light image and the visible light binary mask. A local sub-image is then cropped from the region of interest based on the minimum bounding rectangle of the non-zero region in the visible light binary mask, which is used as the cropped image matrix.

5. The forest pest and disease image recognition method based on edge computing according to claim 1, characterized in that, The edge computing unit inputs the cropped image matrix into the lightweight instance segmentation network to obtain pest and disease category labels and an initial two-dimensional discrete geometric contour point set, including: Perform bilinear interpolation and pixel value normalization on the cropped image matrix to generate three-dimensional tensor data; The three-dimensional tensor data is input into the lightweight instance segmentation network to obtain classification confidence scores, predicted bounding box coordinates, and binary segmentation masks. The pest / disease category label is saved when the classification confidence score is not less than the preset classification confidence threshold. The binary segmentation mask is restored to the full-resolution visible light image coordinate system to generate a global lesion binary mask. After performing morphological opening and closing operations, the edges are obtained, and the outermost closed contour with the largest area value is extracted as the initial two-dimensional discrete geometric contour point set.

6. The forest pest and disease image recognition method based on edge computing according to claim 1, characterized in that, The calculation of the comprehensive weight score for each contour vertex includes: Extract the multidimensional spatial features of each contour vertex in the initial two-dimensional discrete geometric contour point set, including the spatial gradient magnitude of the vegetation index, local geometric curvature, and chord deviation distance; The minimum value of the corresponding feature in the initial two-dimensional discrete geometric contour point set is subtracted from the feature value of the current contour vertex, and then divided by the difference between the maximum and minimum values ​​of the corresponding feature in the initial two-dimensional discrete geometric contour point set. The extreme value normalization process is then performed to obtain the normalized vegetation index spatial gradient magnitude, normalized geometric curvature, and normalized chord deviation distance. The comprehensive weight score is obtained by weighting and fusing the normalized vegetation index spatial gradient magnitude, the normalized geometric curvature, and the normalized chord deviation distance with the fusion weight coefficient.

7. The forest pest and disease image recognition method based on edge computing according to claim 1, characterized in that, The edge computing unit calculates the maximum number of vertices, including: To assess the payload of the wireless communication link, obtain the maximum application layer payload parameters corresponding to the current communication protocol, and calculate the net payload bytes after deducting the number of bytes occupied by the fixed fields of the basic message. When the maximum application layer payload parameter is greater than the number of bytes occupied by the fixed field, the maximum number of vertices that can be accommodated in a single physical communication is obtained by combining the net payload byte number with the fixed storage space occupied by a single vertex and rounding down.

8. The forest pest and disease image recognition method based on edge computing according to claim 1, characterized in that, Adaptive dimensionality reduction encoding is performed based on the maximum number of vertices and the comprehensive weight score to generate a communication data packet containing the vertex set to be transmitted, pest category labels, position and pose data, and geometric encoding pattern. This data packet is then sent via the microcontroller and includes: When the total number of contour vertices in the initial two-dimensional discrete geometric contour point set is not greater than the maximum number of vertices, all vertices are retained as the vertex set to be transmitted and assigned a full contour encoding mode. When the maximum number of vertices is not less than the topology dimensionality reduction switching threshold and is less than the total number of contour vertices, the maximum number of contour vertices are truncated in descending order according to the comprehensive weight score, and the spatial connectivity is restored by rearranging them in ascending order according to the original index number as the vertex set to be transmitted and assigned the dimensionality reduction contour encoding mode. When the maximum number of vertices is not less than the value of two and less than the topology dimensionality reduction switching threshold, and the maximum number of vertices is less than the total number of contour vertices, the outer convex hull of the initial two-dimensional discrete geometric contour point set is extracted to generate the vertex set to be transmitted and a convex hull encoding mode is assigned, or the outer bounding box is extracted to generate the vertex set to be transmitted and a bounding box encoding mode is assigned. When the maximum number of vertices is less than two, an empty set without geometric coordinates is generated as the vertex set to be transmitted, and a point alarm mode or a no-geometric-coding mode is assigned. The communication data packet is generated by concatenating and encapsulating the vertex set to be transmitted, the pest and disease category label, the currently acquired position and pose data, and the corresponding geometric encoding pattern. The data packet is then written into the asynchronous retransmission queue by the microcontroller and sent through the communication module.

9. A forest pest and disease image recognition method based on edge computing according to claim 8, characterized in that, Combining the position and pose data, perform an inverse coordinate transformation calculation on the set of vertices to be transmitted to form a global discrete vertex sequence, including: The two-dimensional pixel coordinates, camera calibration configuration ID, approximate depth parameters, and spatial absolute coordinates and three-dimensional pose quaternions at the acquisition time, which serve as the position and pose data, are extracted from the communication data packet. Read the visible light camera intrinsic parameter matrix and dual-camera static extrinsic parameter matrix associated with the camera calibration configuration ID, and use the digital elevation model data of the forest area geographic information system in combination with the approximate depth parameters to extract the canopy reference elevation surface; Using the inverse perspective projection transformation matrix, the absolute spatial coordinates at the acquisition time, and the three-dimensional pose quaternion at the acquisition time, combined with the geometric intersection constraints formed by the canopy reference elevation surface, the coordinates of each two-dimensional pixel are subjected to inverse coordinate transformation calculation, which is mapped to absolute latitude and longitude coordinates in the global reference coordinate system, thus forming the global discrete vertex sequence.

10. A forest pest and disease image recognition method based on edge computing according to claim 9, characterized in that, Reconstructing the target geometric boundary according to the geometric encoding pattern, and performing semantic rasterization rendering based on the pest and disease category labels combined with the prior pest and disease feature library, including: When the geometric encoding mode indicates a contour type, cyclic expansion assignment is performed on the first and last ends of the global discrete vertex sequence, and interpolation points are generated to form a continuous closed polygon boundary under the constraint of continuously changing interpolation step size parameters using the uniform Catmull-Rom spline interpolation algorithm. When the geometric encoding mode indicates a convex hull type, the global discrete vertex sequence is directly connected to form a polygon boundary; When the geometric encoding mode indicates a bounding box type, the two-dimensional pixel coordinates of the two extreme vertices separated by decoding are used to generate the pixel corner coordinates of four orthogonal rectangles. Then, the inverse coordinate transformation calculation is performed on the pixel corner coordinates of the four orthogonal rectangles respectively, and they are connected to form a polygon boundary. In the main interface of the visualization management system, the target rendering area is defined based on the reconstructed polygon boundaries; The disease and pest category labels obtained from the decoding are extracted and matched with the target texture mapping field in the prior disease and pest feature library. The color pixels of the target texture mapping field are mapped point-to-point to the base map raster points in the target rendering area. The semantic rasterization rendering is achieved by performing transparency attenuation blending operation within the boundary buffer distance threshold.