A Computer Vision-Based Method and System for Segmentation and Parameter Extraction of Cross-Sectional Quality Features in Strong-Aroma Daqu (a type of Chinese liquor)

By using computer vision technology to perform image preprocessing and multi-class semantic segmentation on the cross-section of strong-aroma baijiu, the problem of insufficient accuracy in identifying key quality structures in existing technologies has been solved, enabling quantitative analysis and evaluation of baijiu quality and improving the standardization and intelligence level of baijiu production.

CN122312501APending Publication Date: 2026-06-30JIANGNAN UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-13
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies make it difficult to accurately distinguish and quantitatively analyze key quality structures such as fire rings, cracks, and bacterial spots in the cross-section of strong-aroma baijiu, resulting in insufficient extraction of quality characteristics and affecting the accuracy and reliability of baijiu quality evaluation.

Method used

Using a computer vision-based approach, image preprocessing, multi-class semantic segmentation, and quality feature parameter extraction are employed to achieve automatic segmentation and quantitative analysis of key structures in the cross-section of Daqu, including the calculation of the proportion of miscellaneous bacterial patches, the thickness of the bark, and the total length of cracks.

Benefits of technology

It enables objective and standardized quality evaluation of the cross-section of strong-aroma baijiu, improving the accuracy and consistency of quality evaluation, and is applicable to quality testing and control in the baijiu industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122312501A_ABST
    Figure CN122312501A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of computer vision and food quality inspection technology, and discloses a method and system for segmenting and extracting parameters of cross-sectional quality features of strong-aroma baijiu (a type of Chinese liquor) based on computer vision. The invention acquires cross-sectional images of baijiu through an image acquisition module, performs multi-category pixel-level segmentation after preprocessing, and obtains the main body of the baijiu cross-section, the fire ring, cracks, and areas of bacterial contamination. Further, it calculates parameters such as the proportion of bacterial contamination area, the thickness of the outer layer, and the total length of cracks, realizing automated quantitative analysis of the baijiu cross-sectional quality. This transforms the traditional qualitative description of baijiu cross-sectional quality into a quantifiable analysis, which is beneficial for standardizing and comparing quality evaluation results, reducing the reliance on experience in manual evaluation, and improving the objectivity and consistency of quality evaluation. This invention is easily integrated with existing baijiu production and testing processes, and is applicable to the quality inspection and quality control of strong-aroma baijiu baijiu, possessing good engineering application value and promising prospects for promotion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and food quality inspection technology, and in particular to a method and system for segmenting and extracting quality features and parameters of cross-sections of strong-aroma koji (a type of Chinese liquor) based on computer vision. Background Technology

[0002] Strong-aroma baijiu occupies an important position in my country's baijiu industry, and daqu, as its core saccharification and fermentation agent, directly affects the flavor characteristics and product stability of baijiu. In actual production, the quality of daqu is usually evaluated manually, mainly relying on experienced personnel to observe and judge the appearance, color, and cross-sectional structure of the daqu.

[0003] However, manual evaluation is highly subjective and easily affected by the experience level of the evaluators and environmental factors, making it difficult to achieve objectivity, standardization and repeatability of quality evaluation, and it can no longer meet the needs of modern liquor industry for refined production and quality control.

[0004] With the development of computer vision technology, some studies have attempted to analyze Daqu images using image processing methods. However, existing technologies are mostly focused on extracting overall color or texture features, making it difficult to accurately distinguish and quantitatively analyze key quality structures such as fire rings, cracks, and bacterial patches in Daqu cross-sections. This results in insufficient quality feature extraction, and the reliability and practicality of the evaluation results still need to be improved.

[0005] Therefore, there is an urgent need for a technical solution that can automatically identify the key quality structure of the cross-section of strong-aroma Daqu and quantitatively extract various quality characteristic parameters, so as to improve the accuracy of Daqu quality evaluation and its engineering application value. Summary of the Invention

[0006] In view of the above problems, this invention provides a method and system for segmenting and extracting quality features and parameters of Daqu (a type of starter culture) cross-sections based on computer vision. By performing computer vision processing on Daqu cross-section images, the system achieves automatic segmentation of key quality structures in the cross-section, and on this basis, extracts and analyzes quality feature parameters. This enables accurate and automatic segmentation of key quality structures (such as fire rings, bacterial spots, and cracks) in Daqu cross-sections, and extracts comprehensive and quantifiable quality feature parameters accordingly. This overcomes the shortcomings of subjective manual evaluation and the inability of existing image processing methods to perform quantitative analysis, providing technical support for the standardized and intelligent quality assessment of Daqu for Baijiu.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention provides a method for segmenting and extracting parameters of cross-sectional quality features of strong-aroma baijiu (a type of Chinese liquor) based on computer vision, comprising the following steps: Cross-sectional image acquisition; acquiring cross-sectional images of strong-aroma baijiu daqu (a type of starter culture); Image preprocessing; The cross-sectional image is preprocessed, including image size normalization and brightness and contrast adjustment, to obtain a standardized input image; Multi-class semantic segmentation: The preprocessed cross-sectional image is input into a pre-constructed semantic segmentation model to perform pixel-level multi-class segmentation, and a segmentation result with the same size as the input image is obtained. The segmentation result includes at least the main body region of the large curve, the fire ring region, the crack region and the bacterial spot region. Quality feature parameter extraction: Based on the segmentation results, pixel statistics and geometric analysis are performed on each region to extract the quality feature parameters of the Daqu cross section. The quality feature parameters include the proportion of miscellaneous bacterial spots, the thickness of the bark, and the total length of cracks. Quality evaluation output: Based on the quality characteristic parameters, a comprehensive evaluation of the quality of the Daqu section is performed, and the corresponding quality evaluation results or grade information are output.

