Pig feed fermentation process state analysis method based on image recognition

By using a dynamic morphological manifold mapping mechanism and a self-organizing neural network, the problem of monitoring the dynamic changes in morphological characteristics during pig feed fermentation was solved. This enabled the characterization and trend prediction of the nonlinear dynamic characteristics of the fermentation process, improving identification and early warning capabilities and meeting the real-time and accuracy requirements of large-scale farming.

CN121685993APending Publication Date: 2026-03-17GUANGZHOU KWANGFENG BIOTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing pig feed fermentation process status monitoring systems have low sensitivity to dynamic changes in fermentation morphology, making it difficult to achieve accurate early warning and trend prediction. Furthermore, the image acquisition process is difficult to adapt to fluctuations in fermentation status, resulting in insufficient model generalization ability and reliability.

Method used

A dynamic morphological manifold mapping mechanism based on continuous multi-frame image sequences is adopted, combined with self-organizing neural networks and lightweight convolutional neural networks. Through the dynamic morphological manifold mapping module and differentiable time-gated fusion unit, a morphological dynamic feature matrix is ​​constructed to achieve nonlinear dynamic characteristic characterization and trend prediction of the fermentation process, and the image acquisition frequency is dynamically adjusted to adapt to changes in the fermentation stage.

Benefits of technology

It significantly improves the ability to identify and judge key turning points in the fermentation process, enhances the robustness and real-time performance of the method, meets the real-time and low-latency requirements of large-scale farming environments, improves the misjudgment and omission problems of traditional methods, and provides precise feeding control and fermentation quality assurance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121685993A_ABST
    Figure CN121685993A_ABST
Patent Text Reader

Abstract

The invention provides a pig feed fermentation process state analysis method based on image recognition, and the method comprises the steps: collecting a plurality of frames of fermentation images, generating a morphological enhancement image through illumination normalization and semantic segmentation, and extracting spatial features through a convolutional neural network; then, a dynamic manifold space is constructed by utilizing a self-organizing neural network, and embedding from high-dimensional features to low-dimensional manifolds and typical feature dynamic modeling are realized; tangent vector differential is calculated in a manifold space to obtain dynamic characteristics such as speed and acceleration, dynamic weighting is carried out through a time gating fusion unit, and the characteristic time sequence sensing capacity is improved. And finally, a fermentation stage label and trend prediction confidence are output through a support vector machine classifier, fermentation process state intelligent analysis and collection frequency adaptive adjustment are realized, the precision and timeliness of fermentation process form identification are improved, and the method has relatively high robustness and automation level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition and temporal morphological feature modeling of fermentation processes, and in particular to a method for analyzing the state of pig feed fermentation process based on image recognition. Background Technology

[0002] Currently, with the continuous advancement of intelligentization in large-scale farming, the demand for automation and precise control of pig feed fermentation processes is becoming increasingly prominent. The controllability and safety of the fermentation process directly affect the quality of feed products and animal health. Therefore, image recognition-based fermentation status monitoring, especially the precise identification and trend prediction of key morphological features (such as mycelial distribution and particle aggregation), has become a research and application hotspot in the field of intelligent farming. Currently, the mainstream technical approach in the industry typically employs computer vision and machine learning models to achieve image monitoring and analysis of the fermentation process. However, existing fermentation process status monitoring systems still suffer from several prominent technical shortcomings and unmet needs. First, most conventional image recognition schemes only utilize single-frame images for independent analysis, ignoring the continuous evolution of fermentation morphological features over time. This results in low sensitivity to key dynamic behaviors (such as the transition from slow mycelial growth to rapid expansion), making it impossible to accurately warn or effectively predict fermentation trends. Second, although some systems attempt to use parallel time-series models such as LSTM, directly stacking time-series structures in a high-dimensional feature space often leads to redundancy of feature information and ambiguity of spatiotemporal relationships, making it particularly difficult to scientifically model the highly nonlinear and volatile temporal morphological evolution of fermentation processes. Furthermore, current fermentation state analysis focuses only on optimizing classification accuracy, with limited real-time response and tracking capabilities for trend changes. Traditional models exhibit shortcomings such as lag and high misclassification rates, especially in the boundary discrimination of active, stable, and declining phases and the identification of dynamic transition stages during fermentation. In practical applications of pig feed fermentation, there is a challenge in automatically adapting image acquisition to fluctuations in fermentation conditions. Image sampling frequency and resolution are often fixed parameters, preventing flexible improvement of observation accuracy at critical stages and hindering accurate capture of dynamic processes. Furthermore, existing feature extraction and modeling methods suffer from poor versatility and adaptability, failing to address variations in morphological feature distribution across different fermentation batches and stages, thus impacting model generalization ability and long-term reliability. Summary of the Invention

[0003] In order to solve the above-mentioned technical problems, the present invention provides a method for analyzing the state of pig feed fermentation process based on image recognition.

[0004] The technical solution of this invention is implemented as follows: a method for analyzing the state of pig feed fermentation process based on image recognition, comprising: S1: Collect a series of consecutive multi-frame image sequences during the fermentation process of pig feed, and perform preprocessing operations based on illumination normalization and background segmentation on the image sequences to eliminate environmental interference and retain morphological feature information of mycelial distribution and particle aggregation. S2: Input the preprocessed image sequence into a lightweight convolutional neural network, perform feature dimensionality reduction and nonlinear activation processing on each frame of the image, and generate a preliminary set of morphological feature vectors containing spatial distribution characteristics; S3: Based on the Euclidean distance matrix between the preliminary morphological feature vectors of adjacent frames, a dynamic morphological manifold mapping module is constructed using a self-organizing neural network. This module maps the feature vectors to a learnable low-dimensional manifold space through nonlinear projection, wherein the dimension of the manifold space is dynamically adjusted according to the principal component analysis results of the typical morphological evolution pattern in the fermentation stage. S4: In the manifold space output by the dynamic morphology manifold mapping module, calculate the directional derivative of the local tangent space to quantify the dynamic parameters of morphological changes. Specifically, this includes: performing tangent vector differentiation on the projection points of the current frame and the previous frame in the manifold space to generate a morphological dynamic feature matrix that characterizes the velocity and acceleration of morphological changes. S5: Construct a differentiable temporally gated fusion unit, which includes adaptive weight coefficients generated based on the morphological dynamics feature matrix. Perform weighted fusion processing on the spatial features of the current frame and the corresponding morphological dynamics features, and output an enhanced morphological feature representation of fused temporal information. The weight coefficients are dynamically determined through the product relationship between the gated activation function and the morphological change acceleration value. S6: Input the enhanced morphological feature representation into the fermentation stage classifier. The classifier performs discriminative analysis on the features based on the support vector machine algorithm and outputs a state analysis result containing fermentation stage labels and trend prediction confidence. The trend prediction confidence is calculated based on the matching degree between the morphological change acceleration and the preset fermentation kinetic model. S7: Dynamically adjust the image acquisition frequency based on the trend prediction confidence in the state analysis results. When the confidence is lower than the first threshold, start the high-precision acquisition mode to increase the frame rate and spatial resolution of the image sequence until the confidence recovers to above the second threshold and then switch back to the normal acquisition mode. S8: Update the manifold space parameters of the dynamic morphological manifold mapping module based on the stage-specific feature data of the fermentation process. Incorporate the latest collected morphological feature vector set into the training dataset through an online incremental learning algorithm, and iteratively optimize the parameter configuration of the nonlinear projection mapping function.

[0005] The present invention provides a method for analyzing the state of pig feed fermentation process based on image recognition, which has the following beneficial effects: (1) This invention constructs a dynamic morphological manifold mapping mechanism based on a series of consecutive images, and for the first time transforms the temporal dimension information into a geometric trajectory expression of the morphological evolution process in a low-dimensional nonlinear manifold space. This effectively overcomes the problem of trend perception loss caused by the lack of temporal modeling in traditional methods. This mechanism abandons conventional RNN, TCN or Attention-type temporal network structures and instead adopts a learnable manifold space initialized and optimized online by a self-organizing neural network. It can adaptively characterize the nonlinear dynamic characteristics of typical fermentation morphological evolution modes such as aggregation growth and hyphal diffusion. It significantly improves the ability to identify the key turning point of the transition from slow growth to rapid acid production in the fermentation initiation stage and enhances the robustness and discrimination sensitivity of the method under non-stationary dynamic processes. (2) This invention innovatively introduces a method for calculating the directional derivative of the local tangent space, extracts "morphodynamic" features in the manifold space, and combines it with the designed differentiable time-gated fusion unit to achieve adaptive weighted fusion between current spatial features and historical evolution dynamics, outputting an enhanced morphological feature representation with temporal evolution perception capabilities. Compared with the simple splicing or fixed weight combination method in traditional multimodal fusion strategies, this fusion mechanism can automatically adjust the contribution ratio of spatial static information and temporal dynamic information according to the dynamic characteristics of different fermentation stages, greatly improving the context adaptability and discrimination accuracy of feature representation, especially showing stronger stability in dealing with complex background interference or imaging quality fluctuations. At the same time, the entire feature extraction path is based on a lightweight CNN as the backbone, combined with manifold mapping and gating fusion modules, the overall computational complexity is controllable, and it can be efficiently deployed on embedded vision platforms to meet the stringent requirements of real-time performance and low latency in large-scale aquaculture environments. (3) The feature modeling paradigm proposed in this scheme breaks through the path dependence of existing technologies on explicit temporal modeling components (such as LSTM, GCN, DA-TCN, etc.), avoiding the disadvantages of such structures such as large number of parameters, high training difficulty, and high inference latency. It provides a more compact and physically meaningful way of encoding time information—that is, implicitly modeling time dynamics through trajectory evolution on geometric manifolds. This not only reduces the model's dependence on large-scale labeled data, but also enhances the interpretability and generalization ability of feature representation. This method is particularly suitable for practical scenarios where morphological evolution during fermentation has strong nonlinearity, stage transitions, and local discontinuities. It fundamentally improves the problem of misjudgment and omission caused by traditional static analysis methods, significantly improves the accuracy of fermentation stage discrimination and the advance of trend prediction, and provides reliable technical support for achieving precise feeding regulation and fermentation quality assurance. Attached Figure Description

