An image recognition-based macadamia disease detection and identification method

By employing image recognition-based methods, multi-angle data acquisition, and adaptive feature fusion technology, the accuracy and efficiency issues of macadamia nut disease identification were resolved, enabling efficient disease identification and precise prevention and control in complex environments.

CN121482468BActive Publication Date: 2026-07-31SOUTHWEST FORESTRY UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SOUTHWEST FORESTRY UNIVERSITY
Filing Date
2025-11-11
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies are insufficient in terms of accuracy, environmental adaptability, and identification efficiency in macadamia nut disease identification, and cannot meet the needs of modern precision agriculture.

Method used

An image recognition-based approach is adopted, which involves acquiring image data from multiple angles, data augmentation, multi-level high-resolution detail extraction, and adaptive feature fusion to achieve adaptive learning of disease features and resistance to interference from complex environments. Combined with a lightweight design, this improves recognition accuracy and efficiency.

Benefits of technology

It achieves efficient and accurate disease identification in complex environments, can quickly identify tiny lesions, reduces labor costs, is suitable for large-scale orchard disease monitoring, and supports precision prevention and control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121482468B_ABST
    Figure CN121482468B_ABST
Patent Text Reader

Abstract

This invention relates to the field of smart agriculture, specifically disclosing a method for detecting and identifying macadamia nut diseases based on image recognition, comprising the following steps: S100: Image data acquisition, acquiring high-definition digital images of the upper and middle leaves and fruits of macadamia nut trees from multiple angles under natural light conditions, including healthy leaves and diseased samples confirmed by agricultural experts on-site as anthracnose, leaf blight, and stem canker, and including different disease severity, leaf growth stages, and background environments; accurately labeling each acquired image to generate a dataset containing image file names and corresponding disease category labels; S200: Image input processing, using the dataset obtained in S100 as input data; S300: Image processing; S400: Obtaining the final recognition result; The technical solution of this invention can adaptively learn disease characteristics, resist interference from complex environments, and balance recognition accuracy and efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart agriculture, and in particular to a method for detecting and identifying diseases in macadamia nuts based on image recognition. Background Technology

[0002] Macadamia nuts, as one of the core economic crops of high-efficiency agriculture in tropical and subtropical regions, have seen their industry scale and economic benefits increase year by year, becoming an important pillar of agricultural economic growth in many areas. However, in the process of large-scale macadamia nut cultivation, diseases have always been a key bottleneck restricting yield improvement and quality assurance. Common diseases such as anthracnose, leaf blight, and stem canker are characterized by strong concealment and rapid spread. In the early stages of the disease, small lesions (such as chlorotic spots or water-soaked spots with a diameter of less than 2 mm) often form on the leaf surface. If they are not identified and controlled in time, the diseases will quickly spread to branches and fruits, leading to premature leaf drop, branch dieback, reduced fruit yield, and even the death of the entire plant, causing serious economic losses to growers and seriously threatening the sustainable development of the macadamia nut industry.

[0003] Currently, the identification of macadamia nut diseases in the field mainly relies on two types of technical solutions, but both have significant limitations and are difficult to meet the needs of modern precision agriculture.

[0004] The first category is traditional manual identification methods, which remain the mainstream choice for the vast majority of plantations. This method relies on plant protection technicians or experienced farmers conducting regular field inspections, visually observing changes in the shape and color of leaves and branches to determine the type of disease. However, its accuracy is highly dependent on the professional knowledge and practical experience of the operators, making it extremely subjective. Different people may give completely different diagnoses for the same lesion symptoms, leading to a high rate of misdiagnosis. At the same time, the human eye has limited discernment, easily missing small, atypical lesions in the early stages of disease, often missing the optimal window for prevention and control, allowing the disease to spread further. In addition, manual inspections consume a lot of manpower and are inefficient, making it difficult to cover the high-frequency monitoring needs of large-scale plantations.

[0005] The second category is recognition technology based on traditional image processing. This technology classifies diseases by manually designing features such as color and texture. While it demonstrates some recognition ability under controlled laboratory conditions (e.g., uniform lighting, clean background, and well-defined lesion samples), it suffers from significant limitations in complex field scenarios. Firstly, dynamic changes in light intensity in the natural environment (e.g., backlighting in the morning and evening, shadows during cloudy weather), high-light reflection from leaf surfaces, complex backgrounds composed of soil and weeds, and overlapping leaves can drastically reduce the stability of manually designed color features. This leads to feature confusion, with increased intra-class differences and decreased inter-class differences, blurring the classifier's decision boundaries and causing drastic fluctuations in recognition accuracy. Secondly, traditional image processing technology has limited ability to extract disease features, failing to effectively capture subtle differences in morphology and texture among different diseases, especially poor recognition of small lesions in the early stages of disease. Furthermore, this technology has low computational efficiency. With the expansion of macadamia nut cultivation and the increase in disease monitoring frequency, its recognition speed can no longer meet the demands of real-time diagnosis in practical applications, severely restricting its feasibility for deployment in field scenarios.

[0006] In summary, current technologies for identifying macadamia nut diseases have significant shortcomings in terms of accuracy, environmental adaptability, and efficiency, failing to meet the core requirements of modern precision agriculture for early disease detection and prevention. Therefore, developing an intelligent detection and identification method that can adaptively learn disease characteristics, resist interference from complex environments, and balance accuracy and efficiency is of great significance for promoting the high-quality development of the macadamia nut industry. Summary of the Invention

[0007] This invention provides a method for detecting and identifying macadamia nut diseases based on image recognition, which can adaptively learn disease features, resist interference from complex environments, and balance recognition accuracy and efficiency.

