Agricultural liquid formulation filling control method and system

CN122667503APending Publication Date: 2026-09-01HENAN HANSI CROP PROTECTION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610825517.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-09
Publication Date
2026-09-01

AI Technical Summary

Technical Problem

现有检测系统的训练样本通常基于固定剂型和固定工况采集,样本单一且缺乏覆盖性,无法适应实际产线中多种制剂与容器组合的快速切换需求

Benefits of technology

本发明通过步骤S1中多视角工业相机采集覆盖乳油、悬浮剂、水乳剂等不同粘度特性农药液体制剂类型及玻璃瓶、塑料瓶等不同内壁表面粗糙度的多材质多工况液面图像,经去噪、对比度增强、光照校正及边缘轮廓分析后生成挂壁层厚度分布图,为后续模型训练提供了标准化、结构化的样本数据基础;步骤S2以此为基础,将灌装参数、粘度特性数据及容器内壁表面粗糙度与厚度分布图关联,构建编码器-解码器神经网络模型,建立了从工艺参数到挂壁形态的端到端映射关系,使模型具备对不同农药液体制剂和容器组合的泛化预测能力。在此基础上,步骤S3将待灌装的实时工艺参数输入训练完成的模型,获取预测厚度分布图并提取液面边缘的曲率值、倾斜角度等形态特征,同时沿容器内壁曲面积分计算挂壁层液体体积,实现了挂壁效应的量化表征;步骤S4则利用该体积数据与液面形态特征,将液面主体区域的基准高度与挂壁层体积折算的等效液柱高度求和,得到能够真实反映灌装总量的等效液位高度,并与目标液位高度比较获取液位差,从而将挂壁层从干扰因素转化为可补偿的工艺参量。步骤S5依据该液位差自适应调整灌装速度或灌装时间,并将更新后的参数重新输入模型进行迭代预测与偏差修正,直至液位差收敛至预设精度阈值以内;此外,当模型面临粘度差异显著的多种农药液体制剂而出现特征区分能力饱和时,通过诊断物理参数编码分支的隐藏层活性并动态增加级联扩展层进行再训练,进一步保障了闭环系统在长期多品种生产场景下的预测可靠性。通过上述技术方案之间的相互配合,不仅解决了传统灌装控制因忽略挂壁层体积而导致液位测量值系统性偏低的固有缺陷,更在不透明容器无法直接观测液面的场景下,实现了无需称重和人工拆检的自动化高精度灌装控制,显著提升了农药液体制剂灌装产线的自适应控制能力与灌装合格率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122667503A_ABST
    Figure CN122667503A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image recognition, and particularly relates to a pesticide liquid preparation filling control method and system. The method comprises the following steps: acquiring liquid surface images of different preparations under different containers and filling parameters, preprocessing, extracting wall-hanging layer thickness features, and generating a thickness distribution graph; taking the filling parameters, viscosity characteristics, container roughness, and the thickness distribution graph as training data to construct a thickness prediction model; inputting the parameters of the pesticide liquid preparation to be filled into the model to obtain a predicted thickness distribution graph, identifying the liquid surface morphological features, and calculating the wall-hanging layer volume; obtaining the reference liquid level height and calculating the filling equivalent liquid level height according to the wall-hanging layer volume; comparing the filling equivalent liquid level height with the target liquid level height to obtain the liquid level difference; and adjusting the filling parameters according to the absolute value of the liquid level difference and iteratively optimizing until the accuracy requirement is met. The present application solves the technical problems of liquid level detection distortion and low filling precision caused by the wall-hanging effect in pesticide filling, and realizes accurate compensation of the wall-hanging layer volume and closed-loop adaptive control of the filling parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, and in particular to a method and system for controlling the filling of liquid pesticide formulations. Background Technology

[0002] Filling liquid pesticide formulations is a crucial step in pesticide production, and filling accuracy directly affects the product's dosage accuracy and safety. With the development of automation technology, machine vision-based liquid level detection methods have been widely applied in liquid formulation filling production lines. These methods use industrial cameras to capture images of the liquid surface inside the container after filling, and then process the images to extract the liquid surface edge contours to determine if the filling volume meets the standards. However, liquid pesticide formulations such as emulsifiable concentrates, suspensions, and water-in-oil emulsions have significant adhesive properties. After filling, the liquid easily forms a wall-attached layer on the inner wall of the container, causing the liquid surface edge to bend and deform, rather than presenting an ideal level and flat state. Traditional visual inspection methods typically use the liquid surface edge contour line directly as the basis for liquid level judgment, failing to distinguish between the main liquid surface area and the edge area affected by the wall-attached effect. This results in a systematic deviation of the liquid level detection value from the actual filling volume, causing filling accuracy control to fail. For opaque plastic filling containers, the above-mentioned visual inspection methods are difficult to apply because it is impossible to directly observe the liquid surface shape through the bottle wall. Production lines often rely on weighing sensors or manual disassembly and sampling for inspection, which not only results in low inspection efficiency but also makes it difficult to integrate into the closed-loop control system of high-speed continuous filling processes.

[0003] Furthermore, the production of liquid pesticide formulations is characterized by a wide variety of products and small batches. Different formulations exhibit significant differences in viscosity characteristics, and the materials, geometric features, and inner surface roughness of filling containers vary. Process parameters such as filling speed and ambient temperature are also frequently adjusted according to production tasks. Existing detection systems typically use training samples based on fixed formulations and operating conditions, resulting in limited sample diversity and coverage, failing to meet the rapid switching requirements of various formulations and container combinations in actual production lines. More critically, current technologies have not established a quantitative mapping relationship between filling parameters, liquid viscosity characteristics, container surface conditions, and the spatial distribution of the wall-mounted layer thickness. This makes it impossible to predict the wall-mounted effect before production and lacks a compensation mechanism to convert the volume of the wall-mounted liquid into an equivalent liquid level height, leading to the long-term neglect of the wall-mounted layer volume in filling volume calculations. Simultaneously, when faced with various liquid pesticide formulations with significant viscosity differences, the physical parameter encoding branches of neural network-based prediction models are prone to feature discrimination saturation, making it difficult to effectively decouple the influence of viscosity characteristics and container surface conditions on the wall-mounted morphology. This further restricts the model's generalization ability and prediction reliability under multiple operating conditions. Therefore, existing technologies are insufficient to meet the technical requirements for accurate prediction, volume compensation, and adaptive control of the wall adhesion effect during the filling process of liquid pesticide formulations. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides a method and system for controlling the filling of liquid pesticide formulations, which enables high-precision filling control of liquid pesticide formulations.

[0005] In a first aspect, the present invention provides a method for controlling the filling of liquid pesticide formulations, the method comprising: Step S1: Obtain liquid surface image data of different pesticide liquid formulations after filling with different containers and different filling parameters, generate a set of liquid surface images through preprocessing, extract the wall-mounted layer thickness features from the liquid surface images as the sample image set, and generate a thickness distribution map corresponding to the sample images. Step S2: Use the filling parameters, viscosity characteristics, container inner wall surface roughness parameters, and corresponding thickness distribution map of the pesticide liquid formulation as training data to construct a thickness prediction model; Step S3: By inputting the filling parameters, viscosity characteristics data and container surface roughness parameters of the pesticide liquid formulation to be filled into the thickness prediction model, a predicted thickness distribution map is obtained; based on the predicted thickness distribution map, the liquid surface morphology characteristics of the wall-mounted layer are identified, and the volume of pesticide liquid in the wall-mounted layer is calculated. Step S4: Obtain the reference liquid level height based on the liquid surface morphology characteristics; calculate the filling equivalent liquid level height based on the pesticide liquid volume of the wall-mounted layer and the reference liquid level height; and compare the equivalent liquid level height with the target liquid level height to obtain the liquid level difference. Step S5: Adjust the filling parameters according to the absolute value of the liquid level difference, update the input data of the thickness prediction model based on the adjusted filling parameters, and repeat step S3 to this step until the filling accuracy requirements are met.