[0006] Figure 1 This is a flowchart of a method for analyzing the state of pig feed fermentation process based on image recognition, according to the present invention. Figure 2 This is a sub-flowchart of a method for analyzing the state of pig feed fermentation process based on image recognition according to the present invention. Figure 3 This is another sub-flowchart of the image recognition-based method for analyzing the state of pig feed fermentation process according to the present invention. Detailed Implementation

[0007] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0008] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0009] like Figure 1 As shown, this invention provides a method for analyzing the state of pig feed fermentation process based on image recognition, specifically including: S1: Collect a series of consecutive multi-frame image sequences during the fermentation process of pig feed, and perform preprocessing operations based on illumination normalization and background segmentation on the image sequences to eliminate environmental interference and retain morphological feature information of mycelial distribution and particle aggregation. S2: Input the preprocessed image sequence into a lightweight convolutional neural network, perform feature dimensionality reduction and nonlinear activation processing on each frame of the image, and generate a preliminary set of morphological feature vectors containing spatial distribution characteristics; S3: Based on the Euclidean distance matrix between the preliminary morphological feature vectors of adjacent frames, a dynamic morphological manifold mapping module is constructed using a self-organizing neural network. This module maps the feature vectors to a learnable low-dimensional manifold space through nonlinear projection, wherein the dimension of the manifold space is dynamically adjusted according to the principal component analysis results of the typical morphological evolution pattern in the fermentation stage. S4: In the manifold space output by the dynamic morphology manifold mapping module, calculate the directional derivative of the local tangent space to quantify the dynamic parameters of morphological changes. Specifically, this includes: performing tangent vector differentiation on the projection points of the current frame and the previous frame in the manifold space to generate a morphological dynamic feature matrix that characterizes the velocity and acceleration of morphological changes. S5: Construct a differentiable temporally gated fusion unit, which includes adaptive weight coefficients generated based on the morphological dynamics feature matrix. Perform weighted fusion processing on the spatial features of the current frame and the corresponding morphological dynamics features, and output an enhanced morphological feature representation of fused temporal information. The weight coefficients are dynamically determined through the product relationship between the gated activation function and the morphological change acceleration value. S6: Input the enhanced morphological feature representation into the fermentation stage classifier. The classifier performs discriminative analysis on the features based on the support vector machine algorithm and outputs a state analysis result containing fermentation stage labels and trend prediction confidence. The trend prediction confidence is calculated based on the matching degree between the morphological change acceleration and the preset fermentation kinetic model. S7: Dynamically adjust the image acquisition frequency based on the trend prediction confidence in the state analysis results. When the confidence is lower than the first threshold, start the high-precision acquisition mode to increase the frame rate and spatial resolution of the image sequence until the confidence recovers to above the second threshold and then switch back to the normal acquisition mode. S8: Update the manifold space parameters of the dynamic morphological manifold mapping module based on the stage-specific feature data of the fermentation process. Incorporate the latest collected morphological feature vector set into the training dataset through an online incremental learning algorithm, and iteratively optimize the parameter configuration of the nonlinear projection mapping function.

[0010] Step S1: Acquire a continuous multi-frame image sequence during the pig feed fermentation process, and perform preprocessing operations based on illumination normalization and background segmentation on the image sequence to eliminate environmental interference and retain morphological feature information such as mycelial distribution and particle aggregation. Specifically, this includes: S1.1: Based on industrial cameras, a series of consecutive multi-frame image sequences at different stages of pig feed fermentation are collected. The image sequences contain visual information on mycelial distribution and particle aggregation, in order to construct a spatiotemporal evolution dataset of the fermentation process. The input conditions for the industrial camera acquisition system are multi-time and multi-angle visual signals from the pig feed fermentation site. The industrial camera has programmable exposure control, resolution adjustment and frame rate adjustment capabilities, and can acquire continuous multi-frame image data including mycelial distribution and particle aggregation at different fermentation stages. An acquisition control algorithm based on a hybrid mechanism of time-triggered and stage-triggered acquisition (parameters: acquisition period Δt = 5 seconds, stage determination threshold determined by historical fermentation stage classification dataset) is adopted to enable industrial cameras to perform time-segmented cyclic scanning acquisition at each fermentation stage, so as to ensure that spatiotemporal sampling covers different mycelial growth and particle structure change scenarios; Furthermore, by using a physical optical interference suppression method based on polarization filters (parameters: polarization angle 45°, transmittance 80%), the high reflectivity background is suppressed during the acquisition process, and the original frame image containing the true mycelial distribution outline and particle aggregation region boundary is obtained. Furthermore, a multispectral synchronous acquisition method (bands: red, green, blue and near-infrared, number of channels n=4) was adopted to separate the reflectance characteristics of mycelia and particles under different spectra, and generate a multispectral composite image sequence, providing additional spectral information for subsequent morphological features and temporal evolution modeling; Furthermore, by utilizing a dynamic range extension algorithm based on multi-second differential exposure (parameters: exposure time series E={1ms, 4ms, 8ms}), the synchronous capture of details in the bright and dark areas between acquisition frames is achieved, and a multi-frame HDR image sequence with dynamic range extension is obtained. By using a multi-sensor synchronous timestamp alignment processing method (reference clock frequency 1MHz), the multispectral and multi-exposure image frames acquired in the previous step are precisely bound with their corresponding timestamps, forming a raw fermentation process image dataset sorted by time sequence and containing multi-channel information, thus realizing the construction of a spatiotemporal evolution dataset. For example, a large-scale intelligent farm deployed an industrial camera system with a resolution of 2048×1536 pixels during the active phase of the third stage of fermentation. The acquisition period Δt was set to 5 seconds, the polarization filter transmittance was set to 80% to filter out metallic reflections, and the wavelength combination was selected as RGB + 850nm near-infrared, with four channels acquiring data simultaneously. The dynamic range expansion algorithm used an exposure time E={1ms, 4ms, 8ms}, acquiring data at three exposure levels within the same acquisition period and synthesizing HDR frames. The acquisition control algorithm relied on a stage-based threshold to trigger an increase in sampling density to twice that of the normal period during the active phase, ensuring the capture of continuously changing multispectral HDR image sequences during periods of rapid mycelial expansion and significant particle aggregation. After multi-sensor synchronous processing, the output spatiotemporal evolution dataset contained four-channel HDR frame data and precise timestamp indices for each time point. During verification, this dataset significantly improved the separability and recognition stability of morphological features in subsequent illumination normalization and background segmentation steps. S1.2: Perform illumination normalization processing on the image sequence, and use a multi-scale Gaussian filtering algorithm based on Retinex theory to perform color space conversion and brightness compensation on each frame of the image to eliminate the influence of uneven illumination on morphological feature recognition and obtain illumination-equalized image data. For the collected multi-frame image sequence of the pig feed fermentation process, a multi-scale Gaussian filtering algorithm based on Retinex theory (parameters: multi-scale standard deviation σ is 15, 80, and 250 respectively) is used to realize color space conversion and brightness compensation functions. Furthermore, by performing Gaussian smoothing on the image at each scale, a multi-scale illumination estimation map is generated, and the logarithmic domain reflectance enhancement processing of the RGB channels of the original image is performed using the Retinex color constancy principle to suppress morphological feature brightness distortion caused by ambient illumination fluctuations. Furthermore, through normalization operations, the three-channel enhancement results are mapped to a unified color space range (0-255), and an adaptive histogram equalization algorithm is used to finely adjust the brightness distribution, thereby balancing the brightness contrast between the mycelium and the granular area inside the fermented feed. Furthermore, by calculating the brightness difference matrix of corresponding pixels before and after illumination normalization for each frame, the normalization effect is evaluated using the brightness fluctuation variance index, and residual regions with brightness differences exceeding a preset threshold are screened out to avoid illumination artifacts affecting subsequent feature recognition. By using the multi-scale Retinex algorithm and brightness compensation processing, the original image sequence acquired in the previous step is transformed into illumination-equalized image data, thereby significantly reducing the interference effect of uneven ambient lighting on morphological feature recognition. For example, in a feed fermentation monitoring system at an industrial farm, multiple frames of mycelial distribution images were acquired and processed using multi-scale Gaussian filtering with parameters configured as σ1=15, σ2=80, and σ3=250. Gaussian smoothing with kernel sizes of 31×31, 161×161, and 501×501 were performed at each scale. The Retinex reflectance enhancement formula was then applied.