[0008] To solve the above-mentioned technical problems, this application provides the following technical solution: A method for detecting and identifying diseases in macadamia nuts based on image recognition, comprising the following steps: S100: Image data acquisition. High-resolution digital images of the upper and middle leaves and fruits of macadamia tree canopy are acquired from multiple angles under natural light conditions. The acquisition covers healthy leaves as well as diseased samples confirmed by agricultural experts on-site as anthracnose, leaf blight, and stem canker. The images include different disease severity, leaf growth stages, and background environments. Each acquired image is accurately labeled to generate a dataset containing image file names and corresponding disease category labels. S200: Image input processing, using the dataset obtained in S100 as input data. The training set images undergo data augmentation, including geometric transformations such as random rotation, horizontal and vertical flipping, and random scaling, as well as pixel transformations such as random brightness adjustment and addition of Gaussian noise. The images are then standardized by scaling all input images to a preset size while maintaining aspect ratio, resulting in the output feature map. ; S300: Image processing, converting the output feature map obtained from S200... The input is processed by a multi-level high-resolution detail extraction module, which extracts detail feature maps through initial convolution and a three-layer lightweight feature aggregation module. Simultaneously, the output feature map obtained from S200 is... The input is processed by the parallel double-sampling feature extraction module, and then fused through the downsampling branch and the upsampling branch respectively to obtain the semantic feature map. ; Detail feature map With semantic feature map The input to the adaptive feature fusion module is processed through channel adjustment, channel dimension concatenation, and attention mechanism to obtain the fused feature map. The main body loss is calculated based on a multi-level high-resolution detail extraction module, and the loss is calculated based on the fused feature map. Calculate the boundary loss and fuse the feature maps. Input a multi-scale detection head for detection and segmentation; S400: Obtain the final recognition result and display the obtained final recognition result.

[0009] The basic principle and beneficial effects of this invention are as follows: Through the process design of data acquisition, input processing, feature extraction and fusion, and result output, this invention breaks through the limitations of traditional manual and traditional image processing technologies, and realizes intelligent and accurate disease identification.

[0010] The S100 step involves acquiring images from multiple angles under natural lighting conditions, covering healthy samples as well as samples of typical diseases such as anthracnose, leaf blight, and stem canker. These images include varying degrees of disease severity, leaf growth stages, and background environments. Simultaneously, agricultural experts annotate these images to generate a labeled dataset. This process simulates complex real-world field scenarios, providing rich and realistic sample support for subsequent model training. It avoids overfitting the model to specific scenarios due to limited sample types, ensuring the model's adaptability to different field environments from the data source.

[0011] The S200 step first applies geometric transformations (such as random rotation, flipping, and scaling) and pixel transformations (such as adjusting brightness and adding Gaussian noise) to the training set images to simulate angular differences, lighting variations (such as morning and evening light, and cloudy shadows), and severe weather conditions (such as image noise on rainy days) in actual recognition. Then, through standardization, the images are uniformly scaled to a preset size while maintaining aspect ratio, eliminating the interference of image size differences on feature extraction. This step, through data augmentation and normalization, allows the model to learn the image feature variation patterns under complex environments in advance, reducing the impact of imaging condition fluctuations on feature representation and laying the foundation for subsequent accurate feature extraction.

[0012] The S300 stage employs a dual-branch extraction and adaptive fusion architecture. The multi-level high-resolution detail extraction module, through initial convolution and a three-layer lightweight feature aggregation module, focuses on minute details of the disease (such as the edges and textures of early lesions) to generate detailed feature maps. The parallel double-sampling feature extraction module generates a semantic feature map containing contextual information by fusing a downsampling branch (extracting global semantic features) with an upsampling branch (preserving local details). The two data points are adjusted and stitched together by an adaptive fusion module, and an attention mechanism is used to enhance key disease features and suppress background interference, ultimately generating a fused feature map. Meanwhile, by coordinating the calculation of subject loss (ensuring the accuracy of detail extraction) and boundary loss (optimizing the accuracy of lesion boundary segmentation), the accuracy of feature extraction and segmentation is further improved. Finally, the multi-scale detection head completes the disease classification and location.

[0013] From S100 data acquisition to S400 result output, no manual intervention is required throughout the entire process. Each step is designed in a modular fashion to achieve efficient data and feature transfer, avoiding the efficiency loss caused by manual feature design and multi-step connection in traditional technologies, and providing process assurance for rapid identification.

[0014] Leveraging the diverse labeled dataset S100 and the dual-branch feature extraction architecture S300, the model can automatically learn multi-level features of different diseases from massive datasets (such as the brown sunken texture of anthracnose lesions and the irregular yellowing edges of leaf blight), without the need for manual feature design. When a new disease category is added, only the corresponding labeled samples need to be added and the model retrained to autonomously learn the features of the new disease. This demonstrates good scalability and solves the problem of poor adaptability caused by the need to redesign features in traditional techniques.

[0015] The S200 data augmentation stage simulates complex environments such as changes in light intensity, angle differences, and noise from cloudy or rainy days, enabling the model to adapt to non-ideal imaging conditions in the field in advance. The attention mechanism of the S300 adaptive fusion module can suppress background interference such as soil, weeds, and leaf occlusion, and enhance disease feature signals. Even in scenarios with drastic fluctuations in natural light (such as strong midday light and weak evening light), overlapping leaf occlusion, or blurred images on cloudy or rainy days, the model can still stably extract disease features, avoiding the problem of a sharp drop in recognition accuracy caused by environmental deviations from ideal assumptions in traditional technologies, and significantly improving environmental robustness.

[0016] The multi-level high-resolution detail extraction module can capture early-stage micro-lesion features (such as chlorotic spots and water stains) with a diameter of less than 2 mm, solving the pain point of human eyes and traditional technologies missing early-stage diseases; the dual-branch feature fusion and loss function co-optimization enable the model to accurately identify disease categories and precisely segment lesion ranges, providing technical support for the plant protection principle of prevention first and integrated control, and can control diseases in the bud stage, reducing yield loss.

[0017] The S300 process employs a lightweight feature aggregation module and a dual-branch parallel processing architecture, significantly reducing the computational load of the model. The end-to-end design of the entire process reduces the time spent on manual intervention, and the process from image input to result output can be completed within seconds. The high detection speed can meet the needs of high-frequency disease monitoring in large-area orchards, reducing labor costs while achieving rapid disease early warning.

[0018] Standardized processing and lightweight modular design significantly reduce the number of model parameters and file size, resulting in low peak inference memory requirements and easy integration into mobile devices such as smartphones. Growers do not need specialized equipment; they can obtain disease identification results simply by taking images with their mobile devices. This convenient operation facilitates the widespread adoption of the technology in small and medium-sized plantations.

[0019] Compared to the shortcomings of traditional technologies in batch processing, this method, through process optimization and improved computational efficiency, can stably process large-scale image data (such as processing hundreds of orchard images at a time). Moreover, the recognition accuracy and speed are not affected by the batch size, making it suitable for the disease management needs of large-scale macadamia nut cultivation. It helps growers quickly grasp the distribution of diseases throughout the orchard, formulate precise prevention and control plans, and reduce pesticide overuse and control costs.

