Apple disease and pest multispectral positioning method and system based on comparative learning

By using multi-spectral imaging equipment and meteorological sensors in apple orchards, combined with comparative learning models, the problem of low pest monitoring accuracy is solved, and rapid and accurate pest identification and prevention are achieved.

CN120472136APending Publication Date: 2025-08-12SHAANXI FUTURE VILLAGE CULTURE MEDIA TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510579387.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The prior art has low pest monitoring accuracy in apple orchards, small area of early lesions, difficult feature extraction and lesions localization, and difficult to effectively reduce pest risks.

Method used

Multi-spectral imaging equipment and meteorological sensors are arranged in the orchard, multi-spectral images are collected and pre-processed according to different weather conditions, a comparative learning model that takes into account weather factors is constructed, weather characteristics are integrated, hyperparameters are adjusted through the training set, and pest analysis results are output.

Benefits of technology

The accuracy of multi-spectral positioning of diseases and pests is improved, and the pests and diseases in apple orchards can be quickly and accurately identified, and prevention and control measures are taken in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120472136A_ABST
    Figure CN120472136A_ABST
Patent Text Reader

Abstract

The invention relates to an apple disease and insect pest multispectral positioning method and system based on comparative learning, and the method comprises the steps: collecting data, employing different data collection strategies to obtain multispectral images according to different weather conditions monitored by a meteorological sensor, the weather conditions including sunny days, cloudy days, rainy days and foggy days, and the weather conditions including sunny days, cloudy days, rainy days and foggy days; marking corresponding acquisition time, position and weather condition information of the acquired image; performing data preprocessing on the multispectral images acquired under different weather conditions; constructing a comparative learning model considering weather factors; carrying out model training; and outputting an analysis result. According to the embodiment of the invention, when multi-spectral positioning is carried out on diseases and insect pests, weather conditions are used as influence factors to construct the comparative learning model, and then weather features are integrated into the comparative learning model, so that the constructed model is higher in positioning precision, the diseases and insect pests of the apple orchard can be identified more quickly and accurately, and effective prevention and control measures can be taken in time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the technical field of pest and disease monitoring, and in particular to a multi-spectral positioning method, system, electronic device, and storage medium for apple pest and disease positioning based on contrastive learning. Background Art

[0002] In the apple cultivation industry, the problem of pests and diseases in apple orchards is always an important factor that cannot be ignored and is extremely critical. Pests and diseases constantly threaten the final yield and quality of apples. From the early stages of apple growth, various pests and diseases may quietly breed. For example, aphids will gather on the tender leaves and shoots of apples, sucking juice, hindering the leaves from normal photosynthesis, and thus affecting the overall growth of the apple tree. Diseases such as ring rot and anthracnose will invade the fruit, branches and other parts of the apple, forming unsightly lesions on the surface of the fruit. In severe cases, it can even cause the fruit to rot and fall, resulting in incomplete and low-quality apples that cannot meet the quality standards required by the market, greatly reducing the economic benefits of the apple orchard. Therefore, pests and diseases in apple orchards are a major factor threatening apple yield and quality. During the apple cultivation process, it is necessary to remain vigilant and take effective prevention and control measures.

[0003] In related technologies, under complex backgrounds, due to the lack of consideration of influencing factors, the accuracy of apple disease and pest monitoring is low. For example, the area of early lesions is small, and feature extraction and lesion location are more difficult, which cannot effectively reduce the risk of diseases and pests.

[0004] Therefore, it is necessary to improve one or more problems existing in the above-mentioned related technical solutions.

[0005] It should be noted that this section is intended to provide background or context for the technical solutions of the present disclosure stated in the claims. The description herein is not admitted to be prior art by virtue of being included in this section. Summary of the Invention

[0006] The purpose of the embodiments of the present disclosure is to provide a multispectral positioning method and system for apple pests and diseases based on contrastive learning, thereby overcoming one or more problems caused by the limitations and defects of related technologies, at least to a certain extent.

[0007] The present disclosure first provides a multispectral positioning method for apple pests and diseases based on contrastive learning, comprising:

[0008] A multispectral imaging device and multiple meteorological sensors are arranged in the orchard. The multispectral imaging device is used to collect multispectral image data of apples, and the meteorological sensors are used to monitor weather conditions in the orchard in real time. Different data collection strategies are used to obtain multispectral images based on different weather conditions monitored by the meteorological sensors. The weather conditions include sunny, cloudy, rainy and foggy days. The collected images are marked with corresponding collection time, location and weather condition information and stored in a local database.

[0009] Performing data preprocessing on multispectral images collected under different weather conditions, including noise reduction, image registration and normalization operations;

[0010] Constructing a contrastive learning model that considers weather factors. The model includes a positive and negative sample partitioning based on weather conditions, a feature extraction network that incorporates a mechanism for focusing on weather features, and an objective function that optimizes weather-related terms based on a contrastive learning loss function.

[0011] Using the training set to train the comparative learning model considering weather factors, and adjusting hyperparameters using the validation set until the model converges on the validation set;

[0012] The multispectral images collected in real time and classified according to weather conditions are input into the trained comparative learning model considering weather factors to output the pest and disease analysis results.

[0013] In one embodiment of the present disclosure, the data collection strategy includes: setting corresponding data collection time intervals according to different weather conditions.

[0014] In one embodiment of the present disclosure, the noise reduction step includes:

[0015] The motion estimation and compensation algorithm is used to remove physical noise.

[0016] In one embodiment of the present disclosure, the step of removing physical noise using a motion estimation and compensation algorithm includes:

[0017] Motion estimation is performed using the feature point matching method. Relatively stable feature points are selected from the captured image. The motion direction and velocity vector are estimated by calculating the displacement changes of these feature points in adjacent frame images.

[0018] According to the estimated motion direction and velocity vector, the image is processed using the inverse compensation method;

[0019] Image restoration algorithms are used to restore images to improve image clarity.

[0020] In one embodiment of the present disclosure, the step of constructing a comparative learning model taking weather factors into consideration includes:

[0021] Adjust the number of channels of the convolutional neural network input layer to the number of bands corresponding to the multispectral image;

[0022] Added adaptive weather feature fusion layer;

[0023] The weather feature fusion layer is used to fuse weather label information with image features through a fully connected layer.

[0024] In one embodiment of the present disclosure, the objective function L is expressed as follows:

[0025]

[0026] Among them, M represents the number of samples, i represents the i-th sample, and the positive sample index corresponding to sample i is i + , the negative sample set index J, j represents the j-th index in J, f represents the feature vector, ω represents the weather factor weight adjustment function, and the vector dot product f i ·f j Indicates the calculation of the similarity between two feature vectors, and τ represents the temperature parameter.

[0027] In one embodiment of the present disclosure, the method further includes:

[0028] The location of apples with pests and diseases in the orchard is located based on the pest and disease analysis results and the position information recorded during image acquisition.

[0029] The present disclosure also provides a multispectral positioning system for apple pests and diseases based on contrastive learning, the system comprising:

[0030] The data acquisition module uses a multispectral imaging device to collect multispectral image data of apples and a meteorological sensor to monitor and collect weather conditions in the orchard in real time. Different data acquisition strategies are used to acquire multispectral images based on the different weather conditions detected by the meteorological sensor, including sunny, cloudy, rainy, and foggy days. The collected images are marked with the corresponding collection time, location, and weather condition information and stored in a local database.

[0031] A data preprocessing module is used to perform data preprocessing on multispectral images collected under different weather conditions, wherein the preprocessing includes noise reduction, image registration and normalization operations;

[0032] A model building module for constructing a contrastive learning model that considers weather factors. The model includes a positive and negative sample partitioning based on weather conditions, a feature extraction network that incorporates a mechanism for focusing on weather features, and an objective function setting based on a contrastive learning loss function that optimizes weather-related terms.

[0033] A model training module is used to train the comparative learning model considering weather factors using the training set, and adjust hyperparameters using the validation set until the model converges on the validation set;

[0034] The result output module is used to input the multispectral images collected in real time and classified according to weather conditions into the trained comparative learning model considering weather factors, and output the pest and disease analysis results.

[0035] The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects:

[0036] In the disclosed embodiments, a multispectral positioning method and system for apple pests and diseases based on contrastive learning takes weather conditions as an influencing factor to construct a contrastive learning model when performing multispectral positioning of pests and diseases, and then integrates weather characteristics into the contrastive learning model, so that the constructed model has higher positioning accuracy, can more quickly and accurately identify the pest and disease situation in the apple orchard, and take effective prevention and control measures in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort.