[0011] in This is the original pixel brightness value. This is a multi-scale illumination estimate. After processing each channel, the results are normalized to the range of 0-255, and the brightness distribution is adjusted by adaptive histogram equalization. In the early stages of fermentation, when the mycelial distribution is sparse and the particles are highly reflective, the brightness fluctuation variance before normalization is approximately 18.7, which is reduced to 5.2 after normalization, verifying that the influence of uneven illumination is significantly suppressed. The output illumination-equalized image shows significant enhancement of mycelial contours and stability of particle texture in subsequent background segmentation steps, improving the feature response capability of the segmentation model. S1.3: Based on the illumination equalization image data, a semantic segmentation model based on the U-Net structure is used to perform background segmentation processing on the image. The semantic segmentation model is fine-tuned on the fermented feed sample set through transfer learning and outputs a foreground mask image containing mycelial regions and particle aggregation regions. S1.4: The foreground mask image is fused with the original image at the pixel level to generate a morphological feature image that retains only the distribution of mycelium and the region of particle aggregation, so as to improve the sensitivity and recognition accuracy of key morphological changes in the subsequent feature extraction stage and obtain a morphologically enhanced image set. S1.5: Perform image quality assessment and inter-frame consistency correction on the morphologically enhanced image set. Calculate the visual variability between adjacent frames based on the structural similarity index (SSIM) and frame difference method. Perform image inpainting operation based on interpolation algorithm on abnormal frames to ensure the continuity and stability of the image sequence in the time dimension. Output the preprocessed fermentation image sequence.

[0012] Step S2: Input the preprocessed image sequence into a lightweight convolutional neural network, perform feature dimensionality reduction and nonlinear activation processing on each frame of the image, and generate a preliminary set of morphological feature vectors containing spatial distribution characteristics. Specifically, this includes: S2.1: Based on the preprocessed image sequence, a lightweight convolutional neural network is used to perform convolution operations on each frame of the image to extract local spatial texture features and obtain a preliminary high-dimensional feature map; S2.2: Perform channel attention mechanism weighting on the high-dimensional feature map output by the convolution operation to enhance key feature channels related to mycelial distribution and particle aggregation, and generate a weighted feature map; S2.3: Based on the weighted feature map, global average pooling is used to compress the spatial dimension of the feature map to reduce the feature dimension and retain the feature response intensity between channels, thereby generating channel feature vectors. S2.4: Perform nonlinear activation function processing on the channel feature vectors to introduce nonlinear expressive power, improve the adaptability of features to complex morphological changes during fermentation, and generate nonlinear feature vectors; S2.5: The nonlinear feature vector is mapped and transformed through a fully connected layer to generate a preliminary morphological feature vector of uniform dimension, which serves as the input feature of the dynamic morphological manifold mapping module. For feature vector data that has undergone nonlinear activation processing, a fully connected layer mapping algorithm is used (parameter: weight matrix). Bias vector (The activation function type is linear identity), which realizes the unified mapping of the nonlinear feature response of each channel to the preset target feature dimension space; Furthermore, the mapping output is calculated using matrix multiplication, employing the formula:

[0013] in, The mapped feature vector, The input is a nonlinear feature vector. This is the weight matrix of the fully connected layer. It is the bias vector; Furthermore, the initial parameters of the fully connected layer weights are set through the weight initialization method (parameter: Xavier initialization, distribution type: uniform distribution) to ensure the stability of the gradient distribution of different input channels during feature mapping. Furthermore, a batch normalization algorithm (parameters: batch size is 64, mean μ and variance σ are calculated based on batch data) is used to achieve scale consistency of feature vectors in all dimensions, normalize each feature component, and obtain the batch-normalized mapping feature vector set. Furthermore, the batch-normalized mapping features are linearly combined with the original nonlinear feature vectors through a residual connection strategy (parameter: residual scaling factor α=0.1) to generate a hybrid preliminary morphological feature vector set that combines the original feature distribution and the mapping feature distribution. Through the above fully connected mapping and normalized residual fusion processing, the nonlinear feature vectors of the previous step are transformed into preliminary morphological feature data with a unified dimension and higher stability, thereby achieving the dimensional standardization and feature distribution optimization of the input structure of the dynamic morphological manifold mapping module. For example, in a large-scale farm fermentation monitoring scenario, for the nonlinear feature vector output by step S2.4, a target dimension of 128 is selected, and a fully connected layer weight matrix of size 128×256 is constructed, with the bias vector being a zero vector of length 128. The input batch data size is set to 64, and the weight matrix is ​​initialized using the Xavier uniform initialization method, with an initialization range of ±0.125. When performing batch normalization, the batch mean μ is taken as the mean of 64 samples in each dimension, and the batch variance σ is taken as the variance of the corresponding dimension. The normalized output is fused with the original nonlinear features using a residual connection method with a ratio of α=0.1. The final output of the 128-dimensional preliminary morphological feature vector shows significantly improved feature distribution balance. When input to the dynamic morphological manifold mapping module in step S3, the projection stability of the low-dimensional manifold space and the continuity of the feature evolution trajectory are both enhanced. During the verification process, on typical rapid acid production stage image sequences, the geometric fitting error of the morphological evolution pattern is significantly reduced, and the prediction accuracy of the trend by the state analysis module is greatly improved.

[0014] like Figure 2 As shown, step S3 involves constructing a dynamic morphological manifold mapping module using a self-organizing neural network based on the Euclidean distance matrix between the preliminary morphological feature vectors of adjacent frames. This module maps the feature vectors to a learnable low-dimensional manifold space through nonlinear projection, wherein the dimension of the manifold space is dynamically adjusted according to the principal component analysis results of typical morphological evolution patterns during the fermentation stage. Specifically, this includes: S3.1: Based on the preliminary morphological feature vector set of adjacent frames, calculate the Euclidean distance matrix between each frame and the previous frame to quantify the differential evolution trend of morphological features at adjacent moments and obtain the initial metric matrix of morphological changes between frames, which serves as the input data for the dynamic morphological manifold mapping module. Based on the unified dimension preliminary morphological feature vector set output by step S2, the feature vector pairing method is used to select the feature vectors of the current frame and the previous frame as the calculation objects to realize the data preparation for measuring the feature difference between frames. The Euclidean distance calculation method (parameter: feature vector dimension d = uniform mapping dimension) is used to calculate the difference between feature vectors at adjacent time points, and a scalar result of the distance metric between each frame and the previous frame is generated to construct a first-order temporal difference sequence. Furthermore, the feature difference scalar is calculated using the Euclidean distance formula, as follows:

[0015] in, The Euclidean distance between the current frame t and the previous frame t-1. This represents the i-th feature component of the current frame t. Let d represent the i-th feature component of the previous frame t-1, where d is the feature dimension. Furthermore, by matrix processing, all inter-frame difference scalars are merged in chronological order to form a Euclidean distance matrix, and the row and column indices of the matrix correspond to the frame time identifiers, thus realizing the structured representation of time series data in two-dimensional space. Furthermore, by normalizing the distance matrix (parameters: maximum distance value and minimum distance value), the dimensionality of data from different batches and stages is unified, generating a normalized initial metric matrix to ensure the consistency of the subsequent self-organizing neural network input feature distribution; Through the above Euclidean distance calculation and matrix processing, the result of the previous step is transformed into an inter-frame initial metric matrix that can directly reflect the degree of morphological change between adjacent frames, thereby realizing the construction of the basic input data for the dynamic morphological manifold mapping module. For example, in a certain batch of fermented pig feed, the morphological feature vector of each frame has a dimension of 64. The feature vector of the current frame t is [0.12, 0.35, ..., 0.87], and the feature vector of the previous frame t-1 is [0.14, 0.34, ..., 0.85]. Using the above formula to calculate the Euclidean distance, when d=64, the squared difference is calculated dimension by dimension and summed, resulting in a sum of 0.0215. After square root calculation, the distance value is obtained as 0.1466. The distances of the 300 consecutively acquired frames are calculated pairwise to form a 300×300 Euclidean distance matrix. Normalization is then performed based on the maximum distance value of 0.3254 and the minimum distance value of 0.0123, mapping all matrix elements to the [0,1] interval. This normalized initial metric matrix, after being input into the self-organizing neural network, significantly improves the class separability of data at different fermentation stages during the network topology initialization phase, achieving a clear characterization of the temporal differences in the fermentation process. S3.2: The topology of the dynamic morphological manifold mapping module is initialized using a self-organizing neural network. This structure is adaptively clustered based on the input inter-frame morphological change initial metric matrix to form a neuron activation map that reflects the typical morphological evolution path, which serves as the initial topological representation for manifold space construction. Based on the initial morphological change measurement matrix generated in S3.1, the topology of the dynamic morphological manifold mapping module is initialized using a self-organizing neural network (parameters: initial number of nodes n0, learning rate η0, neighborhood function σ0) to achieve unsupervised encoding of morphological feature differences in the fermentation process. Furthermore, a competitive learning algorithm based on Euclidean distance (parameters: metric matrix D, iteration number T0) is used to map the input features to the winner neurons and obtain the updated weight matrix W0, which is used to characterize the proximity between different morphological states. Furthermore, through the neighborhood diffusion function, the decreasing influence of the currently activated neuron on the weights of its neighboring neurons is realized, and topological aggregation effect data on morphologically similar regions is generated; Furthermore, by using a weight update method, the neuron weights are gradually fitted to the input features, and an initial topological encoding in the morphological feature space is obtained. The activation pattern matrix after clustering is transformed into a neuron activation map, which serves as the initial topological representation for manifold space construction, enabling the geometric prior implantation of typical morphological evolution paths in low-dimensional space. For example, given an image sequence input of a batch of pig feed fermentation process, the initial metric matrix size is 50×50, the initial number of nodes is n0=100, the learning rate is η0=0.05, and the initial width of the neighborhood function is σ0=3.2. Competitive learning is run with 500 iterations T0, resulting in a weight matrix W0 with a mean distance of approximately 0.12, indicating that the feature distribution has converged to a low morphological difference state. In the neighborhood diffusion calculation, the mean Euclidean distance of 0.35 and σ=1.5 are substituted into the diffusion function formula to obtain an average neighborhood weight of 0.69. In the weight update formula, the mean of the input feature vector is taken as 0.45, and the mean of the old weights is 0.42. Substituting η=0.05 and the neighborhood weights of 0.69, a new mean weight of 0.431 is output, showing that the weights gradually converge towards the input features. This embodiment forms five distinct clusters in the neuron activation map, each corresponding to a specific morphological evolution pattern. This provides stable and accurate initial topological support for the subsequent nonlinear embedding of the manifold space, significantly improving the robustness of morphological change trend modeling. S3.3: Based on the principal component analysis results of typical morphological evolution patterns during the fermentation stage, the target dimension of the manifold space is dynamically determined. The principal component analysis is performed on the morphological feature dataset of the historical fermentation process, and the top k principal components are extracted to cover more than 95% of the cumulative variance contribution rate, thereby determining the embedding dimension of the nonlinear manifold space. S3.4: In the dynamic morphological manifold mapping module, a manifold embedding operation is performed on the preliminary morphological feature vector based on a nonlinear projection algorithm. The high-dimensional feature vector is mapped to a low-dimensional manifold space constructed by a self-organizing neural network to obtain the set of projection points of each frame in the manifold space, forming a geometric trajectory representation of the morphological evolution of the fermentation process. The input object is a set of preliminary morphological feature vectors with unified dimensions generated in step S2 and whose embedding dimensions are determined in step S3.3. This set, together with the initial topological representation generated in step S3.2, serves as the input basis for manifold embedding processing. A manifold learning algorithm based on nonlinear projection (parameters: embedding dimension = k, neighborhood size = m) is adopted to achieve the function of maintaining the mapping of the proximity relationship of the high-dimensional preliminary morphological feature vector and to preserve the geometric characteristics of inter-frame morphological changes in the low-dimensional spatial structure. Furthermore, the weights of the manifold neighborhoods between features are assigned using the Local Preserving Projection (LPP) method (parameter: the weight matrix is ​​obtained by calculating the initial topology of the manifold space), and the projection coefficient matrix that preserves the local geometric relationships is obtained. Furthermore, by optimizing the objective function

[0016] in, The Laplacian matrix is ​​calculated from the weight matrix. For degree matrix, This involves solving for the projection direction vector using a low-dimensional projection coordinate matrix. Furthermore, the feature vector set corresponding to the minimum eigenvalue is extracted by the eigenvalue decomposition method to generate the projection basis for manifold embedding, ensuring that the embedded space is consistent with the original high-dimensional space in terms of geometry and topology. By left-multiplying the initial morphological feature vector by the projection basis, the high-dimensional feature vector output in the previous step is converted into a low-dimensional manifold coordinate matrix, thereby realizing the position mapping of each frame in the low-dimensional manifold space. By connecting the projection points of each frame in the low-dimensional manifold space in time index order to form a trajectory curve, the geometric trajectory of the morphological evolution of the feed fermentation process can be explicitly expressed. For example, in the first batch of feed fermentation, the initial morphological feature vector has a dimension of 128. Principal component analysis (S3.3) determines the embedding dimension k=5 and the neighborhood size m=10. The degree matrix is ​​constructed using the initial topological weight matrix W generated by the self-organizing neural network. And calculate the Laplacian matrix. In locally preserving projection optimization, the objective function is solved iteratively. Minimizing the eigenvalues ​​yields the eigenvectors corresponding to the five smallest eigenvalues, forming the projection basis. ∈ The 128-dimensional feature vector of each frame is compared with... Matrix multiplication yields 5-dimensional low-dimensional coordinates, which are then sequentially connected to form a time trajectory curve. In this embedding result, the trajectory curve clearly reflects the dynamic process of mycelial diffusion from sparse distribution to aggregation, significantly improving the sensitivity and stability of the tangential derivative calculation in the subsequent S4 step. S3.5: Perform online optimization processing on the set of projection points in the manifold space, and update the weight parameters of the self-organizing neural network using the latest collected set of morphological feature vectors to adapt to the non-stationary changes in morphological evolution patterns in different fermentation stages, ensuring the manifold space's adaptive modeling capability for morphological evolution throughout the fermentation process.

[0017] like Figure 3 As shown, step S4: In the manifold space output by the dynamic morphology manifold mapping module, the directional derivative of the local tangent space is calculated to quantify the dynamic parameters of morphological changes. Specifically, this includes: performing tangent vector differentiation on the projection points of the current frame and the previous frame in the manifold space to generate a morphological dynamic feature matrix characterizing the velocity and acceleration of morphological changes. Specifically, this includes: S4.1: Perform tangent vector differentiation on the projection points of the current frame and the previous frame in the manifold space output by the dynamic morphology manifold mapping module, and construct tangent space basis vectors based on the local neighborhood structure of the manifold space to analyze the instantaneous direction of the current morphological change. S4.2: Calculate the tangent vector difference between the current frame and the previous frame based on the tangent space basis vectors, and generate a tangent vector difference vector that represents the speed of morphological change, as the initial representation of the morphological change speed feature; Based on the tangent space basis vector input data constructed in S4.1, the local geometric difference calculation method (parameters: manifold space neighborhood radius r, number of neighborhood points m) is used to realize the preliminary calculation of the tangent vector difference between the projection point of the current frame and the projection point of the previous frame. Furthermore, by using the vector subtraction operator (parameter: set of coordinate components of the tangent vector), component-wise difference operations are performed on the tangent vectors of the two frames, and the original representation of the difference vector is obtained, where each coordinate component corresponds to the rate of change of shape in different directions of the manifold space. Furthermore, the Euclidean norm normalization method (parameter: difference vector length threshold L) is adopted to achieve magnitude scaling of the original difference vector and generate a normalized velocity direction vector to ensure the dimensional consistency of vectors with different magnitudes in subsequent calculations. Furthermore, by using the difference vector norm calculation method (parameter: L2 norm), the magnitude of the difference vector is extracted to obtain the scalar velocity value of the morphological change rate, which quantifies the displacement rate of the current frame and the previous frame on the geometric trajectory of the manifold space. A vector combination construction algorithm is adopted to form a standardized representation of the tangent vector difference vector by combining the unitized velocity direction vector and the scalar velocity value, which serves as the initial output data for the morphological change velocity characteristics. By using the geometric difference and normalization algorithm described above, the tangent space basis vector data from the previous step is transformed into an initial representation of the morphological change rate characteristics, thereby achieving a structured quantification of the morphological evolution rate during the fermentation process. For example, in a real-world pig feed fermentation monitoring scenario, the embedding dimension of the manifold space is 5, the local neighborhood radius r is set to 0.2, and the number of neighborhood points m is set to 8. The coordinates of the projected point at time t1 are (0.15, 0.42, 0.33, 0.50, 0.28), and the coordinates of the projected point at time t2 are (0.18, 0.45, 0.36, 0.53, 0.31).

[0018] First, the difference vector is calculated using the vector subtraction operator:

[0019] The difference vector is obtained as (0.03, 0.03, 0.03, 0.03, 0.03).

[0020] Furthermore, the magnitude of the difference vector is calculated using the L2 norm:

[0021] The calculated result is approximately 0.06708, which is taken as the scalar velocity value of the morphological change rate.