[0008] In one embodiment of the present invention, the image size normalization process in the image preprocessing involves uniformly adjusting the cross-sectional image to a preset size and normalizing the pixel grayscale values. Before the model training stage, the cross-sectional image is subjected to data augmentation processing, which includes random rotation, random horizontal or vertical flipping, random cropping, and brightness and contrast perturbation operations to expand the number of training samples and improve the model's adaptability to different shooting conditions and morphological changes.

[0009] In one embodiment of the present invention, the semantic segmentation model is a U²-Net model, including an encoding path and a decoding path. The encoding path includes multiple downsampling stages, each stage including a convolutional unit, a batch normalization unit, and a nonlinear activation unit, used to extract multi-scale semantic features. Each convolutional unit adopts a residual U structure, forming a nested multi-scale feature extraction path within a single stage. A feature decoupling module is introduced between the output of the encoding path and the input of the decoding path. The feature decoupling module is used to further decompose the mixed features extracted in the encoding stage into two types of feature representations: one is a texture feature branch used to characterize the color and texture information of the bacterial plaque region, and the other is a geometric structure feature branch used to characterize the slender shape and structural continuity of the crack. The decoupled features are input into the decoding path through a feature fusion operation. The decoding path restores the spatial resolution through progressive upsampling and fuses the high-resolution features of the corresponding encoding stage through skip connections to enhance the boundary recovery capability. Finally, the output is a multi-channel probability map with the same size as the input, which is normalized by Softmax to generate a pixel-level classification label map.

[0010] In one embodiment of the present invention, a model training step is also included: Building a training dataset: Manually annotate the collected cross-sectional images of Daqu to generate pixel-level multi-class label data; The model parameters are optimized using a hybrid loss function: the hybrid loss function is composed of three weighted combinations of Lovasz-Softmax Loss, Generalized Dice Loss and weighted cross-entropy loss function, in order to alleviate the class imbalance problem and enhance the boundary recognition ability; A separate validation strategy is adopted: the training set and the test set are divided according to different batches or production stages to verify the stability and generalization performance of the model under different production conditions. Data augmentation strategy is adopted: during the training process, the input image is randomly rotated, randomly flipped, and its brightness is perturbed to improve the generalization ability of the model.

[0011] In one embodiment of the present invention, the proportion R of contaminant plaque area in the quality characteristic parameter extraction is... plaque Calculate using the following formula: R plaque

[0012] This indicates the number of pixels that were segmented into the plaque category. This represents the number of pixels that are divided into the main region of the large curve. After obtaining the semantic segmentation results of the bacterial plaque region, a bacterial plaque hazard index is constructed. This is used to comprehensively reflect the potential impact of microbial contamination on the quality of Daqu (a type of starter culture), specifically including: Plaque region extraction: Pixel regions belonging to the plaque category are extracted based on semantic segmentation results, and each plaque region is obtained through connected component analysis; Color feature extraction: The bacterial plaque area is converted from the RGB color space to the HSV color space, and the hue (H), saturation (S), and luminance (V) features are extracted; among them, the luminance component (V) is used to characterize the color depth of the plaque to reflect the degree of bacterial activity. Hazard Index Calculation: The hazard index of microbial plaques is constructed by combining the area ratio, color depth, and spatial location of the plaques. The calculation formula is as follows:

[0013] in, Percentage of area covered by bacterial plaques The color depth characteristics of the bacterial patches α 1. β 2 represents the weighting coefficient.

[0014] In one embodiment of the present invention, the thickness T of the skin is extracted as a quality feature parameter. pizhangThe skin thickness is obtained by calculating the minimum Euclidean distance between the boundary pixels of the fire ring region and the outer boundary pixels of the large curved body, and taking the average value. The skin thickness is calculated according to the following formula:

[0015] Where P represents the set of pixels at the boundary of the fire circle region, E represents the set of pixels at the outer boundary of the main body of the large curve, and d(p,e) represents the Euclidean distance between pixels.

[0016] In one embodiment of the present invention, the total crack length L in the extraction of the quality feature parameters is obtained by statistically analyzing the lengths of each crack skeleton after performing connected component analysis and skeletonization on the crack region. The total crack length is calculated according to the following formula:

[0017] in, Indicates the first The length of the crack, Number the cracks. This represents the total number of cracks. A crack network graph structure is constructed based on the crack skeleton image, and topological analysis is performed on the skeleton nodes. Nodes are classified according to the adjacency relationship of skeleton pixels, and nodes connecting two or more adjacent pixels are defined as branching nodes. Then, using graph theory methods, the topological features are calculated, and a crack complexity index is constructed. The calculation formula is as follows:

[0018] in, Total length of the crack; Number of crack bifurcation nodes; The maximum connected region size of a crack is used to characterize the size of the largest connected region in a crack network. These are the weighting coefficients.