[0020] In summary, this invention achieves the goals of adaptive learning of disease characteristics, resistance to interference from complex environments, and a balance between recognition accuracy and efficiency.

[0021] Furthermore, the image normalization process in S200 is implemented according to the following formula:

[0022] in, Represents the x-coordinate of a point in the original image. Represents the ordinate of a point in the original image. The scaling factor represents the image. This represents the number of pixels needed to fill the left and right sides of the image. This represents the number of pixels needed to fill the upper and lower layers of the image. This represents the x-coordinate of a point on the scaled image. This represents the ordinate of a point on the scaled image.

[0023] Furthermore, the modeling process of the multi-level high-resolution detail extraction module in S300 is implemented according to the following formula:

[0024] in, This represents the detail feature map after high-resolution detail extraction. For lightweight feature aggregation module, The stride represents the step size. The initial convolution of the multi-level high-resolution detail extraction module is a 3×3 ordinary convolution with a stride of 1 and 32 channels. In the three-layer lightweight feature aggregation module, the first layer contains an ordinary convolution with 64 kernels and a stride of 1, and a depthwise separable convolution with 64 output channels and a stride of 1; the second layer contains an ordinary convolution with 128 kernels and a stride of 1, and a depthwise separable convolution with 128 output channels and a stride of 1; the third layer contains an ordinary convolution with 256 kernels and a stride of 1, and a depthwise separable convolution with 256 output channels and a stride of 1. The detail feature map obtained after detail feature extraction by the three-layer lightweight feature aggregation module is as follows: The size is 640×640×256.

[0025] Furthermore, when the lightweight feature aggregation module operates, the stride is 1, including: first, obtaining local features in the feature map through a 3×3 ordinary convolution to detect the basic features of the edges and corners of disease spots; second, using a 3×3 depthwise separable convolution to independently extract spatial features in each channel; then, using a channel attention module to automatically identify and assign higher weights to important feature channels; finally, bottleneck residual connections are made between the input and output feature maps to obtain the final output feature map.

[0026] Furthermore, the modeling process of the parallel double-sampling feature extraction module in S300 is implemented according to the following formula: ; ; ; in, The feature map representing the result obtained from the upsampling branch. The feature map representing the result obtained from the downsampling branch. The semantic feature map represents the final output; the working process of the parallel double-sampling feature extraction module includes: processing the output feature map obtained by S200... Inputting the downsampling branch and the upsampling branch respectively yields an output feature of size 160×160×512. and output features of size 640×640×256 ;right First, input a 1×1 convolution to change its channel count, then perform bilinear interpolation upsampling to resize it to 640×640×256; Input a 3×3 spatially preserves convolution, maintaining its size at 640×640×256; finally, ... and The fusion process involves several steps. First, the downsampled semantic features and upsampled detail features are concatenated along the channel dimension to obtain a feature map of size 640×640×512. Next, a 3×3 depthwise separable convolution with a stride of 1 is used to fuse relevant features along the spatial dimension, resulting in another feature map of size 640×640×512. Then, skip connections are used to obtain a feature map of size 640×640×768. Finally, a 1×1 convolution compresses the number of channels in the feature map to 640×640×512, yielding the final output semantic feature map. .

[0027] Furthermore, the specific steps of the downsampling branch module include: when the stride is 2, a 3×3 depthwise separable convolution is first used to extract spatial features while maintaining channel independence, and finally a 3×3 group convolution is used to expand the channels and extract higher-level semantic features; when the stride is 1, a 3×3 depthwise separable convolution is introduced to extract deep features and enhance local features.

[0028] Furthermore, the upsampling branch module includes the following steps: First, a 3×3 depthwise separable convolution with a stride of 1 is used to reduce the number of channels while retaining important feature information; second, a first progressive upsampling is performed to enlarge the feature map from 640×640 to 1280×1280, and then a 3×3 depthwise separable convolution with a stride of 1 is used to extract fine features in the larger receptive field; then, a second progressive upsampling is performed to transform the feature map into a high-resolution feature map of 2560×2560, and then a 3×3 depthwise separable convolution with a stride of 1 is used to extract even finer features in the larger receptive field; finally, spatial adaptive downsampling is used to resize the feature map to 640×640×256.

[0029] Furthermore, the modeling process of the adaptive feature fusion module in S300 is implemented according to the following formula:

[0030] in, The fused feature map represents the final output and has a size of 640×640×512. For channel attention module, This is a spatial attention module; the adaptive feature fusion module's operation includes: firstly, using a 1×1 convolution to fuse the semantic feature map... The number of channels was adjusted from 512 to 256 to align with the detail feature map. The number of channels must be kept consistent; secondly, the channel dimension splicing module will be used to... and The process involves fusing and preserving the detailed features of the multi-level high-resolution detail branches with the semantic context features of the parallel double-sampling branches. Then, a channel attention mechanism is used to classify disease features and highlight disease texture features, while a spatial attention mechanism suppresses interference from shadow occlusion in the image. Finally, a 3×3 fusion convolution outputs the final fused feature map. .

[0031] Furthermore, the steps of the channel attention mechanism module include: input ,in represent and Feature map after 1×1 convolution processing , These represent the height and width of the feature map, respectively. To determine the number of channels in the feature map, it is first passed through a global average pooling layer. The feature region is divided into 512 1×1 regions, and the average value of all pixel values ​​in these 512 feature regions is then taken. Next, a fully connected layer 1 is used to... Dimensionality reduction projection to Then, the important feature channels are activated by combining them using the ReLU activation function, while the minor feature combinations are suppressed to obtain... Then, input to fully connected layer 2 will... Upward projection to Finally, the numerical values ​​are normalized and the feature output is obtained by using the Sigmoid activation function. .

[0032] Furthermore, the steps of the spatial attention mechanism module include: first, input... The algorithm first reduces the influence of background interference and other regional feature channels in the input feature map through an average pooling operation, and then identifies the strongest disease feature response at each location in the input feature map through a max pooling process. Next, the results of the two pooling layers are concatenated to output a feature map with complementary information. Then, a 7×7 convolution is used to provide a larger receptive field to help the module determine the spatial distribution of disease features. Finally, the Sigmoid activation function is used to achieve numerical normalization and obtain the final output.

