Method and system for optimizing parameters of sheep semen diluent
By constructing an input structure that includes parameters such as pH, and using generative adversarial networks and Bayesian neural networks to optimize sheep semen diluent parameters, the limitations of model learning ability and unstable prediction in existing technologies are solved, achieving efficient optimization and improved flexibility of diluent parameters.
Patent Information
- Application Number
- CN202511081864.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-11-18
AI Technical Summary
Existing technologies for optimizing sheep semen diluent parameters suffer from limitations in model learning ability, localized concentration of prediction range, susceptibility to environmental disturbances, unstable output results, complex weight structures, and wasted computational resources, making it difficult to balance preservation stability and fertilization efficiency.
By constructing an input structure that includes pH value, osmotic pressure regulator concentration, antifreeze content, glycerol ratio, protein content, and random noise, and combining antimicrobial agent type and oxygen consumption rate, a synthetic sample is generated using an adversarial generative network. Normalization is performed based on channel response values and sperm motility, a parameter-aware weight matrix is constructed, redundant connections are removed using a Bayesian neural network, a Pareto design group is generated, and the dilution parameters are optimized.
It improves the structural diversity and goal-oriented distribution quality of data, clarifies the weight distribution of the diluent components' influence on preservation activity, significantly reduces model redundancy, and enhances the responsiveness and flexibility of the formulation in the propagation management process.
Smart Images