[0006] Secondly, the present invention also provides a pesticide liquid formulation filling control system for implementing the above-described method, the system comprising: The image processing unit is used to acquire liquid surface image data of different pesticide liquid formulations after filling with different containers and different filling parameters, generate a set of liquid surface images through preprocessing, extract the wall-mounted layer thickness features from the liquid surface images as a sample image set, and generate a thickness distribution map corresponding to the sample images. The model training unit is used to construct a thickness prediction model by using the filling parameters, viscosity characteristics, container inner wall surface roughness parameters, and corresponding thickness distribution maps of pesticide liquid formulations as training data. The thickness prediction unit is used to obtain a predicted thickness distribution map by inputting the filling parameters, viscosity characteristics data and container surface roughness parameters of the pesticide liquid formulation to be filled into the thickness prediction model; based on the predicted thickness distribution map, it identifies the liquid surface morphology characteristics of the wall-mounted layer and calculates the volume of pesticide liquid in the wall-mounted layer. The liquid level calculation unit is used to obtain a reference liquid level height based on the liquid surface morphology characteristics, calculate the filling equivalent liquid level height based on the pesticide liquid volume of the wall-mounted layer and the reference liquid level height, and compare the equivalent liquid level height with the target liquid level height to obtain the liquid level difference. The parameter control unit is used to adjust the filling parameters according to the absolute value of the liquid level difference, update the input data of the thickness prediction model based on the adjusted filling parameters, and re-execute step S3 to this step until the filling accuracy requirements are met.

[0007] The present invention also provides a computer-readable storage medium storing instructions that, when executed by a processor, implement the above-described method.

[0008] The beneficial effects of this invention are as follows: In step S1, this invention uses a multi-view industrial camera to collect images of liquid pesticide formulations with different viscosity characteristics, such as emulsifiable concentrates, suspensions, and water-in-oil emulsions, as well as images of liquid surfaces in various materials and working conditions, including glass bottles and plastic bottles, with different inner wall surface roughness. After denoising, contrast enhancement, illumination correction, and edge contour analysis, a wall-mounted layer thickness distribution map is generated, providing a standardized and structured sample data foundation for subsequent model training. In step S2, based on this, the filling parameters, viscosity characteristics data, and container inner wall surface roughness are correlated with the thickness distribution map to construct an encoder-decoder neural network model. This establishes an end-to-end mapping relationship from process parameters to wall-mounted morphology, enabling the model to have generalized prediction capabilities for different combinations of liquid pesticide formulations and containers. Based on this, step S3 inputs the real-time process parameters to be filled into the trained model, obtains the predicted thickness distribution map, and extracts the curvature value, tilt angle and other morphological features of the liquid surface edge. At the same time, it calculates the liquid volume of the wall-attached layer along the surface integral of the inner wall of the container, realizing the quantitative characterization of the wall-attached effect. Step S4 uses this volume data and liquid surface morphological features to sum the reference height of the main liquid surface area and the equivalent liquid column height converted from the wall-attached layer volume to obtain the equivalent liquid level height that can truly reflect the total filling volume. It then compares the liquid level height with the target liquid level height to obtain the liquid level difference, thereby transforming the wall-attached layer from an interfering factor into a compensable process parameter. Step S5 adaptively adjusts the filling speed or filling time based on the liquid level difference, and re-inputs the updated parameters into the model for iterative prediction and deviation correction until the liquid level difference converges to within the preset accuracy threshold. Furthermore, when the model encounters saturation in its feature discrimination ability due to the significant viscosity differences among various pesticide liquid formulations, the hidden layer activity of the physical parameter encoding branch is diagnosed, and cascaded extension layers are dynamically added for retraining. This further ensures the predictive reliability of the closed-loop system in long-term, multi-variety production scenarios. Through the synergy of these technical solutions, not only is the inherent defect of traditional filling control—namely, the systematically low liquid level measurement due to neglecting the volume of the wall-mounted layer—solved, but also, in scenarios where the liquid level cannot be directly observed in opaque containers, automated, high-precision filling control without weighing or manual inspection is achieved. This significantly improves the adaptive control capability and filling qualification rate of pesticide liquid formulation filling production lines. Attached Figure Description

[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is a flowchart of a pesticide liquid formulation filling control method in the embodiment; Figure 2This is a diagram showing the iterative convergence curve of the liquid level difference during the closed-loop control process of filling in the example. Figure 3 This is a structural diagram of a pesticide liquid formulation filling control system in an embodiment. Detailed Implementation

[0011] This invention provides a method and system for controlling the filling of liquid pesticide formulations. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0012] For ease of understanding, the specific process of the embodiments of the present invention will be described below, such as... Figure 1 As shown in the figure, an embodiment of the present invention provides a method for controlling the filling of liquid pesticide formulations, comprising: Step S1: Obtain liquid surface image data of different pesticide liquid formulations after filling with different containers and different filling parameters, generate a set of liquid surface images through preprocessing, extract the wall-mounted layer thickness features from the liquid surface images as a sample image set, and generate a thickness distribution map corresponding to the sample images. In step S1, generating a sample image set includes: Multiple industrial cameras are used to capture multi-angle images of the liquid surface of different pesticide liquid formulations after filling with different filling parameters and containers. The pesticide liquid formulations include at least emulsifiable concentrates, suspensions, or water-in-oil emulsions, and the containers include at least transparent glass or plastic bottles. The liquid surface images are preprocessed, including noise reduction, contrast enhancement, and correction of uneven lighting, to obtain clear liquid surface image data. The liquid surface image data set is used as a sample image set, wherein the filling parameters include at least the geometric features of the filling container, the filling volume, the filling speed, and the filling ambient temperature.

[0013] Specifically, on pesticide filling lines, emulsifiable concentrates, suspensions, and water-in-oil emulsions form a coating on the inner wall of glass or plastic bottles after filling. This causes the liquid surface edge to bend, interfering with the judgment of the true liquid level and thus affecting control accuracy. To accurately extract the characteristics of the coating thickness and analyze its impact on liquid level detection, it is first necessary to obtain a liquid surface image that clearly reflects the coating morphology.

[0014] During implementation, multiple industrial cameras capture multi-angle images of the liquid surface of different pesticide liquid formulations after filling with various filling parameters and containers. These multiple industrial cameras refer to image acquisition devices mounted at the same height on the filling line, aimed at the liquid surface of the container from different angles. The multi-angle liquid surface images refer to a combination of liquid surface images from different angles, used to comprehensively cover the morphological information of the adhering layer under different lighting and viewing angles. The aforementioned pesticide liquid formulations include at least emulsifiable concentrates, suspension concentrates, or water-in-oil emulsions. The selection of different pesticide liquid formulations is used to cover the influence of different viscosity characteristics on the adhering morphology. The aforementioned containers include at least transparent glass bottles or plastic bottles. Transparent glass bottles or plastic bottles refer to packaging container materials that allow visible light to pass through so that the industrial cameras can clearly capture the liquid surface edges and the outline of the adhering layer. The filling parameters mentioned above include at least the geometric features of the filling container, the filling volume, the filling speed, and the filling ambient temperature. The geometric features of the filling container refer to the inner diameter, height, and wall curvature parameters of the container. The filling volume refers to the target liquid volume injected into the container during the filling operation. The filling speed refers to the volumetric flow rate of the liquid flowing into the container. The filling ambient temperature refers to the temperature conditions of the environment in which the filling operation takes place. The combination of the above different filling parameters is used to simulate various working conditions that may occur on the actual production line.

[0015] The above-mentioned liquid surface image undergoes preprocessing. This preprocessing refers to a series of operations performed on the original acquired image to improve its quality and suppress interference before image analysis. The denoising involves using a Gaussian filtering algorithm to perform convolution operations on the image, suppressing random noise generated by the industrial camera in the production line environment while preserving key structural information of the liquid surface edge and the wall-mounted layer boundary. The contrast enhancement involves optimizing the overall gray-level distribution of the liquid surface image through histogram equalization or adaptive contrast enhancement methods, amplifying the differences between different gray-level levels in the image, suppressing background reflections and noise interference, and making the gray-level boundaries of the wall-mounted layer, the container inner wall, and the air area clearer, providing a high-contrast image foundation for subsequent edge detection and wall-mounted layer thickness extraction. The correction of uneven illumination involves using a correction method based on illumination component estimation to compensate for local over-brightness or under-brightness caused by the angle of the supplementary lighting or reflection from the curved surface of the bottle, obtaining a liquid surface image with uniform illumination and no local highlights or shadows, thereby eliminating the interference of uneven illumination on the judgment of the wall-mounted layer edge morphology. The preprocessing described above yields clear liquid surface image data. This clear liquid surface image data refers to high-quality image data that accurately reflects the liquid surface edge and the morphology of the adhering layer after noise reduction, contrast enhancement, and illumination correction. This set of liquid surface image data is used as a sample image set. This sample image set refers to an image dataset categorized and archived according to pesticide liquid formulation type, container material, filling parameters, and collection batch, providing a standardized data input basis for subsequent steps.