[0038] Figure 1 A schematic diagram showing a flow chart of a multi-spectral positioning method for apple pests and diseases based on contrastive learning in an exemplary embodiment of the present disclosure is shown;

[0039] Figure 2 A schematic diagram illustrating a process of removing physical noise using a motion estimation and compensation algorithm in an exemplary embodiment of the present disclosure is shown;

[0040] Figure 3 A schematic diagram illustrating a process of constructing a comparative learning model taking weather factors into consideration in an exemplary embodiment of the present disclosure is shown;

[0041] Figure 4 A schematic diagram of modules of a multi-spectral positioning system for apple pests and diseases based on contrastive learning in an exemplary embodiment of the present disclosure is shown;

[0042] Figure 5A schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure is shown;

[0043] Figure 6 A schematic structural diagram of a program product for implementing a multi-spectral positioning method for apple pests and diseases based on contrastive learning in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0044] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0045] In addition, the accompanying drawings are merely schematic illustrations of embodiments of the present disclosure and are not necessarily drawn to scale. Like reference numerals in the figures represent like or similar parts, and thus repeated descriptions thereof will be omitted. Some of the blocks shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically separate entities.

[0046] This example implementation first provides a multispectral positioning method for apple pests and diseases based on contrastive learning. Figure 1 , may include: Step S101 to Step S105. The details are as follows:

[0047] Step S101: Arrange a multispectral imaging device and multiple meteorological sensors in an orchard. The multispectral imaging device is used to collect multispectral image data of apples, and the meteorological sensors are used to monitor the weather conditions in the orchard in real time. Different data collection strategies are used to acquire multispectral images according to different weather conditions monitored by the meteorological sensors. The weather conditions include sunny, cloudy, rainy and foggy days. The collected images are marked with corresponding collection time, location and weather condition information and stored in a local database.

[0048] Step S102 : performing data preprocessing on the multispectral images collected under different weather conditions. The preprocessing includes noise reduction, image registration, and normalization operations.

[0049] Step S103, constructing a contrastive learning model that takes weather factors into consideration, wherein the model includes a division of positive and negative samples according to weather conditions, a feature extraction network that incorporates a mechanism for focusing on weather features, and an objective function setting that is based on a contrastive learning loss function and optimizes weather factor-related items.

[0050] Step S104: Use the training set to train the comparative learning model that considers weather factors, and adjust the hyperparameters through the validation set until the model converges on the validation set.

[0051] Step S105 , inputting the multispectral images collected in real time and classified according to weather conditions into the trained comparative learning model considering weather factors, and outputting the pest and disease analysis results.

[0052] In this embodiment, when performing multispectral positioning of pests and diseases, weather conditions are used as an influencing factor to construct a comparative learning model, and then weather characteristics are integrated into the comparative learning model, so that the constructed model positioning accuracy is higher, and the pest and disease situation in the apple orchard can be identified more quickly and accurately, so that effective prevention and control measures can be taken in time.

[0053] The specific steps in the above embodiments are described below to better understand the technical solutions of the present application.

[0054] In step S101, the data collection strategy includes setting data collection intervals according to different weather conditions. For example, on sunny days, sampling is performed every 2 hours; on cloudy days, sampling is performed every 3 hours; on rainy days, sampling is performed 30 minutes after the rain stops. If the rain continues, sampling can be performed twice a day, or every 4 or 8 hours, etc.; on foggy days, sampling can be performed every 1.5 hours. The sampling interval can be adjusted according to actual needs.

[0055] In step S102 , preprocessing includes noise reduction, image registration, and normalization operations.

[0056] The noise reduction process includes: using motion estimation and compensation algorithms to remove physical noise. For details, please refer to Figure 2 , including steps S201 to S203:

[0057] S201 uses the feature point matching method to perform motion estimation. Relatively stable feature points are selected from the captured image. The motion direction and velocity vector are estimated by calculating the displacement changes of these feature points in adjacent frame images. The relatively stable feature points are generally relatively static texture feature points on the apple surface, fixed branches, etc., which can be used as reference benchmarks. By calculating the displacement changes of these feature points between adjacent frame images, the actual motion state of the object in the image can be accurately captured, and the overall motion direction and velocity vector can be accurately estimated. For example, in an orchard, when branches and leaves are shaken by factors such as wind, these stable feature points can reflect whether they are moving left, right, up or down, and how fast they are moving, laying the foundation for the subsequent effective removal of motion blur noise.

[0058] In step S202, the image is processed using a reverse compensation method based on the estimated motion direction and velocity vector. This step can address motion blur. For example, it can sharpen portions of an apple image that were originally blurred by swaying branches, restoring it to a state close to that without motion interference. This significantly improves image recognizability and facilitates subsequent accurate extraction and analysis of apple pest and disease characteristics.

[0059] S203: Restoring the image using an image restoration algorithm to improve image clarity. For example, algorithms such as Wiener filtering and Lucy-Richardson iteration can be used to fine-tune subtle blurry areas in the image, enhance edge sharpness, and improve contrast, making the image clearer and sharper. This facilitates subsequent accurate multispectral feature-based assessment of apple pests and diseases, reduces the risk of misjudgment due to poor image quality, and ensures the reliability of the entire pest and disease monitoring system.

[0060] In this embodiment, from motion analysis and motion blur removal to further optimization of image quality, the physical noise problem of motion blur is addressed in an all-round way, effectively improving the quality of multispectral images and providing a strong guarantee for the subsequent use of contrast learning to accurately perform multispectral positioning of apple pests and diseases.

[0061] Please refer to Figure 3 In step S103, the steps of constructing a comparative learning model considering weather factors include:

[0062] S301: Adjust the number of channels in the convolutional neural network input layer to the number of bands corresponding to the multispectral image. A network architecture such as ResNet or VGG can be used. Assuming the multispectral image has C bands, the number of channels in the input layer is set to C.

[0063] S302, add an adaptive weather feature fusion layer. The purpose of the fusion layer is to dynamically adjust the feature fusion weights according to the weather label corresponding to the input image, so as to better extract the key features of apples in different weather conditions. Suppose the feature map obtained after the convolution layer and other operations is F, whose dimensions are H×W×D (representing the height, width and depth feature dimensions respectively). The weather label is represented by one-hot encoding. For example, sunny days are encoded as [1,0,0,0], cloudy days are encoded as [0,1,0,0], rainy days are encoded as [0,0,1,0], and foggy days are encoded as [0,0,0,1]. Let it be a vector ω with a dimension of 4.

[0064] S303, the weather feature fusion layer is used to fuse the weather label information with the image features through a fully connected layer. After fusion, a fusion weight matrix W is generated, and the fused feature F f Expressed as:

[0065] F f=Reshape(F)·W·ω

[0066] Reshape(F) means transforming the dimension of the feature map F.

[0067]

[0068] The objective function L is expressed as follows:

[0069]

[0070] Among them, M represents the number of samples, i represents the i-th sample, and the positive sample index corresponding to sample i is i + , the negative sample set index J, j represents the j-th index in J, f represents the feature vector, ω represents the weather factor weight adjustment function, and the vector dot product f i ·f j Indicates the calculation of the similarity between two feature vectors, and τ represents the temperature parameter.

[0071] In step S104, the labeled samples, segmented by weather, are divided into a training set, a validation set, and a test set according to a certain ratio, with a common ratio of 7:2:1. The training set data is input into the constructed comparative learning model that considers weather factors for training, using an optimization algorithm such as the Adam optimizer.

[0072] Let the model parameter be θ and the learning rate be η. θ can be expressed as:

[0073]

[0074] Where, is a correction term used to dynamically adjust the learning rate, v t is the second-order moment estimate, and ∈ is a small constant (to prevent the denominator from being 0).

[0075] In step S105, the pest and disease analysis results may be output in a form that is easy to identify, such as a chart.

[0076] Subsequently, the location of apples with pests and diseases in the orchard can be located based on the pest and disease analysis results and the location information recorded during image acquisition, and effective prevention and control measures can be taken to eliminate the pests and diseases.

[0077] The present invention also provides a multi-spectral positioning system for apple pests and diseases based on contrastive learning, please refer to Figure 4 , the system comprising:

[0078] The data acquisition module uses a multispectral imaging device to collect multispectral image data of apples and a meteorological sensor to monitor and collect weather conditions in the orchard in real time. Different data acquisition strategies are used to acquire multispectral images based on the different weather conditions detected by the meteorological sensor, including sunny, cloudy, rainy, and foggy days. The collected images are marked with the corresponding collection time, location, and weather condition information and stored in a local database.

[0079] A data preprocessing module is used to perform data preprocessing on multispectral images collected under different weather conditions, wherein the preprocessing includes noise reduction, image registration and normalization operations;

[0080] A model building module for constructing a contrastive learning model that considers weather factors. The model includes a positive and negative sample partitioning based on weather conditions, a feature extraction network that incorporates a mechanism for focusing on weather features, and an objective function setting based on a contrastive learning loss function that optimizes weather-related terms.

[0081] A model training module is used to train the comparative learning model considering weather factors using the training set, and adjust hyperparameters using the validation set until the model converges on the validation set;

[0082] The result output module is used to input the multispectral images collected in real time and classified according to weather conditions into the trained comparative learning model considering weather factors, and output the pest and disease analysis results.

[0083] In this embodiment, the technical effects of the system are the same as the beneficial effects of the aforementioned method, which will not be repeated here.

[0084] Regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0085] It should be noted that although several modules of the system for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules described above can be concretized in one module. Conversely, the features and functions of a module described above can be further divided into multiple modules for concretization. The components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the present invention. Those of ordinary skill in the art can understand and implement it without paying any creative work.

[0086] See also Figure 5The embodiment of the present invention further provides an electronic device 300, which includes at least one memory 310, at least one processor 320, and a bus 330 connecting different platform systems.

[0087] The memory 310 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 311 and / or a cache memory 312 , and may further include a read-only memory (ROM) 313 .

[0088] Among them, the memory 310 also stores a computer program, which can be executed by the processor 320, so that the processor 320 executes the steps of the multi-spectral positioning method for apple pests and diseases based on comparative learning in any embodiment of the present invention. Its specific implementation method is consistent with the implementation method and the technical effect achieved in the above-mentioned embodiment of the multi-spectral positioning method for apple pests and diseases based on comparative learning, and some contents will not be repeated here.

[0089] Memory 310 may also include a utility 314 having at least one program module 315, such program modules 315 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0090] Accordingly, the processor 320 may execute the aforementioned computer program and the utility 314 .

[0091] Bus 330 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.

[0092] The electronic device 300 can also communicate with one or more external devices 340, such as a keyboard, pointing device, Bluetooth device, etc., and can also communicate with one or more devices capable of interacting with the electronic device 300, and / or any device that enables the electronic device 300 to communicate with one or more other computing devices (e.g., a router, modem, etc.). Such communication can be performed via an input / output interface 350. Furthermore, the electronic device 300 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 360. The network adapter 360 can communicate with other modules of the electronic device 300 via the bus 330. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 300, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.

[0093] An embodiment of the present invention also provides a computer-readable storage medium for storing a computer program. When the computer program is executed, the steps of the multi-spectral localization method for apple pests and diseases based on contrastive learning in the embodiment of the present invention are implemented. The specific implementation method is consistent with the implementation method and the technical effect achieved in the embodiment of the multi-spectral localization method for apple pests and diseases based on contrastive learning, and some contents will not be repeated here.

[0094] Figure 6 The program product 400 provided in this embodiment is shown for implementing the aforementioned contrastive learning-based multispectral localization method for apple pests and diseases. This program product 400 can be implemented in a portable compact disc read-only memory (CD-ROM) and include program code, and can be executed on a terminal device, such as a personal computer. However, the program product 400 of the present invention is not limited thereto. In the present invention, a readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The program product 400 can utilize any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0095] A computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, or any suitable combination thereof. The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a standalone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. Where a remote computing device is involved, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0096] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.

Claims