[0019] Secondly, the present invention provides a computer vision-based system for segmenting and extracting parameters of cross-sectional quality features of strong-aroma baijiu (Chinese liquor) koji, used to implement the aforementioned computer vision-based method for segmenting and extracting parameters of cross-sectional quality features of strong-aroma koji. The system includes: An image acquisition module is used to acquire cross-sectional images of the large-brick structure. The image acquisition module includes a conveyor belt, an industrial camera, a ring-shaped LED light, and a control and detection host. The conveyor belt transports the large-brick structure to be inspected to a preset acquisition position and ensures that the cross-section of the large-brick structure is centered in the field of view of the industrial camera through a limiting structure or visual positioning algorithm. The industrial camera is fixed above the cross-section of the large-brick structure and synchronizes with the conveyor belt via a trigger signal to achieve dynamic or fixed-point shooting. The ring-shaped LED light provides a uniform and stable ring-shaped lighting environment to reduce the impact of shadows and local reflections on image quality. The image preprocessing module is used to standardize the cross-sectional image acquired by the image acquisition module to improve the stability and robustness of subsequent semantic segmentation; the image preprocessing module includes a size normalization unit, a pixel normalization unit, an image enhancement unit, and a noise reduction unit. A semantic segmentation module is used to perform multi-class pixel-level segmentation on the preprocessed image to generate segmentation results for the large curved cross-section structure. The semantic segmentation module includes a feature extraction unit and a segmentation prediction unit. The feature extraction unit uses a convolutional neural network to extract features from the image at multiple scales. The segmentation prediction unit upsamples and maps the feature map to categories, outputting a category probability map with the same size as the input image. Pixel-level category label maps are generated through maximum probability decision-making. The output results include segmentation masks for the main region of the large curved cross-section, the fire ring region, the crack region, and the bacterial plaque region. The feature extraction unit contains nested residual U-structure units, constructing multiple convolutional paths within a single scale to expand the receptive field and enhance the recognition ability of small cracks and bacterial plaque regions. During the training phase, the semantic segmentation module uses a combined loss function for optimization, including cross-entropy loss and Dice loss, to alleviate class imbalance and improve the segmentation accuracy of small targets. The quality feature parameter extraction module is used to perform pixel statistics and geometric structure analysis based on semantic segmentation results, and calculate the area ratio of miscellaneous plaques, skin thickness, and total crack length. The quality feature parameter extraction module includes an area statistics unit, a boundary extraction unit, a connected component analysis unit, and a skeletonization processing unit. The area statistics unit is used to count the number of pixels in each category of region and calculate the area ratio of miscellaneous plaques. The boundary extraction unit is used to extract the boundary of the fire ring region and the outer contour boundary of the main body of the large curve. The connected component analysis unit is used to identify independent connected regions in the crack region. The skeletonization processing unit is used to refine the crack region into a single-pixel wide skeleton structure and calculate the crack length in combination with the image spatial resolution. Quality evaluation module: used to comprehensively evaluate the quality of the Daqu cross section based on the extracted parameters. The quality evaluation module includes a parameter weighting unit, a rule determination unit, and a result output unit.

[0020] Thirdly, the present invention provides a computer-readable storage medium storing computer instructions, which are executed by a processor as described in the computer vision-based method for segmenting and extracting quality features of cross-sections of strong-aroma Daqu liquor.

[0021] Fourthly, the present invention provides a computer program product, wherein the computer program product stores computer instructions, and the computer instructions are executed by a processor as described in the computer vision-based method for segmenting and extracting cross-sectional quality features of strong-aroma Daqu liquor.

[0022] The beneficial effects achieved by this invention are as follows: 1. This invention uses semantic segmentation technology to perform multi-category fine segmentation of the cross-section of strong-aroma baijiu daqu (a type of starter culture), realizing the automatic identification of key quality structures such as fire rings, bacterial spots, and cracks. This reduces the reliance of manual evaluation on experience and improves the objectivity and consistency of quality evaluation.

[0023] 2. Based on the segmentation of the cross-section structure, this invention further extracts multi-dimensional quality characteristic parameters such as area ratio, crack length and fire ring thickness, so that the quality of the Daqu cross-section is transformed from the traditional qualitative description to a quantitative analysis, which is conducive to the standardization and comparative analysis of quality evaluation results.

[0024] 3. The method of this invention has a clear process and a simple system structure, making it easy to integrate with existing liquor production and testing processes. It is suitable for quality testing and quality control scenarios of strong-aroma liquor koji, and has good engineering application value and promotion prospects. Attached Figure Description

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

[0026] Figure 1 The flowchart illustrates a computer vision-based method for segmenting and extracting quality features and parameters of a cross-section of strong-aroma baijiu (a type of Chinese liquor) as provided in this application embodiment.

[0027] Figure 2 The structural block diagram of the computer vision-based cross-sectional quality feature segmentation and parameter extraction system for strong-aroma baijiu provided in the embodiments of this application is shown.

[0028] Figure 3 This is a schematic diagram of the image acquisition module provided in an embodiment of this application; wherein, 301 is the control and detection host; 302 is the large curve to be detected; 303 is the ring LED light; 304 is the industrial camera; and 305 is the conveyor belt.

[0029] Figure 4 This is a schematic diagram of the semantic segmentation network provided in an embodiment of this application.

[0030] Figure 5 This is a schematic diagram of quality feature parameter extraction based on segmentation results provided in an embodiment of this application; wherein, (a) is a schematic diagram of hide thickness calculation; (b) is a schematic diagram of miscellaneous bacterial spot area ratio calculation; and (c) is a schematic diagram of crack skeletonization and length calculation. Detailed Implementation

[0031] The embodiments of the technical solution of the present invention will now be described in detail with reference to the accompanying drawings. These embodiments are merely illustrative of the technical solution of the present invention and are therefore intended to limit the scope of protection of the present invention.

[0032] Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains; the terminology used in this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention; the terms “comprising” and “having”, and any variations thereof, in the specification, claims and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0033] In the description of the embodiments of this invention, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this invention, "multiple" means two or more, unless otherwise explicitly defined.

[0034] In this invention, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least some embodiments of the invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this invention can be combined with other embodiments.

[0035] In the description of the embodiments of this invention, the term "and / or" is merely a description of the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, in this invention, the character " / " generally indicates that the preceding and following associated objects have an "or" relationship.