[0033] Furthermore, the imaging device in S100 is a digital camera or a smartphone, and the mobile terminal in S400 is a mobile phone, which displays the final recognition result obtained by S400 through a mobile phone APP.

[0034] Furthermore, in the multi-level high-resolution detail extraction module, 3×3 depthwise separable convolutions are used instead of the original 3×3 ordinary convolutions in the network structure, and lightweight bottleneck residual connection blocks are used instead of the original residual connections. The model parameter calculation is implemented according to the following formula:

[0035] in, , This represents the height and width of the output feature map. , Represents the number of input and output channels. , This represents the height and width of the convolution kernel. Attached Figure Description

[0036] Figure 1 This is a flowchart of a method for detecting and identifying macadamia nut diseases based on image recognition; Figure 2 This is a multi-level high-resolution detail feature extraction module (MHDE). Figure 3 LAF is a lightweight feature aggregation module; Figure 4 This is the parallel double-sampling feature extraction module DFEM; Figure 5 This is the downsampling DS branch; Figure 6 For upsampling the US branch; Figure 7 For adaptive feature fusion module AFFM; Figure 8 For the channel attention mechanism module (CAMM); Figure 9 For Spatial Attention Mechanism Module (SAMM); Figure 10 This is a partial original image; Figure 11 For the recognition result image; Figure 12 This is a logic block diagram of a macadamia nut disease detection and identification method based on image recognition. Detailed Implementation

[0037] The following detailed description illustrates the specific implementation method: A method for detecting and identifying macadamia nut diseases based on image recognition (e.g.) Figure 1 , Figure 12 (As shown), including the following steps: S100: Image data acquisition. High-resolution digital images of the upper and middle leaves and fruits of macadamia tree canopy are acquired from multiple angles under natural light conditions. The acquisition covers healthy leaves as well as diseased samples confirmed by agricultural experts on-site as anthracnose, leaf blight, and stem canker. The images include different disease severity, leaf growth stages, and background environments. Each acquired image is accurately labeled to generate a dataset containing image file names and corresponding disease category labels. S200: Image input processing, using the dataset obtained in S100 as input data. The training set images undergo data augmentation, including geometric transformations such as random rotation, horizontal and vertical flipping, and random scaling, as well as pixel transformations such as random brightness adjustment and addition of Gaussian noise. The images are then standardized by scaling all input images to a preset size while maintaining aspect ratio, resulting in the output feature map. ; S300: Image processing, converting the output feature map obtained from S200... The input is processed by a multi-level high-resolution detail extraction module, which extracts detail feature maps through initial convolution and a three-layer lightweight feature aggregation module. Simultaneously, the output feature map obtained from S200 is... The input is processed by the parallel double-sampling feature extraction module, and then fused through the downsampling branch and the upsampling branch respectively to obtain the semantic feature map. ; Detail feature map With semantic feature map The input to the adaptive feature fusion module is processed through channel adjustment, channel dimension concatenation, and attention mechanism to obtain the fused feature map. The main body loss is calculated based on a multi-level high-resolution detail extraction module, and the loss is calculated based on the fused feature map. Calculate the boundary loss and fuse the feature maps. Input a multi-scale detection head for detection and segmentation; S400: Obtain the final recognition result and display the obtained final recognition result.

[0038] In practical use, the above steps involve an image data acquisition end (using the camera of a smartphone or its shooting device), an image input end (a hardware device with data processing capabilities, such as a PC or server), an image processing end (a hardware device with data processing capabilities, such as a PC or server), and an image output end (in this embodiment, a smartphone is used).

[0039] Specifically, S100: Image Data Acquisition. Using a digital camera or smartphone with a resolution of at least 12 megapixels, high-resolution digital images of the upper and middle leaves and fruits of macadamia nut trees are acquired from multiple angles under natural lighting conditions (covering different weather conditions and time periods). The images must cover healthy leaves and be confirmed by agricultural experts on-site to be suffering from different typical diseases (at least including anthracnose, leaf blight, and stem canker). To ensure data diversity and representativeness, the images should include different disease severity levels (from initial small lesions to late-stage large necrotic patches), different leaf growth stages, and different background environments. Each acquired image is precisely labeled to generate a dataset containing image filenames and corresponding disease category labels. This dataset forms the basis for model training.

[0040] Step S200: The working process of the image input end includes: S210: The dataset processed in step s100 is used as... enter; S220: Perform data augmentation on the dataset images from step s100 (for the training phase) by applying a series of random transformations to the training set images, including geometric transformations and pixel transformations.

[0041] S230: It should be noted that geometric transformation is used to simulate different recognition angles in the actual recognition process; brightness adjustment in pixel transformation is to simulate the lighting at different times of the day; and Gaussian noise is to simulate the actual recognition situation on rainy days.

[0042] S240: Image Normalization: The normalization process is shown in formula (1): (1) S250: where x represents the x-coordinate of a point in the original image, y represents the y-coordinate of a point in the original image, and scale represents the image scaling factor. This represents the number of pixels needed to fill the left and right sides of the image. This represents the number of pixels needed to fill the upper and lower layers of the image. This represents the x-coordinate of a point on the scaled image. The ordinate of a point in the scaled image. The image normalization process is as follows: All input images are scaled to a fixed size of 640×640 as required by the model, while maintaining the aspect ratio of the image. Output.

[0043] S300: Image Processing Terminal Operation Process: S310: Multi-level High-resolution detail extraction (MHDE) module extracts the details obtained in step s250. The input is fed into the MHDE module for detailed feature extraction, and the modeling process is shown in formula (2): (2) in, This represents the feature map after high-resolution detail extraction. LFA is a lightweight feature aggregation module, and s represents the step size. The MHDE working process is as follows: The feature map obtained in step s250 is... The input is a 3×3 ordinary convolution with a stride of 1 and 32 channels. This is then fed into a three-layer LFA (Lightweight Feature Aggregation) module. The first layer is an LFA module containing an ordinary convolution with 64 kernels and a stride of 1, and a depthwise separable convolution DSConv with 64 output channels and a stride of 1. The second layer is an LFA module containing an ordinary convolution with 128 kernels and a stride of 1, and a depthwise separable convolution DSConv with 128 output channels and a stride of 1. The third layer is an LFA module containing an ordinary convolution with 256 kernels and a stride of 1, and a depthwise separable convolution DSConv with 256 output channels and a stride of 1. After detailed feature extraction by these three LFA modules, the desired feature is obtained. The size is 640×640×256.