1. A multispectral positioning method for apple pests and diseases based on contrastive learning, characterized by: include: A multispectral imaging device and multiple meteorological sensors are arranged in the orchard. The multispectral imaging device is used to collect multispectral image data of apples, and the meteorological sensors are used to monitor weather conditions in the orchard in real time. Different data collection strategies are used to obtain multispectral images based on different weather conditions monitored by the meteorological sensors. The weather conditions include sunny, cloudy, rainy and foggy days. The collected images are marked with corresponding collection time, location and weather condition information and stored in a local database. Performing data preprocessing on multispectral images collected under different weather conditions, including noise reduction, image registration and normalization operations; Constructing a contrastive learning model that considers weather factors. The model includes a positive and negative sample partitioning based on weather conditions, a feature extraction network that incorporates a mechanism for focusing on weather features, and an objective function that optimizes weather-related terms based on a contrastive learning loss function. Using the training set to train the comparative learning model considering weather factors, and adjusting hyperparameters using the validation set until the model converges on the validation set; The multispectral images collected in real time and classified according to weather conditions are input into the trained comparative learning model considering weather factors to output the pest and disease analysis results.

2. The multispectral positioning method for apple pests and diseases based on contrastive learning according to claim 1, characterized in that: The data collection strategy includes: setting corresponding data collection time intervals according to different weather conditions.

3. The multispectral positioning method for apple pests and diseases based on contrastive learning according to claim 1, characterized in that: The steps of the noise reduction process include: The motion estimation and compensation algorithm is used to remove physical noise.

4. The multispectral positioning method for apple pests and diseases based on contrastive learning according to claim 3 is characterized in that: The step of removing physical noise using a motion estimation and compensation algorithm includes: Motion estimation is performed using the feature point matching method. Relatively stable feature points are selected from the captured image. The motion direction and velocity vector are estimated by calculating the displacement changes of these feature points in adjacent frame images. According to the estimated motion direction and velocity vector, the image is processed using the inverse compensation method; Image restoration algorithms are used to restore images to improve image clarity.

5. The multispectral positioning method for apple pests and diseases based on contrastive learning according to claim 1, characterized in that: The steps of constructing a contrastive learning model considering weather factors include: Adjust the number of channels of the convolutional neural network input layer to the number of bands corresponding to the multispectral image; Added adaptive weather feature fusion layer; The weather feature fusion layer is used to fuse weather label information with image features through a fully connected layer.

6. The multispectral positioning method for apple pests and diseases based on contrastive learning according to claim 1, characterized in that: The objective function L is expressed as follows: Among them, M represents the number of samples, i represents the i-th sample, and the positive sample index corresponding to sample i is i + , the negative sample set index J, j represents the j-th index in J, f represents the feature vector, ω represents the weather factor weight adjustment function, and the vector dot product f i ·f j Indicates the calculation of the similarity between two feature vectors, and τ represents the temperature parameter.

7. The multispectral positioning method for apple pests and diseases based on contrastive learning according to any one of claims 1 to 6, characterized in that: The method further comprises: The location of apples with pests and diseases in the orchard is located based on the pest and disease analysis results and the position information recorded during image acquisition.

8. The multispectral positioning system for apple pests and diseases based on contrastive learning is characterized by: The system comprises: The data acquisition module uses a multispectral imaging device to collect multispectral image data of apples and a meteorological sensor to monitor and collect weather conditions in the orchard in real time. Different data acquisition strategies are used to acquire multispectral images based on the different weather conditions detected by the meteorological sensor, including sunny, cloudy, rainy, and foggy days. The collected images are marked with the corresponding collection time, location, and weather condition information and stored in a local database. A data preprocessing module is used to perform data preprocessing on multispectral images collected under different weather conditions, wherein the preprocessing includes noise reduction, image registration and normalization operations; A model building module for constructing a contrastive learning model that considers weather factors. The model includes a positive and negative sample partitioning based on weather conditions, a feature extraction network that incorporates a mechanism for focusing on weather features, and an objective function setting based on a contrastive learning loss function that optimizes weather-related terms. A model training module is used to train the comparative learning model considering weather factors using the training set, and adjust hyperparameters using the validation set until the model converges on the validation set; The result output module is used to input the multispectral images collected in real time and classified according to weather conditions into the trained comparative learning model considering weather factors, and output the pest and disease analysis results.

9. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the steps of the multi-spectral positioning method for apple pests and diseases based on contrastive learning according to any one of claims 1 to 7 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the multispectral positioning method for apple pests and diseases based on contrastive learning as described in any one of claims 1 to 7 are implemented.