[0036] like Figure 1As shown, this invention provides a computer vision-based method for segmenting and extracting parameters of cross-sectional quality features of strong-aroma baijiu (a type of Chinese liquor), comprising the following steps: Step S101: Obtain cross-sectional image; The image acquisition module 201 acquires a cross-sectional image of the Daqu (a type of glutinous rice) to be detected. The cross-sectional image is a color image that reflects the internal structural characteristics of the Daqu. Figure 3 As shown, the image acquisition module 201 includes a conveyor belt 305, an industrial camera 304, a ring LED light 303, and a control and detection host 301; the conveyor belt 5 is used to transport the large curved section 302 to be detected to the preset acquisition position; the industrial camera 4 is fixed above the cross-section of the large curved section, and the resolution is preferably above 2 million pixels; the ring LED light 303 is used to provide uniform ring illumination, and the color temperature is preferably 5000K to 6500K to reduce the impact of shadows and local reflections on image quality; Step S102: Image preprocessing; After receiving image data, the control and detection host 1 performs the following processing: 1. Size normalization: The original image is uniformly adjusted to a preset size (e.g., 512×512 pixels); 2. Pixel normalization: The RGB channel pixel values ​​are linearly mapped from [0,255] to the [0,1] range; 3. Brightness and contrast normalization: Histogram equalization or adaptive histogram equalization (CLAHE) is used to enhance image contrast; 4. Noise suppression: The image is smoothed using 3×3 median filtering or Gaussian filtering; 5. Data augmentation; Step S103: Multi-class semantic segmentation; The preprocessed cross-sectional image is input into a pre-trained semantic segmentation model for pixel-level classification. The semantic segmentation model preferably adopts a U²-Net network structure, which includes an encoder and a decoder: the encoder is used to extract multi-scale features; the decoder is used to restore spatial resolution and output a category probability map; the model outputs a category label map with the same size as the input, and the categories include at least: the main body region of the large curve, the fire ring region, the crack region, the bacterial spot region, and the background region; finally, pixel-level segmentation results are generated through the maximum probability principle. Step S104: Extraction of quality feature parameters; Based on the segmentation results, pixel statistics and geometric analysis are performed on each region to extract the quality feature parameters of the Daqu cross section. The quality feature parameters include the proportion of miscellaneous bacterial spots, the thickness of the bark, and the total length of the cracks. In this embodiment, based on the semantic segmentation label map obtained in step S103, pixel statistics and geometric structure analysis are performed on each category region to extract the structural parameters required for quality evaluation. Step S105: Quality evaluation output; Based on the quality characteristic parameters, a comprehensive evaluation of the quality of the Daqu section is performed, and the corresponding quality evaluation results or grade information are output.

[0037] I. Dataset Construction and Preprocessing In this optional embodiment, in step S102, the data augmentation randomly performs the following five types of data augmentation operations on the image: (1) Enhanced geometric transformation: including random horizontal or vertical flipping, random rotation within ±15°, random scaling and random cropping, used to simulate different shooting angles and changes in the posture of curved blocks, and improve the model's adaptability to changes in structural orientation; (2) Enhancement of illumination and color perturbation: Within a limited range, brightness, contrast and saturation are randomly adjusted to enhance the robustness of the model to different illumination conditions and imaging differences; (3) Spatial combination enhancement: Using a multi-image stitching method, local regions of multiple samples are randomly combined to form new training samples, increasing the diversity of cross-sectional structure combinations and improving the model's ability to recognize complex backgrounds; (4) Noise and blur enhancement: Introduce mild Gaussian noise and blur processing to simulate sensor noise and imaging interference, and enhance the model's anti-interference ability; Introduce the following random degradation processing: Gaussian noise (variance range 10~30); median filtering and motion blur; optical distortion and mesh distortion; (5) Small target targeted enhancement: In response to the problem that cracks and plaques have a low proportion of categories and small structure, this invention constructs a small target sample pool and performs cross-graph copy enhancement; based on the annotation mask, the crack and plaque regions are locally cropped and enlarged, so that the model increases the learning frequency of small target regions during training, thereby improving the segmentation accuracy of small targets.

[0038] II. Model Construction and Training In this alternative embodiment, such as Figure 4 As shown, the semantic segmentation model U²-Net includes an encoding path and a decoding path. The encoding path includes multiple downsampling stages, each of which includes a convolutional unit, a batch normalization unit, and a nonlinear activation unit for extracting multi-scale semantic features. In a preferred embodiment, each convolutional unit adopts a residual U structure, forming a nested multi-scale feature extraction path within a single stage, thereby expanding the receptive field and improving the ability to recognize slender structures such as cracks without significantly increasing the number of parameters.

[0039] In practical applications, crack areas and bacterial plaque areas in the cross-section of a large curved section may appear visually contiguous or overlapping. Using only a single feature representation for segmentation can easily lead to missegmentation between different categories. Therefore, in one embodiment of this invention, a feature decoupling module is introduced between the output features of the encoding path and the input features of the decoding path. This module further decomposes the mixed features extracted during the encoding stage into two types of feature representations: a texture feature branch characterizing the color and texture information of the bacterial plaque area, and a geometry feature branch characterizing the slender morphology and structural continuity of the cracks. During model training, by setting specific feature constraints or loss functions, the two types of features maintain a low correlation in the feature space, thereby reducing interference between different structural features.

[0040] Subsequently, the decoupled features are input into the decoding path through a feature fusion operation. The decoding path restores spatial resolution through stepwise upsampling and fuses high-resolution features from corresponding encoding stages through skip connections to enhance boundary recovery capabilities. The final output is a multi-channel probability map with the same size as the input, which is then normalized using Softmax to generate a pixel-level classification label map.