Figure CN120977439A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of neural network modeling technology, and in particular to a method and system for optimizing parameters of sheep semen diluent. Background Technology
[0002] The field of neural network modeling technology utilizes artificial neural networks to construct nonlinear mapping relationships between input variables and output targets in order to achieve prediction, classification, and optimization control functions. It features strong modeling capabilities for highly nonlinear and coupled systems, high generalization ability, and strong dependence on samples. It emphasizes key aspects such as model structure design, training algorithms, sample set construction, error function definition, and network performance evaluation.
[0003] The goal of the sheep semen diluent parameter optimization method and system is to establish a nonlinear mapping model between diluent parameters and semen preservation effect based on historical ratio parameters and corresponding semen preservation effect data, and to optimize the diluent component parameters using the model, aiming to improve the preservation stability, spermatogenesis rate and fertility of sheep semen diluent, so as to support more efficient and controllable reproductive management in artificial insemination.
[0004] Existing technologies are highly dependent on the structure and quantity of input samples. In scenarios involving coupling and nonlinear interactions between diluent components, there is a lack of mechanisms to guide the generation of high-quality supplementary samples, limiting the model's learning ability. The sample set construction process cannot cover the entire range of preservation effects, leading to localized concentration of predictions and potential model training bias. Furthermore, existing technologies rely on the mean error and do not provide the fluctuation boundaries of output values under environmental disturbances, making actual predictions susceptible to changes in temperature and oxygen consumption rate, posing an instability risk. The network structure often retains fully connected states without removing channels with limited contributions, resulting in complex weight structures and wasted computational resources. The output results are often single solutions, neglecting the performance balance between multiple objectives, making formulation selection inflexible and failing to achieve a synergistic effect of preservation stability and fertilization efficiency in breeding sheep. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the existing technology and to propose a method and system for optimizing sheep semen diluent parameters.
[0006] To achieve the above objectives, the present invention employs the following technical solution: a method for optimizing parameters of sheep semen diluent, comprising the following steps:
[0007] S1: Input the pH value, osmotic pressure regulator concentration, antifreeze content, glycerol ratio, protein content and random noise into the adversarial generative network, add antibacterial agent type and oxygen consumption rate as joint input, expand the vector structure, correct the parameter range, select samples in the specified preservation effect range, and generate a synthetic sample matrix.
[0008] S2: Based on the synthetic sample matrix, extract the channel responses corresponding to pH value, osmotic pressure regulator, glycerol, and protein, combine sperm motility and energy metabolism indicators to complete the normalization process, calculate the channel weights, complete the sorting and screening of active channels, and establish a parameter-aware weight matrix.
[0009] S3: Based on the parameter-sensing weight matrix, perform normal sampling and multiple inferences on the network weights, statistically save the mean and variance of the effect output, construct the prediction fluctuation range based on the upper and lower limits, and obtain the uncertainty interval;
[0010] S4: Based on the uncertainty interval, extract the activation mapping of the teacher network and the prediction output of the student network, use a Bayesian neural network to construct a joint error term for oxygen consumption rate and temperature fluctuation, calculate the double loss, judge the performance of each layer based on the error results and remove redundant coefficients to obtain the weight set of the distillation network.
[0011] S5: Based on the weight set of the distillation network, the weights of each layer are converted into floating-point codes and constitute a chromosome population. The sorting and screening are completed by combining the antibacterial agent type and the glycerol ratio. Crossover and mutation operations are performed to generate a Pareto design group.
[0012] As a further embodiment of the present invention, the synthetic sample matrix includes diluent component parameters, generated sample vectors, and preservation effect label values; the parameter-aware weight matrix includes channel scores for each component, channel activation identifiers, and channel sorting priorities; the uncertainty interval includes the predicted mean of preservation effect, the predicted variance range, and upper and lower bound thresholds; the distillation network weight set includes network layer weight values, redundant parameter identifiers, and compressed structure configuration; and the Pareto design group includes multi-objective non-dominated solution ratios, objective scores for each formulation, and clustering classification labels.
[0013] As a further aspect of the present invention, the specific steps for generating the synthetic sample matrix are as follows:
[0014] Based on pH value, osmotic pressure regulator concentration, antifreeze content, glycerol ratio, protein content and random noise, an original input vector set is constructed. An adversarial generative network is used to connect the values sequentially to form a unified structure by parameter splicing. The antimicrobial agent type and oxygen consumption rate are integrated according to the channel dimension to generate a joint input vector set.
[0015] Based on the joint input vector set, a dimension expansion operation is performed and the range of each parameter is set. Numerical normalization is completed through proportional conversion. Abnormal data points are removed by combining the upper and lower boundary truncation logic, and valid values are filled in for missing positions to generate a structured normalized matrix.
[0016] Based on the structured normalized matrix, a judgment threshold is set according to the preservation effect range. Interval matching and label mapping operations are performed on each group of samples. Samples that do not meet the conditions are screened out and the data index matrix is reorganized to generate a synthetic sample matrix.
[0017] As a further aspect of the present invention, the adversarial generative network first concatenates pH value, osmotic pressure regulator concentration, antifreeze content, glycerol ratio, protein content, and random noise to form an original input vector group, and integrates antibacterial agent type and oxygen consumption rate according to the channel dimension. Then, it is sequentially mapped to the fake sample distribution according to the multi-layer convolutional structure and activation function. The discriminator inputs real samples and fake samples in parallel and evaluates the output through the binary classification cross-entropy loss function. In each iteration, the discriminator parameters are first fixed, and the generator output is used to optimize the generator parameters. Then, the generator parameters are fixed again, and the discriminator parameters are optimized using real samples and generated samples until the discriminator can no longer distinguish between real and fake samples. Finally, after multiple alternating training, the generator outputs a synthetic sample that meets the requirements of the preservation effect range.
[0018] As a further aspect of the present invention, the specific steps for generating the parameter-aware weight matrix are as follows:
[0019] Based on the synthesized sample matrix, channel indexing was used to extract pH channel response, osmotic pressure regulator channel response, glycerol channel response, and protein channel response. Combined with sperm motility and energy metabolism indicators, numerical normalization was performed. Channel response sequence splicing and missing data filling were then performed to generate a channel response matrix.
[0020] Based on the channel response matrix, a score sequence is constructed according to the response values. The response value sorting and channel filtering operations are performed to identify high-response channels and match channel weights. The sorting priority and activation status of each channel are marked to generate a parameter-aware weight matrix.
[0021] As a further aspect of the present invention, the specific steps for generating the uncertainty interval are as follows:
[0022] Based on the parameter-aware weight matrix, multiple weight combinations are generated by normal distribution sampling, ten forward propagation inferences of the network are performed, the corresponding saved effect prediction outputs are collected and a continuous numerical set is constructed to generate a prediction sample sequence.
[0023] Based on the predicted sample sequence, the mean and variance of the output sequence are calculated, the upper and lower boundary points are extracted to construct an interval list, the effective value range is filtered and the boundary positions are marked to generate the uncertainty interval.
[0024] As a further aspect of the present invention, the specific steps for generating the distillation network weight set are as follows:
[0025] Based on the uncertainty interval, the activation vectors output by the teacher network and the predicted value set of the student network are extracted. The output results are matched one-to-one according to the hierarchical structure, and data synchronization is completed through position index to establish a response difference mapping matrix.
[0026] Based on the response difference mapping matrix, a Bayesian neural network is used to perform multiple forward samplings to construct the output deviation value distribution under the reference sequence of oxygen consumption rate and temperature fluctuation, and to statistically analyze the output differences of each channel to generate a multi-source error signal set.
[0027] Based on the multi-source error signal set, the amplitude of the error signal is statistically analyzed according to the channel order and a fixed threshold is set to determine the elimination boundary. Redundant connection channels are identified and the corresponding parameter items are cleared. At the same time, the weights of the retained connections are rearranged to obtain the distillation network weight set.
[0028] As a further aspect of the present invention, the Bayesian neural network first takes the response difference mapping matrix as input and performs multiple parameter sampling on the network weights according to the prior distribution. Then, each set of sampled weights is loaded into the network, and forward propagation is performed sequentially for the oxygen consumption rate and temperature fluctuation reference sequences. Then, all forward propagation results are summarized to construct the output deviation value distribution. Finally, deviation statistics are calculated for each channel and a multi-source error signal set is generated.
[0029] As a further aspect of the present invention, the specific steps for generating the Pareto design group are as follows:
[0030] Based on the distillation network weight set, the weights of each convolutional layer and the weights of the fully connected layer are numerically mapped to the floating-point range using a weight mapping method, and vector columns are concatenated and dimension is verified to generate a chromosome vector group.
[0031] Based on the chromosome vector group, an attribute injection method is used to add antibacterial agent type and glycerol ratio identifiers to each vector, and priority sorting and threshold filtering are performed. Field swapping and random element replacement operations are also performed to generate a Pareto design group.
[0032] A sheep semen diluent parameter optimization system, wherein the sheep semen diluent parameter optimization system is used to execute the above-mentioned sheep semen diluent parameter optimization method, the system comprising:
[0033] Adversarial Generation Module: Based on the input of pH value, osmotic pressure regulator concentration, antifreeze content, glycerol ratio, protein content and random noise, and with the addition of antibacterial agent type and oxygen consumption rate, a joint vector structure is constructed. The adversarial generation network expansion dimension and correction value range are input and invalid samples are screened out to generate a synthetic sample matrix.
[0034] Channel sensing module: Extracts pH, osmolarity regulator, glycerol, and protein channel responses based on the synthetic sample matrix, normalizes and sorts them with sperm motility and metabolic indicators, and generates a high-response channel matrix;
[0035] Fluctuation prediction module: Based on the high-response channel matrix, the network weights are normally sampled and multiple rounds of inference are performed. The mean and variance of the preservation effect are statistically analyzed and the fluctuation range of the preservation effect is constructed.
[0036] Weight compression module: Based on the fluctuation range of the preservation effect, extract the difference between the network output of teachers and students, input it into the Bayesian neural network to perform sampling inference and calculate the error density, remove redundant connections and rearrange the remaining weights, and generate parameters to simplify the weight structure;
[0037] Formula evolution module: Based on the parameters, the weight structure is simplified and converted into floating-point code. The antibacterial agent type and glycerol ratio are injected. After sorting and screening, crossover and replacement operations are performed to generate a Pareto formula structure set.
[0038] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0039] In this invention, by constructing an input structure that includes pH value, osmotic pressure regulator concentration, antifreeze content, glycerol ratio, protein content and random noise, and combining antibacterial agent type and oxygen consumption rate to form a joint input, a generative adversarial network is used to generate synthetic samples that meet specific preservation effect requirements, thereby improving the structural diversity of data and the quality of target-oriented distribution.
[0040] In this invention, normalization, sorting, and screening operations are performed based on channel response values and sperm motility and energy metabolism indicators to determine the set of channels with significant responses and clarify the weight distribution of the influence of diluent components on preservation activity. Through forward inference after multiple samplings, the mean and variance of the predicted preservation effect are statistically analyzed to construct a fluctuation range, providing boundary indicators for subsequent weight stability evaluation.
[0041] In this invention, the difference between the teacher network output and the student network prediction is used as a basis to input into a Bayesian neural network to perform multiple sets of forward sampling, construct the error density distribution under oxygen consumption rate and temperature perturbation, and then remove high-error connections to significantly compress model redundancy. The weight structure is transformed into a chromosome population through floating-point encoding, and sorting, screening, crossover and mutation are performed in combination with the antibacterial agent type and glycerol ratio fields to generate a Pareto design formulation that takes into account multiple objectives, thereby improving the responsiveness and flexibility of the formulation in the breeding management process. Attached Figure Description
[0042] Figure 1 This is a schematic diagram of the workflow of the present invention;
[0043] Figure 2This is a system flowchart of the present invention. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0045] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0046] Example 1
[0047] Please see Figure 1 This invention provides a technical solution: a method for optimizing parameters of sheep semen diluent, comprising the following steps:
[0048] S1: Input the pH value, osmotic pressure regulator concentration, antifreeze content, glycerol ratio, protein content and random noise into the adversarial generative network, add antibacterial agent type and oxygen consumption rate as joint input, expand the vector structure, correct the parameter range, select samples in the specified preservation effect range, and generate a synthetic sample matrix.
[0049] S2: Based on the synthetic sample matrix, extract the channel responses corresponding to pH value, osmotic pressure regulator, glycerol, and protein, combine sperm motility and energy metabolism indicators to complete the normalization process, calculate the channel weights, complete the sorting and screening of active channels, and establish a parameter-aware weight matrix.
[0050] S3: Based on the parameter-aware weight matrix, perform normal sampling and multiple inferences on the network weights, statistically save the mean and variance of the output, construct the prediction fluctuation range based on the upper and lower limits, and obtain the uncertainty interval.
[0051] S4: Based on the uncertainty interval, the activation mapping of the teacher network and the prediction output of the student network are extracted. A Bayesian neural network is used to construct a joint error term for oxygen consumption rate and temperature fluctuation. The double loss is calculated. The performance of each layer is judged based on the error results and redundant coefficients are removed to obtain the weight set of the distillation network.
[0052] S5: Based on the weight set of the distillation network, the weights of each layer are converted into floating-point codes and constitute a chromosome population. Combining the antibacterial agent type and glycerol ratio, sorting and screening are completed, and crossover and mutation operations are performed to generate a Pareto design group.
[0053] The synthetic sample matrix includes diluent component parameters, generated sample vectors, and preservation effect label values. The parameter-aware weight matrix includes channel scores for each component, channel activation identifiers, and channel ranking priorities. The uncertainty interval includes the predicted mean of preservation effect, the predicted variance range, and upper and lower bound thresholds. The distillation network weight set includes network layer weight values, redundant parameter identifiers, and compressed structure configuration. The Pareto design group includes multi-objective non-dominated solution ratios, objective scores for each formulation, and cluster classification labels.
[0054] The specific steps for generating the synthetic sample matrix are as follows:
[0055] Based on pH value, osmotic pressure regulator concentration, antifreeze content, glycerol ratio, protein content and random noise, an original input vector set is constructed. An adversarial generative network is used to connect the values sequentially to form a unified structure by parameter splicing. The antimicrobial agent type and oxygen consumption rate are integrated according to the channel dimension to generate a joint input vector set.
[0056] Based on the joint input vector set, the dimension expansion operation is performed and the range of each parameter is set. The numerical normalization process is completed through proportional conversion. Abnormal data points are removed by combining the upper and lower boundary truncation logic, and valid values are filled in for missing positions to generate a structured normalized matrix.
[0057] Based on the structured normalized matrix, a judgment threshold is set according to the preservation effect range. Interval matching and label mapping operations are performed on each group of samples. Samples that do not meet the conditions are screened out and the data index matrix is reorganized to generate a synthetic sample matrix.
[0058] Based on pH value, osmotic pressure regulator concentration, antifreeze content, glycerol ratio, protein content, and random noise, an adversarial generative network is employed. The generator structure consists of an input layer, three hidden fully connected layers, and an output layer. The input layer has nine dimensions and uses ReLU activation function. The number of neurons in the hidden layers is 64, 128, and 64 respectively. The output layer uses the Tanh function to map the values to the interval between -1 and 1. The parameters are initialized using a normal distribution with a mean of zero and a standard deviation of 0.02. A sequential concatenation operation is performed on the six parameters from pH value to protein content. The antibacterial agent type is constructed as a sparse one-heated encoding vector, and the oxygen consumption rate is expanded into a floating-point vector of the same length as the main vector and appended to the end of the concatenated vector according to the channel dimension. The discriminator consists of an input layer, two convolutional layers, and an output layer. The convolutional kernel size is 3×3 with a stride of 1 and the activation function is LeakyReLU. The output uses the Sigmoid function to determine whether the input is a generated sample or a real sample, generating a joint input vector set.
[0059] Based on the joint input vector set, the input structure is adjusted into a two-dimensional sequence using the vector structure expansion command. Each parameter is independently arranged in a continuous dimension position. The pH range is set to 6.0 to 8.5, the osmotic pressure regulator concentration is set to 0.2 to 0.8 mol / L, the antifreeze content is set to 1.0 to 5.0%, the glycerol ratio is set to 2.0 to 6.0%, the protein content is set to 0.5 to 2.5 g / L, the random noise is set to -1 to 1, the antibacterial agent number is set to 0 to 4 (integers), and the oxygen consumption rate range is set to 0.1 to 1.2. Each value is proportionally linearly converted according to the minimum and maximum boundaries. The conversion results are judged for upper and lower limits, outliers are marked and uniformly removed, and the interval average is used to fill in missing data points. The data sequence matrix with complete structure is reconstructed, and a structured normalized matrix is generated.
[0060] Based on the structured normalized matrix, a standard range for preservation effect is set, divided into three segments: 0 to 0.4, 0.4 to 0.7, and 0.7 to 1.0. The preservation effect values of each group of samples are matched with the above three segments one by one. The segments they fall into are labeled as 0, 1, or 2. The samples that are not in any valid range are filtered out by logical filtering commands and the corresponding index records are cleared. The remaining sample numbers are reordered. All valid samples are recombined in the sorted order and an index table is built to generate a synthetic sample matrix.
[0061] The adversarial generative network (PGN) first concatenates pH value, osmotic pressure regulator concentration, antifreeze content, glycerol ratio, protein content, and random noise to form an original input vector set. Then, it integrates antibacterial agent type and oxygen consumption rate according to the channel dimension. Subsequently, it is mapped to the fake sample distribution according to the multi-layer convolutional structure and activation function. The discriminator inputs real and fake samples in parallel and evaluates the output through the binary classification cross-entropy loss function. In each iteration, the discriminator parameters are fixed first, and the generator output is used to optimize the generator parameters. Then, the generator parameters are fixed again, and the discriminator parameters are optimized using real and generated samples until the discriminator can no longer distinguish between real and fake samples. Finally, after multiple alternating training, the generator outputs a synthetic sample that meets the requirements of the preservation effect range.
[0062] Generative adversarial networks, according to the formula:
[0063]
[0064] Where: Z′ represents the joint input vector value set, x pH Indicates the pH value of the diluent, x π Indicates the concentration of osmotic pressure regulator in the diluent, x af Indicates the antifreeze content in the diluent, x g Indicates the proportion of glycerol in the diluent, xpro This indicates the protein content in the diluted solution, w i δ represents the weighting coefficient of the five basic physicochemical parameters mentioned above. pH_stab η represents the pH stability coefficient, β1 represents the weighting coefficient of the pH stability coefficient term, and η represents the pH stability coefficient. osm β1 represents the osmotic stress response coefficient, β2 represents the weighting coefficient of the osmotic stress response coefficient term, β3 represents the weighting coefficient of the protein structure density correction coefficient term, and ∈ represents the standard normal distribution noise term.
[0065] Execution process: First, the pH value of the diluent is measured and standardized to obtain x. pH The concentration of the osmotic pressure regulator was detected and normalized to obtain x. π The antifreeze content was recorded as x. af The glycerol ratio was recorded as x. g The protein content was recorded as x. pro These five physicochemical parameters are assigned the corresponding numbers x1, x2, x3, x4, and x5, respectively. The pH stability coefficient δ is then calculated. pH_stab osmotic stress response coefficient η osm and protein structure density correction factor ρ prot_den The effects of pH fluctuation stability, osmotic pressure change sensitivity, and protein structure density on system stability were characterized, and then the five parameters were weighted according to their corresponding coefficients w. i Weighted summation is performed by summing the three extended parameters by weights β1, β2, and β3 and adding the random noise term ∈, where the weighting coefficients w i and β j After determining the initial values through Pearson correlation analysis, gradient descent is used for iterative optimization during the training of the generative network until convergence. Finally, all calculation results are linearly superimposed to obtain the joint input vector set value Z′, which is used as input to the subsequent generative network to achieve dilution parameter optimization.
[0066] The specific steps for generating the parameter-aware weight matrix are as follows:
[0067] Based on the synthetic sample matrix, channel indexing was used to extract pH channel response, osmolarity regulator channel response, glycerol channel response, and protein channel response. Combined with sperm motility and energy metabolism indicators, numerical normalization was performed. Channel response sequence splicing and missing data filling were performed to generate a channel response matrix.
[0068] Based on the channel response matrix, a score sequence is constructed according to the response value. The response value sorting and channel filtering operations are performed to identify high-response channels and match channel weights. The sorting priority and activation status of each channel are marked to generate a parameter-aware weight matrix.
[0069] Based on the synthetic sample matrix, a normalization method was used to extract the responses of four channels—pH, osmotic pressure regulator, glycerol, and protein—by channel dimension. The extraction method involved setting a fixed column index position for each channel in the matrix and performing column-by-column slicing. After obtaining the numerical sequence of each channel, a linear ratio was constructed based on the minimum and maximum values of each data point in its respective channel. The numerical scaling of each channel was performed by subtracting the minimum value from each value and then dividing by the range. Subsequently, standard values from sperm motility and energy metabolism indicators were used to pair all channel response values one-to-one according to the sample position and perform weighted averaging. Missing response values were filled using the average value of the existing values in the channel. The processed results of each channel were then concatenated into a complete sample response vector in the original channel order. Finally, the response vectors of all samples were combined into a matrix to generate the channel response matrix.
[0070] Based on the channel response matrix, a response ranking and weight extraction method is adopted. The channel response values in each row of samples are compared one by one, and the response intensity is ranked according to the position of each channel response value in a single sample. The channel response value threshold is set to 0.65, and the list of channel numbers above the threshold is selected as the filtering target. A structured record table containing channel number, corresponding response value, and ranking position is constructed according to the filtering results. Each channel response value is divided by the sum of all channel response values to obtain the relative weight value of the channel in the sample. After extracting the weight value list, the weight results are uniformly paired and summarized according to the channel number to establish a correspondence table with three columns of content: channel number, weight value, response ranking value, and activation status, and a parameter-aware weight matrix is generated.
[0071] The specific steps for generating the uncertainty interval are as follows:
[0072] Based on the parameter-aware weight matrix, multiple weight combinations are generated by normal distribution sampling, ten forward propagation inferences are performed, the corresponding saved effect prediction outputs are collected and a continuous numerical set is constructed to generate a prediction sample sequence.
[0073] Based on the predicted sample sequence, the mean and variance of the output sequence are calculated, the upper and lower boundary points are extracted to construct an interval list, the effective value range is filtered and the boundary positions are marked to generate the uncertainty interval.
[0074] Based on the parameter-aware weight matrix, a normal distribution sampling method is adopted. The sampling mean is set as the original weight value of each channel, and the standard deviation is taken as the standard deviation of the response amplitude in the corresponding channel. Channel-by-channel sampling is performed. Each round of sampling generates a set of floating-point weights of a complete network structure. The weight set is loaded into the neural network model. The model input is set as a vector of standard ratio parameter values in the preserved semen samples. Ten forward propagations are performed in sequence. Each propagation uses a different set of weights obtained from sampling. Ten sets of corresponding preservation effect prediction values are obtained through the model output layer. The ten prediction results are concatenated one by one to construct a unified output array structure to generate a prediction sample sequence.
[0075] Based on the predicted sample sequence, statistical analysis methods are used to group the output values of each group according to the sample order. The arithmetic mean of the ten predicted values in each group is calculated as the output mean. The squared deviation between the predicted value and the mean of each group is calculated, and the average of the sums is taken as the square root of the output standard deviation. The lower boundary point is determined by subtracting twice the standard deviation from the mean, and the upper boundary point is determined by adding twice the standard deviation to the mean. The position index is recorded for each group of boundary points, and the boundary list is organized by group number. The boundary is compared item by item for the predicted values in all groups. The values located between the upper and lower boundaries are retained and their original positions in the sequence are marked to generate the uncertainty interval.
[0076] The specific steps for generating the weight set of the distillation network are as follows:
[0077] Based on the uncertainty interval, the activation vectors output by the teacher network and the predicted values set of the student network are extracted. The output results are matched one-to-one according to the hierarchical structure, and data synchronization is completed through position index to establish a response difference mapping matrix.
[0078] Based on the response difference mapping matrix, a Bayesian neural network is used to perform multiple forward samplings to construct the output deviation value distribution under the reference sequence of oxygen consumption rate and temperature fluctuation, and to statistically analyze the output differences of each channel to generate a multi-source error signal set.
[0079] Based on the multi-source error signal set, the amplitude of the error signal is statistically analyzed according to the channel order and a fixed threshold is set to determine the elimination boundary. Redundant connection channels are identified and the corresponding parameter items are cleared. At the same time, the weights of the retained connections are rearranged to obtain the distillation network weight set.
[0080] Based on the uncertainty interval, the response mapping matching method is adopted to extract the activation vectors in the teacher network output and the predicted value set in the student network output. The mapping relationship is established layer by layer according to the order of each layer in the network structure. The activation vector and the predicted vector of each layer are paired one-to-one according to the position index. The data format is uniformly adjusted to ensure that the vector dimension is consistent. After the position synchronization is completed, the difference calculation results are saved to an independent array structure in the order of the hierarchy. The arrays are then spliced into a complete multi-layer difference record according to the original network structure order to generate a response difference mapping matrix.
[0081] Based on the response difference mapping matrix, a Bayesian neural network is used. The prior distribution of the weights of each neuron in the layer is set to a normal distribution with a mean of zero and a variance of one. Multiple weight combinations are generated by sampling one sample at a time. After each combination is loaded into the network, a unified standard vector is input. The oxygen consumption rate in the standard vector is set to 0.6, and the temperature fluctuation value is set to a continuous value in the range of ±1. The forward inference of the network is performed group by group and the output results are recorded. All sampling results are grouped and summarized according to the channel number to construct the output deviation value set under each channel. Finally, the output deviation data corresponding to all channels are combined according to the number to generate a multi-source error signal set.
[0082] Based on a multi-source error signal set, an error amplitude elimination method is adopted. The maximum error value of each channel deviation data is calculated in numerical order, and the elimination threshold is set to 0.1. The error value of each channel is compared with the threshold, and all channels exceeding the threshold are marked as redundant connection channels. The original connection weights of redundant channels are set to zero. At the same time, the connection weights of unmarked channels are reordered from largest to smallest according to their original values, and an updated parameter list is constructed. Finally, all the retained connection weights are recombined according to the structural hierarchy to generate the distillation network weight set.
[0083] The Bayesian neural network first takes the response difference mapping matrix as input and performs multiple parameter sampling on the network weights based on the prior distribution. Then, each set of sampled weights is loaded into the network, and forward propagation is performed sequentially for the reference sequences of oxygen consumption rate and temperature fluctuation. Next, all forward propagation results are summarized to construct the output deviation value distribution. Finally, deviation statistics are calculated for each channel and a multi-source error signal set is generated.
[0084] Bayesian neural networks are based on the following formula:
[0085]
[0086] in: The output bias distribution estimate is represented by f(u; W), where T represents the number of forward samples performed by the Bayesian neural network, and f(u; W) represents the output bias distribution estimate. t This indicates that the input variable u passes through the weight parameter W at the t-th sampling time. t The network output results, The mean u of the output after T forward samplings represents the input variable sequence, and W represents the mean of the output after T forward samplings. t R represents the weight samples selected by the Bayesian neural network at the t-th sampling time. diff Represents the response difference mapping matrix, ||R diff || F Let ΔT represent the Frobenius norm of the response difference mapping matrix. var This represents the variance of the temperature fluctuation series. c The channel sensitivity coefficient is represented by λ, and the precision parameter λ of the Bayesian prior distribution is represented by λ. -1 γ1 represents the weighting coefficient of the Frobenius norm term of the response difference mapping matrix, γ2 represents the weighting coefficient of the temperature fluctuation variance term, γ3 represents the weighting coefficient of the channel sensitivity coefficient term, and γ4 represents the weighting coefficient of the prior distribution uncertainty term.
[0087] Execution process: First, obtain the reference sequence of oxygen consumption rate and temperature fluctuation and construct the input variable sequence u. Then, input u into the Bayesian neural network and set the number of forward samplings T. The weighted samples W are then used to perform the calculation. t Perform T forward samplings on the network and obtain the output f(u; W). t After completing all sampling, the output mean f is calculated, and the basic variance term is calculated based on the squared deviation of each output from the mean. Then, the response difference mapping matrix R is constructed. diff And calculate its Frobenius norm ||R diff || F To quantify the degree of difference in response across multiple samplings, and simultaneously calculate the variance ΔT based on a temperature fluctuation reference sequence. var Then, the sensitivity of each output channel to input changes is determined by the channel sensitivity detection model, and the channel sensitivity coefficient s is obtained. c The precision parameter λ of the Bayesian prior distribution is extracted, and its reciprocal quantified uncertainty is calculated. All terms are multiplied by their corresponding weighting coefficients γ1, γ2, γ3, and γ4. The coefficient values are determined by screening significant terms through Pearson correlation analysis and using standardized correlation coefficients as initial values. During network training, the gradient descent algorithm is used for iterative optimization until convergence. Finally, the basic variance, response difference matrix, temperature fluctuation variance, channel sensitivity, and prior uncertainty terms are linearly summed to obtain the output bias distribution estimate. Based on this, a multi-source error signal set is generated.
[0088] The specific steps for generating a Pareto design group are as follows:
[0089] Based on the distillation network weight set, a weight mapping method is used to perform numerical mapping to the floating-point range for the weights of each convolutional layer and the weights of the fully connected layer, and vector column concatenation and dimension verification are performed to generate a chromosome vector group.
[0090] Based on chromosome vector groups, an attribute injection method is used to add antibacterial agent type and glycerol ratio identifiers to each vector, and priority sorting and threshold filtering are performed. Field swapping and random element replacement operations are also performed to generate Pareto design groups.
[0091] Based on the weight set of the distilled network, a linear normalization method for weight values is adopted. Flattening operation is performed on the weight matrix of each convolutional layer and the weight vector of the fully connected layer to obtain a one-dimensional list. The minimum and maximum values are obtained by scanning the list. For each weight value, a linear mapping operation is performed by subtracting the minimum value and then dividing by the range to normalize the value to the zero to one floating-point range. The mapped lists of each layer are merged into a single vector by concatenating the ends according to the network layer order. The length of the concatenated vector is checked element by element against the preset total length. The concatenation of all layer vectors is completed to generate a chromosome vector group.
[0092] Based on chromosome vector groups, an attribute injection method is used to append an integer identifier for the antibacterial agent type and a floating-point value field for the glycerol ratio to the end of each vector. All vectors in the population are sorted in ascending order according to the value of the first field. The field value filtering threshold is set to 0.3 to filter the sorted vectors. For each filtered vector, a field-level swap operation is performed to interchange the elements at index positions 2 and 5. Then, a random index sequence with the same length as the vector is generated, and a floating-point number randomly generated within the range of 0.5 to 0.8 is used to replace the original element at each specified index position. Finally, the Pareto design group is generated.
[0093] Please see Figure 2 A sheep semen diluent parameter optimization system, used to execute the above-mentioned sheep semen diluent parameter optimization method, the system includes:
[0094] Adversarial Generation Module: Based on the input of pH value, osmotic pressure regulator concentration, antifreeze content, glycerol ratio, protein content and random noise, and with the addition of antibacterial agent type and oxygen consumption rate, a joint vector structure is constructed. The adversarial generation network expansion dimension and correction value range are input and invalid samples are screened out to generate a synthetic sample matrix.
[0095] Channel sensing module: Extracts pH, osmolarity regulator, glycerol, and protein channel responses based on the synthetic sample matrix, normalizes and sorts them with sperm motility and metabolic indicators, and generates a high-response channel matrix;
[0096] Fluctuation prediction module: Based on the high-response channel matrix, the network weights are normally sampled and multiple rounds of inference are performed. The mean and variance of the preservation effect are statistically analyzed and the fluctuation range of the preservation effect is constructed.
[0097] Weight compression module: Based on the fluctuation range of the preservation effect, extract the difference between the network output of teachers and students, input it into the Bayesian neural network to perform sampling inference and calculate the error density, remove redundant connections and rearrange the remaining weights, and generate parameters to simplify the weight structure;
[0098] Formula evolution module: Based on the parameter simplification weight structure, it is converted into floating-point code, injects antibacterial agent type and glycerin ratio, sorts and filters, performs crossover and replacement operations, and generates Pareto formula structure set.
[0099] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for optimizing parameters of a semen diluent for sheep, characterized in that, The method comprises the following steps: S1: splice the pH value, the concentration of the osmotic pressure regulator, the content of the antifreezing agent, the glycerol ratio, the protein content and the random noise into the adversarial generation network, additionally input the type of the antibacterial agent and the oxygen consumption rate as the joint input, expand the vector structure, correct the parameter range, screen the samples in the specified preservation effect interval, and generate a synthetic sample matrix; S2: based on the synthetic sample matrix, extract the channel response corresponding to the pH value, the osmotic pressure regulator, the glycerol and the protein, complete the normalization processing by combining the sperm motility and energy metabolism indicators, calculate the channel weight, complete the sorting and screen out the active channel, and establish a parameter perception weight matrix; S3: based on the parameter perception weight matrix, perform normal sampling on the network weight and infer multiple times, count the mean and variance of the preservation effect output, construct the prediction fluctuation range according to the upper and lower limits, and obtain the uncertainty interval; S4: based on the uncertainty interval, extract the activation mapping of the teacher network and the prediction output of the student network, use the Bayesian neural network, construct the oxygen consumption rate and temperature fluctuation joint error term, calculate the double loss, judge the performance of each layer according to the error result and remove the redundant coefficients, and obtain a distillation network weight set; S5: based on the distillation network weight set, convert each layer weight into a floating point code and form a chromosome population, complete sorting and screening by combining the type of the antibacterial agent and the glycerol ratio, perform cross and mutation operations, and generate a Pareto design group.
2. A method of parameter optimization of ram semen diluent according to claim 1, characterized in that, The synthetic sample matrix comprises diluent component parameters, generated sample vectors and preservation effect label values, the parameter perception weight matrix comprises component channel scores, channel activation identifiers and channel sorting priorities, the uncertainty interval comprises preservation effect prediction mean values, prediction variance ranges and upper and lower threshold values, the distillation network weight set comprises network level weight values, redundant parameter identifiers and compressed structure configurations, and the Pareto design group comprises multi-objective non-inferior solution ratios, each formula target score and clustering classification labels.
3. The method of optimizing parameters of ram semen diluent according to claim 1, characterized in that, The specific steps for generating the synthetic sample matrix are as follows: Based on the pH value, the concentration of the osmotic pressure regulator, the content of the antifreezing agent, the glycerol ratio, the protein content and the random noise, an original input vector group is constructed, an adversarial generation network is used, parameter splicing is used to sequentially connect each value to form a unified structure, and the type of the antibacterial agent and the oxygen consumption rate are integrated according to the channel dimension to generate a joint input vector set; Based on the joint input vector set, a dimension expansion operation is performed and the parameter interval range is set, the numerical normalization processing is completed through proportional conversion, the abnormal data points are removed by combining the upper and lower boundary truncation logic, and the legal values are supplemented to the missing positions to generate a structured normalized matrix; Based on the structured normalized matrix, the judgment threshold is set according to the preservation effect interval, the interval matching and label mapping operation is performed on each sample, the samples that do not meet the conditions are screened out and the data index matrix is reorganized to generate a synthetic sample matrix.
4. A method of optimising parameters of a ram semen diluent according to claim 3 characterised in that, The adversarial generative network first splices the pH value, the osmotic pressure regulator concentration, the antifreezing agent content, the glycerol ratio and the protein content with random noise to form an original input vector group, integrates the antibacterial agent type and the oxygen consumption rate according to the channel dimension, then sequentially maps to the false sample distribution according to the multi-layer convolution structure and the activation function, the discriminator inputs the true sample and the false sample in parallel, evaluates the output through the binary classification cross entropy loss function, in each iteration, first fix the discriminator parameters, optimize the generator parameters using the generator output, then fix the generator parameters, optimize the discriminator parameters using the true sample and the generated sample, until the discriminator cannot distinguish the true and false samples, finally after multiple alternating training, the generator output meets the requirements of the synthesized sample in the saving effect interval.
5. The method of optimizing parameters of ram semen diluent according to claim 1, characterized in that, The specific steps for generating the parameter-aware weight matrix are: Based on the synthesized sample matrix, the pH value channel response, the osmotic pressure regulator channel response, the glycerol channel response and the protein channel response are extracted using the channel index, the numerical normalization processing is completed combined with the sperm motility value and the energy metabolism index, the channel response sequence splicing and the missing data filling are executed, and the channel response matrix is generated; Based on the channel response matrix, the score sequence is constructed according to the response value, the response value sorting and channel screening operation are executed, the high response channel is identified and the channel weight is matched, the channel ordering priority and the activation state are labeled, and the parameter-aware weight matrix is generated.
6. The method of semen diluent parameter optimization for sheep of claim 1, wherein, The specific steps for generating the uncertainty interval are: Based on the parameter-aware weight matrix, multiple weight combinations are generated using normal distribution sampling, ten times of network forward propagation inference are executed, the corresponding saving effect prediction output is collected and a continuous numerical set is constructed, and a prediction sample sequence is generated; Based on the prediction sample sequence, the output sequence mean and variance value are calculated, the upper and lower boundary points are extracted to construct an interval list, the effective value range is screened and the boundary position is labeled, and the uncertainty interval is generated.
7. The method of semen diluent parameter optimization for sheep of claim 1, wherein, The specific steps for generating the distillation network weight set are: Based on the uncertainty interval, the activation vector output by the teacher network and the prediction value set of the student network are extracted, the output results are one-to-one matched according to the hierarchical structure, and data synchronization is completed through the position index to establish a response difference mapping matrix; Based on the response difference mapping matrix, the Bayesian neural network is used to execute multiple forward sampling, construct the output deviation value distribution under the oxygen consumption rate and temperature fluctuation reference sequence, and count the output difference of each channel to generate a multi-source error signal set; Based on the multi-source error signal set, the error signal amplitude is counted according to the channel order and the fixed threshold is set to judge and remove the boundary, the redundant connection channel is identified and the corresponding parameter item is removed, and the remaining connection weight is rearranged to obtain the distillation network weight set.
8. A method of parameter optimization of ram semen diluent according to claim 7, characterized in that, The Bayesian neural network first takes the response difference mapping matrix as the input, performs multiple parameter sampling on the network weight according to the prior distribution, then loads each group of sampled weights into the network, performs forward propagation for the oxygen consumption rate and the temperature fluctuation reference sequence in turn, then sums up all the forward propagation results to construct the output deviation value distribution; finally, the bias statistics of each channel are calculated to generate a multi-source error signal set.
9. The method of optimizing parameters of ram semen diluent according to claim 1, characterized in that, The specific steps for generating the Pareto design group are: Based on the distillation network weight set, numerical mapping is performed on each convolutional layer weight and fully connected layer weight to the floating point interval using weight mapping method, vector column splicing and dimension checking are performed, and the chromosome vector group is generated; Based on the chromosome vector group, attribute injection is used to add antibacterial agent type and glycerol proportion identifier to each vector, priority sorting and threshold filtering are performed, and field exchange and random element replacement operations are performed, generating a Pareto design group.
10. A system for optimizing parameters of a semen diluent for sheep, characterized in that, The sheep semen diluent parameter optimization method according to any one of claims 1-9, the system comprises: Adversarial generation module: based on pH value, osmotic pressure regulator concentration, antifreeze content, glycerol proportion, protein content and random noise splicing input, additional antibacterial agent type and oxygen consumption rate, construct joint vector structure, input adversarial generation network expansion dimension, correct numerical range and filter out invalid samples, generate synthetic sample matrix; Channel perception module: based on the synthetic sample matrix, extract the pH, osmotic pressure regulator, glycerol, and protein channel response, and normalize and sort the active channels according to the sperm motility and metabolic indicators to generate a high response channel matrix; Fluctuation prediction module: based on the high response channel matrix, normal sampling of network weights is performed and multi-round reasoning is executed, the mean and variance of the preservation effect output are calculated and saved, and the fluctuation interval of the preservation effect is constructed; Weight compression module: based on the fluctuation interval of the preservation effect, extract the output difference of the teacher and student network, input the Bayesian neural network to perform sampling reasoning and calculate the error density, remove redundant connections and rearrange the remaining weights, generate a parameter simplified weight structure; Formulation evolution module: based on the parameter simplified weight structure, convert to floating point encoding, inject antibacterial agent type and glycerol proportion, sort and filter, then perform cross and replacement operations to generate a Pareto formulation structure set.