[0044] The lightweight feature aggregation module LAF has the following specific steps: When the stride is 1, local features in the feature map are first obtained through a 3×3 ordinary convolution to detect basic features such as the edges and corners of lesions. Then, a 3×3 depthwise separable convolution DSConv is used to extract spatial features independently in each channel. After that, a channel attention module CA is used to automatically identify and assign higher weights to important feature channels. Finally, the input and output feature maps are connected by a bottleneck residual connection RC to obtain the final output feature map.

[0045] S320: Parallel Dual-sampling feature extraction module (DFEM): This module extracts the feature obtained in step s250. The DFEM module is used for downsampling, upsampling, and feature fusion. The modeling process is shown in formulas (3), (4), and (5): (3) (4) (5) in, , These represent the feature maps obtained from the upsampling (US) and downsampling (DS) branches, respectively. The fused feature map representing the final output, the DFEM process is as follows: The feature map obtained in step s250... Input the downsampling DS branch and the upsampling US branch respectively to obtain the output features. and The sizes are 160×160×512 and 640×640×256 respectively. First, input a 1×1 convolution, change its number of channels, then perform bilinear interpolation upsampling to resize it to 640×640×256. Input a 3×3 spatially preservative convolution, maintaining its size at 640×640×256, and finally... and Adding them together gives The feature map is 640×640×512 in size. The specific steps of the addition process are as follows: First, concatenate the CS (Sequential Convolutional Map) along the channel dimension to combine the downsampled semantic features and the upsampled detail features, resulting in a feature map of size 640×640×512. Next, use a 3×3 depthwise separable convolution DSConv (with a stride of 1) to fuse relevant features in the spatial dimension, obtaining another feature map of size 640×640×512. Then, use skip connections to obtain a feature map of size 640×640×768. Finally, use a 1×1 convolution to compress the number of channels in the feature map to 640×640×512, resulting in the final output. .

[0046] The DS module, a downsampling branch, operates as follows: With a stride of 2, a 3×3 depthwise separable convolution (DSConv) is first used to extract spatial features while maintaining channel independence. Finally, a 3×3 grouped convolution (Grouped conv) is used to expand the channels and extract higher-level semantic features. With a stride of 1, a 3×3 depthwise separable convolution (DSConv) is introduced to extract deep features and enhance local features.

[0047] The US (Upperware) module is an upsampling branch module. Its specific steps are as follows: First, a 3×3 depthwise separable convolution DSConv with a stride of 1 is used to reduce the number of channels while retaining important feature information. Second, a first progressive upsampling (PU) is performed to enlarge the feature map from 640×640 to 1280×1280. Then, a 3×3 depthwise separable convolution DSConv with a stride of 1 is used to extract fine features in the larger receptive field. After that, a second progressive upsampling PU is performed to transform the feature map into a high-resolution feature map of 2560×2560. Then, a 3×3 depthwise separable convolution DSConv with a stride of 1 is used to extract even finer features in the larger receptive field. Finally, spatial adaptive downsampling is used to resize the feature map to 640×640×256.

[0048] S330: Adaptive feature fusion module (AFFM), the modeling process is as follows (6): (6) in, The final output feature map is 640×640×512 pixels. CAMM stands for Channel Attention Module, SAMM stands for Spatial Attention Module, and the AFFM module works as follows: First, it uses a 1×1 convolution to... The number of channels was adjusted from 512 to 256, so that it is in harmony with... The number of channels is kept consistent. Secondly, the CS module is spliced ​​together by channel dimension. and The process involves fusing and preserving detailed features from multi-level high-resolution detail branches with semantic context features from parallel double-sampling branches. Then, a channel attention mechanism module (CAMM) is used to classify disease features and highlight disease texture features, while a spatial attention mechanism module (SAMM) suppresses interference factors such as shadow occlusion in the image. Finally, a 3×3 fusion convolution (Fusion Convolution) outputs the final result. The size is 640×640×512.