[0016] The above-mentioned sample image set generation process, through a combination of multi-view acquisition and targeted preprocessing, established a standardized image dataset covering multiple formulations, materials, and working conditions. This solved the technical problem that traditional detection samples are singular and cannot adapt to the characteristics of multi-variety, small-batch production of liquid pesticide formulations, and provided high-quality sample images for wall-mounted layer thickness feature extraction and model training.

[0017] Further, in step S1, generating a thickness distribution map includes: An edge detection algorithm is applied to each liquid surface image in the sample image set to extract the boundary information of the adhering layer; the uneven distribution area of ​​the adhering layer is identified by contour analysis to determine the local thickness variation characteristics; The thickness of the adhering layer at different locations on the inner wall of the container is calculated based on the local thickness variation characteristics, generating thickness distribution data; the thickness distribution data is then mapped to a two-dimensional image space corresponding to the liquid surface image to form a visualized thickness distribution map.

[0018] Specifically, after acquiring the sample image set, in order to quantify and extract the spatial distribution of the adhering layer on the inner wall of the container from the liquid surface image and generate structured thickness data that can be used for model training, a thickness distribution map is generated by combining edge detection and contour analysis.

[0019] During implementation, an edge detection algorithm is applied to each liquid surface image in the aforementioned sample image set to extract the boundary information of the hanging layer. The aforementioned edge detection algorithm refers to an image processing operator used to distinguish the hanging layer area from the background area in the image and locate the boundary of the hanging layer. The boundary information of the hanging layer includes the contact boundary between the hanging layer and the inner wall of the container, as well as the liquid surface boundary line where the hanging layer contacts the air. Specifically, the liquid surface image can first be converted to grayscale to reduce computational complexity. Then, the edge detection operator is used to perform convolution operation on the grayscale image. This operator calculates the gradient magnitude and gradient direction of each pixel in the image and performs non-maximum suppression along the gradient direction, which can accurately preserve the boundary information of the hanging layer edge while suppressing noise. After processing, a binary edge image is obtained.

[0020] Contour analysis is used to identify uneven distribution areas of the hanging layer and determine local thickness variation characteristics. Contour analysis refers to the method of analyzing the continuity and closure of the inner and outer boundary contours of the edge image to extract the geometric shape of the hanging layer region. Uneven distribution areas refer to regions where the thickness of the hanging layer exhibits significant fluctuations or abrupt changes within a local area. Local thickness variation characteristics are quantitative indicators characterizing the degree of change in the thickness of the hanging layer between adjacent sampling positions. Specifically, connected component labeling is performed on the boundary pixels in the edge image, and the inner and outer boundaries are fitted into two continuous contour curves. Multiple sampling points are then sampled on these contour curves using equal arc lengths or equal intervals. The inner boundary line is the boundary line in contact with the inner wall of the container, and the outer boundary line is the boundary line away from the inner wall and in contact with the air inside the container. Along the extension direction of the inner wall of the container, from the top of the hanging layer downwards to the bottom of the hanging layer, a sampling point is taken at a preset distance. The distance between the inner and outer contour curves at each sampling point is calculated. When the contour distance between adjacent sampling points changes gently, the local thickness change characteristic is low variance. When there is local accumulation or thin layer area in the hanging layer, the contour distance between adjacent sampling points shows a step or violent fluctuation, and the local thickness change characteristic is high variance or high gradient. Through the above contour analysis method, the location of the area with uneven thickness distribution in the hanging layer and the degree of change can be identified.

[0021] Based on the aforementioned local thickness variation characteristics, the thickness values ​​of the wall-mounted layer at different locations on the inner wall of the container are calculated, generating thickness distribution data. This thickness distribution data refers to a structured dataset containing the thickness values ​​of the wall-mounted layer at each sampling location on the inner wall of the container and their corresponding spatial coordinates. Specifically, the industrial camera is first calibrated to obtain the actual physical size corresponding to each pixel in the liquid surface image, establishing a mapping relationship between the pixel coordinate system and the physical coordinate system. For each sampling location within the wall-mounted layer area, the wall-mounted layer thickness value, expressed in actual length units, is obtained by multiplying the pixel distance between the inner and outer boundary contours at that location by the physical size corresponding to each pixel. During the thickness calculation process, gradient information from the local thickness variation characteristics can also be used for thickness interpolation. For example, linear interpolation or spline interpolation methods can be used between adjacent sampling points to smoothly estimate the thickness value at intermediate locations that are not directly sampled, thereby obtaining a continuous thickness distribution covering the entire area of ​​the wall-mounted layer. The thickness values ​​at the aforementioned locations obtained from each of the aforementioned liquid surface images, along with their corresponding spatial coordinates, are organized into structured data, which constitutes the thickness distribution data.

[0022] The thickness distribution data corresponding to multiple liquid surface images acquired under the same pesticide liquid formulation, container, and filling parameters are stitched together, and the average value of overlapping areas is used to replace the data. This is then mapped onto a two-dimensional image space corresponding to the unfolded longitudinal cross-section of the corresponding container, forming a visualized thickness distribution map. The two-dimensional image space refers to an unfolded image matrix that can describe the thickness distribution around the wall-mounted layer. The thickness distribution map is a visualized image that encodes the wall-mounted layer thickness information using pixel grayscale or pseudo-color values. Specifically, for each spatial coordinate position in the thickness distribution data, the corresponding thickness value is normalized and converted into a grayscale level or color level value, which is then assigned to the corresponding pixel. Positions with greater thickness have higher grayscale values ​​or a warmer pseudo-color, thus forming an image that intuitively shows the variation pattern of the wall-mounted layer thickness. To further reduce abnormal fluctuations in local thickness values ​​caused by image acquisition noise and edge detection errors, Gaussian smoothing can be performed on the thickness distribution data before thickness mapping. A weighted average of the thickness data within the spatial neighborhood is applied using a convolution kernel, smoothing out isolated high-frequency noise points, making the final thickness distribution map more continuous and smooth while retaining the main thickness variation trend.

[0023] The above technical solution establishes a quantitative mapping relationship between the geometric shape of the wall layer and the image space by transforming the thickness information of the wall layer implicit in the liquid surface image into structured thickness distribution data and a visualized thickness distribution map, thus solving the technical problem of directly quantifying the spatial distribution of the wall layer from the liquid surface image.

[0024] Step S2: Using the filling parameters, viscosity characteristics, container inner wall surface roughness parameters, and corresponding thickness distribution maps of the pesticide liquid formulation as training data, a thickness prediction model is constructed; specifically including: Multiple sets of training samples were collected, each set containing filling parameters, viscosity characteristics data of pesticide liquid formulations, surface roughness parameters of container inner wall and corresponding thickness distribution maps; the thickness prediction model is an encoder-decoder neural network model, including a physical parameter encoding branch, a spatial feature mapping module and a thickness distribution decoding branch; The physical parameter encoding branch uses a multilayer perceptron to encode the input parameters and generate physical feature vectors. The spatial feature mapping module maps and reshapes the physical feature vectors into a low-resolution spatial feature map through a fully connected layer. The physical parameter information is embedded into each spatial location through feature expansion operations to generate an initial spatial feature map. The thickness distribution decoding branch adopts a progressive upsampling structure. The spatial resolution of the feature map is gradually restored through multiple upsampling and convolution. After each upsampling, the corresponding scale feature information is fused to generate a predicted thickness distribution map with the same size as the thickness distribution map. The model is trained based on the training samples using a hybrid loss function consisting of pixel-level mean squared error loss, edge region weighted loss, and physical constraint loss.