[0041] In this optional embodiment, to improve the stability and generalization ability of the semantic segmentation model in multi-class pixel-level prediction tasks, the present invention adopts the following training strategy: To address the class imbalance problem in semantic segmentation tasks, this invention introduces an automatic class weight calculation mechanism.

[0042] By statistically analyzing the pixel proportions of each category in the training set, a category weight vector is automatically generated and introduced into the loss function, thereby increasing the gradient contribution ratio of small target categories (such as cracks and bacterial plaques).

[0043] In this embodiment, an enhanced combined loss function is employed, including: Loss = λ1·LovaszLoss + λ2·DiceLoss + λ3·CrossEntropyLoss Lovasz Loss is used to directly optimize the IoU metric; Dice Loss is used to alleviate class imbalance; CrossEntropy is used to stabilize pixel-level classification boundaries.

[0044] Optimizer settings: AdamW optimizer is used, with an initial learning rate of 1× The weight decay coefficient is 1× This reduces the risk of model overfitting and improves convergence stability.

[0045] A multi-step learning rate scheduler is used to reduce the learning rate proportionally (e.g., 0.9) at preset training rounds (e.g., round 20, round 50), thereby improving the model's convergence accuracy in later stages.

[0046] III. Results Analysis and Parameter Extraction The outer layer is the outer structure formed during the fermentation and storage of Daqu (a type of starter culture). Its thickness can be calculated by the spatial distance between the fire ring area and the outer boundary of the Daqu. .

[0047] In this optional embodiment, in step S104 and Figure 5 In (a) of the semantic segmentation result, the fire circle region is extracted and the boundary of the fire circle region is detected to obtain the set of boundary pixels P of the fire circle region; at the same time, the outer contour boundary of the main body region of the large curve is extracted to obtain the set of boundary pixels E.

[0048] For any pixel p within the boundary of the fire circle region, calculate its Euclidean distance to each point in the pixel set E of the outer boundary of the large curve (d(p,e) represents the Euclidean distance between pixel p and pixel e), and take the minimum value, expressed as:

[0049] By employing the average distance calculation method, the impact of local extreme values ​​on the overall thickness calculation results can be reduced, thereby improving the stability of the calculation results.

[0050] In this optional embodiment, in step S104 and Figure 5 In (b), after obtaining the semantic segmentation result, pixel regions classified as bacterial plaques are extracted from the segmented image, and their pixel count is counted, denoted as . Simultaneously, the total number of pixels in the entire Daqu cross-sectional area is counted and denoted as . The large curved section region refers to the total number of pixels classified as the entire large curved section region in the semantic segmentation result.

[0051] Percentage of miscellaneous bacterial plaque area R plaque The calculation formula is as follows: R plaque

[0052] The percentage of miscellaneous bacterial patches obtained through the above method is used to characterize the degree of contamination of the Daqu cross-section, providing a quantitative basis for quality evaluation.

[0053] In actual brewing production, the impact of contaminant spots on the quality of Daqu (a type of starter culture) is not only related to their size, but also closely related to their color characteristics and spatial distribution. Generally speaking, darker-colored spots tend to represent higher contaminant activity and have a more significant impact on the fermentation process. Therefore, the proportion of contaminant spots alone is insufficient to comprehensively characterize the degree of contamination.

[0054] To further improve the accuracy of evaluating the severity of microbial plaque hazards on Daqu cross-sections, in one embodiment of the present invention, after obtaining the semantic segmentation results of the microbial plaque region, a microbial plaque hazard index (Plaque Hazard Index) is further constructed. This is used to comprehensively reflect the potential impact of microbial contamination on the quality of Daqu (a type of starter culture).

[0055] The specific steps are as follows: (1) Extraction of plaque regions: Pixel regions belonging to the plaque category are extracted based on the semantic segmentation results, and each plaque region is obtained through connected component analysis.

[0056] (2) Color feature extraction: The bacterial plaque area was converted from the RGB color space to the HSV color space, and the hue (H), saturation (S), and brightness (V) features were extracted. Among them, the brightness component V was used to characterize the color depth of the plaque to reflect the degree of bacterial activity.

[0057] (3) Hazard Index Calculation: The hazard index of bacterial patches is constructed by combining the area ratio, color depth, and spatial location of the patches. The calculation formula can be expressed as follows:

[0058] in, Percentage of area covered by bacterial plaques The color depth characteristics of the bacterial patches α 1. β 2 represents the weighting coefficient.

[0059] Cracks are elongated structural regions in the cross-section of a large curved section, and their length reflects the integrity of the curved block structure.

[0060] In this optional embodiment, in step S104 and Figure 5 In (c), crack regions are extracted from the semantic segmentation results, and connected component analysis is performed on the crack regions to divide different cracks into multiple independent connected regions.

[0061] Each crack connected region is skeletonized, converting the original crack region into a single-pixel-wide skeleton structure to eliminate the impact of crack width differences on length calculation.

[0062] The number of pixels in the skeleton of each crack is counted, and combined with the image spatial resolution, the number of pixels is converted into an actual length value to obtain the length of the crack. Crack length .

[0063] Total length of crack L The calculation formula is:

[0064] in, Indicates the first The length of a crack can be obtained by performing connected component detection and skeletonization on the crack region. This represents the total number of cracks.

[0065] By using skeletonization and connected domain separation, the interference of irregular crack edges on measurement results can be avoided, thus improving the accuracy of crack length calculation.