[0049] The specific steps of the channel attention mechanism module (CAMM) are as follows: Input ()( represent and The feature map after 1×1 convolution is first passed through a global average pooling (GAP) layer. The data is divided into 512 1×1 feature regions. The average pixel values ​​of all pixels in these 512 feature regions are then calculated. Finally, a fully connected layer (FCL) is applied. Dimensionality reduction projection to Then, the important feature channels are activated by combining them using the ReLU activation function, while the minor feature combinations are suppressed to obtain... Then, the input fully connected layer FCL2 will Upward projection to Finally, the Sigmoid activation function is used to achieve numerical normalization and obtain feature output. .

[0050] The specific steps of the Spatial Attention Mechanism (SAMM) module are as follows: First, input... The input feature map is reduced by using an average pooling (AP) operation to minimize background interference and other regional feature channel effects. Then, a max pooling (MP) operation is performed to identify the strongest disease feature response at each location in the input feature map. Next, the results from the two pooling layers are concatenated using channel splicing (CS) to output a feature map with complementary information. Following this, a 7×7 convolution provides a larger receptive field, helping the module determine the spatial distribution of disease features. Finally, a sigmoid activation function is used for numerical normalization and the final output.

[0051] S340: Calculate the main loss based on the multi-level high-resolution detail extraction module in step s310, and calculate the boundary loss using the output features from step s330; S350: The features obtained in step s330 The multi-scale detection head MShead is input for detection and segmentation to obtain the final recognition result.

[0052] S400: Completion process: Based on the results obtained from the image processing module, the results are displayed using mobile devices such as mobile apps.

[0053] In this example, the image is acquired... After being input into the image processing module, diverse datasets and corresponding labels are obtained. , will get Input the multi-level high-resolution detail extraction (MHDE) module and the parallel double-sampling feature extraction (DFEM) module to obtain detail features. and contextual semantic features , and then and The input adaptive feature fusion module AFFM fuses detailed features and contextual semantic features to obtain the final output features. Finally The final recognition result is obtained by inputting the multi-scale feature detection head MShead.

[0054] like Figure 2 As shown, the Multi-Level High-Resolution Feature Extraction (MHDE) module extracts input data of size 640×640×3. The input consists of a three-layer LAF module. The first layer contains a regular convolution with 64 kernels and a stride of 1, and a depthwise separable convolution DSConv with 64 output channels and a stride of 1. The second layer contains a regular convolution with 128 kernels and a stride of 1, and a depthwise separable convolution DSConv with 128 output channels and a stride of 1. The third layer contains a regular convolution with 256 kernels and a stride of 1, and a depthwise separable convolution DSConv with 256 output channels and a stride of 1. After detailed feature extraction from these three LAF modules, the following is obtained: The size is 640×640×256.

[0055] like Figure 3As shown, the lightweight feature aggregation module LAF, with a stride of 1, first obtains local features in the feature map through a 3×3 ordinary convolution to detect basic features such as the edges and corners of lesions. Second, it uses a 3×3 depthwise separable convolution DSConv to extract spatial features independently in each channel. Then, it uses a channel attention module CA to automatically identify and assign higher weights to important feature channels. Finally, it performs a bottleneck residual connection (RC) between the input and output feature maps to obtain the final output feature map.

[0056] like Figure 4 As shown, the parallel double-sample feature extraction module DFEM processes an input of size 640×640×3. Input the downsampling DS branch and the upsampling US branch to obtain the output features. and The sizes are 160×160×512 and 640×640×256 respectively. First, input a 1×1 convolution, change its number of channels, then perform bilinear interpolation upsampling to resize it to 640×640×256. Input a 3×3 spatially preservative convolution, maintaining its size at 640×640×256, and finally... and Adding them together gives The feature map is 640×640×512 in size. The specific steps of the addition process are as follows: First, concatenate the CS (Sequential Convolutional Map) along the channel dimension to combine the downsampled semantic features and the upsampled detail features, resulting in a feature map of size 640×640×512. Next, use a 3×3 depthwise separable convolution DSConv (with a stride of 1) to fuse relevant features in the spatial dimension, obtaining another feature map of size 640×640×512. Then, use skip connections to obtain a feature map of size 640×640×768. Finally, use a 1×1 convolution to compress the number of channels in the feature map to 640×640×512, resulting in the final output. .

[0057] like Figure 5 As shown, the downsampling DS branch will take an input size of 640×640×3... With input DS and a stride of 2: First, a 3×3 depthwise separable convolution DSConv is used to extract spatial features while maintaining channel independence. Finally, a 3×3 grouped convolution conv is used to expand the channels and extract higher-level semantic features. With a stride of 1: A 3×3 depthwise separable convolution DSConv is introduced for depth feature extraction and local feature enhancement.

[0058] like Figure 6 As shown, the upsampling US branch will upsample the input size to 640×640×3. The input US is first processed through a 3×3 depthwise separable convolution DSConv with a stride of 1 to reduce the number of channels while retaining important feature information. Next, a first progressive upsampling PU is performed to enlarge the feature map from 640×640 to 1280×1280. Then, a 3×3 depthwise separable convolution DSConv with a stride of 1 is used to extract fine features in the larger receptive field. After that, a second progressive upsampling PU is performed to transform the feature map into a high-resolution feature map of 2560×2560. Then, a 3×3 depthwise separable convolution DSConv with a stride of 1 is used to extract even finer features in the larger receptive field. Finally, spatial adaptive downsampling is used to resize the feature map to 640×640×256.

[0059] like Figure 7 As shown, the adaptive feature fusion module AFFM takes features of size 640×640×256 as input to AFFM, and first performs a 1×1 convolution to... The number of channels was adjusted from 512 to 256, so that it is in harmony with... The number of channels is kept consistent. Secondly, the CS module is spliced ​​together by channel dimension. and The process involves fusing and preserving detailed features from multi-level high-resolution detail branches with semantic context features from parallel double-sampling branches. Then, a Channel Attention (CAMM) module is used to classify disease features and highlight disease texture features, while a Spatial Attention (SAMM) module suppresses interference factors such as shadow occlusion in the image. Finally, a 3×3 Fusion Convolution outputs the final result. The size is 640×640×512.

[0060] The specific steps of the channel attention mechanism module (CAMM) are as follows: Input ()( represent and The feature map after 1×1 convolution is first passed through a global average pooling layer (GAP) to... The data is divided into 512 1×1 feature regions. The average value of all pixel values ​​in these 512 feature regions is then calculated. Finally, a fully connected layer FCL1 is used to... Dimensionality reduction projection to Then, the important feature channels are activated by combining them using the ReLU activation function, while the minor feature combinations are suppressed to obtain... Then, the input fully connected layer FCL2 will Upward projection to Finally, the numerical normalization and final output are achieved through the Sigmoid activation function.

[0061] The specific steps of the Spatial Attention Mechanism (SAMM) module are as follows: First, input... The influence of background interference and other regional feature channels in the input feature map is reduced through an average pooling operation. Then, a max pooling (MP) process is used to identify the strongest disease feature response at each location in the input feature map. Next, the results of the two pooling layers are concatenated by channel concatenation (CS) to output a feature map with complementary information. After that, a 7×7 convolution is used to provide a larger receptive field to help the module determine the spatial distribution of disease features. Finally, the Sigmoid activation function is used to achieve numerical normalization and the final output.

[0062] like Figure 8 As shown, the specific steps of the Channel Attention Mechanism (CAMM) module are as follows: Input ()( represent and The feature map after 1×1 convolution is first passed through a global average pooling layer (GAP) to... The data is divided into 512 1×1 feature regions. The average value of all pixel values ​​in these 512 feature regions is then calculated. Finally, a fully connected layer FCL1 is used to... Dimensionality reduction projection to Then, the important feature channels are activated by combining them using the ReLU activation function, while the minor feature combinations are suppressed to obtain... Then, the input fully connected layer FCL2 will Upward projection to Finally, numerical normalization and feature output are achieved through the Sigmoid activation function. .

[0063] like Figure 9 As shown, the specific steps of the Spatial Attention Mechanism (SAMM) module are as follows: First, input... An average pooling operation (AP) reduces the influence of background interference and other regional feature channels in the input feature map. Simultaneously, a max pooling operation (MP) identifies the strongest disease feature response at each location in the input feature map. Next, the results from the two pooling layers are concatenated (CS) to output a feature map with complementary information. Then, a 7×7 convolution provides a larger receptive field, helping the module determine the spatial distribution of disease features. Finally, a sigmoid activation function is used to achieve numerical normalization and final output. .

[0064] In the multi-level high-resolution detail extraction module, 3×3 depthwise separable convolutions are used instead of the original 3×3 ordinary convolutions in the network structure, and lightweight bottleneck residual connectives are used instead of the original residual connections, reducing the number of model parameters by 75.9%. (Refer to the parameter calculation formula:) H and W represent the height and width of the output feature map. , Represents the number of input and output channels. , Table 1 shows a comparison of the branch parameters of the multi-level high-resolution detail feature extraction module (representing the height and width of the convolution kernel).

[0065] Table 1 Comparison of parameters of the multi-level high-resolution detail feature extraction module

[0066] For the parallel double-sampling feature extraction module branch, in the downsampling branch, grouped convolution and depthwise separable convolution are used to reduce the number of parameters in this part of the model; in the upsampling branch, progressive upsampling is used to replace the 4x bilinear interpolation in the original model, reducing the model computation and peak memory usage of the parallel double-sampling feature extraction module branch, and reducing large-scale interpolation artifacts. A comparison of the parameters of the parallel double-sampling feature extraction module branch is shown in Table 2.

[0067] Table 2 Comparison of parameters of parallel double sampling feature extraction module

[0068] The present invention proposes an image recognition-based method for detecting and identifying macadamia nut diseases. Compared with the original model structure of each branch, the method improves the number of parameters in each part, greatly improving the calculation speed and recognition accuracy. The correspondence between the model parameters of this method and the original model parameters is shown in Table 3.

[0069] Table 3 Comparison of Model Parameters

[0070] To further illustrate the effectiveness of this embodiment, Faster-RCNN, SSD, and YOLO-K models are introduced for comparison. Specifically, the core idea of ​​the Faster-RCNN model is "recommend first, then detect," which is a two-stage object detection method, consisting of a region proposal network and a candidate region-based detection stage. This two-stage design allows the model to classify and regress candidate boxes more times, thus ensuring high recognition accuracy, but the recognition speed is relatively slow.

[0071] The core idea of ​​the SSD model is "one-step detection," which eliminates the separate candidate region generation step and is a typical single-stage object detection method. Its working principle is: feature extraction → prediction → post-processing. This single-stage design results in fast detection speed but lower accuracy.

[0072] The YOLO-K model is a network model structure improved by our team based on YOLOv10. It incorporates the SIMAM attention mechanism module and an improved C2F module. The model's recognition accuracy and recognition speed are improved compared to the original YOLOv10 model, but it has a large number of parameters.

[0073] Testing Methodology: Our team used the PyCharm open-source programming software platform and a dataset we collected in August 2023 in Xinghuan Village, Xishan Township, Santaishan De'ang Ethnic Township, and Nanxiangzhang Village, Fengping Town, Dehong Jingpo Autonomous Prefecture, Yunnan Province. The subjects collected were different macadamia varieties, including OC, H2, and 344, with tree ages ranging from 9 to 13 years. Under different natural conditions, the camera was positioned at a horizontal angle of ±45°. All data was saved in JPG format with an image resolution of 6000×4000 pixels, totaling 1952 images. Of these, 600 images showed no fruit obstruction, 720 showed fruit obstruction, and 632 showed fruit obstruction by foliage. Some macadamia images are shown below. Figure 10 As shown in Table 4 below, after 300 rounds of training: Table 4 Model Comparison Table

[0074] As can be seen from Table 4, this embodiment has significant advantages over other methods (Faster-RCNN, SSD, and YOLO-k model network structures) in terms of parameter quantity, model size, average precision, recall, accuracy, and detection speed. Note: The YOLO-K model is a network model structure improved by our team based on YOLOv10, which incorporates the SIMAM attention mechanism module and an improved C2F module.

[0075] The recognition result of this embodiment is as follows: Figure 11As shown in the figure, the recognition effect of macadamia nuts in the natural environment and the recognition effect of macadamia nuts in a rainy environment after Gaussian blurring are shown respectively. In the natural environment, the color of macadamia nuts is almost the same as the background color, and the nuts are blocked by leaves or occlusion of each other, which will cause inaccurate recognition. In the rainy environment, the recognition rate may be reduced due to the recognition device being blocked by rain. However, the average confidence level of recognition in this embodiment reaches 0.85.

[0076] The above are merely embodiments of the present invention. The invention is not limited to the fields covered by these embodiments. Commonly known structures and characteristics in the solutions are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are able to access all existing technologies in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.

Claims

1. An image recognition-based macadamia disease detection and identification method, characterized in that, Includes the following steps: S100: Image data acquisition. High-resolution digital images of the upper and middle leaves and fruits of macadamia tree canopy are acquired from multiple angles under natural light conditions. The acquisition covers healthy leaves as well as diseased samples confirmed by agricultural experts on-site as anthracnose, leaf blight, and stem canker. The images include different disease severity, leaf growth stages, and background environments. Each acquired image is accurately labeled to generate a dataset containing image file names and corresponding disease category labels. S200: Image input processing, using the dataset obtained in S100 as input data. The training set images undergo data augmentation, including geometric transformations such as random rotation, horizontal and vertical flipping, and random scaling, as well as pixel transformations such as random brightness adjustment and addition of Gaussian noise. The images are then standardized by scaling all input images to a preset size while maintaining aspect ratio, resulting in the output feature map. ; S300: Image processing, converting the output feature map obtained from S200... The input is processed by a multi-level high-resolution detail extraction module, which extracts detail feature maps through initial convolution and a three-layer lightweight feature aggregation module. Simultaneously, the output feature map obtained from S200 is... The input is processed by the parallel double-sampling feature extraction module, and then fused through the downsampling branch and the upsampling branch respectively to obtain the semantic feature map. ; Detail feature map With semantic feature map The input to the adaptive feature fusion module is processed through channel adjustment, channel dimension concatenation, and attention mechanism to obtain the fused feature map. The main body loss is calculated based on a multi-level high-resolution detail extraction module, and the loss is calculated based on the fused feature map. Calculate the boundary loss and fuse the feature maps. Input a multi-scale detection head for detection and segmentation; The modeling process of the multi-level high-resolution detail extraction module in S300 is implemented according to the following formula: in, This represents the detail feature map after high-resolution detail extraction. For lightweight feature aggregation module, The stride represents the step size. The initial convolution of the multi-level high-resolution detail extraction module is a 3×3 ordinary convolution with a stride of 1 and 32 channels. In the three-layer lightweight feature aggregation module, the first layer contains an ordinary convolution with 64 kernels and a stride of 1, and a depthwise separable convolution with 64 output channels and a stride of 1; the second layer contains an ordinary convolution with 128 kernels and a stride of 1, and a depthwise separable convolution with 128 output channels and a stride of 1; the third layer contains an ordinary convolution with 256 kernels and a stride of 1, and a depthwise separable convolution with 256 output channels and a stride of 1. The detail feature map obtained after detail feature extraction by the three-layer lightweight feature aggregation module is as follows: The size is 640×640×256; The modeling process of the parallel double-sampling feature extraction module in S300 is implemented according to the following formula: ; ; ; in, The feature map representing the result obtained from the upsampling branch. The feature map representing the result obtained from the downsampling branch. The semantic feature map represents the final output; the working process of the parallel double-sampling feature extraction module includes: processing the output feature map obtained by S200... Inputting the downsampling branch and the upsampling branch respectively yields an output feature of size 160×160×512. and output features of size 640×640×256 ;right First, input a 1×1 convolution to change its channel count, then perform bilinear interpolation upsampling to resize it to 640×640×256; Input a 3×3 spatially preserves convolution, maintaining its size at 640×640×256; finally, ... and The fusion process involves several steps. First, the downsampled semantic features and upsampled detail features are concatenated along the channel dimension to obtain a feature map of size 640×640×512. Next, a 3×3 depthwise separable convolution with a stride of 1 is used to fuse relevant features along the spatial dimension, resulting in another feature map of size 640×640×512. Then, skip connections are used to obtain a feature map of size 640×640×768. Finally, a 1×1 convolution compresses the number of channels in the feature map to 640×640×512, yielding the final output semantic feature map. ; The modeling process of the adaptive feature fusion module in S300 is implemented according to the following formula: in, The fused feature map represents the final output and has a size of 640×640×512. For channel attention module, This is a spatial attention module; the working process of the adaptive feature fusion module includes: firstly, using a 1×1 convolution to fuse the semantic feature map... The number of channels was adjusted from 512 to 256 to align with the detail feature map. The number of channels must be kept consistent; secondly, the channel-dimensional splicing module will be used to... and The process involves fusing and preserving the detailed features of the multi-level high-resolution detail branches with the semantic context features of the parallel double-sampling branches. Then, a channel attention mechanism is used to classify disease features and highlight disease texture features, while a spatial attention mechanism suppresses interference from shadow occlusion in the image. Finally, a 3×3 fusion convolution outputs the final fused feature map. ; S400: Obtain the final recognition result and display the obtained final recognition result.

2. The method for detecting and identifying macadamia nut diseases based on image recognition according to claim 1, characterized in that, Image normalization in S200 is achieved using the following formula: in, Represents the x-coordinate of a point in the original image. Represents the ordinate of a point in the original image. The scaling factor represents the image. This represents the number of pixels needed to fill the left and right sides of the image. This represents the number of pixels needed to fill the upper and lower layers of the image. This represents the x-coordinate of a point on the scaled image. This represents the ordinate of a point on the scaled image.

3. The method of claim 2, wherein the method comprises: When the lightweight feature aggregation module is working, the stride is 1, including: first, obtaining local features in the feature map through a 3×3 ordinary convolution to detect the basic features of the edges and corners of disease spots; second, using a 3×3 depthwise separable convolution to independently extract spatial features in each channel; then, using a channel attention module to automatically identify and assign higher weights to important feature channels; finally, bottleneck residual connection is performed between the input and output feature maps to obtain the final output feature map.

4. The method of claim 3, wherein the method comprises: The specific steps of the downsampling branch module include: when the stride is 2, a 3×3 depthwise separable convolution is first used to extract spatial features while maintaining channel independence, and finally a 3×3 group convolution is used to expand the channels and extract higher-level semantic features; when the stride is 1, a 3×3 depthwise separable convolution is introduced to extract deep features and enhance local features.

5. The method of claim 4, wherein the method is characterized by: The upsampling branch module includes the following steps: First, a 3×3 depthwise separable convolution with a stride of 1 is used to reduce the number of channels while retaining important feature information; second, a first progressive upsampling is performed to enlarge the feature map from 640×640 to 1280×1280, and then a 3×3 depthwise separable convolution with a stride of 1 is used to extract fine features in the larger receptive field; then, a second progressive upsampling is performed to transform the feature map into a high-resolution feature map of 2560×2560, and then a 3×3 depthwise separable convolution with a stride of 1 is used to extract even finer features in the larger receptive field; finally, spatial adaptive downsampling is used to resize the feature map to 640×640×256.

6. The method for detecting and identifying macadamia nut diseases based on image recognition according to claim 5, characterized in that, The steps of the channel attention mechanism module include: input ,in represent and Feature map after 1×1 convolution processing , These represent the height and width of the feature map, respectively. To determine the number of channels in the feature map, it is first passed through a global average pooling layer. The feature region is divided into 512 1×1 regions, and the average value of all pixel values ​​in these 512 feature regions is then taken. Next, a fully connected layer 1 is used to... Dimensionality reduction projection to Then, the important feature channels are activated by combining them using the ReLU activation function, while the minor feature combinations are suppressed to obtain... Then, input to fully connected layer 2 will... Upward projection to Finally, the numerical values ​​are normalized and the feature output is obtained by using the Sigmoid activation function. ; The steps of the spatial attention mechanism module include: first, input... First, an average pooling operation is used to reduce the influence of background interference and other regional feature channels in the input feature map. Simultaneously, a max pooling process is used to identify the strongest disease feature response at each location in the input feature map. Next, the results from the two pooling layers are concatenated to output a feature map with complementary information. Then, a 7×7 convolution is used to provide a larger receptive field to help the module determine the spatial distribution of disease features. Finally, a sigmoid activation function is used to normalize the values ​​and obtain the final output. The imaging device in S100 is a digital camera or a smartphone, and the mobile terminal in S400 is a mobile phone, which displays the final recognition result obtained by S400 through a mobile phone APP.

7. The method for detecting and identifying macadamia nut diseases based on image recognition according to claim 6, characterized in that, In the multi-level high-resolution detail extraction module, 3×3 depthwise separable convolutions are used instead of the original 3×3 ordinary convolutions in the network structure, and lightweight bottleneck residual connection blocks are used instead of the original residual connections. The model parameter calculation is implemented according to the following formula: in, , This represents the height and width of the output feature map. , Represents the number of input and output channels. , This represents the height and width of the convolution kernel.