[0025] Specifically, after obtaining the sample image set and the corresponding thickness distribution map, in order to establish the mapping relationship between filling parameters, liquid properties and container surface conditions to the thickness distribution of the wall layer, an encoder-decoder neural network model is constructed and a multi-source physical parameter fusion training strategy is adopted. The following is a detailed explanation of the construction and training process of the thickness prediction model.

[0026] Before training, multiple sets of training samples are collected. Each set of training samples includes filling parameters corresponding to the liquid pesticide formulation, viscosity characteristics data of the liquid pesticide formulation, surface roughness parameters of the inner wall of the container, and the corresponding thickness distribution map. The thickness distribution map is generated by step S1 and is used to characterize the thickness distribution state of the wall-mounted layer at different positions on the inner wall of the container.

[0027] The thickness prediction model described above is constructed as an encoder-decoder neural network model, which is an end-to-end neural network architecture that maps multi-source physical parameters to spatial thickness distribution. Its inputs are filling parameters, viscosity characteristic data, and container inner wall surface roughness parameters, and its output is a predicted thickness distribution map with the same size as the thickness distribution map described above. The model includes a physical parameter encoding branch, a spatial feature mapping module, and a thickness distribution decoding branch.

[0028] The aforementioned physical parameter encoding branch employs a multilayer perceptron (MLP) to encode the input filling parameters, viscosity characteristics, and container inner wall surface roughness parameters. The MLP is a fully connected neural network consisting of an input layer, hidden layers, and an output layer, used to map low-dimensional physical parameters into high-dimensional feature representations. Before encoding, the filling parameters, viscosity characteristics, and container inner wall surface roughness parameters are linearly normalized to map all parameters to a unified numerical range, eliminating dimensional differences and ensuring comparability of different physical parameters in the feature space. The normalized parameters are input into the MLP, and after nonlinear transformation by the hidden layer, a physical feature vector is generated. This physical feature vector integrates comprehensive information from filling process conditions, liquid adhesion characteristics, and container surface properties.

[0029] The aforementioned spatial feature mapping module receives the aforementioned physical feature vectors and maps and reshapes them into a low-resolution spatial feature map through a fully connected layer. This low-resolution spatial feature map has a preset spatial height and width, as well as multiple channel dimensions. Physical parameter information is embedded into various spatial locations of the low-resolution spatial feature map through a feature expansion operation. This feature expansion operation involves copying and expanding the dimensional information of the physical feature vectors to each pixel location of the spatial feature map, ensuring that each location carries complete physical parameter perception capabilities, thereby generating an initial spatial feature map with physical parameter perception capabilities. Although this initial spatial feature map has a low spatial resolution, it already contains the wall thickness distribution trend determined by physical parameters.

[0030] The aforementioned thickness distribution decoding branch employs a progressive upsampling structure, gradually restoring the spatial resolution of the feature map through multiple upsampling and convolution operations. This progressive upsampling structure refers to expanding the spatial size of the feature map layer by layer using deconvolution or interpolation combined with convolution, while simultaneously refining the feature representation through convolutional layers. After each upsampling, the corresponding scale feature information output by the aforementioned spatial feature mapping module is fused. This fusion involves concatenating the current scale feature map during decoding with the corresponding scale feature information from the encoding end through channel-wise concatenation or element-wise addition to supplement any details that may be lost during upsampling, ultimately generating a predicted thickness distribution map with the same size as the original thickness distribution map.

[0031] Based on the training samples described above, the encoder-decoder neural network model is trained using a hybrid loss function, which consists of pixel-level mean square error loss, edge region weighted loss, and physical constraint loss. Before calculating the hybrid loss function, each loss term is normalized to unify its dimensions. This normalization involves mapping the numerical range of each loss term to the same scale range through a linear transformation, preventing any single loss term from dominating gradient updates due to differences in dimensions. The pixel-level mean square error loss measures the overall error between the predicted and actual thickness distribution maps at all pixel locations, calculating the squared average of the differences between the predicted and actual values ​​for all pixels. The edge region weighted loss assigns higher weights to regions near the liquid surface where thickness changes drastically. Specifically, the liquid surface edge region is extracted from the actual thickness distribution map using an edge detection algorithm, and pixels within this region are assigned a higher weight coefficient than those in non-edge regions to improve the model's prediction accuracy for areas with abrupt thickness changes near the liquid surface edge. The aforementioned physical constraint loss is used to penalize predictions that do not conform to the physical laws of wall adhesion. These include a non-negative thickness constraint, a monotonically non-decreasing thickness constraint along the inner wall of the container from top to bottom, and a zero-thickness constraint at the liquid surface boundary. These penalize cases where the predicted thickness is less than zero, the wall adhesion layer thickness increases vertically upwards, and the predicted thickness at the liquid surface edge is not zero, respectively. The aforementioned hybrid loss function calculates the total loss by weighting and summing the three normalized losses. The weight coefficient of each loss term is set according to its contribution to model convergence. The model parameters are updated based on this total loss using the backpropagation algorithm, iteratively optimizing until the model converges.

[0032] The above technical solution encodes multi-source physical information such as filling parameters, viscosity characteristics, and surface roughness into spatial features and progressively decodes them into thickness distribution, achieving end-to-end prediction from process parameters to wall adhesion morphology. It solves the technical problem of correlating liquid properties with container conditions to quantitatively predict wall adhesion distribution, enabling the prediction of wall adhesion layer thickness to adapt to different combinations of pesticide formulations and container materials, and significantly improving the model's generalization ability and prediction reliability under multiple operating conditions.

[0033] Step S3: By inputting the set filling parameters, viscosity characteristics data, and container surface roughness parameters of the pesticide liquid formulation to be filled into the thickness prediction model, a predicted thickness distribution map is obtained; based on the predicted thickness distribution map, the liquid surface morphology characteristics of the wall-mounted layer are identified, and the volume of the pesticide liquid in the wall-mounted layer is calculated; specifically including: The set filling parameters, viscosity characteristics data, and container inner wall surface roughness parameters of the pesticide liquid formulation to be filled are input into the thickness prediction model to obtain the predicted thickness distribution map. Pixel coordinate data of the liquid surface edge of the wall-hanging layer are extracted from the predicted thickness distribution map to determine the position distribution of the liquid surface edge within the container; curve fitting is performed on the position distribution of the liquid surface edge to obtain the geometric parameters of the curved shape of the liquid surface edge; the curvature value and tilt angle of the liquid surface edge are calculated based on the geometric parameters to construct a multi-dimensional feature description; the multi-dimensional feature description is integrated into a shape feature vector, which is used to characterize the bending characteristics of the liquid surface edge caused by the wall-hanging effect; Based on the thickness value of the wall-mounted layer at each pixel position in the predicted thickness distribution map, and combined with the geometric parameters of the inner wall of the container, an integral calculation is performed along the curved surface of the inner wall of the container to obtain the volume of pesticide liquid in the wall-mounted layer.