[0066] Meanwhile, in actual production, when complex connections form between cracks, even a small total crack length can lead to a loose internal structure in the fermentation koji (a type of starter culture), thus affecting the fermentation performance of the koji blocks. Therefore, after obtaining the crack skeleton structure, further topological analysis of the crack network can be performed. Specifically, a crack network graph structure is constructed based on the crack skeleton image, and topological analysis is performed on the skeleton nodes. Nodes are classified according to the adjacency relationship of skeleton pixels, and nodes connecting two or more adjacent pixels are defined as branching nodes. Then, using graph theory methods, the topological features are calculated, and a crack complexity index (Crack Complexity Index) can be constructed. The calculation formula is as follows:

[0067] in, Total length of the crack; Number of crack bifurcation nodes; The maximum connected region size of a crack is used to characterize the size of the largest connected region in a crack network. These are the weighting coefficients.

[0068] In addition, such as Figure 2 As shown, the present invention also provides a computer vision-based system for segmenting and extracting parameters of cross-sectional quality features of strong-aroma baijiu (Chinese liquor) koji, used to implement the aforementioned computer vision-based method for segmenting and extracting parameters of cross-sectional quality features of strong-aroma koji. The system includes: Image acquisition module 201 is used to acquire cross-sectional images of the large curve, such as... Figure 3As shown, the image acquisition module 201 includes a conveyor belt 305, an industrial camera 304, a ring LED light 303, and a control and detection host 301. The conveyor belt 5 is used to transport the large curve 302 to be detected to a preset acquisition position, and ensures that the cross-section of the large curve is at the center of the field of view of the industrial camera 304 through a limiting structure or visual positioning algorithm. The industrial camera 4 is fixed above the cross-section of the large curve, with a resolution preferably above 2 million pixels, and is synchronized with the conveyor belt through a trigger signal to realize dynamic shooting or fixed-point shooting. The ring LED light 303 is used to provide a uniform and stable ring lighting environment, with a color temperature preferably between 5000K and 6500K to reduce the impact of shadows and local reflections on image quality. The image acquisition module 201 outputs the original color cross-section image data to the image preprocessing module 202. The image preprocessing module 202 is used to standardize the cross-sectional image acquired by the image acquisition module 201 to improve the stability and robustness of subsequent semantic segmentation. The image preprocessing module 202 includes a size normalization unit, a pixel normalization unit, an image enhancement unit, and a noise reduction unit. The image preprocessing module 202 outputs the preprocessed image data to the semantic segmentation module 203. The semantic segmentation module 203 is used to perform multi-class pixel-level segmentation on the preprocessed image to generate the segmentation result of the Daqu cross-section structure. The semantic segmentation module 203 includes a feature extraction unit and a segmentation prediction unit. The feature extraction unit uses a convolutional neural network to extract multi-scale features from the image. The segmentation prediction unit upsamples and maps the feature map to categories, and outputs a category probability map with the same size as the input image. A pixel-level category label map is generated through maximum probability decision. The output result includes segmentation masks for the main area of ​​the Daqu cross-section, the fire ring area, the crack area, and the bacterial spot area. The feature extraction unit includes nested residual U-structure units, which construct multiple convolutional paths within a single scale to expand the receptive field and enhance the ability to identify small cracks and bacterial plaques. The semantic segmentation module 203 is optimized during the training phase using a combined loss function, which includes the cross-entropy loss function and the Dice loss function, to alleviate the class imbalance problem and improve the segmentation accuracy of small objects. The quality feature parameter extraction module 204 is used to perform pixel statistics and geometric structure analysis based on semantic segmentation results, and calculate the proportion of miscellaneous bacterial spots, skin thickness, and total crack length. The quality feature parameter extraction module 204 includes an area statistics unit, a boundary extraction unit, a connected component analysis unit, and a skeletonization processing unit. The area statistics unit is used to count the number of pixels in each category of region and calculate the proportion of miscellaneous bacterial spots. The boundary extraction unit is used to extract the boundary of the fire ring region and the outer contour boundary of the main body of the large curve. The connected component analysis unit is used to identify independent connected regions in the crack region. The skeletonization processing unit is used to refine the crack region into a single-pixel wide skeleton structure and calculate the crack length in combination with the image spatial resolution. Quality evaluation module 205: used to comprehensively evaluate the quality of the Daqu cross section based on the extracted parameters. The quality evaluation module includes a parameter weighting unit, a rule determination unit, and a result output unit.

[0069] To verify the effectiveness of the technical solution of this application, a comparative experiment was conducted, comparing the method of this invention with the typical semantic segmentation model U-Net. Experimental results show that the method described in this application improves the segmentation, intersection, and union (IoU) of the plaque by 1.41% compared to the U-Net model, demonstrating the superiority of the technical solution of this invention.

[0070] 1. Set up a control group: Control Group A (existing technology): Referring to existing visual inspection methods for Daqu quality, traditional image processing and feature extraction methods, including grayscale threshold segmentation, texture feature extraction, and morphological analysis, are used to identify and calculate the features of the Daqu cross-section structure.

[0071] Control group B (general model): The cross-sectional image was segmented at the pixel level using the general semantic segmentation model U-Net, and quality parameters were extracted in the same way.

[0072] Experimental Group C (Invention): The method for segmentation and parameter extraction of cross-sectional quality features of strong-aroma Daqu based on the improved U²-Net proposed in this invention is adopted.

[0073] 2. Select key indicators: Method Improvement: Compared with existing visual inspection methods for Daqu quality, the method of this invention can more accurately identify cracks and bacterial patches in the cross-section of Daqu in images, rather than being limited to simple classification of Daqu.

[0074] Segmentation accuracy: The U²-Net model used in this invention achieves an average intersection-over-union ratio (mIoU) of 88.79%, representing a 1.41% improvement in overall segmentation performance compared to the U-Net model's 87.38%. Furthermore, this invention demonstrates better recognition capabilities for smaller target parameters. Specifically, the IoU for crack regions reaches 85.30%, an improvement of approximately 4.07% compared to the U-Net model; and the IoU for bacterial plaque regions reaches 85.66%, an improvement of approximately 4.94% compared to the U-Net model.