[0022] Furthermore, amplitude scaling is used to generate a normalized velocity direction vector:

[0023] The normalized vector is approximately (0.447, 0.447, 0.447, 0.447, 0.447). This direction vector is combined with the scalar velocity value of 0.06708 to form a normalized difference vector, creating an initial representation of the morphological change velocity characteristics. In this scenario, this velocity representation significantly improves the accuracy of subsequent acceleration calculations and temporal trend predictions, ensuring stable velocity quantification even during rapid changes in the fermentation state. S4.3: Perform a second-order difference operation on the tangent vector difference vectors of three consecutive frames in the manifold space to generate a second-order tangent vector difference vector representing the acceleration of morphological changes, so as to capture the nonlinear acceleration behavior in the morphological evolution process. S4.4: The morphological change velocity and acceleration feature vector are concatenated into tensors to construct a morphological dynamic feature tensor containing first-order and second-order temporal derivative information, so as to uniformly represent the dynamic evolution trend of morphological change. After obtaining the morphological change velocity feature vector and the morphological change acceleration feature vector, tensor concatenation operation is used (parameter: concatenation axis is the feature channel dimension, keeping the time series dimension consistent) to achieve the structured combination of first-order and second-order time series derivative information in the same data structure. Furthermore, by using the tensor dimension expansion method (parameter: expansion dimension matching channel attention weight input requirements), the dimensions of velocity features and acceleration features are aligned, and the adapted first-order derivative feature array and second-order derivative feature array are obtained; Furthermore, by using the matrix index mapping method (parameter: using a splicing mapping matrix based on time frame index), the first derivative feature array is placed in the first half of the channel position of the tensor, and the second derivative feature array is placed in the second half of the channel position of the tensor, thus generating a combined three-dimensional tensor data structure. Furthermore, by normalizing the splicing coefficients (parameter: the coefficients are derived from the ratio of the variance of velocity and acceleration features), the numerical scale of different physical quantities is standardized, thereby avoiding weight shift caused by excessively high magnitude of a single feature in the subsequent feature fusion process. Through the above tensor splicing and standardization process, the velocity and acceleration feature vectors of the previous step are transformed into morphodynamic feature tensors containing first-order and second-order temporal derivative information, thereby achieving a unified geometric and dynamic characterization of the morphological change trend of the fermentation process. For example, in an image recognition system for pig feed fermentation, after performing tangent vector difference and second-order difference on the projection points of three consecutive frames in the manifold space, the morphological change velocity feature vector *v* and the morphological change acceleration feature vector *a* are obtained, respectively. Let *v* be a vector of length 64 and *a* be a vector of length 64. Tensor concatenation is used to concatenate them along the channel dimension to form a matrix of size 2×64. The normalization coefficients are calculated using the following formula:

[0024] in The standard deviation of the velocity characteristic, The standard deviation of the acceleration feature is given. The velocity feature vector is multiplied by a coefficient k and then concatenated with the acceleration feature vector by channel to obtain the normalized morphodynamic feature tensor. This tensor significantly improves the responsiveness to rapidly changing stages of the fermentation process in subsequent channel attention weighting. Validated by the state analysis module, the model provides stable identification results for the transition from slow growth to rapid acid production, and its trend prediction accuracy is significantly improved. S4.5: Perform channel attention weighting on the morphodynamic feature tensor, and generate an adaptive channel weight vector based on the variance contribution rate of each channel feature to enhance the response sensitivity to key morphological evolution features in the fermentation process, thus forming a weighted morphodynamic feature tensor. S4.6: The weighted morphodynamic feature tensor is converted into a morphodynamic feature matrix and output to the time-gated fusion unit as the input basis for fusing the spatial features and dynamic evolution information of the current frame; The morphodynamic feature tensor, after channel attention weighting, is received as the input condition. A matrix dimension rearrangement algorithm (parameters: number of tensor channels c, time step t) is used to convert the three-dimensional tensor structure into a two-dimensional matrix structure, so that the time-gated fusion unit can efficiently read feature data in matrix form; Furthermore, by using the feature column normalization method (parameters: normalization method is Z-score, mean μ and standard deviation σ are calculated by the current batch feature statistics), the feature dimensions of different channels are standardized, and the normalized morphological dynamic matrix is ​​obtained as intermediate data result; Furthermore, a sparsification mapping algorithm (parameter: the proportion of non-zero features retained is 0.85) is adopted to achieve feature sparsification processing of the normalized matrix, suppress the interference of data noise on subsequent fusion weight calculation, and generate a sparse morphological dynamic matrix. Furthermore, based on the feature covariance calculation method (parameter: matrix size m×n), the covariance of each feature column of the sparse matrix is ​​calculated, and a feature correlation coefficient matrix is ​​generated to guide the adaptive weight allocation of the time-gated fusion unit. By using matrix reconstruction processing, the sparse morphological dynamics matrix and covariance matrix from the previous step are structurally spliced ​​together to transform into the final two-dimensional morphological dynamics feature matrix, thus preserving the dynamic evolution information of velocity and acceleration in two dimensions before spatial feature fusion. For example, in a pig feed fermentation monitoring task, the input morphodynamic feature tensor has dimensions (64, 2, 50), where 64 is the number of channels, 2 is the order of the temporal derivative, and 50 is the time step. A matrix dimension rearrangement algorithm transforms it into a two-dimensional matrix structure of (128, 50). Z-score normalization is performed on the matrix, with the mean μ being the arithmetic mean of each column of data and the standard deviation σ being the standard deviation of each column of data, ensuring that the variance of each channel feature is on a uniform scale. In the sparsity mapping algorithm, the proportion of non-zero features is set to 0.85, meaning that only the top 85% of the data in each column are retained by absolute value, and the rest are set to zero, in order to reduce the influence of outliers. In the covariance calculation step, a 128×128 covariance matrix is ​​obtained with columns as variables and m rows as samples. The matrix values ​​are used to characterize the linear correlation between different channels. Finally, the sparse morphodynamic matrix and its covariance matrix are merged into a feature matrix by column concatenation and input into the time-gated fusion unit. In this scenario, after the above processing, the weight allocation of the acceleration-sensitive channel by the time-gated fusion unit is significantly improved, and the system exhibits a stronger trend recognition capability in the transition detection from the active period to the stable period.

[0025] Step S5: Construct a differentiable temporally gated fusion unit, which includes adaptive weight coefficients generated based on the morphological dynamics feature matrix. It performs weighted fusion processing on the spatial features of the current frame and the corresponding morphological dynamics features, outputting an enhanced morphological feature representation of the fused temporal information. The weight coefficients are dynamically determined through the product relationship between the gating activation function and the morphological change acceleration value. Specifically, this includes: S5.1: Perform gated activation function calculation on the morphological dynamic feature matrix output by the dynamic morphological manifold mapping module to generate an initial gated weight vector. The gated activation function is the Sigmoid function, whose input is the product of the morphological change acceleration value and the normalized time step, which is used to characterize the significance of the morphological evolution trend at the current moment. The morphological dynamic feature matrix output by the dynamic morphological manifold mapping module is calculated using the Sigmoid gated activation function (parameters: morphological change acceleration value, normalized time step) to transform continuous temporal dynamic features into an initial weighted response with interval constraints. Furthermore, by inputting the construction algorithm (parameters: acceleration feature vector, time step normalization coefficient), the acceleration features and time scale factors are combined element-wise to obtain the input vector of the gating function. Furthermore, by using a normalization mapping algorithm (parameters: maximum time step and minimum time step), the original time step sequence is linearly scaled to generate a normalized time step coefficient vector, which provides a unified dimensional benchmark for the subsequent Sigmoid function input. Furthermore, the activation value is calculated using the following formula:

[0026] in, These are the initial gating weight vector element values. This represents the acceleration value of the shape change. To normalize the time step, It is the natural exponent constant; Furthermore, by using a vectorized evaluation algorithm (parameters: Sigmoid function expression, input matrix), parallel weight calculations are performed on each element of the entire morphological dynamics feature matrix, and an initial set of gated weight vectors is generated. Through the above activation function calculation process, the acceleration of morphological change and the significance of time dimension are coupled and transformed into a weight amplitude within a controllable interval [0,1], thereby quantifying the significance of the morphological evolution trend at the current moment; For example, in a pig feed fermentation monitoring scenario, the acceleration component of the morphodynamic feature matrix is ​​taken from the second-order tangent vector difference of three frames of images, with values ​​ranging from 0.15 to 0.45. The time step is set to 1 frame per second, and the normalized time step coefficient is calculated based on the difference between the maximum fermentation cycle duration of 72 hours and the current time. The acceleration values ​​are used as... Normalized time step For example, let's plug in the formula:

[0027] The initial gating weight was approximately 0.519. For frames where the morphological change acceleration was in a rapidly increasing phase (e.g., a value greater than 0.4), the activation output approached 0.6, demonstrating the system's effectiveness in improving the weight allocation of temporal features during the acceleration significance phase. Field verification showed that this initial gating weight significantly improved the response capability of subsequent fused features to the rapid aggregation and hyphal diffusion phases, enhancing the trend prediction module's dynamic perception performance of the fermentation process. S5.2: Based on the product relationship between the generated initial gating weight vector and the morphological change acceleration value, a dynamic weight adjustment factor is constructed. The dynamic weight adjustment factor is obtained by multiplying the initial gating weight vector and the acceleration value element by element, and is used to enhance the sensitivity of the characteristic response to the rapid morphological evolution stage. S5.3: The extracted spatial features of the current frame and the calculated morphological dynamic features are input into the feature alignment mapping layer respectively. Based on the learnable linear transformation matrix, the two types of features are dimensionally aligned and nonlinearly activated to generate spatial feature vectors and dynamic feature vectors with unified feature dimensions. S5.4: The generated dynamic weight adjustment factor is used to perform weighted fusion processing on the output spatial feature vector and dynamic feature vector. An enhanced morphological feature vector with fused temporal information is generated by weighted summation of elements. The fusion weight is controlled by the dynamic weight adjustment factor to achieve an adaptive response to the morphological evolution trend. For the spatial feature vector and dynamic feature vector output in S5.3, an element-wise weighted summation method based on dynamic weight adjustment factor (parameter: dynamic weight adjustment factor is derived from the element-wise product of the initial gate weight vector and the morphological change acceleration value) is adopted to realize the fusion calculation of the two types of features in a unified dimension, so as to preserve the spatial distribution characteristics and temporal evolution information. Furthermore, through a matrix broadcasting mechanism (parameters: feature vector dimension is d, dynamic weight adjustment factor dimension is d), the dynamic weight adjustment factor is extended to match the corresponding elements of spatial features and dynamic features, realizing element-wise multiplication operation, and obtaining the weighted spatial feature matrix and the weighted dynamic feature matrix. Furthermore, by performing element-wise matrix addition, the weighted spatial feature matrix and the weighted dynamic feature matrix are added together to generate the fused feature matrix, ensuring that the key information of temporal evolution occupies a contribution proportion proportional to the weighted response in the fusion result; Furthermore, feature normalization constraints (parameter: Euclidean norm constraint threshold ε) are adopted to prevent the numerical range of a certain type of feature from becoming unbalanced due to excessive weight during the fusion process, and to generate a normalized fusion feature vector to maintain feature scale consistency in order to facilitate the discriminative analysis of the downstream classifier. Through the above weighted fusion process, spatial features and dynamic features are combined into an enhanced morphological feature vector in a unified feature space, thereby achieving an adaptive response capability to the morphological evolution trend of the fermentation process. For example, in a certain batch of fermented pig feed, the spatial feature vector dimension is set to 128, the dynamic feature vector dimension is set to 128, and the dynamic weight adjustment factor is obtained by element-wise multiplication of the initial gating weight vector and the acceleration value. When the mean of the acceleration vector in each dimension during the high-activity period is 0.65, and the mean of the initial gating weight is 0.72, the following calculation formula is used to achieve weight adjustment:

[0028] in As a dynamic weight adjustment factor, The initial gating weight vector, The acceleration vector is given. The mean of the dynamic weight adjustment factor is calculated to be 0.468. This factor is applied to the spatial and dynamic features respectively, and element-wise multiplication is performed to obtain the weighted spatial feature matrix and the weighted dynamic feature matrix. After obtaining the fused feature matrix through element-wise addition, the Euclidean norm normalization formula is used:

[0029] in To fuse feature vectors, The normalized and fused feature vectors for The Euclidean norm is used to output a normalized 128-dimensional enhanced morphological feature vector. This vector demonstrates significant improvements in the convergence speed of the discrimination boundary and enhanced stability of trend prediction results in subsequent support vector machine scenarios. S5.5: Perform L2 normalization on the output enhanced morphological feature vector and perform nonlinear enhancement through a differentiable feature compression activation function to generate the final enhanced morphological feature representation. The feature representation has spatial distribution characteristics and temporal evolution perception capabilities, and is used as the discriminant analysis input for the classifier in the subsequent fermentation stage.

[0030] Step S6: The enhanced morphological feature representation is input into the fermentation stage classifier. This classifier performs discriminative analysis on the features based on the support vector machine algorithm and outputs a state analysis result containing fermentation stage labels and trend prediction confidence. The trend prediction confidence is calculated based on the matching degree between the morphological change acceleration and the preset fermentation kinetic model. Specifically, this includes: S6.1: The enhanced morphological feature representation, which incorporates temporal information, is input into a pre-trained support vector machine classifier model. The enhanced morphological feature representation is output by a differentiable temporally gated fusion unit and includes a weighted fusion result of the current frame spatial features and morphodynamic features. Based on the support vector machine model, classification boundary discrimination is performed on the feature vectors, and the kernel function similarity between the feature vectors and the support vectors of each fermentation stage is calculated to obtain the classification confidence value of each stage. S6.2: Perform multi-class softmax normalization processing based on the classification confidence values ​​of each fermentation stage to generate a fermentation stage probability distribution vector; the fermentation stage includes four typical stages: initiation stage, active stage, stable stage and decay stage. The classification confidence values ​​of each stage are mapped by the Softmax function to form a probability distribution, which is used to characterize the probability of the current image sequence belonging to the fermentation stage. S6.3: Calculate the trend prediction confidence level based on the matching degree between the morphological change acceleration and the preset fermentation kinetic model; the morphological change acceleration is obtained by calculating the local tangent space directional derivative in the dynamic morphological manifold mapping module, and the preset fermentation kinetic model is a typical morphological evolution curve fitted based on historical fermentation processes; by calculating the sum of squared residuals of the first derivative of the current morphological change acceleration and the model curve, the consistency between the current fermentation trend and the typical evolution path is quantified, thereby obtaining the trend prediction confidence index; The input conditions are the morphological change acceleration vector calculated by the dynamic morphological manifold mapping module and the first derivative expression of the preset fermentation kinetic model curve; The local tangent space directional derivative method (parameters: manifold space neighborhood radius r, inter-frame time step Δt) is used to calculate the morphological change acceleration data from the projection points of the current frame and the previous frame, and output the acceleration feature vector. Furthermore, by analyzing the historical fitting parameters (parameters: number of model nodes M, curve smoothing order s) of the preset fermentation kinetic model curve, the first derivative vector of the model curve is obtained as reference data for typical morphological evolution speed; Furthermore, the residual sum of squares matching degree calculation method (parameters: acceleration feature vector a, model derivative vector b) is used to quantify the consistency between the two and generate an initial trend matching degree matrix; Furthermore, through normalization and weighting (parameter: residual sum of squares threshold T), the standardized output of the trend matching degree is achieved, resulting in a trend prediction confidence index. ;

[0031] in, This is the feature vector of acceleration for the current morphological change. The first derivative vector of the fermentation kinetic model curve. eigenvector length; sum of squared residuals This reflects the degree of deviation between the current acceleration and the historical model velocity;

[0032] in, For trend prediction confidence level, The threshold for residual normalization; By calculating the ratio of the sum of squared residuals, the matching result of the previous step is transformed into a trend prediction confidence level between 0 and 1, thus achieving the expected technical effect of quantifying the consistency between the trend and the typical evolution path. For example, in a large-scale farm fermentation monitoring system, the length N of the morphological change acceleration feature vector is set to 120, the radius r of the manifold space neighborhood is 0.05, and the inter-frame time step Δt is 2 minutes. The current acceleration vector a is calculated by the dynamic morphological manifold mapping module, with a mean of 0.0125 and a variance of 0.0008. The first derivative vector b of the historically fitted fermentation kinetic model curve has a mean of 0.0119 and a variance of 0.0007. The summation of the squared residuals is used to obtain... = Preset normalization threshold for Substitute into the formula to calculate the confidence level of trend prediction. = 0.55. In this scenario, the confidence level indicates that the current fermentation trend matches the typical model to a moderate to low degree. Based on this result, the system automatically increases the sampling frame rate and resolution in subsequent data acquisition stages, achieving a significant improvement in capturing details and updating the state during rapidly changing phases. S6.4: Perform joint weighted fusion processing on the fermentation stage probability distribution vector and the trend prediction confidence to generate the final state analysis result; the weighted fusion processing is performed based on the weighted average algorithm, wherein the stage probability weight is determined by the Softmax output, the trend confidence weight is determined by the acceleration matching degree, and the output is a structured state analysis report containing fermentation stage labels, stage probabilities and trend prediction confidence. The fermentation stage probability distribution vector output from step S6.2 and the trend prediction confidence calculated from step S6.3 are used as input data. A fusion algorithm based on weighted average (parameters: stage probability weight vector p, calculated from Softmax output; trend confidence weight w, obtained from acceleration matching degree) is used to achieve the joint fusion function of probability and trend confidence. Furthermore, by using the normalized weight mapping method (parameters: p normalization range [0,1], w normalization range [0,1]), the units of the two types of weights are unified, and the normalized stage probability weight vector p' and trend confidence weight vector w' are obtained. Furthermore, a weight balancing adjustment algorithm (parameter: balancing coefficient β, the value is based on the historical prediction accuracy evaluation) is adopted to achieve adaptive adjustment of the weight ratio and generate a fusion calculation coefficient matrix F, which is used to control the contribution ratio of probability and trend signals in each stage in the fusion result; Furthermore, a weighted average fusion calculation is performed, and the fusion result is calculated using the following formula. :