[0034] Specifically, by inputting the set filling parameters, viscosity characteristics data, and container inner wall surface roughness parameters of the pesticide liquid formulation to be filled into the aforementioned thickness prediction model, the predicted thickness distribution map is obtained. Each pixel value in the predicted thickness distribution map represents the predicted wall-mounted layer thickness corresponding to that pixel location. The set filling parameters are the original default parameters of the production line, such as filling speed and filling volume. Since the final actual filling volume corresponding to these default parameters may not be accurate, the thickness prediction model is used to obtain the predicted thickness distribution map, thereby obtaining the thickness distribution of the wall-mounted layer corresponding to the model input parameters, especially for opaque containers. This provides a basis for filling control in the filling scenario; it also extracts pixel coordinate data of the liquid surface edge from the above predicted thickness distribution map. The liquid surface edge refers to the set of pixel points corresponding to the liquid surface boundary line between the wall layer and the air in the above predicted thickness distribution map. Its position distribution reflects the spatial shape change of the liquid surface caused by the wall effect. Specifically, the above predicted thickness distribution map can be scanned row by row or column by column to detect the pixel position where the thickness value jumps from a non-zero value to a zero value in each row or column. This position is the coordinate point of the liquid surface edge in that row or column. By sorting the pixel coordinate data of all edge points according to the horizontal position, the position distribution of the liquid surface edge in the container can be obtained. Curve fitting is performed on the positional distribution of the liquid surface edges. Curve fitting refers to transforming a discrete set of pixel coordinates into a continuous mathematical curve to extract geometric parameters describing the degree of curvature. Specifically, a polynomial fitting method can be used, with the horizontal pixel coordinates of the liquid surface edge points as independent variables and the vertical pixel coordinates as dependent variables. The polynomial coefficients are solved using the least squares method to obtain a fitting curve that approximates all edge points. The polynomial coefficients and the curve equation determined by them are the geometric parameters of the curvature shape of the liquid surface edge. Based on the above geometric parameters, the curvature value and tilt angle of the liquid surface edge are calculated. The curvature value is used to characterize the degree of curvature of the liquid surface edge curve at different positions; a larger curvature value indicates a more severe curvature at that position. The tilt angle is used to characterize the degree of tilt of the liquid surface edge curve relative to the horizontal direction at different positions. When calculating the curvature value, the curvature of each point on the curve can be solved based on the polynomial expression of the fitted curve. When calculating the tilt angle, the arctangent value can be obtained by taking the first derivative of the curve at that point. Based on the aforementioned curvature values ​​and tilt angles, a multidimensional feature description is constructed. This multidimensional feature description refers to a data structure containing curvature parameters and tilt angle parameters at multiple sampling locations, forming a complete geometric representation of the curved shape of the liquid surface edge. This multidimensional feature description is then integrated into a shape feature vector. This shape feature vector is formed by organizing the dispersed multidimensional feature descriptions into a fixed-dimensional vector according to a unified arrangement rule, ensuring that the curved shape of the liquid surface edge for each filling instance can be uniquely represented. This shape feature vector is used to characterize the bending characteristics of the liquid surface edge caused by the wall adhesion effect.

[0035] Based on the thickness values ​​of the wall-mounted layer at each pixel location in the predicted thickness distribution map, and combined with the geometric parameters of the container's inner wall, an integral operation is performed along the curved surface of the container's inner wall to obtain the volume of the pesticide liquid in the wall-mounted layer. This integral operation involves summing the continuously distributed thickness values ​​on the curved surface of the container's inner wall to convert the two-dimensional thickness distribution into a three-dimensional volume. Specifically, first, based on the pre-defined mapping relationship between the pixel coordinate system and the physical coordinate system, the actual physical area corresponding to each pixel is obtained. For each pixel location within the wall-mounted layer area in the predicted thickness distribution map, the thickness value at that location is multiplied by the actual physical area to obtain the micro-volume at that location. Then, along the vertical extension direction of the container's inner wall, all micro-volumes are summed to obtain the volume of the pesticide liquid in the wall-mounted layer.

[0036] The above technical solution combines physical parameter-driven thickness prediction with liquid surface morphology analysis and volume integration, thereby achieving a quantitative characterization of process parameters and wall adhesion effect. This provides an accurate basis for calculating the equivalent liquid level height during filling and effectively eliminates filling volume errors caused by wall adhesion.

[0037] Step S4: Based on the pesticide liquid volume of the wall-mounted layer and the liquid surface morphology, calculate the equivalent liquid level height for filling, and compare the equivalent liquid level height with the target liquid level height to obtain the liquid level difference; specifically including: Based on the liquid surface morphology features, the main liquid surface region is identified in the predicted thickness distribution map. The main liquid surface region refers to a flat liquid surface region that is far from the container wall and whose thickness distribution gradient is close to zero. Based on the pre-established mapping relationship between pixel coordinates and liquid level height, the pixel positions corresponding to the main liquid surface region are converted into the liquid surface reference height. Based on the pesticide liquid volume of the wall-mounted layer and the cross-sectional area of ​​the container's inner wall, the pesticide liquid volume of the wall-mounted layer is converted into an equivalent liquid column height; the liquid level reference height and the equivalent liquid column height are summed to obtain the filling equivalent liquid level height; the difference between the filling equivalent liquid level height and the preset target liquid level height is calculated to obtain the liquid level difference.

[0038] Specifically, after obtaining the liquid surface morphology characteristics and the pesticide liquid volume of the wall-mounted layer, in order to quantitatively compensate for the liquid level deviation caused by the wall-mounted effect and obtain the equivalent liquid level height that can truly reflect the filling volume, the equivalent liquid level height of the filling is calculated by combining the identification of the main liquid surface area with volume conversion.

[0039] During implementation, based on the above-mentioned liquid surface morphology characteristics, the main liquid surface region is identified in the above-mentioned predicted thickness distribution map. The main liquid surface region refers to a flat liquid surface region that is far away from the container wall and whose thickness distribution gradient is close to zero. Specifically, based on the liquid surface edge contour obtained from the above-mentioned liquid surface morphology characteristics, the region within a preset distance inward from the container wall boundary is regarded as the edge exclusion region, and the connected regions in the remaining region whose thickness distribution gradient is less than a preset gradient threshold are identified as the main liquid surface region. The above-mentioned thickness distribution gradient being close to zero indicates that the region is not affected by the wall adhesion effect and the liquid surface remains flat.

[0040] After identifying the main liquid surface area, the pixel positions corresponding to the main liquid surface area are converted into a liquid surface reference height based on the pre-established mapping relationship between pixel coordinates and liquid level height. The mapping relationship between pixel coordinates and liquid level height is a mapping table or conversion function established during the filling calibration stage by associating the liquid surface image at the standard liquid level height with the corresponding physical liquid level height. Specifically, when the container is in the standard filling station, multiple liquid surface images at known liquid level heights are acquired, and the vertical coordinates of the pixels in the main liquid surface area corresponding to each known liquid level height are recorded. The mapping relationship between the vertical coordinates of the pixels and the physical liquid level height is established through linear fitting or table lookup. After the pixel positions in the main liquid surface area are converted by the above mapping relationship, the average value or the center point conversion value is taken as the liquid surface reference height. The liquid surface reference height is used to characterize the true liquid level position that is not affected by the bending of the wall.

[0041] Based on the pesticide liquid volume of the aforementioned wall-mounted layer and the cross-sectional area of ​​the container's inner wall, the pesticide liquid volume of the wall-mounted layer is converted into an equivalent liquid column height. This equivalent liquid column height refers to the height of the liquid column obtained by equivalently converting the volume of the wall-mounted liquid adhering to the container's inner wall according to the container's inner wall cross-sectional area. This height reflects the liquid level increment corresponding to the complete influx of the wall-mounted liquid into the main liquid. Specifically, the pesticide liquid volume of the wall-mounted layer can be divided by the cross-sectional area of ​​the container's inner wall to obtain the equivalent liquid column height. The aforementioned liquid level reference height is then summed with the aforementioned equivalent liquid column height to obtain the filling equivalent liquid level height. This filling equivalent liquid level height refers to the total liquid level height after comprehensively considering the main liquid level height and the height converted from the wall-mounted liquid volume. This height accurately reflects the liquid level position corresponding to the total amount of liquid actually contained in the container. The difference between the above-mentioned equivalent liquid level height and the preset target liquid level height (i.e., the filling volume relative to the target filling height of the filling container) is calculated to obtain the above-mentioned liquid level difference. The above-mentioned liquid level difference is used to quantify the deviation between the actual filling volume and the target filling volume, providing a direct quantitative basis for subsequent filling accuracy determination. The above-mentioned technical solution, by combining the analysis of liquid surface morphology characteristics with the compensation of wall-mounted layer volume, transforms the wall-mounted effect from an interference factor into a compensable process parameter, solving the technical problem that the liquid level measurement value is lower than the actual filling volume due to the neglect of the wall-mounted layer volume in traditional methods, and significantly improving the filling control accuracy.

