Zero-time baseline anchor threshold adaptation method for cross-domain deployment of tea tree disease spectrum detection
Patent Information
- Application Number
- CN202611207926.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2046-08-11
AI Technical Summary
然而,这些经典计算机视觉技术在向农业植物病理学交叉应用时,遇到了实施限制:
[0020] First, before batch detection of the target domain, the present invention uses negative samples from the target domain 0h baseline to complete threshold adaptation. Without using the target domain disease label, the source domain model can be more suitable for the spectral detection of tea tree diseases under the target tea garden, target batch, or target equipment conditions.
Smart Images

Figure CN122712295B_ABST
Abstract
Description
Technical Field
[0001] In the field of tea tree disease spectral detection and agricultural sensing equipment deployment technology, specifically, it relates to a zero-time baseline anchoring threshold adaptation method for cross-domain deployment of tea tree disease spectral detection. Background Technology
[0002] In the early spectral detection of tea tree diseases before symptoms appear, disease detection models trained on hyperspectral, near-infrared, or multispectral data can usually achieve high detection accuracy in controlled laboratories. However, when such models are actually deployed to target tea gardens or target detection batches in different seasons, batches, instruments, varieties, or locations, inconsistencies often arise between the model's output ranking ability and the fixed probability threshold operation point.
[0003] When a tea tree disease spectral detection model trained in a specific season or batch (i.e., the source domain) is actually deployed to a target domain under conditions of another season, another batch, another instrument platform, another tea tree variety, or another location, the input spectrum of the target domain and the distribution of its model output scores will undergo overall translation or scale change due to the combined effects of instrument physical noise, differences in ambient light, and changes in the physiological background of the tea trees.
[0004] The direct impact of this drift is that although the predicted scores output by the detection model may still partially retain their ability to rank healthy and diseased leaves relative to each other, the absolute numerical distribution of their predicted probabilities has shifted. This leads to a higher likelihood of false positives or more missed detections when the fixed operating thresholds determined through validation in the source domain are migrated to the target domain, thus affecting the batch disease screening in the target tea garden or target detection batch.
[0005] Conventional approaches to addressing this "domain shift" problem in existing technologies typically employ probability calibration, domain adaptation networks, or transfer learning. However, these classic computer vision techniques encounter implementation limitations when applied to agricultural plant pathology:
[0006] First, all existing domain adaptation or retraining techniques require, without exception, obtaining labeled samples of the target domain in the early stages of deployment, and may even require a complete readjustment of model weights or refitting of the preprocessed mean matrix.
[0007] Secondly, in the specific commercial scenario of early non-destructive detection of agricultural diseases before symptoms appear, operators initially deploy sensors on green leaves without any visible necrotic lesions, making it impossible to obtain "target domain disease labels" immediately. Therefore, any probabilistic calibration method relying on target domain disease labels cannot be practically deployed. Conversely, obtaining a batch of healthy, uninfected, or negative baseline samples (0 hours before inoculation) is relatively easy in agricultural practice.
[0008] It is important to note that the "0h baseline sample" referred to in this instruction manual is not a disease label generated by artificial pathological identification, nor is it a weak label at the time of detection in the target domain; it is essentially a health status record defined by the collection time and experimental / deployment procedures. In other words, the 0h sample only represents the background spectral record obtained before sensor deployment, inoculation treatment, or detection at the target time, used to characterize the background distribution of the target domain, and is not used to determine whether the target domain is diseased at 30h, subsequent times, or the actual sample to be tested.
[0009] However, existing tea tree disease spectral detection schemes still mostly adopt fixed threshold strategies when deployed across domains. Both academia and industry lack a technical solution that can be embedded in tea tree disease spectral detection equipment or systems and use target domain 0h negative baseline samples to complete threshold adaptation under conditions without target domain disease labels. Summary of the Invention
[0010] The purpose of this invention is to provide a zero-time baseline anchoring threshold adaptation method for cross-domain deployment of spectral detection of tea tree diseases, so as to solve the problems mentioned in the background art.
[0011] To achieve the above objectives, the present invention provides the following technical solution: A zero-time baseline anchoring threshold adaptation method for cross-domain deployment of spectral detection of tea tree diseases includes: S1, obtain the tea tree disease spectral detection model that has been trained on the source domain, obtain the source domain operation threshold or the source domain normalization operation threshold, and obtain the historical prediction score distribution of the tea tree disease spectral detection model for negative samples at the source domain 0h baseline. S2, collect negative baseline samples of the target domain at 0h and generate baseline scores for the target domain; S3, perform probability truncation, logit transformation and robust anchoring parameter calculation on the baseline prediction probabilities of the source domain and the target domain to obtain the robust location parameter of the source domain, the robust scale parameter of the source domain, and the robust location parameter of the target domain, respectively. S4. Based on robust anchoring parameters, establish a comparable normalized score space between the source and target domains, and determine the source domain normalization operation threshold on the source domain validation data. S5, map the source domain normalization operation threshold to the target domain logit threshold and the target domain probability threshold, determine at least one of the target domain logit threshold, the target domain probability threshold, and the source domain normalization operation threshold as the target domain operation threshold, and write or update the target domain operation threshold to the threshold determination module of the detection device. S6, use the target domain operation threshold to determine the negative / positive results of the target domain tea leaf spectral samples and output the detection results; S7. Use the target domain operation threshold to re-judge the target domain 0 h baseline samples, calculate the target domain 0 h false positive rate, and determine whether to trigger the adaptation failure fallback mechanism based on the target domain 0 h false positive rate and the scale status of the target domain baseline distribution.
[0012] Furthermore, S2 includes: during the deployment initialization phase under the conditions of the target tea garden, target detection batch, or target equipment, the spectral acquisition unit automatically collects a set of spectral samples of negative tea leaves at the target domain 0h baseline and inputs them into the source domain trained model to obtain the target domain baseline prediction score.
[0013] Furthermore, the probability truncation, logit transformation, and robust anchoring parameter calculation for the baseline prediction probabilities of the source and target domains in S3 include: calculating the original probability p of the i-th sample output by the tea tree disease spectral detection model. i Perform probability truncation to obtain the truncated probability p. i,clip And the truncated probability p i,clip Perform the logit transformation to obtain the logit score s. i : In the formula, i is the sample index, p i p represents the original predicted probability output by the tea tree disease spectral detection model for the i-th sample. i,clip Let be the truncated probability, min{·} be the minimum function, max(·) be the maximum function, log(·) be the natural logarithm function, and ε be the probability truncation parameter.
[0014] Further, obtaining the robust location parameter of the source domain, the robust scale parameter of the source domain, the robust location parameter of the target domain, and the robust scale parameter of the target domain in S3 includes: calculating the robust location parameter μ of the source domain. S Source domain robust scaling parameter σ S Target domain robust position parameter μ T and the target domain robust scaling parameter σ T : Where median(·) denotes the median function, median i (·) indicates taking the median for sample index i. EPS represents the logit score of the i-th baseline negative sample in the source domain with a 0h baseline, and EPS is the lower limit of the preset scale. This represents the logit score of the i-th baseline negative sample in the target domain.
[0015] Further, S4 includes: constructing source domain normalized fractions according to the following formulas respectively. and target domain normalized score : In the formula, This represents the logit score of the i-th sample in the source domain. Let represent the logit score of the i-th sample in the target domain. The source domain normalization threshold is determined based on the prediction score from the source domain grouped cross-validation or the prediction score from the source domain independent validation set. The determination methods include maximizing the Youden index, maximizing sensitivity under a preset specificity, maximizing specificity under a preset sensitivity, and maximizing F... β The metric is either the minimum of a preset cost function or the determined source domain normalization threshold is denoted as... Among them, F β A weighted harmonic mean index that comprehensively measures sensitivity and accuracy.
[0016] Further, step S5 includes: applying the source domain normalization threshold determined in step S4. Mapped to the target domain logit threshold θ T,logit And the target domain logit threshold is inversely mapped to the target domain probability threshold θ. T,prob : In the formula, exp(·) is an exponential function with the natural constant e as its base.
[0017] Furthermore, S6 includes: using the target domain operation threshold to control the tea tree disease spectral detection equipment or detection system to perform automatic disease determination on the spectral sample of tea leaves to be tested in the target domain, and outputting one or more of the following through the result output module: disease early warning result, positive alarm, risk classification, detection result, uncertain result, and review prompt.
[0018] Further, S7 includes: re-evaluating the target domain 0-h baseline negative tea leaf spectral sample set using the target domain operation threshold, and calculating the target domain 0-h false positive rate according to the following formula: In the formula, FPR T,0h For the target domain 0h false positive rate, N +,T,0h N represents the number of samples identified as positive in the baseline negative tea leaf spectral samples of the target domain at 0h. T,0h The total number of valid samples for the baseline negative tea leaf spectral samples in the target domain at 0h. The adaptation failure fallback mechanism is triggered when any of the following conditions are met: a) The false positive rate of the target domain 0 h exceeds the preset false positive rate limit; b, The median absolute deviation of the baseline logit score in the target domain 0 h is less than the preset scale lower limit EPS; c. The robust scaling parameter of the target domain is lower than the preset scaling threshold; The adaptation failure rollback mechanism includes one or more of the following: adjusting the threshold according to a preset priority, rolling back the conservative threshold, switching to a backup model, outputting uncertain results, adding a 0 h baseline sample size prompt, and prompting for re-collection.
[0019] Compared with the prior art, the beneficial effects of the present invention are:
[0020] First, before batch detection of the target domain, the present invention uses negative samples from the target domain 0h baseline to complete threshold adaptation. Without using the target domain disease label, the source domain model can be more suitable for the spectral detection of tea tree diseases under the target tea garden, target batch, or target equipment conditions.
[0021] Second, by performing truncation and logit transformation on the model output probability and using median and scaledMAD to extract robust anchoring parameters, this invention helps to reduce the impact of extreme prediction probabilities, sensor noise and a small number of outliers on the target domain threshold mapping.
[0022] Third, this invention does not change the network weights or ranking relationships of the trained model in the source domain, but uses the baseline distribution of the target domain 0h for operation threshold adaptation, thus making it suitable for the deployment and initialization process of tea tree disease spectral detection equipment or systems.
[0023] Fourth, this invention uses a target domain 0h false positive rate monitoring and rollback mechanism to impose safety constraints on the operation threshold of the mapped target domain, which helps reduce the risk of abnormal thresholds directly entering the batch detection process. Attached Figure Description
[0024] Figure 1Flowchart for zero-time baseline anchoring threshold adaptation in cross-domain deployment of spectral detection equipment for tea tree diseases;
[0025] Figure 2 A flowchart for multidimensional label isolation and leak prevention safety control;
[0026] Figure 3 A flowchart for monitoring false positive anomalies in the target domain at 0h and for multi-level emergency rollback decision-making. Detailed Implementation
[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] Please see Figure 1 In this embodiment, the tea tree disease spectral detection device includes a spectral acquisition unit, a model inference module, a threshold adaptation module, a threshold determination module, a result output module, and a processor. Before batch detection in the target domain, the device performs threshold adaptation according to the following steps.
[0029] S1. Obtain basic information about the source domain model and source domain threshold.
[0030] S1 includes: the processor calling the device memory or an external model library to obtain the tea tree disease spectral detection model trained in the source domain, obtaining the historical prediction score distribution of the tea tree disease spectral detection model for negative samples at the 0h baseline of the source domain, and recording the input feature set used by the tea tree disease spectral detection model. The tea tree disease spectral detection model can adopt partial least squares discriminant analysis model, logistic regression model, support vector machine, random forest, gradient boosting tree, one-dimensional convolutional neural network, Transformer model, etc. The tea tree disease spectral detection model can be trained based on tea leaf reflectance spectrum, near-infrared spectrum, multispectral or hyperspectral data, and is used for pre-symptom or early detection of diseases such as tea anthracnose, tea cake disease, tea cloud leaf blight or tea ring spot; the source domain normalization operation threshold is preferably determined by the source domain grouped cross-validation prediction score or the source domain independent validation set prediction score.
[0031] S2. Collect baseline samples of the target domain 0h and generate the target domain baseline prediction score.
[0032] like Figure 2As shown, S2 includes: during the deployment initialization phase of the target tea garden, target detection batch, or target equipment conditions, the spectral acquisition unit automatically collects a set of spectral samples of negative tea leaves from the target domain at 0h baseline. The model inference module inputs the sample set into the source domain trained model and outputs the target domain baseline prediction score. The 0h baseline samples are defined by the acquisition time and deployment process and are used to characterize the background distribution of the target domain, not as disease labels for the target domain. The target domain data is divided into a baseline adaptation data area, a test inference data area, and a post-evaluation data area in the memory. When performing threshold adaptation, the processor only calls the baseline adaptation data area and the source domain verification data area, and does not call the artificial pathological review results or future disease outcomes in the post-evaluation data area.
[0033] S3. Perform probability truncation, logit transformation and robust anchoring parameter calculation on the baseline prediction probabilities of the source domain and the target domain to obtain the robust location parameter of the source domain, the robust scale parameter of the source domain, the robust location parameter of the target domain and the robust scale parameter of the target domain, respectively.
[0034] S3 includes: the original probability p of the i-th sample output by the tea tree disease spectral detection model. i Perform probability truncation to obtain the truncated probability p. i,clip And the truncated probability p i,clip Perform the logit transformation to obtain the logit score s. i :
[0035]
[0036]
[0037] In the formula, i is the sample index, p i p represents the original predicted probability output by the tea tree disease spectral detection model for the i-th sample. i,clip Let be the truncated probability, min{·} be the minimum function, max(·) be the maximum function, log(·) be the natural logarithm function, and ε be the probability truncation parameter, satisfying 0 < ε < 0.5, preferably 10. -6 This is used to avoid division by zero or numerical overflow during the logit transformation. Through this transformation, the model output probability is mapped to the real number domain, which is beneficial for subsequent translation and scale anchoring.
[0038] Calculate the robust location parameter μ in the source domain respectively. S Source domain robust scaling parameter σ S Target domain robust position parameter μ T and the target domain robust scaling parameter σ T :
[0039]
[0040]
[0041]
[0042]
[0043] Where median(·) denotes the median function, median i (·) indicates taking the median for sample index i. EPS represents the logit score of the i-th negative sample with a 0h baseline in the source domain. EPS is a preset lower bound for the scale, used as the lower bound of the denominator when the median absolute deviation is zero or abnormally close to zero. This represents the logit score of the i-th baseline negative sample in the target domain.
[0044] In the threshold adaptation process of this invention, the robust position parameters of the source domain and the robust position parameters of the target domain are the median of the logit score of the corresponding domain 0h baseline, respectively; the robust scale parameters of the source domain and the robust scale parameters of the target domain are the larger of the median absolute deviation of the logit score of the corresponding domain 0h baseline and the preset scale lower limit EPS, respectively. When the median absolute deviation of the logit score of the target domain 0h baseline is less than EPS, or when the robust scale parameter of the target domain is lower than any one or both of the preset scale thresholds occur simultaneously, a scale aberration signal is output and an adaptation failure fallback mechanism is triggered. When the number of baseline samples in the target domain 0h is less than the preset minimum number N... min At this time, the processor does not perform automatic threshold mapping and outputs a prompt to increase the number of 0h baseline samples. Before calculating the target domain robust anchoring parameters, the processor can perform quantile truncation or outlier masking on the target domain 0h baseline prediction scores. The masked samples do not participate in the calculation of median and scaled MAD, but their number and proportion are written to the adaptation log.
[0045] S4. Based on robust anchoring parameters, establish a comparable normalized score space between the source and target domains, and determine the source domain normalization operation threshold on the source domain validation data.
[0046] S4 includes: constructing source domain normalized fractions according to the following formula. and target domain normalized score :
[0047]
[0048]
[0049] Thus, the 0h baseline distributions of the source and target domains are transformed to a comparable scale.
[0050] In the formula, This represents the logit score of the i-th sample in the source domain. This represents the logit score of the i-th sample in the target domain. The source domain normalization threshold is determined based on the source domain grouped cross-validation prediction score or the source domain independent validation set prediction score. The determination methods include maximizing the Youden exponent, maximizing sensitivity under a preset specificity, maximizing specificity under a preset sensitivity, and maximizing F... β The value or minimization of one of the preset cost functions, F β To comprehensively measure the weighted harmonic mean index of sensitivity and precision, β is a weighting coefficient greater than 0, used to adjust the relative importance of sensitivity and precision. The preset cost function is constructed based on the false positive cost and false negative cost.
[0051] The process of determining the threshold for the above source domain normalization operation does not call the target domain disease label, the target domain future disease outcome label, or the artificial pathological judgment result.
[0052] S5, map the source domain normalization operation threshold determined in step S4 to the target domain logit threshold and the target domain probability threshold, and determine at least one of the target domain logit threshold, the target domain probability threshold, or the source domain normalization operation threshold directly used in the target domain normalization score space as the target domain operation threshold, and write or update it to the threshold determination module of the detection device. Specifically, this includes:
[0053] The source domain normalization threshold determined in step S4 is used. Mapped to the target domain logit threshold θ T,logit And the target domain logit threshold is inversely mapped to the target domain probability threshold θ. T,prob :
[0054]
[0055]
[0056] In the formula, exp(·) is an exponential function with the natural constant e as its base.
[0057] The threshold adaptation module will set the target domain logit threshold θ. T,logit Target domain probability threshold θ T,prob Or source domain normalization operation threshold Write to the threshold determination module. After writing is complete, the device generates an adaptation log, which includes at least the number of baseline samples in the target domain 0h, the collection time range, the robust position parameters of the source domain, the robust scale parameters of the source domain, the robust position parameters of the target domain, the robust scale parameters of the target domain, the target domain operation threshold obtained by mapping, the false positive rate of the target domain 0h, and whether the rollback mechanism was triggered.
[0058] In one implementation, the threshold determination module makes a determination in the target domain normalized score space. For the i-th target domain test sample, its target domain normalized score is calculated. , The i-th target domain sample is determined to be positive if the following conditions are met; otherwise, the i-th target domain sample is determined to be negative:
[0059]
[0060] Correspondingly, the decision result in the normalized fraction space of the target domain satisfies:
[0061]
[0062] in, This indicates that the i-th target domain sample was determined to be positive. This indicates that the i-th target domain sample is determined to be negative.
[0063] In another embodiment, the threshold determination module makes the determination in the target domain probability space. For the i-th target domain sample to be tested, its predicted probability after probability truncation is obtained. ,when The i-th target domain sample is determined to be positive if the following conditions are met; otherwise, the i-th target domain sample is determined to be negative:
[0064]
[0065] Correspondingly, the decision result in the target domain probability space satisfies:
[0066]
[0067] in, This represents the predicted probability of the i-th target domain sample after probability truncation. This represents the target domain probability threshold obtained by inverse mapping from the target domain logit threshold.
[0068] S6. Utilize the target domain operation threshold to determine the negative / positive status of the spectral samples of tea leaves in the target domain and output the test results. Based on the test results, selectively output the infection risk level, alarm information, and / or review prompts, specifically including:
[0069] After the spectral sample of tea leaves to be tested in the target domain enters the model inference module, the model inference module outputs the predicted probability. The threshold determination module performs automatic negative / positive determination according to the target domain operation threshold written or updated in step S5 and outputs the detection result. The result output module selectively outputs one or more of the following based on the detection result: disease warning, positive alarm, risk classification, uncertain result, and review prompt, for batch screening under the conditions of target tea garden, target batch, or target equipment.
[0070] S7, such as Figure 3 As shown, the target domain 0h baseline samples are re-evaluated using the target domain operation threshold, the target domain 0h false positive rate is calculated, and the scale status of the target domain baseline distribution is used to determine whether to trigger the adaptation failure fallback mechanism, in order to prevent abnormal thresholds from entering the batch detection process. Specifically, this includes:
[0071] After adaptation, the processor uses the mapped target domain operation threshold to re-evaluate the target domain 0-h baseline negative tea leaf spectral sample set, and calculates the target domain 0-h false positive rate according to the following formula:
[0072]
[0073] In the formula, FPR T,0h For the target domain 0h false positive rate, N +,T,0h N represents the number of samples identified as positive in the baseline negative tea leaf spectral samples of the target domain at 0h. T,0h The target domain 0h baseline negative tea leaf spectral samples represent the total number of valid samples. The target domain 0h false positive rate is the proportion of target domain 0h baseline negative tea leaf spectral samples that are identified as positive.
[0074] The adaptation failure fallback mechanism is triggered when any of the following conditions are met:
[0075] a) The false positive rate of the target domain 0 h exceeds the preset false positive rate limit;
[0076] b, The median absolute deviation of the baseline logit score in the target domain 0 h is less than the preset scale lower limit EPS;
[0077] c. The robust scaling parameter of the target domain is lower than the preset scaling threshold;
[0078] The adaptation failure rollback mechanism includes one or more of the following: adjusting the threshold according to a preset priority, rolling back the conservative threshold, switching to a backup model, outputting uncertain results, adding a 0 h baseline sample size prompt, and prompting for re-collection.
[0079] Through the above S1 to S7, the system completes the target domain operation threshold adaptation without calling the target domain disease label, and reduces the risk of directly using abnormal thresholds for batch detection by monitoring the 0h false positive rate and scale anomalies.
[0080] Cross-domain deployment experiment and threshold adaptation effect verification of spectral detection of tea tree diseases:
[0081] To verify the effectiveness of the above threshold adaptation technology for cross-domain deployment of spectral detection of tea tree diseases under different acquisition times and target domain conditions, this embodiment uses multiple hyperspectral datasets for cross-domain comparison experiments.
[0082] The data matrix used for evaluation included an internally controlled standard validation domain (Internal-30h) and two externally deployed domains acquired over time (the Apr-2025 domain collected in April and the Jul-2025 domain collected in the hot summer of July). The sensor feature set used for validation included the unedited full spectrum, the best 30-band combination fixed from internal data (top30_fixed_from_internal), a set extracting only the near-infrared channels (nir_only_fixed), and an extremely narrow set specifically designed for low-cost filter lenses (band_840_900_fixed).
[0083] In terms of baseline support structure, the Internal-30h 0h baseline has a large redundant sample size of n=576, while the external deployment seasons Apr-2025 and Jul-2025 each rely on n=288 baseline samples as independent support points for the target domain. The internal master data includes 12 varieties, 600 individual leaves, and 5400 hyperspectral records, of which the Internal-30h 0h baseline sample size is n=576; the external seasonal data includes the Apr-2025 0h baseline sample size and the Jul ...
[0084] To enhance the verifiability of the threshold adaptation technique's effectiveness, a set of cross-domain experimental comparison data is presented below. In the table, "Fixed source domain threshold" indicates that the operational threshold obtained from source domain cross-validation is directly deployed to the target domain; "BASN / ZBTA of this invention" indicates that robust anchoring and threshold mapping are performed using only the target domain 0h baseline samples. Traditional platt scaling equal-probability calibration methods typically require a labeled calibration set in the target domain. Under the "no target domain disease label" deployment condition specified in this invention, it cannot be directly executed. Therefore, this embodiment does not fabricate its quantification results but only describes it in the text as a control method requiring target domain labels.
[0085] Table 1. Comparison of experimental data on cross-domain threshold strategies
[0086] In the table, AUC represents the Area Under the Receiver Operating Characteristic Curve, BA represents Balanced Accuracy, Sens represents Sensitivity, Spec represents Specificity, FPR represents False Positive Rate, and 0hFPR represents the 0h False Positive Rate of the target domain baseline samples. As shown in Table 1, the threshold adaptation of this invention does not change the sample ranking of the classifier itself; therefore, the AUC remains consistent under the same transfer settings. In the Internal→Apr / NIR-only setting, BASN / ZBTA increases the sensitivity from 0.4931 to 0.6597, the balanced accuracy from 0.7465 to 0.8299, and the target domain 0h FPR remains 0. In the Internal → Jul / 840-900 nm setting, BASN / ZBTA improved sensitivity from 0.1389 to 0.3611 and balanced accuracy from 0.5694 to 0.6701, while the target domain 0h FPR remained at 0. In the Internal → Jul / NIR-only setting, BASN / ZBTA significantly improved sensitivity, but the 0h FPR reached 0.0660, exceeding the preset upper limit of 0.05. Therefore, a fallback mechanism should be triggered instead of blind deployment to prevent false alarms from spiraling out of control from an engineering perspective.
[0087] It should be noted that this invention does not assume that all target domain scenarios will automatically pass threshold adaptation. For the Internal→Jul / NIR-only setting, although the sensitivity is improved after threshold mapping, the FPR of the target domain 0h reaches 0.0660, exceeding the preset upper limit of 0.05. According to the security judgment logic of this invention, this scenario does not enter the normal automatic adaptation deployment process, but triggers the rollback mechanism. Therefore, the experimental results are used to prove that this invention can identify the risk of threshold adaptation failure and prevent high false alarm thresholds from being used in batches, rather than to prove that automatic adaptation will necessarily succeed under this migration setting.
[0088] The experiments above demonstrate that BASN / ZBTA, as a post-processing method applied to model output scores and operational thresholds, does not alter the network weights of the already trained model in the source domain, nor does it change the ranking of predicted scores for the same batch of samples. Therefore, under the same transfer settings, the AUC remains consistent before and after adaptation. Its main function is to adjust the operational threshold based on the baseline distribution of the target domain 0h, thereby improving the sensitivity, specificity, or balanced accuracy performance of a fixed source domain threshold in some target domains. For scenarios where the false positive rate in the target domain 0h exceeds a preset upper limit, the system uses a fallback mechanism to prevent this threshold from directly entering the batch detection process.
[0089] It should be noted that the threshold adaptation method of this invention is mainly used to alleviate the operational threshold mismatch problem caused by changes in the background distribution of model output scores when deploying source domain models across domains. For situations where the spectral distribution of the target domain undergoes severe nonlinear changes, the model's ranking ability significantly decreases, or the false positive rate of the target domain (0h) exceeds a preset upper limit, this invention outputs an adaptation failure signal through scale anomaly detection and a multi-level backoff mechanism, adopts a conservative threshold, or prompts for re-acquiring data, thereby reducing the risk of directly using abnormal thresholds for batch detection.
[0090] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A zero-time baseline anchoring threshold adaptation method for cross-domain deployment of spectral detection of tea tree diseases, characterized in that, include: S1, obtain the tea tree disease spectral detection model that has been trained on the source domain, obtain the source domain operation threshold or the source domain normalization operation threshold, and obtain the historical prediction score distribution of the tea tree disease spectral detection model for negative samples at the source domain 0h baseline. S2, collect negative baseline samples of the target domain at 0h and generate baseline scores for the target domain; S3, perform probability truncation, logit transformation and robust anchoring parameter calculation on the baseline prediction probabilities of the source domain and the target domain to obtain the robust location parameter of the source domain, the robust scale parameter of the source domain, and the robust location parameter of the target domain, respectively. S4. Based on robust anchoring parameters, establish a comparable normalized score space between the source and target domains, and determine the source domain normalization operation threshold on the source domain validation data. S5, map the source domain normalization operation threshold to the target domain logit threshold and the target domain probability threshold, determine at least one of the target domain logit threshold, the target domain probability threshold, and the source domain normalization operation threshold as the target domain operation threshold, and write or update the target domain operation threshold to the threshold determination module of the detection device. S6, use the target domain operation threshold to determine the negative / positive results of the target domain tea leaf spectral samples and output the detection results; S7. Use the target domain operation threshold to re-judge the target domain 0 h baseline samples, calculate the target domain 0 h false positive rate, and determine whether to trigger the adaptation failure fallback mechanism based on the target domain 0 h false positive rate and the scale status of the target domain baseline distribution.
2. The zero-time baseline anchoring threshold adaptation method for cross-domain deployment of spectral detection of tea tree diseases according to claim 1, characterized in that, S2 includes: during the deployment initialization phase under the conditions of the target tea garden, target detection batch, or target equipment, the spectral acquisition unit automatically collects the target domain 0h baseline negative tea leaf spectral sample set and inputs it into the source domain trained model to obtain the target domain baseline prediction score.
3. The zero-time baseline anchoring threshold adaptation method for cross-domain deployment of spectral detection of tea tree diseases according to claim 1, characterized in that, The S3 step, which involves probability truncation, logit transformation, and robust anchoring parameter calculation for the baseline prediction probabilities of the source and target domains, includes: calculating the original probability p of the i-th sample output by the tea tree disease spectral detection model. i Perform probability truncation to obtain the truncated probability p. i,clip And the truncated probability p i,clip Perform the logit transformation to obtain the logit score s. i : In the formula, i is the sample index, p i p represents the original predicted probability output by the tea tree disease spectral detection model for the i-th sample. i,clip Let be the truncated probability, min{·} be the minimum function, max(·) be the maximum function, log(·) be the natural logarithm function, and ε be the probability truncation parameter.
4. The zero-time baseline anchoring threshold adaptation method for cross-domain deployment of spectral detection of tea tree diseases according to claim 3, characterized in that, The step S3, which involves obtaining the robust source domain position parameter, robust source domain scale parameter, robust target domain position parameter, and robust target domain scale parameter, includes: calculating the robust source domain position parameter μ. S Source domain robust scaling parameter σ S Target domain robust position parameter μ T and the target domain robust scaling parameter σ T : Where median(·) denotes the median function, median i (·) indicates taking the median for sample index i. EPS represents the logit score of the i-th baseline negative sample in the source domain with a 0h baseline, and EPS is the lower limit of the preset scale. This represents the logit score of the i-th baseline negative sample in the target domain.
5. The zero-time baseline anchoring threshold adaptation method for cross-domain deployment of spectral detection of tea tree diseases according to claim 1, characterized in that, S4 includes: constructing source domain normalized fractions according to the following formula. and target domain normalized score : In the formula, This represents the logit score of the i-th sample in the source domain. Let represent the logit score of the i-th sample in the target domain. The source domain normalization threshold is determined based on the prediction score from the source domain grouped cross-validation or the prediction score from the source domain independent validation set. The determination methods include maximizing the Youden index, maximizing sensitivity under a preset specificity, maximizing specificity under a preset sensitivity, and maximizing F... β The metric is either the minimum of a preset cost function or the determined source domain normalization threshold is denoted as... Among them, F β A weighted harmonic mean index that comprehensively measures sensitivity and accuracy.
6. The zero-time baseline anchoring threshold adaptation method for cross-domain deployment of spectral detection of tea tree diseases according to claim 1, characterized in that, S5 includes: setting the source domain normalization threshold determined in step S4. Mapped to the target domain logit threshold θ T,logit And the target domain logit threshold is inversely mapped to the target domain probability threshold θ. T,prob : In the formula, exp(·) is an exponential function with the natural constant e as its base.
7. The zero-time baseline anchoring threshold adaptation method for cross-domain deployment of spectral detection of tea tree diseases according to claim 1, characterized in that, The S6 includes: using the target domain operation threshold to control the tea tree disease spectral detection equipment or detection system to perform automatic disease determination on the spectral sample of tea leaves to be tested in the target domain, and outputting one or more of the following through the result output module: disease early warning result, positive alarm, risk classification, detection result, uncertain result, and review prompt.
8. The zero-time baseline anchoring threshold adaptation method for cross-domain deployment of spectral detection of tea tree diseases according to claim 1, characterized in that, S7 includes: re-evaluating the target domain 0-h baseline negative tea leaf spectral sample set using the target domain operation threshold, and calculating the target domain 0-h false positive rate according to the following formula: In the formula, FPR T,0h For the target domain 0h false positive rate, N +,T,0h N represents the number of samples identified as positive in the baseline negative tea leaf spectral samples of the target domain at 0h. T,0h The total number of valid samples for the baseline negative tea leaf spectral samples in the target domain at 0h. The adaptation failure fallback mechanism is triggered when any of the following conditions are met: a) The false positive rate of the target domain 0 h exceeds the preset false positive rate limit; b, The median absolute deviation of the baseline logit score in the target domain 0 h is less than the preset scale lower limit EPS; c. The robust scaling parameter of the target domain is lower than the preset scaling threshold; The adaptation failure rollback mechanism includes one or more of the following: adjusting the threshold according to a preset priority, rolling back the conservative threshold, switching to a backup model, outputting uncertain results, adding a 0 h baseline sample size prompt, and prompting for re-collection.
Citation Information
Patent Citations
Cross-domain multi-modal remote sensing image classification method based on comparative learning
CN116912595A
Method and system for detecting a biological substance by hyperspectral imaging
US20220120674A1