[0033] in, Let be the normalized probability value for the i-th stage. This represents the normalized trend confidence value for the current time t. and These are the balance coefficients for stage probability and trend confidence, respectively; Furthermore, the fermentation stage labels are automatically selected through the stage label discrimination function (parameters: fusion result R and threshold list T), and structured output data containing stage labels, stage probability vectors and trend prediction confidence are generated. By using weighted average fusion processing, the probability distribution and trend confidence of the previous step are transformed into a structured analysis report that fully reflects the current fermentation state, realizing the synchronous output of stage identification and trend prediction, thereby significantly improving the stability and reliability of state analysis. For example, during the fermentation process of a batch of pig feed, the Softmax support vector machine classifier outputs a stage probability vector p = [0.15, 0.65, 0.15, 0.05], which, after normalization, becomes p' = [0.15, 0.65, 0.15, 0.05]. The dynamic morphological manifold module calculates a trend confidence score w = 0.74, which, after normalization, becomes w' = 0.74. The balance coefficients β1 = 0.8 and β2 = 0.2. Substituting the second stage (active period) probability p'_2 = 0.65 and the trend confidence score w' = 0.74 into the formula:

[0034] The calculated fusion score was R = 0.668. With the discrimination rule set at T2 = 0.6 and R > T2, the stage label was determined to be "active period." The final structured state analysis report output the label: "active period," with a stage probability of 0.65 and a trend prediction confidence level of 0.74. This result demonstrated significant predictive stability for temperature and pH changes during fermentation in field validation, improving the reliability of trend prediction decisions. S6.5: Transmit the structured state analysis report to the system control module to trigger the image acquisition parameter adjustment or dynamic manifold space update process; the state analysis report contains three types of output items: fermentation stage label, stage probability, and trend prediction confidence. The trend prediction confidence is used to drive the dynamic adjustment mechanism of image acquisition frequency in the subsequent step S7, and the online incremental learning process of manifold space parameters in step S8.

[0035] Step S7: Dynamically adjust the image acquisition frequency based on the trend prediction confidence level in the state analysis results. When the confidence level is lower than the first threshold, activate the high-precision acquisition mode to increase the frame rate and spatial resolution of the image sequence until the confidence level recovers to above the second threshold, at which point switch back to the normal acquisition mode. Specifically, this includes: S7.1: Based on the trend prediction confidence score output by the fermentation stage classifier, perform confidence score threshold comparison processing to determine whether the current confidence score is lower than the preset first threshold, obtain the confidence score status flag, and use it to trigger the acquisition mode switching mechanism; S7.2: When the confidence status flag is in the low confidence state, based on the preset high-precision acquisition parameter configuration table, generate high frame rate and high spatial resolution image acquisition control commands to improve the sampling density and detail capture capability of the image acquisition system. Based on the input condition that the confidence status flag is in a low confidence state, the system calls a pre-established high-precision acquisition parameter configuration table (fields include a set of parameters such as high frame rate, high resolution, exposure time, and gain coefficient) as the parameter source for generating acquisition control commands. The parameter matching retrieval method (parameters: confidence status flag = low, acquisition mode = high precision) is used to index and locate the corresponding mode entry in the configuration table and output the set of all control parameters required for the target acquisition mode. Furthermore, by acquiring parameter mapping algorithms (parameters: target acquisition mode parameter set, device driver port mapping table), a nonlinear mapping relationship is constructed from the acquisition system logic parameters to the physical control command bit stream, and device-recognizable command sequence data is obtained; Furthermore, through a time-series scheduling algorithm (parameters: target frame rate, target resolution, and acquisition window period), the acquisition task time slice allocation is realized based on the current system load, and a scheduling matrix containing the start timestamp, frame rate adjustment value, and image resolution configuration value is generated. By using a command sequence encapsulation processing method (parameters: device communication protocol, check code generation rules), the acquisition control command matrix output in the previous step is converted into a data packet that conforms to the device protocol format, thereby enabling the high-precision mode activation control signal output of the acquisition system. For example, during the monitoring of a certain batch of fermented feed, if the trend prediction confidence level is determined to be low, the frame rate target value in the corresponding high-precision acquisition parameter configuration table entry is set to [value missing]. Frames per second, target resolution value pixels, exposure time is microseconds, gain factor is The system locates the entry based on a parameter matching retrieval method and uses a parameter mapping algorithm to map the frame rate and resolution values ​​to device register numbers and their written value pairs, achieving a non-linear mapping from logical parameters to physical registers, such as frame rate. Mapped to register Value range, resolution Mapped to register Value range. The timing scheduling algorithm operates within the acquisition window period. Within milliseconds, schedule high frame rate runtime slices in the first second of each second. milliseconds, remaining Milliseconds are used for cache refresh. The command encapsulation process generates the corresponding start bit, data bit, and checksum according to the device communication protocol, forming a complete high-precision acquisition mode start command package, which is transmitted to the industrial camera execution module via the control bus. The execution effect is that the sampling density of the acquisition system is significantly improved, the ability to capture image details is enhanced, and the clarity of mycelial edges and granular microstructures in morphological features is improved, providing higher quality input data for subsequent feature extraction; S7.3: Sends high frame rate and high spatial resolution image acquisition control commands to the image acquisition module to perform dynamic adjustment of acquisition parameters, so as to realize real-time switching of the acquisition frequency and image resolution of the image acquisition device; S7.4: Continuously monitor the changes in trend prediction confidence. Based on the status analysis results under the current acquisition mode, determine whether the trend prediction confidence has recovered to above the preset second threshold and obtain the acquisition mode switching recovery flag to decide whether to switch back to the normal acquisition mode. The trend prediction confidence sequence output by the fermentation stage classifier is used as input data; A sliding window mean filtering algorithm (window length: 5 time steps) is used to smooth the short-term fluctuations of the confidence sequence, resulting in smoothed confidence curve data for subsequent recovery condition judgment. Furthermore, by using the second-order difference calculation method (parameter: time step interval Δt=1), the rate of change of the smooth confidence curve is estimated, and the dynamic rate of change vector of the trend prediction confidence under the current acquisition mode is obtained; Furthermore, by using an interval threshold comparison algorithm (with the upper threshold parameter set to the second threshold), the joint condition determination of the rate of change vector and the smooth confidence curve is realized, and a logical state vector that meets the recovery condition is generated. Furthermore, through Boolean mapping, the logical state vector is transformed into acquisition mode switching recovery flag data, where a value of 1 indicates that the trend prediction confidence has recovered to above the preset second threshold, and a value of 0 indicates that the switching condition has not been met. By combining the smooth confidence level and dynamic change rate with the above state determination and flag conversion processing method, the acquisition mode switching recovery flag is transformed into an accurate drive control for switching back to the normal state of the acquisition mode. For example, during the operation of the fermentation monitoring system, the trend prediction confidence sequence is acquired at a frequency of 10 fps in low-precision acquisition mode and at a frequency of 30 fps in high-precision acquisition mode. With a window length of 5, a moving average filter is applied to the confidence sequence {0.42, 0.45, 0.48, 0.52, 0.55, 0.57, 0.60} to obtain a smooth curve {0.42, 0.435, 0.45, 0.467, 0.49, 0.535, 0.56}. The rate of change is calculated using the second-order difference method; for example, the formula for the rate of change at the 6th time step is:

[0036] in, To smooth the confidence scores, For time step index, Set it to 1. Substitute in =0.535 and =0.49, yielding a change rate of 0.045. The smoothed confidence curve is compared to a preset second threshold of 0.55. When the smoothed confidence is ≥0.55 and the change rate is ≥0, it is marked as meeting the recovery condition in the logic state vector, and this condition is mapped to the acquisition mode switching recovery flag 1. Upon receiving flag 1, the system control module automatically performs a normal acquisition mode revert, restoring high frame rate and high resolution acquisition to the initial 10fps and 720p settings, significantly improving acquisition resource utilization. S7.5: When the acquisition mode switching recovery flag is in a high confidence state, an image acquisition control command with a normal frame rate and normal resolution is generated based on the normal acquisition parameter configuration table and sent to the image acquisition module to restore the image acquisition frequency and resolution to the initial set values, thereby realizing dynamic optimization scheduling of acquisition resources.