[0042] Step S5: Adjust the filling parameters according to the absolute value of the liquid level difference, update the input data of the thickness prediction model based on the adjusted filling parameters, and repeat step S3 to this step until the filling accuracy requirements are met; specifically including: Calculate the absolute value of the liquid level difference and determine whether the absolute value is greater than a preset filling accuracy threshold; if the absolute value is less than or equal to the preset filling accuracy threshold, determine that the current filling accuracy meets the requirements and generate a filling qualified signal. If the absolute value is greater than the preset filling accuracy threshold, a filling parameter adjustment strategy is determined based on the sign of the liquid level difference and the magnitude of the absolute value. When the liquid level difference is positive, the filling speed is reduced or the filling time is shortened; when the liquid level difference is negative, the filling speed is increased or the filling time is extended. The larger the absolute value, the larger the corresponding adjustment step size. Update the adjusted filling parameters to the input data of the thickness prediction model, repeat step S3 to this step, use the updated filling parameters to obtain the predicted thickness distribution map again and calculate the new liquid level difference, iterate and optimize until the absolute value is less than or equal to the preset filling accuracy threshold.

[0043] Specifically, after calculating the liquid level difference between the equivalent liquid level height and the target liquid level height, in order to quantify the current filling accuracy and automatically correct the filling process parameters to form a closed-loop control when the deviation exceeds the allowable range, the filling accuracy judgment and parameters are adaptively adjusted by setting an accuracy threshold and an iterative feedback strategy.

[0044] Calculate the absolute value of the aforementioned liquid level difference, which refers to the algebraic difference between the equivalent liquid level height obtained in the preceding steps and the preset target liquid level height. The sign indicates the direction of deviation of the actual liquid level relative to the target liquid level, and the absolute value is used to eliminate the influence of direction and quantify the deviation magnitude. Determine whether the absolute value is greater than a preset filling accuracy threshold. This preset filling accuracy threshold is a judgment limit set according to the maximum allowable liquid level deviation range of the pesticide liquid formulation filling quality standard, used to distinguish between qualified and unqualified filling. If the absolute value is less than or equal to the preset filling accuracy threshold, the current filling accuracy is determined to meet the requirements, and a filling qualification signal is generated. This filling qualification signal is a control instruction indicating that the current filling volume of the pesticide liquid formulation in the container meets the quality standard and allows entry into the next production process.

[0045] If the absolute value is greater than the preset filling accuracy threshold, a filling parameter adjustment strategy is determined based on the sign and magnitude of the liquid level difference. This strategy refers to a filling process parameter correction scheme based on the direction and magnitude of the liquid level deviation. When the liquid level difference is positive, it indicates that the actual filling equivalent liquid level is higher than the target liquid level, meaning the current filling volume is too high. In this case, the filling speed is reduced or the filling time is shortened to reduce the liquid injection volume per unit time or unit cycle. When the liquid level difference is negative, it indicates that the actual filling equivalent liquid level is lower than the target liquid level, meaning the current filling volume is insufficient. In this case, the filling speed is increased or the filling time is extended to increase the liquid injection volume per unit time or unit cycle. The larger the absolute value, the larger the corresponding adjustment step size. This adjustment step size refers to the change in filling speed or filling time during a single parameter adjustment. Its magnitude is positively correlated with the absolute value of the liquid level deviation, ensuring that larger deviations are quickly corrected while smaller deviations are finely adjusted, avoiding over-adjustment that could cause new deviation oscillations.

[0046] The adjusted filling parameters are updated to the input data of the thickness prediction model. Step S3 is then repeated to this step, where the updated filling parameters, viscosity characteristics data, and surface roughness parameters are input into the trained model. Forward inference outputs a predicted thickness distribution map adapted to the new operating conditions. Since changes in filling parameters directly affect the liquid flow state and wall adhesion morphology, the updated parameters need to be re-inputted into the model to obtain prediction results matching the new operating conditions. The predicted thickness distribution map is obtained again using the updated filling parameters, and the new liquid level difference is calculated. Iterative optimization continues until the absolute value is less than or equal to the preset filling accuracy threshold. The iterative optimization effect is as follows: Figure 2 As shown, the above iterative optimization refers to gradually reducing the liquid level deviation by repeatedly executing a cycle of prediction, calculation, comparison, and adjustment, so that the filling accuracy converges to the range that meets the threshold requirements.

[0047] The above technical solution combines quantitative judgment of liquid level deviation with adaptive adjustment of filling process parameters to achieve automated precision management of control, significantly improving the adaptive control capability and filling qualification rate of the filling production line under multiple working conditions. Especially when the filling bottle is opaque and the liquid level cannot be directly viewed, there is no need for weighing and manual disassembly inspection. The filling accuracy can be accurately controlled during the filling process simply by using the above thickness prediction model.

[0048] Furthermore, after step S5, the method further includes: By keeping the filling parameters and the surface roughness parameters of the container inner wall constant, statistical analysis is conducted on the predicted thickness distribution maps corresponding to pesticide liquid formulations with arbitrary different viscosity characteristics, and the variance of the predicted thickness values ​​in the liquid surface edge region of each predicted thickness distribution map is calculated. Determine whether the variance of the thickness prediction value is less than a preset sensitivity threshold. If so, determine that the physical parameter encoding branch is saturated in distinguishing features of viscosity characteristic data. Analyze the degree of dispersion of the output feature vectors of each hidden layer in the physical parameter encoding branch and determine the hidden layer with a dispersion degree lower than a preset activity threshold as a feature extraction failure layer. A cascaded expansion layer is added after the feature extraction failure layer. The cascaded expansion layer is used to expand the dimension and enhance the nonlinearity of the physical feature vector output by the physical parameter encoding branch to generate an updated physical parameter encoding branch. Expanded training samples corresponding to the pesticide liquid formulations with different viscosity characteristics are collected under the condition that the filling parameters and the surface roughness parameters of the inner wall of the container remain unchanged. The expanded training samples are input into the thickness prediction model with the updated physical parameter encoding branch for retraining until the variance of the thickness prediction value is greater than or equal to the preset sensitivity threshold.

[0049] Specifically, by measuring the thickness distribution map, it is possible to identify whether the predicted thickness values ​​of the edge regions of pesticide liquid formulations with different viscosity characteristics converge. If so, the model structure is adaptively adjusted to restore its physical parameter sensing sensitivity. Furthermore, by using control variable comparison and hidden layer activity analysis methods, the structure of the physical parameter encoding branch is adaptively adjusted to ensure the prediction accuracy of the aforementioned thickness prediction model.

[0050] During implementation, the filling parameters and container inner wall surface roughness parameters are kept constant. Predicted thickness distribution maps for pesticide liquid formulations with different viscosity characteristics are statistically analyzed. These predicted thickness distribution maps refer to the two-dimensional spatial thickness distribution prediction results output after inputting the filling parameters, viscosity characteristics, and container inner wall surface roughness parameters of the pesticide liquid formulation to be filled into the thickness prediction model. The variance of the predicted thickness values ​​in the liquid surface edge region of each predicted thickness distribution map is calculated. The liquid surface edge region refers to the set of transition pixels in the predicted thickness distribution map where the thickness value jumps from non-zero to zero. This variance is used to quantify the dispersion of the wall-mounted layer thickness prediction results for pesticide liquid formulations with different viscosity characteristics under the same filling parameters and container surface roughness conditions. A smaller variance indicates a weaker response difference in the model to different viscosity inputs. The variance of the predicted thickness values ​​is then determined to be less than a preset sensitivity threshold. This preset sensitivity threshold is a judgment boundary set based on the minimum allowable range of predicted response differences according to the viscosity differences of the pesticide liquid formulation, used to distinguish whether the model has sufficient viscosity characteristic discrimination ability. If so, it is determined that the physical parameter encoding branch has saturated feature discrimination ability for viscosity characteristic data, and the model structure needs to be adjusted. Feature discrimination ability saturation means that when the physical parameter encoding branch maps viscosity characteristic data to high-dimensional feature representation, due to insufficient hidden layer capacity or limited nonlinear transformation ability, the physical feature vectors generated after encoding different viscosity inputs tend to be similar, and cannot provide distinguishable viscosity prior information for subsequent decoding branches.

