Deep learning evaluation model training method for beef cattle reproductive performance prediction
Patent Information
- Application Number
- CN202611347319.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-02
- Publication Date
- 2026-10-23
AI Technical Summary
其一,阈值或单一分类器主导的判定对夜间弱光远距离设备状态不稳等质量波动高度敏感,易形成阶段性误报,尤其在夜间--多篇报道认为夜间分娩占比较高,管理负荷与误扰代价更为集中;其二,跨牧场、跨季节与不同饲养方式导致的分布差异,会使概率输出与阈值在迁移时发生偏移,出现同一模型在不同场景下告警口径难以对齐的情况;其三,训练与上线流程中普遍缺乏把提前量误警代价等管理诉求前置为统一约束的机制,多依赖经验调参和人工巡检配合,难以形成可复用的阈值与口径统一机制,亦难对误警密度给出明确上界,更难稳定提供具可操作性的提前量
窗口标签与区间标签在统一时间戳入库,配合质量元特征与综合质量评分,使训练样本在同一口径对齐并在数据层表达证据可信度,从而减少由夜间弱光、遮挡与佩戴松动引起的噪声进入后续学习与判定链路;
Smart Images

Figure CN122964531A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of beef cattle reproductive prediction technology, specifically to a deep learning evaluation model training method for predicting beef cattle reproductive performance. Background Technology
[0002] In the reproductive management of beef and dairy cattle, peripartum monitoring typically relies on neck-worn sensors (used to collect temporal information such as body movement) and fixed cameras to identify behavioral and physiological changes before calving. Publicly available studies often use 24-hour / 6-hour time windows to evaluate the ability to distinguish calving occurring within these two windows, and conduct comparative verification in tethered and untethered pens. In recent years, two-stage identification approaches for grazing environments and short-term video verification based on posture and trajectory have emerged. Independent field validation also shows that when tail movement devices are used to combine alarms for discrimination within a 12-hour timeframe, they often only achieve moderate sensitivity and specificity, and there are practical problems such as loosening of the device, device detachment, and missing data.
[0003] Based on the above information, it can be seen that existing solutions mainly face three common constraints in real-world scenarios: First, threshold-based or single-classifier-driven judgments are highly sensitive to quality fluctuations such as unstable conditions of equipment at low light and distances at night, easily leading to periodic false alarms, especially at night—multiple reports suggest that nighttime births account for a higher proportion, resulting in a more concentrated management burden and cost of false alarms. Second, distribution differences across pastures, seasons, and different feeding methods can cause the probability output and threshold to shift during migration, leading to difficulties in aligning the alarm criteria of the same model in different scenarios. Third, the training and deployment processes generally lack a mechanism to incorporate management requirements such as the cost of false alarms as unified constraints, relying more on experience-based parameter tuning and manual inspections. This makes it difficult to form a reusable and unified threshold and caliber mechanism, to provide a clear upper bound on false alarm density, and to stably provide operable advance warnings.
[0004] Based on the above situation, the core technical problem to be solved is that under complex production conditions such as pen and grazing, existing birthing early warning methods lack endogenous inhibition and cross-field consistency in judging data and scene quality fluctuations, day and night and pasture differences, and threshold dependence. This makes it difficult to control the false alarm density during critical periods such as night and to stably provide an operable advance warning while ensuring the hit rate. Summary of the Invention
[0005] (a) Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a deep learning evaluation model training method for predicting the reproductive performance of beef cattle. This method involves conducting event-time joint training, applying monotonically consistent constraints, incorporating nighttime false alarm penalties and lead time limits into the loss function, and fusing multimodal evidence using quality gating. It also implements pasture-specific probability calibration, constructs a conformity risk set and a daily false alarm budget for each cattle, and standardizes trigger criteria. Furthermore, it establishes a candidate-verification state machine, schedules video poses according to quality standards, fuses evidence in the logarithmic probability domain with windowed evidence, and incorporates adaptive testing and student model degradation. This approach achieves fewer false alarms, operable lead times, and solves the technical problems described in the background section.
[0006] (II) Technical Solution To achieve the above objectives, the present invention provides the following technical solution: The training method for a deep learning evaluation model for predicting the reproductive performance of beef cattle includes generating 24-hour, 6-hour, and 2-hour window labels based on the calf's birth time and allowing interval labels; collecting equipment health and video quality data to form quality meta-features and a comprehensive quality score, and storing them in a database with timestamps. Discrete-time risks are learned based on labels and multi-window probabilities are output; nighttime false alarms and lead time lower bound penalties are added to the loss; multimodal evidence is weighted and masked based on quality element features and monotonic consistency constraints are applied. Temperature scaling or order-preserving calibration is applied to the probability based on the pasture; a set of conformal risks is constructed on the validation set and a risk indicator is generated, based on which the daily false alarm budget per cow is set and the triggering criteria are solidified; Candidates are triggered by risk indicators and comprehensive quality scores; when the quality meets the standard, video pose verification is scheduled and fused with window evidence in the log odds domain; when the quality or connectivity is insufficient, the student model is switched downgraded and the budget is recorded.
[0007] Furthermore, the quality meta-features include at least battery level, signal strength, data packet loss ratio, wearing stability, image quality score, brightness, and occlusion ratio; the quality meta-features, window labels, and interval labels are stored in the database under a unified timestamp and unique identifier, and serve as input fields for confidence gating and candidate triggering.
[0008] Furthermore, a bag-based aggregation method is adopted to absorb weak labels: sample bags are formed by continuous time segments of the same cow, bag-level labels are determined by interval labels, and weights are generated based on the distance mapping between the segment time and the interval center; bag-level probabilities and sample unique identifiers are stored together to serve as the supervision entry point for subsequent joint training.
[0009] Furthermore, discrete risk rate sequences and multi-window probabilities are output on the same time axis. The loss function includes both nighttime false alarm penalties and lead time lower limit penalties. Nighttime indications and lead time thresholds are recorded as deployment parameters. The three-window probabilities are corrected by monotonic consistency constraints and bound to timestamps for subsequent calibration and budget calls.
[0010] Furthermore, the confidence-gated fusion uses the comprehensive quality score mapping as the weight to perform weighted and failure-masking on neck sensing, video pose and environmental meteorological evidence; the weights and masking thresholds are configured in the same dimension and recorded as deployment parameters, and the fusion output and multi-window probability are aligned in the same criterion domain.
[0011] Furthermore, calibration parameters are generated and solidified into calibration curves according to pasture and season, and the corresponding curve is selected according to pasture during deployment; a symmetrical risk set is constructed by reserving a validation set and the risk indication threshold is calculated, and budget levels are set in layers for day and night, with the threshold and budget caliber explicitly registered in the configuration file.
[0012] Furthermore, the budget uses a daily counter per cow. If a candidate trigger is confirmed and not deducted during calving on the same day, the counter is refreshed daily. The budget is recorded as a prerequisite for candidate triggers and is bound to the trigger criteria. It is also fixed and stored together with the threshold and calibration curve in the deployment report.
[0013] Furthermore, a candidate-review state machine is constructed: candidates are triggered when the risk indicator passes and the comprehensive quality score reaches the threshold; the review only schedules short-term videos, extracts fragmented temporal evidence of tail lift, standing up and lying down, exertion and gait, and fuses it with window evidence in the log probability domain to form the online judgment input.
[0014] Furthermore, online adaptation is limited to updating normalized statistics and channel affine coefficients, with small batches of samples coming from candidate or verification caches; when entering the student model rollback, adaptation is paused and the parameters from the previous round are retained, and adaptation is resumed after the quality recovers to above the threshold, maintaining consistency with the budget and threshold caliber.
[0015] Furthermore, the student model rollback is triggered based on a preset degradation judgment rule, which consists of a comprehensive quality score threshold, a connectivity packet loss rate threshold, and a behavior scheduling cost threshold, and records the trigger item identifier; the rollback path follows the judgment criteria of a six-hour window probability and a budget threshold.
[0016] (III) Beneficial Effects This invention provides a method for training a deep learning evaluation model for predicting the reproductive performance of beef cattle, which has the following beneficial effects: Window labels and interval labels are stored in the database with the same timestamp. Combined with quality meta-features and comprehensive quality scores, the training samples are aligned with the same caliber and the credibility of evidence is expressed at the data layer, thereby reducing the noise caused by low light at night, occlusion, and loose wearing into the subsequent learning and judgment links. Discrete risk rate and multi-window probability are jointly output on the same time axis and subjected to monotonically consistent constraints. Combined with the nighttime false alarm penalty and the lead time lower limit penalty in the loss, the triggering basis is concentrated on the time period with management significance, while ensuring that the probability relationship between short window and long window remains consistent during the training phase. Confidence-gated fusion applies weighting and failure masking to neck sensing, video pose and environmental weather based on comprehensive quality scores, which suppresses the influence of unreliable modes and ensures that reliable modes can still provide usable evidence under varying lighting, distance and occlusion conditions, and provide consistent input for subsequent candidate and verification processes. Before deployment, the probability calibration of different pastures and the combination of risk sets form risk indicators and budget calibrators, so that the trigger threshold sources are unified under different pastures and seasons, and the number of false alarms is budgeted at the level of each cow per day, thereby establishing a verifiable trigger standard and recording system for cross-scenario migration and long-term operation.
[0017] The candidate-review state machine triggers candidates with risk indicators and comprehensive quality scores. When the quality meets the standard, only video pose review is scheduled. It also fuses evidence in the log-odds domain and window evidence to keep candidate selection and review calls in the same criterion domain, reduce invalid scheduling and maintain consistency between online judgment and training criteria. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the training method for the deep learning evaluation model used for predicting the reproductive performance of beef cattle according to the present invention. Detailed Implementation
[0019] 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.
[0020] Please see Figure 1 This invention provides a method for training a deep learning evaluation model for predicting the reproductive performance of beef cattle, comprising: Step 1: Before entering model training, based on unified event criteria and quality evidence, establish a continuous chain of event labels - interval weights - quality vectors - bag aggregation, so that subsequent steps can take into account sample weights, gating weights and candidate triggering conditions, thereby bringing forward the management requirements of fewer false alarms and operable advance to the data layer and solidifying them in a verifiable form.
[0021] Perinatal data is characterized by asynchronous acquisition, significant scene differences, and a high proportion of weak annotations. If coarse labels and raw signals are directly input into the model, the model may easily misinterpret nighttime agitation, loose clothing, and low-light occlusion as strong evidence. Therefore, it is necessary to first form three-window event labels and interval weights under a unified time reference, then introduce cross-modal quality evidence, and finally form a stable training entry point using bag aggregation and self-supervised methods.
[0022] Three types of objects are organized side-by-side on the same timeline: first, three-window labels and interval weights based on event time points; second, quality vectors and comprehensive quality scores aligned to the time scale; and third, bag samples and their bag-level labels, organized by cow. These objects are semantically mutually supportive: interval weights contribute to sample importance, comprehensive quality scores serve as gating and weighting cues, and bag-level labels support the absorption of weak labels. All three have a consistent timestamp and unique identifier, ensuring seamless integration with the objective function and threshold setting in the next step.
[0023] Among these, the time point of the event was determined at the scene using the delivery record. And establish a 24-hour window set on the timeline. Six-hour window assembly Two-hour window assembly For any time scale Define the window label function as follows:
[0024] Where: Event time point Determined by the moment of calf birth, used as a reference for uniform window alignment; time scale. : The distance of a sample relative to an event at the time of sensing or video sampling; window set Based on the time of the event A family of fixed-length intervals for backtracking. , , These represent time intervals of 24 / 6 / 2 hours before delivery, used for label assignment.
[0025] Indicator Function : If the logic is true, it takes 1; otherwise, it takes 0. This is used to map time relationships to label values.
[0026] The event time was recorded on-site immediately after the cow gave birth. The system aligns wearable data with video timestamps using a unified clock, and assigns corresponding time scales according to a formula. Function to generate window labels And it is entered into the database along with the sample's unique identifier. Window label function Aligning different modalities and sampling frequencies under the same caliber solves the common problem of inconsistent labels across modalities for the same cow; the three-window setup lays the data foundation for subsequent multi-window monotonic consistency constraints; and unified timestamps and unique identifiers ensure traceability during review and verification.
[0027] When the scene can only confirm the time of the event, At a certain point in the previous period, the interval endpoints were introduced. It assigns soft weights only to samples within this interval, such that the weights are at their maximum value of one at the center of the interval, decrease to zero at the two endpoints of the interval, and are zero outside the interval, to reflect the intuition that the confidence level increases as the sample approaches the center of the interval.
[0028] Where: Interval endpoints : Prior boundaries in hours, satisfying Positive real numbers, used to define the upper and lower bounds of uncertain time periods, with their subscripts a and b used to distinguish them from τ, which serves as the discrete time step index in step two; interval center. The arithmetic midpoint of the interval endpoints is where the weight reaches its maximum value; the weight function. : Assign soft weights to samples within the interval, with values ranging from 0 to 1. The weight is 1 at the center of the interval, 0 at the two ends of the interval, and 0 outside the interval. This is used to reduce the weights of samples according to their deviation from the center of the interval during training. The staff on duty will enter the records of calvings occurring within approximately six to eight hours as the interval endpoints. The system is based on a time scale. Calculate the weight function and with the window label function Synchronized data import; during the training phase, the weight function... It will be used as the sample weight.
[0029] Weighting function This allows fuzzy records to be retained as learnable evidence rather than discarded, reducing the risk of overfitting to a small number of precise labels; the interval endpoints can be flexibly set according to the recording accuracy or personnel system, improving consistency across shifts and seasons; soft weights are naturally compatible with subsequent objective functions and do not introduce new offline thresholds.
[0030] As an example, in a stall-fed calf pen, the recorder confirms the time of the event in the system after the calf is born. The system backtracks to generate 24 / 6 / 2-hour window label functions. Only cases of calving within six to eight hours can be confirmed and registered as the endpoint of the interval during the same night shift. Then a weight function is generated. The data is then stored together with camera and wearable samples. This ensures that data fragments from different sources maintain consistency in terms of temporal alignment, weight allocation, and data storage.
[0031] For each time scale, extract quality elements from both the wearer and video sides, and map them uniformly into a quality vector. And calculate the overall quality score. This serves as the basis for subsequent gating, weight reduction, and offline screening:
[0032] Where: mass vector The measurements are taken separately at each data acquisition point, including the neckband device's battery level, signal strength, packet loss rate, and wearing stability; the video side's image quality score, brightness, and occlusion rate; and the meteorological data acquisition point's missing data rate and data freshness, totaling nine components (i.e., the total number of elements is nine). Each element, after monotonically normalized mapping, takes a value from 0 to 1; the mapping function... : Regarding the first A function that performs piecewise linear or piecewise spline normalization mapping on each quality element, taking values from 0 to 1, used to eliminate dimensional differences and set boundary truncation. Weight : No. The importance coefficients of each quality element, ranging from 0 to 1, sum to 1; overall quality score. The weighted sum of quality elements is summarized on the same time scale, with values ranging from 0 to 1; Quality factors are categorized into two types based on their value direction: positive factors include battery level, signal strength, wearing stability, image quality score, and brightness, with higher values indicating better quality; negative factors include data packet loss ratio and occlusion ratio, with higher values indicating worse quality. A monotonically non-decreasing piecewise linear mapping is given for the positive factors, and its boundaries are declared:
[0033] A monotonically non-increasing piecewise linear mapping is applied to the inverse elements, ensuring that their normalization results align with the direction of quality in the same way as the positive elements:
[0034] : No. The original quantities of each quality element (power, signal strength, packet loss ratio and wearing stability of the neckband device, image quality score, brightness and occlusion ratio of the video side, and missing measurement ratio and data freshness of the meteorological data acquisition end) are input according to the sensor dimensions. The effective range endpoints of quality elements must satisfy the condition that the lower endpoint is less than the upper endpoint, as specified in the one-time acceptance test or equipment manual; positive elements are normalized according to the former formula, and negative elements are normalized according to the latter formula, so that the normalization results of both types of elements are that the larger the value, the better the quality, thereby ensuring that the comprehensive quality score remains monotonically unchanged with respect to quality. : Normalization result, range Enter the comprehensive quality score ; Weight, range And the sum is It is initialized based on small sample validation or operational experience.
[0035] At each time scale, data such as battery level, signal strength, packet loss ratio, and wearing stability are read from the neckband device; image quality score, brightness, and occlusion ratio are read from the video side; and the missing data ratio and data freshness are read from the meteorological data acquisition terminal. This is then processed through a mapping function. Normalized to a 0-1 scale, by weight Calculate the overall quality score ; With mass vector With window label function Use the same timestamp in the database to ensure that they can be used together.
[0036] Furthermore, quality elements are assigned according to evidence modalities to facilitate modal weighting and masking in step two: the neck sensing modality corresponds to the neckband device's battery level, signal strength, packet loss rate, and wearing stability; the video posture modality corresponds to image quality score, brightness, and occlusion rate; and the environmental meteorological modality corresponds to the missing measurement rate and data freshness of the meteorological data acquisition terminal, where data freshness is the monotonically normalized value of the time interval between the current moment and the most recent valid meteorological record. Modal quality scores are calculated separately for each modality.
[0037] In the formula: modal identifier m: taken from one of neck sensing, video pose, or environmental weather; modal element index set :: The set of quality element subscripts belonging to the m-th mode, where the index sets of each mode are disjoint; intra-modal weights : Values range from 0 to 1 and sum to 1 within the modal; Modal mass fraction The value ranges from 0 to 1 and is used for confidence gating fusion in step two. The comprehensive quality score Q is still calculated based on all quality elements and is used for candidate triggering and degradation judgment. The modal quality score and the comprehensive quality score are stored together in the database with the same timestamp and unique identifier.
[0038] When used, the mass vector With overall quality score It makes implicit risks such as low light, obstruction, loose fit, and communication attenuation explicit, and strictly aligns them with the time scale; comprehensive quality score The existence of this ensures that subsequent candidate triggering, video review, and downgrade operation have a unified adjudication scale; the segmented form of the mapping function facilitates review and parameter tuning, and does not rely on empirical thresholds passed down by word of mouth.
[0039] Furthermore, for samples where only the approximate calving stage can be identified, sample bags are constructed from several segments of a single cow at adjacent time periods, and weak labels are carried by weighted aggregation under bag-level label supervision:
[0040] Where: the probability of an instance being inside the bag : No. Each fragment represents a predicted probability of being related to labor, with values ranging from 0 to 1, used to express the strength of evidence at the fragment level; aggregate weights. : No. The importance coefficients of each segment in bag-level decision-making, ranging from 0 to 1 and summing to 1; bag-level probabilities : The summation probability obtained by weighting the probability of instances within the bag, with a value of 0 to 1, is used as a supervisory signal for alignment with bag-level labels.
[0041] Give aggregate weights Specific form:
[0042] : The central moment of the j-th segment; The center of the interval label, i.e., the interval endpoint. and The arithmetic midpoint; : Weight decay parameter, field-end constant, example taken as 0.4 per hour; Weight, range And the sum is .
[0043] The system constructs sample bags based on the unique identifier of the cow and temporal continuity, using calving records within six to eight hours of the night shift as bag-level labels. Before entering supervised learning, the model undergoes self-supervised pre-training on long-term wearable data using a masking-reconstruction task, enabling the encoder to reconstruct normal daily rhythms and behavioral transitions. Subsequently, bag aggregation is employed in the supervised phase to aggregate bag-level probabilities. Aligning with bag-level labels avoids forcibly labeling instance-level data while preserving weakly certain evidence.
[0044] In practice, bag aggregation robustly transforms records with only approximate time periods written on paper into usable monitoring signals; and with interval weighting functions... In conjunction with this, confidence is expressed at both the instance level and the bag level. It is integrated with pre-supervised learning so that the encoder has learned the temporal structure of segmentation-transition-regression before seeing the label, reducing the subsequent learning's dependence on a few strong labels.
[0045] As an example: In a grazing pasture, neck collar devices transmit power and signal strength at fixed intervals, and the base station records the packet loss rate; cameras at the entrance capture short videos as cattle pass by, and the system calculates image quality scores, brightness, and occlusion rates for each video segment; these quantities are aligned on the time axis to form a quality vector. And calculate the overall quality score. Cases of calving within six to eight hours recorded during the night shift were automatically sorted into sample bags. During the training phase, bag-level probabilities were obtained by aggregated bag-based sampling. It is aligned with bag-level labels; long-day sequence data undergoes masking-reconstruction pre-training before supervision, followed by three-window labels and bag-level supervision.
[0046] Step 2: Under the same time axis and quality caliber, simultaneously learn the discrete risk rate sequence and multi-window probability, and write the nighttime false alarms and insufficient advance into the objective function. Use the quality score to drive the fusion weights, and finally use monotonic projection to correct the multi-window output, so that the training objective and the upper limit judgment remain numerically isomorphic.
[0047] Physiological and behavioral signs in beef cattle before calving exhibit a clear time-progressive nature: as calving approaches, the probability of an event occurring within a short window should be no lower than the corresponding probability within a long window; however, at night, in low light, and when clothing conditions are unstable, the reliability of modal evidence changes over time. If this is not addressed during the training phase, the threshold will be transferred to the upper limit, resulting in concentrated false alarms and non-transferable empirical thresholds. Therefore, it is necessary to uniformly characterize the relationship between remaining time and window probability using a discrete risk-survival framework, and to incorporate nighttime false alarms and ineffective advances into the objective function with a cost term. Simultaneously, quality scores should drive modal fusion, and monotonic projection should be used to constrain the multi-window output within an order relationship of two hours ≤ six hours ≤ twenty-four hours.
[0048] The process involves first outputting a discrete risk rate sequence on a discrete time scale, then obtaining three types of window probabilities through survival mapping; subsequently, false alarms at night and insufficient lead time are transformed into differentiable cost terms and added to the joint objective; through this chain-like organization of construction followed by constraint, the probability output, lead time, and cost weights are coupled to each other during the training phase.
[0049] On the same time axis at the observation time, the model outputs a discrete hazard rate sequence, which is superimposed at fixed time steps and mapped to the occurrence probabilities of different windows. To ensure that the multi-window output follows survival semantics, an exponential survival mapping is used to construct the window probabilities:
[0050] Where: Window probability The probability that a childbirth event will occur at least once, representing the probability at the observation time. After The probability of delivery within one hour, ranging from [value missing]. to Window width : Indicates from the observation time The cumulative time length moving towards the future, with a set of values. ; Observation time : Sample relative time, Indicates before delivery; Summation upper limit ⌊T / δ⌋: represents the number of time steps calculated by time step δ based on window width T, where ⌊⋅⌋ is the floor operator, used to ensure that the accumulation range is consistent with the window width in terms of time dimension; Discrete risk rate Discrete risk rate sequence at observation time The The value of each time step is a non-negative real number, representing the value at the remaining time displacement of . to The strength of the condition occurring within the interval; the time step : Represents the actual time length corresponding to a single discrete time step. It is a positive real number used to couple the risk rate with the time scale. For example, one minute is taken, which is one-sixtieth of an hour.
[0051] Align the wear sequence with the video pose at the minute level and determine a fixed time step. The encoder outputs a discrete risk rate sequence. The above formula yields Three window probabilities are used; the discrete risk rate sequence is also retained to characterize the lead-related constraints in the cost term. The mapping from the discrete risk rate sequence to the window probabilities makes the remaining time distribution mathematically consistent with the multi-window probabilities, thus avoiding the counterintuitive situation where the short window probability is higher than the long window probability; the three types of windows are linked under the same survival semantics, providing a unified dimension for subsequent monotonic projection and budgeted thresholding.
[0052] Furthermore, based on multi-window probabilities, the penalty for false alarms at night and the constraint of the lower limit of the operable lead time are incorporated into the objective function in a weighted differentiable form, enabling training to directly respond to management requirements. Define the joint objective:
[0053] The specific form of window loss is given:
[0054] Where: Joint loss : Non-negative real numbers, representing the minimization objective during the training phase; window loss weights : Positive real numbers, used to distribute attention among the three types of windows; window loss function : Take the logarithmic loss form to ensure consistency in probabilistic learning; Window tabs : Binary variable, derived from the window label vector in step one; window probability The aforementioned survival mapping output; nighttime penalty coefficient. : Positive real number, used to amplify the cost of false alarms at night; night indication function : Values Or 1, obtained by mapping timestamps to ranch schedules; Monotonically increasing penalty function The input is a probability, and the output is a non-negative real number. It is used to suppress unfounded alarms and takes the form of a piecewise linear or smooth polygonal line.
[0055] : Probability shift threshold; Quality modulation lower and upper limits; : Slope, example value is 8; Quality threshold (compared to step one) (Same caliber), for example, 0.60. The quality modulation function g(Q) is uniformly defined in this step to maintain a consistent quality caliber. Its value is used as the quality modulation weight of the behavioral evidence in step four. The joint loss in this step does not directly call this function.
[0056] Lead time penalty coefficient : A positive real number used to constrain insufficient lead time; trigger indicator function A value of 0 or 1 indicates that in the window Samples that triggered alarms within the specified timeframe; lower limit of operable lead time. : Set the window value to a fixed value in hours. In the example, a two-hour window takes 2, a six-hour window takes 2, and a twenty-four-hour window takes 6; Positive part operator Output equals input and... The larger of the two; Lead time point estimation : A non-negative real number, in hours, obtained by weighted summation of discrete risk rate sequences through discrete distributions, and compared with the lower limit of the actionable lead time on the same time dimension;
[0057] : Maximum number of replay steps, corresponding to the longest advance attention time, example is 1440, matched with a time step of one minute, corresponding to 24 hours; : Discrete approximation of survival probability; the product factor τδ is the actual lead time corresponding to the τth time step, in hours, so that the lead point estimate and the lower limit of the operable lead are subtracted on the same time dimension; the other symbols are the same as before.
[0058] Using the window labels and interval labels from step one as monitoring signals, a nighttime indicator function is constructed in conjunction with the night shift schedule. With trigger indicator function Set the lower limit of the operable lead time. A fixed threshold is used to explicitly penalize samples that trigger a two-hour window but whose remaining time points are estimated to be below the threshold; during training, the window loss weights are adjusted. Nighttime penalty coefficient Lead time penalty coefficient Grid-based filtering is used to ensure that the three types of costs are comparable in magnitude. In the example, the window loss weight is between 0.5 and 2.0 with a step size of 0.5, the night penalty coefficient is between 0.5 and 5.0 with a step size of 0.5, and the lead time penalty coefficient is between 0.1 and 2.0 with a step size of 0.1.
[0059] When used, the joint objective incorporates the three requirements of equal recall, minimal disruption, and early intervention into the same differentiable framework, enabling the model to develop an inherent preference during the training phase that nighttime alarms should be treated with caution and that insufficient lead time should not trigger high-level alarms; through explicit lower limit thresholds, the semantics of lead time and window probability are quantitatively coupled.
[0060] As an example: During the training week for stall-fed farrowing pens, the management terminal imports the window labels and interval labels generated in step one, along with the night shift schedule; engineers set the lower limit of the operable lead time for a two-hour window to two hours and the lower limit of the operable lead time for a six-hour window to two hours in the training script; the system reads the discrete risk rate sequence on the same time axis, obtains the probabilities of the three types of windows according to the above formula, and constructs a joint loss accordingly; during training, nighttime samples are given a higher cost, and the model gradually reduces its response intensity to short-term agitation at night; when the batch ends, the log shows that samples triggered by the two-hour window but with insufficient remaining time occupy a significant weight in the loss, indicating that the next round of training will still converge toward a discrimination strategy that prioritizes lead time before triggering.
[0061] Furthermore, under multimodal input, the credibility of evidence varies with device health and image quality. The quality score should first drive modal weight allocation and failure masking, and then monotonically consistent projection should be applied to the multi-window output. This ensures that quality determines who speaks and order determines how they speak, forming a continuous link and avoiding cross-window probability reversals caused by short-term distortion of individual modalities.
[0062] Instead of directly superimposing modal outputs with fixed weights during the fusion phase, the multimodal quality scores obtained in step one are first read, mapped to weights, and failure masking is implemented.
[0063] The specific approach is as follows: Multimodal quality scores are read at each time scale and converted into modality weighting coefficients using a monotonic function. Modality is masked when its weight falls below a threshold. Subsequently, the discrete risk rate sequences of each modality are weighted and aggregated. The aggregated result serves as the sole input to the survival mapping, and the window probability is uniformly derived from this fusion result, thus obtaining a quality-sensitive fusion result. To ensure feasibility, a monotonic spline mapping with fixed nodes is used for the monotonic function. The masking threshold and weighting are set within the same dimension to avoid inconsistencies between the masking and weighting methods. Gradients during training are backpropagated through the differentiable segment of the weight mapping. Failure masking uses an approximately smooth replacement at nodes that do not satisfy differentiability.
[0064] Furthermore, the specific form of confidence-gated fusion is given. Let the evidence modality set ℳ include three categories: neck sensing, video pose, and environmental / meteorological data. At each time scale, each modality is weighted according to the modality quality score from step one and failure masking is implemented:
[0065] Where: Modal weights : A non-negative real number, obtained by multiplying the shielding characteristic by the monotonic spline mapping; shielding threshold Values range from 0 to 1. When the modal quality score is below this threshold, the weights are reset to zero. An example value is 0.35. Monotonic spline mapping S(⋅): A monotonic, non-decreasing spline with fixed nodes. Nodes are 0, 0.25, 0.50, 0.75, and 1.00, corresponding to node values of 0, 0.15, 0.45, 0.80, and 1.00. Nodes are interpolated using monotonic cubic interpolation. Nodes and their values are recorded together as deployment parameters. Normalized modal weights. : Non-negative real numbers that sum to 1 over all modes; when the modal quality scores of all modes are below the masking threshold, the normalized denominator of the above formula is zero. In this case, confidence-gated fusion is not performed, and the student model degradation path is directly entered according to the degradation trigger instruction in step four. The normalized modal weights at the moment before degradation are retained for review. Modal quality score This comes from step one.
[0066] After obtaining the normalized mode weights, the discrete hazard rate sequences of each mode output are weighted and converged with the same weight. The converged result serves as the sole input to the aforementioned survival mapping.
[0067] Where: Modal discrete risk rate The non-negative real number output by the coding branch of the m-th mode at the τ-th time step of observation time t; the discrete risk rate after fusion. The only input to the survival map. The masking threshold and weights are configured on the same 0 to 1 dimension to avoid inconsistencies between masking and weight reduction. The gradient during training is backpropagated through the differentiable segment of the monotonic spline, and the masking characteristic is approximated at non-differentiable nodes by a smooth piecewise line with a slope of 20.
[0068] In use, the fusion weights are driven by the multimodal quality scores, ensuring that short-term distortions caused by low light, occlusion, loose fitting, and missing data packets are not amplified in the fusion layer; fusion is applied only to the discrete risk rate path, and the window probability is uniformly derived from the fused discrete risk rate through survival mapping, ensuring that the remaining time characterization and window probability output are synchronized and consistent from a quality perspective without generating secondary weighting; the threshold and weights are set with the same dimensions, which facilitates the continued use of the same scale for budgeting and scheduling in steps three and four.
[0069] Furthermore, even when using survival semantics to construct window probabilities, noise during training can still lead to short-term inversions. Therefore, at the end of each training batch, a monotonically consistent projection is performed on the three types of window probabilities, projecting them onto an ordered set of two hours ≤ six hours ≤ twenty-four hours, while minimizing the distance from the original values:
[0070] Where: the probability of the window two hours after projection : Indicates the time of observation The two-hour window delivery probability, after being corrected by monotonic uniformity projection, is the final two-hour window probability value used for subsequent calibration, budgeting, and go-live determination. Window probability six hours after projection : Indicates the time of observation Below, the probability of delivery within the six-hour window after monotonic uniform projection correction, and... Together they satisfy the order relation that two hours is no greater than six hours and six hours is no greater than twenty-four hours; Window probability 24 hours after projection : Indicates the time of observation Under the following conditions, the probability of delivery within the 24-hour window after monotonic uniform projection correction is the longest among the three types of windows; Projected variable two-hour window probability The intermediate variable introduced in the solution process represents the probability of the candidate two-hour window, and is required to be consistent with... Satisfy together .
[0071] Projected variable six-hour window probability The intermediate variable introduced in the solution process represents the probability of the candidate six-hour window, and is subject to the following constraints. This monotonic constraint.
[0072] Projection variable 24-hour window probability The intermediate variable introduced during the solution process represents the probability of the candidate 24-hour window and is the largest one in the constraint chain.
[0073] Window Index Set : This indicates that the summation is performed on three windows: two hours, six hours, and twenty-four hours, controlling the types of windows that the summation symbol traverses.
[0074] Projection variables : consecutive real numbers, subject to order constraints ; Projection weights : Corresponding to each window The non-negative weights reflect the desire to maintain the original window probability during projection. The degree of [something] can be set according to the verification results by window. For example, a two-hour window of 1.0, a six-hour window of 1.0, and a twenty-four-hour window of 0.5 are used. Original window probability : Indicates the time of observation Below is the window probability directly calculated by the survival model, without undergoing monotonic consistent projection correction; where... Choose two, six, or twenty-four; The adjacent violation merging method is used to solve the above-mentioned order-constrained quadratic programming, and the intra-batch projection is completed in linear time complexity. After training, the nodes and weights of the projection operation are solidified into the post-processing steps of the inference side to keep the same order constraints inside and outside the training. In order to avoid numerical oscillation, upper and lower limits are set for the weights and linked with the calibration curve in step three to ensure that the projection scale is consistent when migrating across pastures.
[0075] When used, monotonic consistent projection forms isomorphic constraints inside and outside the training process, ensuring that the probabilities of the three types of windows satisfy the semantics that the short window is no higher than the long window in any scenario; by weight allocation and batch solving, changes to the backbone network structure are avoided, thus achieving stable order constraints at a low cost; and it forms a continuous interface with the calibration-budget step three, so that the window caliber and order criteria do not need to be redefined in the future.
[0076] Step 3: Under a unified window probability calibrator, first apply temperature scaling or ordinal regression calibration to the multi-window probability according to pasture and season. Then, construct a conformal risk set on the reserved validation set and generate a risk indicator. Based on this, the daily false alarm budget per cow is deduced into a deployable trigger threshold and the trigger calibrator is solidified, so that the alarm density during cross-pasture and cross-seasonal migration has a commensurable upper bound.
[0077] Although the three-window probabilities output in step two satisfy the order relation, their numerical scale still drifts with pasture size, pen type, feeding method, and season: the actual calving rate corresponding to the same probability value is different in pasture A than in pasture B. If empirical thresholds are directly applied, the alarm calibrators of the same model may be difficult to align across different pastures; at the same time, without statistical guarantees, it is impossible to provide a clear upper bound on the false alarm density. Therefore, it is necessary to first calibrate the probabilities to a scale consistent with the actual frequency according to pasture and season, then establish a risk set with finite sample coverage guarantees on the reserved validation set using conformal inference, and finally decompose the daily false alarm budget per cow given by the management to obtain the trigger threshold, forming a continuous chain of calibration-guarantee-budget.
[0078] First, grouped calibration curves are obtained by temperature scaling or order-preserving regression. Then, a conformity risk set is constructed using the non-compliance score and empirical quantiles, and a binary conformity indicator and a continuous risk indicator are generated from this set. Finally, the empirical curve of false alarm density with respect to the threshold is statistically analyzed on the same holdout set, and the trigger threshold is triggered by inverse solution according to day and night stratification. The calibration curve, conformity quantiles, budget level and threshold are registered together as the trigger calibrator.
[0079] Let the window probability obtained by monotonically consistent projection in step two be... According to group identifier Grouping, and applying temperature scaling on the reserved validation set of that group using a linear transformation in the log-odds domain:
[0080] Where: calibrated window probability The value ranges from 0 to 1, representing the window probability after grouping and calibration. It is the sole probability entry point for subsequent fitting construction, inverse budgeting, and upper bound determination; grouping identifier. A discrete identifier composed of pasture and season identifiers. Seasons are divided into four segments—spring, summer, autumn, and winter—based on local phenology; therefore, one pasture corresponds to four groups. Temperature parameter. : Positive real number, used to scale the log-odds ratio; values greater than 1 lower the confidence level, while values less than 1 raise the confidence level; bias parameter : Real numbers, used to shift the center of the logarithmic probability; logarithmic probability function Mapping the probabilities from 0 to 1 to a monotonically increasing function on the entire real number line; mapping function S-shaped mapping, defined in step four.
[0081] Temperature and bias parameters are solved on the reserved validation set using window labels as supervision and by minimizing the negative log-likelihood.
[0082] Where: Leave out the validation set : Belongs to group And the sample index set that did not participate in the training in step two; window loss function Define the same as in step two, but use the logarithmic loss form; window label This is derived from step one. The solution uses a one-dimensional mesh search combined with quasi-Newton refinement. In the example, the temperature parameter is between 0.5 and 3.0 and the mesh is formed with a step size of 0.05. The bias parameter is between -2.0 and 2.0 and the mesh is formed with a step size of 0.05. The one with the smallest negative log-likelihood is selected.
[0083] When the validation sample size for a certain group is sufficient and the probability deviates non-linearly from the frequency, order-preserving regression is used instead of temperature scaling to directly solve for the monotonically non-decreasing mapping:
[0084] In the formula: ℱ: a family of monotonically non-decreasing functions whose domain and range are both from 0 to 1; order-preserving mapping. : Piecewise constant function obtained by adjacent violation merging method; Fitting weights : A non-negative real number used to allocate fitting attention among the three types of windows. For example, 0.5 for a two-hour window, 0.3 for a six-hour window, and 0.2 for a twenty-four-hour window. Temperature scaling and ordinal-preserving regression are selected, based on comparing the expected calibration error on the same set of buffers and choosing the smaller value. The selected method and the resulting parameters are written to the configuration file.
[0085] Regardless of whether temperature scaling or ordinal-preserving regression is used, the calibration results are solidified into calibration curves: equidistant quantile nodes are selected in the 0-1 interval (example: 101 nodes with a step size of 0.01). The calibrated probability is calculated for each node and written to a lookup table. During deployment, the corresponding lookup table is selected according to the group identifier, and values are obtained using linear interpolation. When the validation sample size for a group is insufficient to the preset lower limit (example: 30 birth events), the regression is performed to the annual curve for the same pasture. If the annual curve for the same pasture is still insufficient, the regression is performed to the full-farm curve for the same season, and the regression identifier and regression level are recorded in the configuration file.
[0086] When used, group calibration ensures that probability values under different pastures and seasons have consistent frequency meanings, and the same threshold maintains the same actual alarm intensity after migration; the lookup table format eliminates the need for the inference side to resolve the optimization problem, and the calibration curve itself can be reviewed and verified node by node; the hierarchical backoff rule when samples are insufficient avoids calibration backlash caused by overfitting of small samples.
[0087] Furthermore, calibration only ensures that the probability scale is consistent with the actual frequency, which is insufficient to provide a statistical upper bound on the false alarm density. Therefore, a risk set is constructed on the same held-out validation set using conformity inference: the nonconformity score is taken as the complement of the calibrated probability, and empirical quantiles are taken according to the significance level, resulting in a window set with finite sample coverage guarantee under the commutativity assumption.
[0088]
[0089] In the formula: non-compliance score The value ranges from 0 to 1, representing the probability complement of the i-th calibration sample within its true window. A larger value indicates that the model does not match the sample as closely as possible; the true window is... The value is determined by the window label from step one, taking two, six, or twenty-four. Because the three types of windows are nested, the same sample may be selected from the labels of multiple windows. Therefore, it is agreed that the window with the smallest width containing the sample (where the window label is one) should be selected to ensure the uniqueness of the symbol value. The number of calibrated samples is then used. : Reserve the number of samples with labels of 1 in the validation set; significance level : A decimal value between 0 and 1, 0.1 in the example, corresponding to a coverage guarantee of no less than 90%. This symbol is a scalar without a fragment subscript in this step, which has a different meaning from the bag-level aggregation weight with fragment subscript j in step one; order statistics The k-th value after sorting all nonconformity scores in ascending order; conformity quantile. The threshold obtained from the above formula takes a value between 0 and 1; the rounding up operator .
[0090] Derive the lower probability bound from the conformal quantile and construct the conformal risk set, while generating a binary conformal indicator:
[0091] In the formula: the conformal lower probability bound : takes a value from 0 to 1, which is the minimum calibrated probability required to enter the risk set; the conformal risk set : a set formed by windows satisfying the lower probability bound at observation time t. Since the calibrated probability is non-decreasing with respect to the window width, this set is always an upper set, that is, if the two-hour window is included in the set, the six-hour and twenty-four-hour windows will inevitably be included in the set; the conformal indicator : binary, takes 1 when the set is non-empty and 0 when the set is empty, which is the pre-switch used in step 4; the empty set symbol ∅.
[0092] Under the gating of the conformal indicator, a risk indicator is generated by a weighted combination of the short window and the long window, which serves as a continuous criterion for candidate triggering:
[0093] In the formula: the risk indicator : a non-negative real number, which is the only continuous criterion for candidate triggering, and its value is always 0 when the conformal indicator takes 0; the two-hour window weight : a positive real number, used to improve the sensitivity of the short window to imminent calving, with an example value of 0.5; the calibrated six-hour and two-hour window probabilities : obtained from the aforementioned calibration curve.
[0094] In application, the conformal quantile is directly given by the empirical quantile of the holdout set, no parametric assumption on the probability distribution is required, and a finite sample guarantee for the coverage rate is provided when exchangeability holds; the conformal indicator acts as a hard gate to prevent statistically unacceptable moments from entering the candidate pool at all, while the risk indicator provides continuous ranking after the gate is passed, and the division of labor between the two ensures that the statistical guarantee and sensitivity do not crowd each other out.
[0095] Further, the demand from the management side is the upper limit of the number of false alarms per cow per day, while the adjustable parameter on the model side is the threshold; it is necessary to establish an empirical curve of false alarm density with respect to the threshold on the same holdout set, and inversely solve for the threshold by stratifying day and night, so that the budget becomes the source of the threshold rather than ex-post verification.
[0096]
[0097] In the formula: the false alarm density function : a non-negative real number, representing the average number of false alarms per cow per day in time period e under the threshold ; the time period identifier : takes day or night, determined by the night indicator function in step 2 and the pasture scheduling table; the cow-day set Leave out the set of cow-day pairs in the validation set that fall within time period e; cow days The number of elements in the set; the inner summation of time scale indicators takes the merged alarm start time: when the risk indicator of the same cow is not less than the threshold on several consecutive time scales, only the earliest time scale is included in the summation, and subsequent times within the cooldown period from that time are not included. The cooldown period is set to six hours in the example, so that the false alarm density is counted according to alarm events rather than by time scale, thus consistent with the deduction of the budget counter; the calving label of the day. : A binary value, where 1 is taken if the i-th cow gives birth on day d, and 0 is taken otherwise. This is used to exclude triggers on the actual day of calving from the false alarm count.
[0098] Since the indicator function is monotonically non-increasing with respect to the threshold, and the false alarm density function is also monotonically non-increasing with respect to the threshold, a unique inverse solution can be found on the candidate threshold set using the bisection method to satisfy the minimum threshold of the budget:
[0099] Where: trigger threshold Candidate trigger thresholds for time period e, with the same dimensions as the risk indicator; Candidate threshold set Θ: A finite set consisting of all deduplicated and sorted values of the risk indicator on the hold-out set; Daily false alarm budget per cow. : Positive real number, the maximum number of false alarms per cow per day given by the ranch management, for example, 0.5 times during the day and 0.2 times at night; min operator: the minimum among the thresholds that meet the budget constraints, in order to retain the highest sensitivity while meeting the budget.
[0100] The threshold provides an upper bound in the expected sense. To ensure that the number of false alarms per cow per day is also subject to a hard constraint, a daily budget counter for each cow is established and refreshed daily:
[0101] Where: Budget counter : A non-negative integer representing the remaining number of false alarms for the i-th cow on day d; initial value of the day cutoff. : Obtained by rounding up the sum of day and night budgets, and taking the value of 1 as an example, where and The daily false alarm budget for each cow is defined separately for daytime and nighttime sampling periods. The deduction condition is that the candidate is triggered and enters the review process, and the cow is verified by manual or post-calving records to have not calved that day; when the counter is zero, the cow will no longer trigger the candidate for that day, but the risk indicator and conformity indicator will still be calculated and recorded as usual for post-event review and threshold recalibration; the counter is reset at 0:00 every day according to the above formula.
[0102] The trigger criteria are explicitly registered in the configuration file and documented in the deployment report. The registered fields must include at least: group identifier and its constituent pastures and seasons, calibration method, calibration curve lookup table and its rollback identifier and rollback level, significance level, conformity quantile, lower bound of conformity probability, two-hour window weight, daily false alarm budget per cow for daytime and nighttime, trigger thresholds for daytime and nighttime, quality threshold, criterion version number, and effective date. Any change to any field generates a new version number; the old version is retained for traceability. The thresholds used for deployment decisions must be taken from the currently effective version and cannot be temporarily rewritten on the inference side.
[0103] In practice, the threshold is derived from the budget inverse, giving the false alarm density a commensurable upper bound instead of relying on empirical parameter tuning; day-night stratification allows the stricter budget to take effect independently at night, forming a consistent constraint between the training and deployment ends with the night false alarm penalty in step two; since the candidate score in step four is based on the risk indicator multiplied by a quality factor and a night factor not greater than one, its triggering frequency will only be less than the case of direct triggering based on the risk indicator, so the above budget upper bound still holds in step four; field registration and version management in the configuration file allow the alarm caliber of the same model in different ranches to be checked item by item.
[0104] As an example: A group manages three fattening farms: Farm A is a stall-feeding pen, Farm B is a semi-open fenced area, and Farm C is a grazing pasture. These are divided into twelve groups based on pasture and season. Each group's calving records from the previous year form a retention validation set. Farm A's winter group had 42 calving events. Temperature and bias parameters were obtained using temperature scaling fitting and written as a 101-node lookup table. Farm C's spring group had only 19 calving events, below the lower limit of 30. The system was reverted to Farm C's annual curve, and the reversion flag was recorded in the configuration file. Using a significance level of 0.1, the conformity quantiles of Farm A's winter group were obtained by sorting by non-conformity scores, leading to the lower bound of the conformity probability and the conformity risk set. The management provided a daily false alarm budget of 0.5 per cow during the day and 0.2 per cow at night. The system plotted an empirical curve of false alarm density versus thresholds on the retention set of each group, and used a bisection method to inversely solve for the daytime and nighttime trigger thresholds, with the nighttime threshold being higher than the daytime threshold. The calibration curves, quantiles, budgets, and thresholds for the above twelve groups are written into the configuration file and a version number is generated, which is archived with the deployment report. This step is repeated every year when the season changes to generate a new version number, and the old version is retained for future reference.
[0105] Step 4: Under a unified quality and budget framework, the set of conforming risks, candidate triggers, video verification, log-probability fusion, entropy-based adaptive learning, and student degradation are connected in series into an implementable online state machine. This ensures that delivery warnings under nighttime and remote conditions maintain a commensurable upper bound on false alarms and an operable lead time under the same recall constraints.
[0106] In online environments, the strength of wearable and video evidence is affected by the overall quality score. Nighttime Indication Significant impact. Using only a fixed threshold will lead to concentrated false alarms during periods of low illumination or shading; if the risk set is not included at the triggering end, the threshold will lose its statistical significance during cross-pasture migration. Therefore, candidate triggers should simultaneously meet the requirements of acceptable statistical risk and quality standards, and the review stage should be fused in the log-probability domain to avoid mismatch in probability domain weight scales and the superposition of low illumination bias.
[0107] The shape indication quantity output in step three As a pre-switch; using the risk indication output in step three. Constitutes temporal evidence; To smooth out quality thresholds; Modulate the difficulty of triggering at night. After entering the review stage, use the log-odds of the additive fusion window evidence at log-odds levels. Log-likelihood ratio with behavioral evidence And with quality modulated weights Nighttime deduction Gain of constraint verification.
[0108] Furthermore, define the candidate scoring function:
[0109] Where: Candidate score Positive real number, used to determine whether to proceed to the review stage; a definite shape indicator. : Binary value, derived from the conformal risk set in step three, with a value of 1 indicating that the conformal risk set at that moment is not empty; risk indicator. This originates from step three and is a weighted combination of the six-hour and two-hour window probabilities after calibration of the conformal indicator gating. Overall quality score : Derived from the quality vector mapping in step one; quality threshold : Indicates the minimum quality requirement for initiating review; mapping function S-shaped mapping Used to smooth the threshold to Interval; Nighttime Indicator Binary value; nighttime magnification : A non-negative real number used to moderately lower candidate scores at night; 0.3 is used in the example. The condition for triggering a candidate is: the candidate score is not less than the trigger threshold obtained by inverse solution by time period in step three. And the daily budget counter Greater than zero.
[0110] When in use, a review is triggered only when the statistical risk is acceptable and the quality meets the standard, to avoid ineffective scheduling during low light or shading phases; the combined effect of the six-hour and two-hour calibrated window probabilities in the risk indicator takes into account both stability and proximity; since the quality factor and the night factor are both no greater than one, and the candidate scores do not exceed the risk indicator, the upper bound of the daily false alarm budget per cow obtained by inverse solution of the risk indicator in step three still holds in this step.
[0111] And define the final alarm probability after review:
[0112] Where: final alarm probability Used for online determination; logarithmic probability of window evidence. : Determined by the calibrated window probability or Conversion, Log-likelihood ratio of behavioral evidence Real numbers are derived from the posture and spatiotemporal characteristics of short video clips (taillift amplitude and duration, rise-and-fall rhythm, exertion rhythm, gait fragmentation, and discrimination scoring of the tremor cycle of the lateral muscle groups). Quality Modulation Weight : Non-negative real numbers, take Where g(⋅) is the quality modulation function defined in step two, and the higher the quality, the greater the weight of the behavioral evidence; nighttime deduction. : A non-negative real number used to offset the systematic bias of behavioral evidence under low-light conditions; 0.5 is used in the example. Mapping function Nighttime indicator : The definition is the same as above.
[0113] Additive fusion in the log-probability domain avoids scale mismatch in probability domain superposition; quality modulation suppresses the amplification of behavioral evidence in low-quality images; nighttime deduction provides a unified treatment for low-light bias, reducing false alarms at night without compromising budget constraints.
[0114] Day-night cycles, weather changes, and alterations in camera viewing distance can cause persistent distribution drift. Offline retraining is costly and cannot be deployed continuously; on the other hand, continuing to schedule video verification during periods of extremely low quality or poor connectivity increases costs and amplifies noise. Therefore, it is necessary to adaptively improve calibration consistency in small, parameter-constrained steps, and switch to a wearable-only student model when hard conditions are met, maintaining consistency between the threshold and the budget.
[0115] An adaptive mini-batch is formed by candidate and verification caches. The output entropy is minimized for samples that meet the quality standard, and the magnitude and frequency of parameter offset are constrained by sparse regularization. When any hard condition of quality, connectivity, or behavioral cost is met, the system immediately switches to the student model, which assumes the online judgment with a six-hour window probability, until the quality continuously recovers to above the threshold.
[0116] Furthermore, define the adaptive objective during the testing period:
[0117] Where: Optimal adaptive parameter : A subset of parameters that can be updated online (normalized layer statistics and channel affine coefficients), a vector; initial parameters The original parameter vector after offline training and deployment to the field corresponds one-to-one with the adaptive parameters in terms of dimension; mini-batch sample index set. During the adaptive testing phase, a set of time indices is extracted from the recent candidate or verification sample cache. Each element in the set... Corresponding to one input sample; Single input sample : Index is The input data can be a time-series segment of the wearable device within a certain time window, or a sequence of short video frames paired with it, which is an input vector or tensor that the model can directly receive at the deployment end; Discriminant function : Network forward mapping with adaptive parameters as parameters, which maps the input samples It is mapped to a class probability distribution, and the output is a set of non-negative numbers that sum to 1; Specifically, the pre-trained network structure (temporal encoder, multimodal fusion layer, classification output layer) is deployed online. For each input sample, a forward inference is performed to output a category probability distribution, such as the probability that the current time belongs to the near delivery window or does not belong to the near delivery window. This is the deep learning evaluation model.
[0118] Entropy function Shannon entropy Used to measure the uncertainty of classification distribution; adaptive parameter balance coefficient. : A non-negative real number that controls the weight of the regularization term. It is used to balance the requirements of reducing entropy and increasing confidence with keeping the adaptive parameters from deviating from the initial parameters. In the example, it is set to 0.01.
[0119] When used, it improves calibration consistency and confidence stability in nighttime and low-light conditions without requiring annotation or rewriting of training objectives; it only updates a small subset of parameters without violating the budget and threshold criteria established in step three.
[0120] Furthermore, define the degradation trigger indicator:
[0121] Where: Degradation indicator quantity At the observation time A binary flag indicating whether to trigger student model downgrade, with a value of 0 or 1; a value of 1 indicates that the current time step enters the downgrade execution path; indicator function. The value is 1 when the logical condition inside the curly braces is true and 0 when it is false. It is used to convert a set of logical conditions into a numerical value of the downgrade indicator. Overall quality score At the observation time The overall score is a weighted and normalized composite score based on quality meta-features such as device health and video quality, ranging from 0 to 1; the quality degradation threshold is... : The lower threshold used to determine whether a degradation is triggered due to excessively low overall quality; the range is between 0 and 1, with an example value of 0.35; network packet loss rate. At the observation time Within the sliding time window, the ratio of missing data packets or frames actually received to missing data packets or frames that should have been received ranges from 0 to 1. Packet loss threshold This is a threshold used to determine whether a degradation is triggered due to excessively high network packet loss. It ranges from 0 to 1; the example uses 0.20. When the threshold is exceeded, connectivity is considered insufficient; behavioral scheduling cost. At the observation time The comprehensive cost index of the video-side behavior analysis link can be obtained by weighted summation of keypoint tracking breakpoints, skeleton breakpoints, and average keypoint confidence, and is a non-negative real number; behavior cost threshold. : A threshold used to determine whether a degradation is triggered due to excessive behavior scheduling costs. It is a positive real number; in this example, it is 3.0. If the threshold is exceeded, the video evidence is considered no longer suitable for inclusion in the judgment.
[0122] When in use, degradation is triggered by three observable hard conditions: quality, connectivity, and behavioral cost, to avoid continuing scheduling and review during low-quality phases; the student model is distilled from step two and uses the same six-hour window criterion and budget threshold, so switching will not cause criterion drift; the system maintains continuous operation in weak network and extremely low light scenarios.
[0123] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0124] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0125] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0126] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0127] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for training a deep learning evaluation model for predicting the reproductive performance of beef cattle, characterized by: include, Generate 24-hour, 6-hour, and 2-hour window labels based on the calf's birth time, and allow interval labels; collect device health and video quality data to form quality metadata and a comprehensive quality score, and store them in the database with timestamps; Discrete-time risks are learned based on labels and multi-window probabilities are output; nighttime false alarms and lead time lower bound penalties are added to the loss; multimodal evidence is weighted and masked based on quality element features and monotonic consistency constraints are applied. Temperature scaling or order-preserving calibration is applied to the probability based on the pasture; a set of conformal risks is constructed on the validation set and a risk indicator is generated, based on which the daily false alarm budget per cow is set and the triggering criteria are solidified; Candidates are triggered using risk indicators and overall quality scores; When the quality meets the standard, schedule video pose verification and fuse it with window evidence in the log-odds domain; when the quality or connectivity is insufficient, switch the student model downgrade and record the budget.
2. The deep learning evaluation model training method according to claim 1, characterized in that: Quality characteristics include at least battery level, signal strength, data packet loss rate, wearing stability, image quality score, brightness, and occlusion rate; Quality element features, window labels, and interval labels are stored in the database under a unified timestamp and unique identifier, and used as input fields for confidence gating and candidate triggering.
3. The deep learning evaluation model training method according to claim 2, characterized in that: Weak labels are absorbed by bag aggregation: sample bags are formed by continuous time segments of the same cow, bag-level labels are determined by interval labels, and weights are generated based on the distance between the segment time and the center of the interval; bag-level probabilities and sample unique identifiers are stored together to serve as the supervision entry point for subsequent joint training.
4. The deep learning evaluation model training method according to claim 3, characterized in that: The discrete risk rate sequence and multi-window probability are output on the same time axis. The loss function includes both nighttime false alarm penalty and lead time lower limit penalty. The nighttime indication and lead time threshold are recorded as deployment parameters. The three-window probability is corrected by monotonic consistency constraint and bound to the timestamp for subsequent calibration and budget calls.
5. The deep learning evaluation model training method according to claim 4, characterized in that: The confidence-gated fusion uses the comprehensive quality score mapping as the weight to perform weighted and invalidation masking on neck sensing, video pose and environmental meteorological evidence; the weights and masking thresholds are configured in the same dimension and recorded as deployment parameters, and the fusion output and multi-window probability are aligned in the same criterion domain.
6. The deep learning evaluation model training method according to claim 1, characterized in that: Calibration parameters are generated and solidified into calibration curves according to the pasture and season. During deployment, the corresponding curve is selected according to the pasture. A set of symmetrical risks is constructed by reserving a validation set and the risk indication threshold is calculated. Budget levels are set in layers for day and night. The threshold and budget caliber are explicitly registered in the configuration file.
7. The deep learning evaluation model training method according to claim 6, characterized in that: The budget uses a daily counter per cow. If a candidate trigger is confirmed and not deducted during calving on the same day, the counter is refreshed daily. The budget is recorded as a prerequisite for candidate triggers and is bound to the trigger criteria. It is also stored as evidence along with the thresholds and calibration curves in the deployment report.
8. The deep learning evaluation model training method according to claim 7, characterized in that: Construct a candidate-review state machine: Candidates are triggered when the risk indicator passes and the comprehensive quality score reaches the threshold; review only schedules short-time videos, extracts fragmented temporal evidence of tail lift, standing up and lying down, exertion and gait, and fuses it with window evidence in the log probability domain to form the online judgment input.
9. The deep learning evaluation model training method according to claim 8, characterized in that: Online adaptive optimization is limited to updating normalized statistics and channel affine coefficients, with small batches of samples coming from candidate or verification caches. When entering the student model rollback, adaptive optimization is paused and the parameters from the previous round are retained. Adaptive optimization is resumed only after the quality recovers to above the threshold, maintaining consistency with the budget and threshold caliber.
10. The deep learning evaluation model training method according to claim 9, characterized in that: The student model rollback is triggered based on a preset degradation judgment rule. The degradation judgment rule consists of a comprehensive quality score threshold, a connectivity packet loss rate threshold, and a behavior scheduling cost threshold, and records the trigger item identifier. The rollback path follows the same criteria as the six-hour window probability and budget threshold.