[0037] Step S8: Update the manifold space parameters of the dynamic morphological manifold mapping module based on the stage-specific feature data of the fermentation process. Incorporate the latest collected morphological feature vector set into the training dataset using an online incremental learning algorithm, and iteratively optimize the parameter configuration of the nonlinear projection mapping function. Specifically, this includes: S8.1: Based on the fermentation stage label and trend prediction confidence score output by the fermentation stage classifier, determine the current fermentation cycle stage in order to select a set of morphological feature vector samples suitable for manifold space updates. S8.2: Perform normalization processing on the selected morphological feature vector sample set to eliminate the impact of feature scale differences between different fermentation batches on the update of manifold space parameters, and obtain the normalized feature vector set. S8.3: Based on the normalized feature vector set and the historical training dataset, the parameters of the nonlinear projection function of the dynamic morphological manifold mapping module are updated using an online incremental learning algorithm to generate updated manifold space mapping parameters. S8.4: Calculate the principal component distribution of the current manifold space based on the updated manifold space mapping parameters, and dynamically adjust the manifold space dimension to match the complexity requirements of the typical morphological evolution pattern in the current fermentation stage; S8.5: Deploy the updated manifold space parameters to the dynamic morphological manifold mapping module, replacing the original nonlinear projection mapping function configuration, to enhance the system's ability to model the morphological evolution trend of the subsequent fermentation process.

[0038] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

[0039] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and rules of the present invention should be included within the scope of protection of the present invention.

Claims

1. An image recognition-based analysis method for the state of a pig feed fermentation process, characterized by, The method comprises the following steps: S1: collecting a continuous multi-frame image sequence in the fermentation process of pig feed, performing preprocessing operations based on illumination normalization and background segmentation on the image sequence, and generating a preprocessed image sequence; S2: inputting the preprocessed image sequence into a lightweight convolutional neural network, performing feature dimension reduction and nonlinear activation processing on each frame of image, and generating a preliminary morphological feature vector set containing spatial distribution characteristics; S3: based on the Euclidean distance matrix between the preliminary morphological feature vectors of adjacent frames, a dynamic morphological manifold mapping module is constructed using a self-organizing neural network, which maps the feature vectors to a learnable low-dimensional manifold space through nonlinear projection; S4: in the low-dimensional manifold space, the directional derivative of the local tangent space is calculated, and the tangent vector differential operation is performed on the projection points of the current frame and the previous frame in the manifold space, and a morphological dynamics feature matrix representing the morphological change speed and acceleration is generated; S5: a differentiable time-gated fusion unit is constructed to perform weighted fusion processing on the spatial features of the current frame and the corresponding morphological dynamics features, and output an enhanced morphological feature representation of fusion time sequence information; S6: inputting the enhanced morphological feature representation into a fermentation stage classifier to output a state analysis result containing a fermentation stage label and a trend prediction confidence.

2. The image recognition-based pig feed fermentation process state analysis method according to claim 1, characterized in that, The step S6 further comprises: S7: dynamically adjusting the image acquisition frequency according to the trend prediction confidence in the state analysis result, starting a high-precision acquisition mode when the confidence is below a first threshold, increasing the frame rate and spatial resolution of the image sequence, and switching back to the normal acquisition mode when the confidence recovers to above a second threshold; S8: updating the manifold space parameters of the dynamic morphological manifold mapping module based on the phase feature data of the fermentation process, merging the latest collected morphological feature vector set into the training data set through an online incremental learning algorithm, and iteratively optimizing the parameter configuration of the nonlinear projection mapping function. 3.The image recognition-based pig feed fermentation process state analysis method according to claim 1, characterized in that, The step S1 specifically comprises: Collecting a continuous multi-frame image sequence at different stages of the fermentation process of pig feed based on an industrial camera, and constructing a spatio-temporal evolution data set of the fermentation process; Performing illumination normalization processing on the image sequence, using a multi-scale Gaussian filtering algorithm based on Retinex theory to perform color space conversion and brightness compensation on each frame of image, and obtaining illumination equalization image data; Based on the illumination equalization image data, a semantic segmentation model based on U-Net structure is used to perform background segmentation processing on the image, and a foreground mask image containing mycelium region and particle aggregation region is output; Pixel-level fusion is performed on the foreground mask image and the original image to generate a morphological feature image that only retains the mycelium distribution and particle aggregation region, and a morphological enhancement image set is obtained; Perform image quality evaluation and inter-frame consistency correction processing on the morphological enhancement image set, calculate the visual change degree between adjacent frames based on structural similarity index and frame difference method, perform image repair operation based on interpolation algorithm on abnormal frames, and output a preprocessed fermentation image sequence.

4. The image recognition-based pig feed fermentation process state analysis method according to claim 3, characterized in that, The image sequence contains visual information of mycelium distribution state and particle aggregation degree.

5. The image recognition-based pig feed fermentation process state analysis method according to claim 1, characterized in that, The step S2 specifically comprises: Based on the pre-processed image sequence, a light-weight convolutional neural network is used to perform convolution operation on each frame of image, local spatial texture features are extracted, and a preliminary high-dimensional feature map is obtained; The high-dimensional feature map is subjected to channel attention mechanism weighting processing to generate a weighted feature map; Based on the weighted feature map, a global average pooling operation is adopted to compress the spatial dimension of the feature map to generate a channel feature vector; The channel feature vector is subjected to nonlinear activation function processing to introduce nonlinear expression capability to generate a nonlinear feature vector; The nonlinear feature vector is mapped and transformed through a fully connected layer to generate a preliminary morphological feature vector of uniform dimension.

6. The image recognition-based pig feed fermentation process state analysis method according to claim 1, characterized in that, The step S3 specifically comprises: Based on the set of preliminary morphological feature vectors of adjacent frames, a Euclidean distance matrix between each frame and the previous frame is calculated to obtain an initial metric matrix of inter-frame morphological change; The topology structure of the dynamic morphological manifold mapping module is initialized by using a self-organizing neural network to form a neuron activation map reflecting a typical morphological evolution path; According to the principal component analysis result of the typical morphological evolution mode of the fermentation stage, the target dimension of the manifold space is dynamically determined; In the dynamic morphological manifold mapping module, based on a nonlinear projection algorithm, a manifold embedding operation is performed on the preliminary morphological feature vector to map the high-dimensional feature vector to a low-dimensional manifold space constructed by the self-organizing neural network, a set of projection points of each frame in the manifold space is obtained, and a geometric trajectory representation of the morphological evolution of the fermentation process is formed; The set of projection points in the manifold space is subjected to online optimization processing, the latest collected set of morphological feature vectors is incorporated into the training data set, and the parameter configuration of the nonlinear projection mapping function is iteratively optimized.

7. The image recognition-based pig feed fermentation process state analysis method according to claim 6, characterized in that, The topology structure of the self-organizing neural network is adaptively clustered by inputting the initial metric matrix of inter-frame morphological change to form a neuron activation map reflecting a typical morphological evolution path, and k principal components are extracted by principal component analysis to cover more than 95% of the cumulative variance contribution rate. 8.The image recognition-based pig feed fermentation process state analysis method according to claim 1, characterized in that, The step S4 specifically comprises: A tangent vector differential operation is performed on the current frame and the previous frame projection points in the manifold space output by the dynamic morphological manifold mapping module based on the local neighborhood structure of the manifold space to construct tangent space basis vectors; Based on the tangent space basis vectors, a tangent vector difference between the current frame and the previous frame is calculated to generate a tangent vector difference vector representing the morphological change speed; A second-order difference operation is performed on the tangent vector difference vectors of three consecutive frames in the manifold space to generate a second-order tangent vector difference vector representing the morphological change acceleration; The tangent vector difference vector and the second-order tangent vector difference vector are tensor spliced to construct a morphological dynamics feature tensor containing first-order and second-order time derivative information; The morphological dynamics feature tensor is subjected to channel attention weighting processing to generate an adaptive channel weight vector based on the variance contribution rate of each channel feature, and a weighted morphological dynamics feature tensor is formed; The weighted morphological dynamics feature tensor is converted into a morphological dynamics feature matrix and output to a time-gated fusion unit. 9.The image recognition-based pig feed fermentation process state analysis method according to claim 1, characterized in that, The step S5 specifically comprises: Perform a gating activation function calculation process on the morphological dynamics feature matrix output by the dynamic morphological manifold mapping module to generate an initial gating weight vector; Based on the product relationship between the initial gating weight vector and the morphological change acceleration value, a dynamic weight adjustment factor is constructed; The extracted current frame spatial features and the calculated morphological dynamics features are input into the feature alignment mapping layer respectively, and based on the learnable linear transformation matrix, the two types of features are dimensionally aligned and nonlinearly activated to generate spatial feature vectors and dynamics feature vectors with unified feature dimensions; Using the dynamic weight adjustment factor, the spatial feature vectors and dynamics feature vectors are subjected to weighted fusion processing, and through element-wise weighted summation, an enhanced morphological feature vector with fused temporal information is generated; Perform normalization processing on the enhanced morphological feature vector, and perform nonlinear enhancement through a differentiable feature compression activation function to generate the final enhanced morphological feature representation.

10. The image recognition-based pig feed fermentation process state analysis method according to claim 9, characterized in that, The gating activation function is a Sigmoid function, whose input is the product of the morphological change acceleration value and the normalized time step, used to represent the significance of the morphological evolution trend at the current time.