[0051] The dispersion of the output feature vectors of each hidden layer in the physical parameter encoding branch is analyzed. The hidden layer refers to the intermediate transformation layer of the multilayer perceptron in the physical parameter encoding branch. The output feature vector of each hidden layer is a high-dimensional feature representation obtained after the input data undergoes a nonlinear transformation by this layer. The dispersion is used to quantify the distribution dispersion of the output feature vector of the same hidden layer under different viscosity inputs. Hidden layers with a dispersion below a preset activity threshold are identified as feature extraction failure layers. The preset activity threshold is a critical criterion for determining whether a hidden layer still possesses effective feature extraction capabilities. These feature extraction failure layers are those whose output feature vectors are too concentrated under different viscosity inputs, failing to effectively transmit viscosity differences to subsequent network layers, resulting in the model's loss of ability to perceive viscosity changes.

[0052] A cascaded extension layer is added after the aforementioned feature extraction failure layer. This cascaded extension layer refers to an auxiliary transformation module added to the output of the feature extraction failure layer on the basis of the hidden layer structure of the original physical parameter encoding branch. It is used to expand the dimension and enhance the nonlinearity of the physical feature vector output by the physical parameter encoding branch. The aforementioned dimension expansion refers to increasing the number of channels or elements of the physical feature vector to increase the feature expression capacity. The aforementioned nonlinear enhancement refers to introducing additional activation function transformations to improve the nonlinear discriminativeness of the feature space, thereby improving the decoupling representation capability of viscosity characteristic data and container surface roughness parameters. The aforementioned decoupling representation capability refers to the model's ability to independently identify and respond to changes in viscosity characteristics and changes in surface roughness, rather than mixing the two into a single feature pattern, and generating an updated physical parameter encoding branch.

[0053] Under the condition that the filling parameters and the surface roughness parameters of the container inner wall remain unchanged, expanded training samples corresponding to the above-mentioned pesticide liquid formulations with different viscosity characteristics are collected respectively. The expanded training samples are input into the thickness prediction model with the updated physical parameter encoding branch for retraining until the variance of the above-mentioned thickness prediction value is greater than or equal to the above-mentioned preset sensitivity threshold. The above-mentioned expanded training samples refer to the sample data collected on the basis of the original training samples to enhance the ability to distinguish viscosity characteristic data. It includes the viscosity characteristic data corresponding to pesticide liquid formulations with different viscosity characteristics under the condition that the filling parameters and the surface roughness parameters of the container inner wall are fixed, as well as the thickness distribution map generated according to step S1. The above technical solution solves the technical problem that the thickness prediction model cannot effectively distinguish the wall adhesion form when facing pesticide liquid formulations with significant differences in viscosity characteristics by diagnosing the activity of the hidden layer and dynamically expanding the feature extraction capacity, and significantly improves the generalization of the model to the filling scenario of multi-formula pesticide liquid formulations.

[0054] The present invention also provides a pesticide liquid formulation filling control system for implementing the above-mentioned method, such as... Figure 3 As shown, the system includes: The image processing unit is used to acquire liquid surface image data of different pesticide liquid formulations after filling with different containers and different filling parameters, generate a set of liquid surface images through preprocessing, extract the wall-mounting layer thickness features from the liquid surface images as the sample image set, and generate a thickness distribution map corresponding to the sample images. The model training unit is used to construct a thickness prediction model by using the filling parameters, viscosity characteristics, container inner wall surface roughness parameters, and thickness distribution map corresponding to the liquid pesticide formulation as training data. The thickness prediction unit is used to obtain a predicted thickness distribution map by inputting the filling parameters of the pesticide liquid formulation to be filled, pesticide characteristic data, and container surface roughness parameters into the thickness prediction model; based on the predicted thickness distribution map, it identifies the liquid surface morphology characteristics and calculates the volume of pesticide liquid in the wall-mounted layer. The liquid level calculation unit is used to obtain the reference liquid level height based on the liquid surface morphology characteristics, calculate the filling equivalent liquid level height based on the pesticide liquid volume of the wall-mounted layer and the reference liquid level height, and compare the equivalent liquid level height with the target liquid level height to obtain the liquid level difference. The parameter control unit is used to determine whether the absolute value of the liquid level difference is greater than the preset difference. If not, the filling accuracy meets the requirements. If so, the filling parameters are adjusted, the input data of the thickness prediction model is updated based on the adjusted filling parameters, and step S3 is re-executed until the filling accuracy requirements are met.

[0055] In summary, this invention uses a multi-view industrial camera in step S1 to collect multi-material, multi-condition liquid surface images covering different types of pesticide liquid formulations with varying viscosity characteristics, such as emulsifiable concentrates, suspensions, and water-in-oil emulsions, as well as different inner wall surface roughnesses, such as glass bottles and plastic bottles. After denoising, contrast enhancement, illumination correction, and edge contour analysis, a wall-mounted layer thickness distribution map is generated, providing a standardized and structured sample data foundation for subsequent model training. Step S2 uses this as a basis to correlate filling parameters, viscosity characteristic data, and container inner wall surface roughness with the thickness distribution map, constructing an encoder-decoder neural network model. This establishes an end-to-end mapping relationship from process parameters to wall-mounted morphology, enabling the model to have generalized prediction capabilities for different combinations of pesticide liquid formulations and containers. Based on this, step S3 inputs the real-time process parameters to be filled into the trained model, obtains the predicted thickness distribution map, and extracts the curvature value, tilt angle and other morphological features of the liquid surface edge. At the same time, it calculates the liquid volume of the wall-attached layer along the surface integral of the inner wall of the container, realizing the quantitative characterization of the wall-attached effect. Step S4 uses this volume data and liquid surface morphological features to sum the reference height of the main liquid surface area and the equivalent liquid column height converted from the wall-attached layer volume to obtain the equivalent liquid level height that can truly reflect the total filling volume. It then compares the liquid level height with the target liquid level height to obtain the liquid level difference, thereby transforming the wall-attached layer from an interfering factor into a compensable process parameter. Step S5 adaptively adjusts the filling speed or filling time based on the liquid level difference, and re-inputs the updated parameters into the model for iterative prediction and deviation correction until the liquid level difference converges to within the preset accuracy threshold. Furthermore, when the model encounters saturation in its feature discrimination ability due to the significant viscosity differences among various pesticide liquid formulations, the hidden layer activity of the physical parameter encoding branch is diagnosed, and cascaded extension layers are dynamically added for retraining. This further ensures the predictive reliability of the closed-loop system in long-term, multi-variety production scenarios. Through the synergy of these technical solutions, not only is the inherent defect of traditional filling control—namely, the systematically low liquid level measurement due to neglecting the volume of the wall-mounted layer—solved, but also, in scenarios where the liquid level cannot be directly observed in opaque containers, automated, high-precision filling control without weighing or manual inspection is achieved. This significantly improves the adaptive control capability and filling qualification rate of pesticide liquid formulation filling production lines.

[0056] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0057] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0058] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for controlling the filling of liquid pesticide formulations, characterized in that, The method includes: Step S1: Obtain liquid surface image data of different pesticide liquid formulations after filling with different containers and different filling parameters, generate a set of liquid surface images through preprocessing, extract the wall-mounted layer thickness features from the liquid surface images as a sample image set, and generate a thickness distribution map corresponding to the sample images. Step S2: Use the filling parameters, viscosity characteristics, container inner wall surface roughness parameters, and corresponding thickness distribution map of the pesticide liquid formulation as training data to construct a thickness prediction model; Step S3: By inputting the filling parameters, viscosity characteristics data and container surface roughness parameters of the pesticide liquid formulation to be filled into the thickness prediction model, a predicted thickness distribution map is obtained; based on the predicted thickness distribution map, the liquid surface morphology characteristics of the wall-mounted layer are identified, and the volume of pesticide liquid in the wall-mounted layer is calculated; Step S4: Obtain the reference liquid level height based on the liquid surface morphology characteristics; calculate the filling equivalent liquid level height based on the pesticide liquid volume of the wall-mounted layer and the reference liquid level height; and compare the equivalent liquid level height with the target liquid level height to obtain the liquid level difference. Step S5: Adjust the filling parameters according to the absolute value of the liquid level difference, update the input data of the thickness prediction model based on the adjusted filling parameters, and repeat step S3 to this step until the filling accuracy requirements are met.