[0075] In some embodiments, the present invention provides a computer-readable storage medium storing computer instructions that are executed by a processor as described in any of the above embodiments: a computer vision-based method for segmenting and extracting quality features of cross-sections of strong-aroma Daqu liquor.

[0076] Computer-readable storage media can take the form of any combination of one or more readable media. A readable medium can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (not an exhaustive list) may include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD). ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0077] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0078] Embodiments of the present invention may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the computer vision-based method for segmenting and extracting quality features of cross-sections of strong-aroma baijiu according to various embodiments of the present invention, as described in the "Exemplary Methods" section above.

[0079] The steps of the method of the present invention are not limited to the specific order described above, unless otherwise specifically stated. Furthermore, in some embodiments, the invention may also be implemented as a program recorded on a recording medium, the program comprising machine-readable instructions for implementing the method according to the invention. Therefore, the invention also covers recording media storing programs for performing the method according to the invention.

[0080] Although the invention has been described with reference to preferred embodiments, various modifications can be made and components can be replaced with equivalents without departing from the scope of the invention. In particular, the technical features mentioned in the various embodiments can be combined in any manner as long as there is no structural conflict. The invention is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A method for segmenting and extracting parameters of cross-sectional quality features of strong-aroma Daqu (a type of Chinese liquor) based on computer vision, characterized in that, Includes the following steps: Cross-sectional image acquisition; acquiring cross-sectional images of strong-aroma baijiu daqu (a type of starter culture); Image preprocessing; The cross-sectional image is preprocessed, including image size normalization and brightness and contrast adjustment, to obtain a standardized input image; Multi-class semantic segmentation; The preprocessed cross-sectional image is input into a pre-constructed semantic segmentation model for pixel-level multi-class segmentation to obtain a segmentation result with the same size as the input image. The segmentation result includes at least the main body region of the large curve, the fire ring region, the crack region, and the bacterial spot region. Extraction of quality characteristic parameters; Based on the segmentation results, pixel statistics and geometric analysis are performed on each region to extract the quality characteristic parameters of the Daqu cross section. The quality characteristic parameters include the proportion of miscellaneous bacterial spots, the thickness of the skin, and the total length of cracks. Quality evaluation output: Based on the quality characteristic parameters, a comprehensive evaluation of the quality of the Daqu section is performed, and the corresponding quality evaluation results or grade information are output.

2. The method for segmenting and extracting parameters of cross-sectional quality features of strong-aroma baijiu based on computer vision according to claim 1, characterized in that, The image preprocessing process involves adjusting the cross-sectional image to a preset size and normalizing the pixel grayscale values. Before the model training stage, the cross-sectional image is subjected to data augmentation processing, which includes random rotation, random horizontal or vertical flipping, random cropping, and brightness and contrast perturbation operations to expand the number of training samples and improve the model's adaptability to different shooting conditions and morphological changes.

3. The method for segmenting and extracting parameters of cross-sectional quality features of strong-aroma baijiu based on computer vision according to claim 1, characterized in that, The semantic segmentation model is a U²-Net model, which includes an encoding path and a decoding path. The encoding path includes multiple downsampling stages, each of which includes a convolutional unit, a batch normalization unit, and a nonlinear activation unit to extract multi-scale semantic features. Each convolutional unit adopts a residual U structure, forming a nested multi-scale feature extraction path within a single stage. A feature decoupling module is introduced between the output of the encoding path and the input of the decoding path. This module further decomposes the mixed features extracted in the encoding stage into two types of feature representations: one is a texture feature branch that characterizes the color and texture information of the bacterial plaque region, and the other is a geometric structure feature branch that characterizes the slender shape and structural continuity of the crack. The decoupled features are input into the decoding path through a feature fusion operation. The decoding path restores the spatial resolution by upsampling at each level and fuses the high-resolution features from the corresponding encoding stage through skip connections to enhance the boundary recovery capability. Finally, a multi-channel probability map with the same size as the input is output, which is then normalized by Softmax to generate a pixel-level classification label map.

4. The method for segmenting and extracting parameters of cross-sectional quality features of strong-aroma baijiu based on computer vision according to claim 1, characterized in that, It also includes the model training step: Building a training dataset: Manually annotate the collected cross-sectional images of Daqu to generate pixel-level multi-class label data; The model parameters are optimized using a hybrid loss function: the hybrid loss function is composed of three weighted combinations of Lovasz-Softmax Loss, Generalized Dice Loss and weighted cross-entropy loss function, in order to alleviate the class imbalance problem and enhance the boundary recognition ability; A separate validation strategy is adopted: the training set and the test set are divided according to different batches or production stages to verify the stability and generalization performance of the model under different production conditions. Data augmentation strategy is adopted: during the training process, the input image is randomly rotated, randomly flipped, and its brightness is perturbed to improve the generalization ability of the model.

5. The method for segmenting and extracting parameters of cross-sectional quality features of strong-aroma Daqu (a type of Chinese liquor) based on computer vision according to claim 1, characterized in that, The percentage of bacterial plaque area R in the extracted quality characteristic parameters plaque Calculate using the following formula: R plaque This indicates the number of pixels that were segmented into the plaque category. This represents the number of pixels that are divided into the main region of the large curve. After obtaining the semantic segmentation results of the bacterial plaque region, a bacterial plaque hazard index is constructed. This is used to comprehensively reflect the potential impact of microbial contamination on the quality of Daqu (a type of starter culture), specifically including: Plaque region extraction: Pixel regions belonging to the plaque category are extracted based on semantic segmentation results, and each plaque region is obtained through connected component analysis; Color feature extraction: The bacterial plaque area is converted from the RGB color space to the HSV color space, and the hue (H), saturation (S), and luminance (V) features are extracted; among them, the luminance component (V) is used to characterize the color depth of the plaque to reflect the degree of bacterial activity. Hazard Index Calculation: The hazard index of microbial plaques is constructed by combining the area ratio, color depth, and spatial location of the plaques. The calculation formula is as follows: in, Percentage of area covered by bacterial plaques The color depth characteristics of the bacterial patches α 1. β 2 represents the weighting coefficient.

6. The method for segmenting and extracting parameters of cross-sectional quality features of strong-aroma baijiu based on computer vision according to claim 1, characterized in that, The quality characteristic parameter extraction process involves the thickness T of the diaphragm. pizhang The skin thickness is obtained by calculating the minimum Euclidean distance between the boundary pixels of the fire ring region and the outer boundary pixels of the large curved body, and taking the average value. The skin thickness is calculated according to the following formula: Where P represents the set of pixels at the boundary of the fire circle region, E represents the set of pixels at the outer boundary of the main body of the large curve, and d(p,e) represents the Euclidean distance between pixels.

7. The method for segmenting and extracting parameters of cross-sectional quality features of strong-aroma baijiu based on computer vision according to claim 1, characterized in that, The total crack length L in the quality feature parameter extraction is obtained by statistically analyzing the lengths of each crack skeleton after performing connected component analysis and skeletonization on the crack region. The total crack length is calculated according to the following formula: in, Indicates the first The length of the crack, Number the cracks. This represents the total number of cracks. A crack network graph structure is constructed based on the crack skeleton image, and topological analysis is performed on the skeleton nodes. Nodes are classified according to the adjacency relationship of skeleton pixels, and nodes connecting two or more adjacent pixels are defined as branching nodes. Then, using graph theory methods, the topological features are calculated, and a crack complexity index is constructed. The calculation formula is as follows: in, Total length of the crack; Number of crack bifurcation nodes; The maximum connected region size of a crack is used to characterize the size of the largest connected region in a crack network. These are the weighting coefficients.

8. A computer vision-based system for segmenting and extracting parameters of cross-sectional quality features of strong-aroma baijiu (Chinese liquor) starter culture, characterized in that, The system is used to implement the computer vision-based method for segmenting and extracting the quality features of a strong-aroma baijiu cross-section as described in any one of claims 1-7, the system comprising: An image acquisition module is used to acquire cross-sectional images of the large-brick structure. The image acquisition module includes a conveyor belt, an industrial camera, a ring-shaped LED light, and a control and detection host. The conveyor belt transports the large-brick structure to be inspected to a preset acquisition position and ensures that the cross-section of the large-brick structure is centered in the field of view of the industrial camera through a limiting structure or visual positioning algorithm. The industrial camera is fixed above the cross-section of the large-brick structure and synchronizes with the conveyor belt via a trigger signal to achieve dynamic or fixed-point shooting. The ring-shaped LED light provides a uniform and stable ring-shaped lighting environment to reduce the impact of shadows and local reflections on image quality. The image preprocessing module is used to standardize the cross-sectional image acquired by the image acquisition module to improve the stability and robustness of subsequent semantic segmentation; the image preprocessing module includes a size normalization unit, a pixel normalization unit, an image enhancement unit, and a noise reduction unit. A semantic segmentation module is used to perform multi-class pixel-level segmentation on the preprocessed image to generate segmentation results for the large curved cross-section structure. The semantic segmentation module includes a feature extraction unit and a segmentation prediction unit. The feature extraction unit uses a convolutional neural network to extract features from the image at multiple scales. The segmentation prediction unit upsamples and maps the feature map to categories, outputting a category probability map with the same size as the input image. Pixel-level category label maps are generated through maximum probability decision-making. The output results include segmentation masks for the main region of the large curved cross-section, the fire ring region, the crack region, and the bacterial plaque region. The feature extraction unit contains nested residual U-structure units, constructing multiple convolutional paths within a single scale to expand the receptive field and enhance the recognition ability of small cracks and bacterial plaque regions. During the training phase, the semantic segmentation module uses a combined loss function for optimization, including cross-entropy loss and Dice loss, to alleviate class imbalance and improve the segmentation accuracy of small targets. The quality feature parameter extraction module is used to perform pixel statistics and geometric structure analysis based on semantic segmentation results, and calculate the area ratio of miscellaneous plaques, skin thickness, and total crack length. The quality feature parameter extraction module includes an area statistics unit, a boundary extraction unit, a connected component analysis unit, and a skeletonization processing unit. The area statistics unit is used to count the number of pixels in each category of region and calculate the area ratio of miscellaneous plaques. The boundary extraction unit is used to extract the boundary of the fire ring region and the outer contour boundary of the main body of the large curve. The connected component analysis unit is used to identify independent connected regions in the crack region. The skeletonization processing unit is used to refine the crack region into a single-pixel wide skeleton structure and calculate the crack length in combination with the image spatial resolution. Quality evaluation module: used to comprehensively evaluate the quality of the Daqu cross section based on the extracted parameters. The quality evaluation module includes a parameter weighting unit, a rule determination unit, and a result output unit.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, which are executed by a processor as described in any one of claims 1-7: a computer vision-based method for segmenting and extracting quality features of cross-sections of strong-aroma baijiu.

10. A computer program product, characterized in that, The computer program product stores computer instructions, which are executed by a processor as described in any one of claims 1-7: a method for segmenting and extracting quality features of cross-sections of strong-aroma baijiu based on computer vision.