2. The method according to claim 1, characterized in that, In step S1, a sample image set is generated, including: Multiple industrial cameras are used to capture multi-angle images of the liquid surface of different pesticide liquid formulations after filling with different filling parameters and containers. The pesticide liquid formulations include at least emulsifiable concentrates, suspensions, or water-in-oil emulsions, and the containers include at least transparent glass bottles and plastic bottles. The liquid surface images are preprocessed, including noise reduction, contrast enhancement, and correction of uneven lighting, to obtain clear liquid surface image data. The liquid surface image data set is used as a sample image set, wherein the filling parameters include at least the geometric features of the filling container, the filling volume, the filling speed, and the filling ambient temperature.

3. The method according to claim 2, characterized in that, In step S1, a thickness distribution map is generated, including: An edge detection algorithm is applied to each liquid surface image in the sample image set to extract the boundary information of the adhering layer; the uneven distribution area of ​​the adhering layer is identified by contour analysis to determine the local thickness variation characteristics; The thickness of the adhering layer at different locations on the inner wall of the container is calculated based on the local thickness variation characteristics, generating thickness distribution data; the thickness distribution data is then mapped to a two-dimensional image space corresponding to the liquid surface image to form a visualized thickness distribution map.

4. The method according to claim 1, characterized in that, In step S2, a thickness prediction model is constructed, including: Multiple sets of training samples were collected, each set containing filling parameters, viscosity characteristics data of pesticide liquid formulations, surface roughness parameters of container inner wall and corresponding thickness distribution maps; the thickness prediction model is an encoder-decoder neural network model, including a physical parameter encoding branch, a spatial feature mapping module and a thickness distribution decoding branch; The physical parameter encoding branch uses a multilayer perceptron to encode the input parameters and generate physical feature vectors. The spatial feature mapping module maps and reshapes the physical feature vectors into a low-resolution spatial feature map through a fully connected layer. The physical parameter information is embedded into each spatial location through feature expansion operations to generate an initial spatial feature map. The thickness distribution decoding branch adopts a progressive upsampling structure. The spatial resolution of the feature map is gradually restored through multiple upsampling and convolution. After each upsampling, the corresponding scale feature information is fused to generate a predicted thickness distribution map with the same size as the thickness distribution map. The model is trained based on the training samples using a hybrid loss function consisting of pixel-level mean squared error loss, edge region weighted loss, and physical constraint loss.

5. The method according to claim 1, characterized in that, In step S3, the volume of pesticide liquid in the wall-mounted layer is calculated, including: The filling parameters, viscosity characteristics, and container inner wall surface roughness parameters of the pesticide liquid formulation to be filled are input into the thickness prediction model to obtain the predicted thickness distribution map. Pixel coordinate data of the liquid surface edge of the wall-hanging layer are extracted from the predicted thickness distribution map to determine the position distribution of the liquid surface edge within the container; curve fitting is performed on the position distribution of the liquid surface edge to obtain the geometric parameters of the curved shape of the liquid surface edge; the curvature value and tilt angle of the liquid surface edge are calculated based on the geometric parameters to construct a multi-dimensional feature description; the multi-dimensional feature description is integrated into a shape feature vector, which is used to characterize the bending characteristics of the liquid surface edge caused by the wall-hanging effect; Based on the thickness value of the wall-mounted layer at each pixel position in the predicted thickness distribution map, and combined with the geometric parameters of the inner wall of the container, an integral calculation is performed along the curved surface of the inner wall of the container to obtain the volume of pesticide liquid in the wall-mounted layer.

6. The method according to claim 1, characterized in that, In step S4, the equivalent liquid level height is compared with the target liquid level height to obtain the liquid level difference, including: Based on the curvature value and tilt angle in the liquid surface morphology features, surface fitting is performed on the liquid surface edge pixel coordinates in the predicted thickness distribution map to establish a liquid surface equation; the height coordinates at each position of the liquid surface are calculated based on the liquid surface equation, and the average height of the liquid surface is extracted as the liquid surface reference height. Based on the pesticide liquid volume of the wall-mounted layer and the cross-sectional area of ​​the container's inner wall, the pesticide liquid volume of the wall-mounted layer is converted into an equivalent liquid column height; the liquid level reference height and the equivalent liquid column height are summed to obtain the filling equivalent liquid level height; the difference between the filling equivalent liquid level height and the preset target liquid level height is calculated to obtain the liquid level difference.

7. The method according to claim 1, characterized in that, Step S5 includes: Calculate the absolute value of the liquid level difference and determine whether the absolute value is greater than a preset filling accuracy threshold; if the absolute value is less than or equal to the preset filling accuracy threshold, determine that the current filling accuracy meets the requirements and generate a filling qualified signal. If the absolute value is greater than the preset filling accuracy threshold, a filling parameter adjustment strategy is determined based on the sign of the liquid level difference and the magnitude of the absolute value. When the liquid level difference is positive, the filling speed is reduced or the filling time is shortened; when the liquid level difference is negative, the filling speed is increased or the filling time is extended. The larger the absolute value, the larger the corresponding adjustment step size. Update the adjusted filling parameters to the input data of the thickness prediction model, repeat step S3 to this step, use the updated filling parameters to obtain the predicted thickness distribution map again and calculate the new liquid level difference, iterate and optimize until the absolute value is less than or equal to the preset filling accuracy threshold.

8. The method according to claim 1, characterized in that, After step S5, the following also includes: By keeping the filling parameters and the surface roughness parameters of the container inner wall constant, statistical analysis is conducted on the predicted thickness distribution maps corresponding to pesticide liquid formulations with arbitrary different viscosity characteristics, and the variance of the predicted thickness values ​​in the liquid surface edge region of each predicted thickness distribution map is calculated. Determine whether the variance of the thickness prediction value is less than a preset sensitivity threshold. If so, determine that the physical parameter encoding branch in the thickness prediction model has saturated feature discrimination ability for viscosity characteristic data. Analyze the degree of dispersion of the output feature vector of each hidden layer in the physical parameter encoding branch and determine the hidden layer with a dispersion degree lower than a preset activity threshold as the feature extraction failure layer. A cascaded expansion layer is added after the feature extraction failure layer. The cascaded expansion layer is used to expand the dimension and enhance the nonlinearity of the physical feature vector output by the physical parameter encoding branch to generate an updated physical parameter encoding branch. Expanded training samples corresponding to the pesticide liquid formulations with different viscosity characteristics are collected under the condition that the filling parameters and the surface roughness parameters of the inner wall of the container remain unchanged. The expanded training samples are input into the thickness prediction model with the updated physical parameter encoding branch for retraining until the variance of the thickness prediction value is greater than or equal to the preset sensitivity threshold.

9. A pesticide liquid formulation filling control system for implementing the method as described in any one of claims 1-8, characterized in that, The system includes: The image processing unit is used to acquire liquid surface image data of different pesticide liquid formulations after filling with different containers and different filling parameters, generate a set of liquid surface images through preprocessing, extract the wall-mounted layer thickness features from the liquid surface images as a sample image set, and generate a thickness distribution map corresponding to the sample images. The model training unit is used to construct a thickness prediction model by using the filling parameters, viscosity characteristics, container inner wall surface roughness parameters, and corresponding thickness distribution maps of pesticide liquid formulations as training data. The thickness prediction unit is used to obtain a predicted thickness distribution map by inputting the filling parameters, viscosity characteristics data and container surface roughness parameters of the pesticide liquid formulation to be filled into the thickness prediction model; based on the predicted thickness distribution map, it identifies the liquid surface morphology characteristics of the wall-mounted layer and calculates the volume of pesticide liquid in the wall-mounted layer. The liquid level calculation unit is used to obtain the reference liquid level height based on the liquid surface morphology characteristics, calculate the filling equivalent liquid level height based on the pesticide liquid volume of the wall-mounted layer and the reference liquid level height, and compare the equivalent liquid level height with the target liquid level height to obtain the liquid level difference. The parameter control unit is used to adjust the filling parameters according to the absolute value of the liquid level difference, update the input data of the thickness prediction model based on the adjusted filling parameters, and re-execute step S3 to this step until the filling accuracy requirements are met.

10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the method as described in any one of claims 1-8.