Image recognition based casing surface defect recognition system

The image recognition-based sausage casing surface defect identification system solves the problems of light variation and noise interference in sausage casing surface detection technology, and achieves high-precision defect identification and adaptability for sausage casings of different materials, thereby improving detection accuracy and adaptability.

CN122175877APending Publication Date: 2026-06-09SHANDONG FUYU FOOD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG FUYU FOOD CO LTD
Filing Date
2026-02-09
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies for detecting defects on the surface of sausage casings are susceptible to human fatigue and changes in lighting conditions, making them difficult to adapt to different materials and working conditions. Furthermore, they lack lighting balance adjustment and dynamic noise suppression, resulting in poor detection accuracy.

Method used

An image recognition-based sausage casing surface defect identification system is adopted, including image acquisition, preprocessing, multi-dimensional feature extraction and discrimination modules. Through adaptive illumination-noise collaborative correction, dynamic window mid-range filtering and dynamic threshold calculation, illumination equalization and noise suppression are achieved, and dynamic adjustment is made in combination with sausage casing material characteristics and feature matching degree.

Benefits of technology

It achieves high-precision defect identification of sausage casings made of different materials, improves the adaptability and accuracy of detection, can adapt to different production conditions, reduces noise interference, and improves model decision-making efficiency and feature recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175877A_ABST
    Figure CN122175877A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of visual detection, and discloses an image recognition-based casing surface defect identification system, comprising image acquisition, image preprocessing, multi-dimensional feature extraction, defect discrimination and result output modules connected in sequence. The image acquisition module acquires original images through components such as a linear array camera and a ring-shaped adjustable LED light source; the preprocessing module optimizes images using a self-adaptive light-noise collaborative correction and dynamic window median filtering model; the feature extraction module extracts three types of features, namely texture, shape and grayscale, and generates a fusion feature vector through iterative optimization; the defect discrimination module realizes defect type determination in combination with a reference feature library and a dynamic threshold; and the result output module generates an XML format detection report and outputs a device control signal. The present application is suitable for casings of different materials and high-speed production lines, effectively solves problems such as low detection precision and weak anti-interference of traditional detection, realizes a closed loop of detection, sorting and data tracing, and improves casing production quality and efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual inspection technology, and more specifically to an image recognition-based system for identifying defects on the surface of sausage casings. Background Technology

[0002] In the food processing industry, sausage casings are a core material for meat product packaging, and their surface quality directly affects the product's safety, shelf life, and appearance. Currently, the detection of surface defects in sausage casings mainly relies on two methods: one is traditional manual visual inspection, where operators observe the surface of the casing for defects such as holes, wrinkles, and impurities; the other is early semi-automatic inspection equipment, which uses simple image acquisition and threshold segmentation technology to achieve preliminary defect identification.

[0003] However, with the increase in sausage casing production rates, the diversification of materials, and the stringency of defect detection standards, the aforementioned detection methods have gradually exposed many technical shortcomings. For example, manual visual inspection is easily affected by personnel fatigue and subjective judgment differences, making it difficult to identify minute defects; early image detection systems used fixed threshold segmentation and single feature extraction, which could not adapt to the optical characteristics of different sausage casing materials and were sensitive to changes in lighting and noise interference, resulting in poor defect identification accuracy; the light intensity in the sausage casing production environment is prone to fluctuation, and traditional detection equipment lacks a lighting equalization adjustment mechanism, resulting in uneven image brightness; at the same time, surface friction of sausage casings and equipment vibration can easily generate image noise, and existing filtering methods mostly use fixed windows, which cannot dynamically adapt to noise distribution, affecting the defect feature extraction effect; early systems only extracted single-dimensional features such as grayscale or morphology, which is difficult to comprehensively represent the differences between different types of defects (holes, wrinkles, impurities); and the lack of redundant feature screening can easily lead to decision bias in the discrimination model due to invalid features; existing detection systems mostly use fixed discrimination thresholds, which cannot be dynamically adjusted in real time by combining sausage casing material, image quality, feature matching degree, etc., resulting in insufficient adaptability to different working conditions and different defect types.

[0004] Therefore, there is an urgent need for an image recognition-based system for identifying defects on the surface of sausage casings. Summary of the Invention

[0005] To overcome the aforementioned deficiencies of the prior art, the present invention provides an image recognition-based sausage casing surface defect identification system to solve the problems existing in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a sausage casing surface defect identification system based on image recognition, characterized in that it includes an image acquisition module, an image preprocessing module, a multi-dimensional feature extraction module, a defect discrimination module, and a result output module connected in sequence;

[0007] The image acquisition module is used to acquire raw image datasets of the sausage casing surface and output them to the image preprocessing module;

[0008] The image preprocessing module is used to perform illumination equalization and noise suppression on the original image dataset and output a standardized preprocessed image dataset.

[0009] The multi-dimensional feature extraction module is used to extract texture, morphology and grayscale features from the standardized preprocessed image dataset, and generate a fused feature vector dataset after iterative optimization.

[0010] The defect discrimination module is used to determine the type of surface defect of sausage casing based on the fused feature vector dataset, combined with a preset benchmark feature library and dynamic threshold, and output the discrimination result dataset; the result output module is used to generate a standardized inspection report and equipment control signals based on the discrimination result dataset.

[0011] The technical effects and advantages of this invention are as follows:

[0012] 1. This invention employs a multi-dimensional feature extraction strategy, integrating texture features based on the gray-level co-occurrence matrix, morphological features from morphological operations, and gray-level features of defect areas to comprehensively characterize the essential differences in defects. It improves feature recognition by filtering redundant features through a feature similarity matrix and optimizing feature effectiveness based on a standard defect set. Simultaneously, it constructs a feature feedback-type dynamic threshold calculation model, dynamically adjusting the threshold based on the casing material coefficient, image noise standard deviation, and feature matching degree to adapt to different materials and working conditions.

[0013] 2. This invention utilizes an adaptive illumination-noise collaborative correction mathematical model, employing initial illumination compensation and secondary correction via noise feedback to achieve synergistic optimization of illumination equalization and noise suppression; the dynamic windowed mean-value filtering model dynamically adjusts the window size (3≤w≤41) based on the noise standard deviation, preserving defect details while reducing noise;

[0014] 3. This invention covers three core feature categories: texture (contrast, energy, entropy, correlation), morphology (area, roundness, aspect ratio), and grayscale (mean, variance, skewness). It can accurately distinguish different defect types such as holes, wrinkles, and impurities. Through two iterative optimizations (redundant feature filtering + feature validity verification), redundant features with a similarity ≥ 0.7 are eliminated, ensuring that the retained features match the standard defect set with a degree ≥ 0.8, thus improving the model's decision-making efficiency.

[0015] 4. The dynamic threshold of this invention integrates the characteristics of sausage casing material, image quality parameters (noise standard deviation), and feature matching degree. It calculates the base threshold using the L2 norm and undergoes double calibration, enabling real-time adaptation to different sausage casing materials, defect levels, and production conditions, thus avoiding the limitations of fixed thresholds. Attached Figure Description

[0016] Figure 1 This is a block diagram of the overall structure of the present invention;

[0017] Figure 2 This is a schematic diagram of the image preprocessing process of the present invention;

[0018] Figure 3 This is a flowchart of the multi-dimensional feature extraction and iterative optimization process of the present invention;

[0019] Figure 4 This is a flowchart of the defect discrimination logic and dynamic threshold calculation of the present invention;

[0020] Figure 5 This is a schematic diagram of defect candidate region segmentation and feature extraction according to the present invention. Detailed Implementation

[0021] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. In addition, the forms of the various structures described in the following embodiments are merely illustrative. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] Reference Figure 1-5 The present invention provides a sausage casing surface defect identification system based on image recognition, comprising an image acquisition module, an image preprocessing module, a multi-dimensional feature extraction module, a defect discrimination module and a result output module connected in sequence.

[0023] The image acquisition module is used to acquire raw image datasets of sausage casing surfaces and output them to the image preprocessing module. The raw image dataset includes surface grayscale image data of sausage casings of different materials (collagen casings, cellulose casings) under different production conditions, encompassing four scenes: defect-free, porous, wrinkled, and impurity-laden. The image resolution is 4096×2048 pixels, and the grayscale depth is 8 bits. This module consists of a line scan camera, a ring-shaped adjustable LED light source, a servo-controlled uniform speed conveying platform, and a high-speed image buffer unit. The parameters and matching logic of each component are as follows:

[0024] Linear Scan Camera: A monochrome linear scan camera with a 4096-pixel array size, a pixel size of 14μm×14μm, a spectral response range of 400-700nm, and a dynamic range ≥60dB is selected. It is arranged perpendicularly to the conveyor platform, with the optical axis perpendicular to the sausage casing surface at a distance of 300mm±5mm. The frame rate and conveying speed are strictly matched using the following formula: ,in: Camera frame rate (unit: fps). The speed of the transmission platform (unit: m / s). The image pixel resolution (unit: μm / pixel) must meet the following requirements. (Camera maximum frame rate threshold);

[0025] Ring-shaped adjustable LED light source: inner diameter 80mm, outer diameter 120mm, beam angle 120°, color temperature 5500K±500K, light intensity adjustment range 100-2000 lux, distance between the light source and the sausage casing surface 150mm±5mm. The actual light intensity on the sausage casing surface is collected by a light sensor (accuracy ±1 lux) and fed back to the light source drive module to achieve closed-loop adjustment of light uniformity, ensuring that the light intensity fluctuation in any area of ​​the sausage casing surface is ≤±5%.

[0026] Servo-controlled uniform speed conveying platform: It adopts ball screw drive, with a conveying speed adjustment range of 0.5-3m / s, speed fluctuation ≤±0.01m / s, positioning accuracy ±0.1mm, and the platform surface is covered with anti-static rubber pad (2mm thick) to avoid static electricity adsorption of impurities caused by sausage casing friction.

[0027] High-speed image caching unit: Cache capacity ≥16GB, read / write speed ≥1GB / s, supports RAW format image storage, cache latency ≤1ms, used for real-time storage of raw image data acquired by line scan camera, providing a continuous, frame-free image data source for subsequent preprocessing modules.

[0028] The image preprocessing module is used to input the raw image dataset output by the image acquisition module into the adaptive illumination-noise co-correction mathematical model and the dynamic window mid-value filtering model, and output a standardized preprocessed image dataset. The raw image dataset includes grayscale image data of different regions of the sausage casing surface under different illumination conditions. The standardized preprocessed image dataset includes standardized grayscale image data after illumination equalization and noise suppression. The image grayscale values ​​are mapped to the [0, 255] interval and can be directly used for subsequent feature extraction. Its principle lies in achieving image enhancement through fine adjustment of the image pixel grayscale values. The core model formula and processing flow are as follows:

[0029] The adaptive illumination-noise co-correction mathematical model achieves synergistic optimization of illumination equalization and noise suppression through two coefficient calculations. The core formula system of the model is as follows:

[0030] Initial illumination compensation coefficient calculation: First, calculate the original image... (size , The image width in pixels. Grayscale statistics are performed on the image height (in pixels). The core statistical formula is:

[0031] ;

[0032] ;

[0033] in The mean gray level of the original image. Set the standard deviation of the original image's grayscale; set the mean grayscale value of the target image under standard illumination. (Dynamic range adapted to 8-bit grayscale images) and target standard deviation (Based on the optimal grayscale dispersion statistically derived from a large number of qualified sausage casing images), the initial illumination compensation coefficient is calculated using the following formula:

[0034] ;

[0035] in: (Minimum value, used to avoid) When the denominator approaches zero, the denominator becomes zero. The horizontal pixel coordinates of the image (range 1~M). The image's vertical pixel coordinates (range 1~N) are used to adjust the original image pixel by pixel using initial coefficients, resulting in a preliminary illumination-equalized image. The formula is adjusted as follows:

[0036] ;

[0037] in To ensure rounding, the adjusted grayscale value is an integer (0~255).

[0038] Among them, it must meet the following requirements. When the value exceeds the range, the boundary value is used (0 if less than 0, 255 if greater than 255).

[0039] Noise feedback correction: Calculated using the 3×3 neighborhood gray-level gradient method. noise standard deviation The formula is as follows:

[0040] ;

[0041] ;

[0042] in For pixels The 3×3 neighborhood, The mean gray level of the neighborhood; where The initial noise standard deviation of the illumination equalization image is used; the initial compensation coefficients are then corrected a second time based on the noise intensity, and a preset ideal noise standard deviation is introduced. (Based on the statistical calibration of grayscale noise distribution of 500 sets of noise-free standard sausage casing images, ensuring the basic noise level covering different sausage casing materials), the final compensation coefficient formula is as follows:

[0043] ;

[0044] in As the noise correction factor, when When the correction factor is less than 1, the compensation coefficient is reduced to suppress noise amplification; when At this time, the correction factor is ≥0.8187 to ensure the illumination compensation effect; the original image is then adjusted a second time using the final coefficients to obtain the illumination-noise co-optimized image. Adjust the formula:

[0045] ;

[0046] in When the value exceeds the range, the boundary value is used (0 if less than 0, 255 if greater than 255).

[0047] Dynamic window value filtering model: Based on collaborative image optimization The noise distribution is calculated, and its noise standard deviation is determined. (Calculation method is the same as formula) Dynamically adjust the filter window size; core formula:

[0048] ;

[0049] in For floor operations, The filter window size is an odd number, and satisfies the following conditions: (To avoid loss of image details due to excessively large windows), if the value exceeds 41, then... ;right Perform pixel-by-pixel dynamic window mid-value filtering, and the filtered image The pixel grayscale value is the corresponding The median value of all pixel grayscale values ​​in the neighborhood after sorting.

[0050] Gray-level normalization model: This model applies gray-level normalization to the denoised image. The grayscale values ​​are linearly mapped to the [0, 255] interval, as shown in the following formula:

[0051] ;

[0052] in for The minimum grayscale value, for Maximum grayscale value; when When the image has no grayscale change, normalize the preprocessed image. (Intermediate grayscale values); after normalization, a standardized preprocessed image is obtained. This is used for subsequent feature extraction;

[0053] The multi-dimensional feature extraction module is used to input the standardized preprocessed image dataset output by the image preprocessing module into the basic feature extraction model and the feature iterative optimization model, and output a fused feature vector dataset. The standardized preprocessed image dataset is standardized image data that has undergone illumination correction, noise reduction, and grayscale normalization. The fused feature vector dataset is high-discrimination feature data that integrates three core features: texture, morphology, and grayscale, and can be directly input into the defect discrimination module for comparison and analysis. It achieves a comprehensive representation of defect information through the basic feature extraction model and the feature iterative optimization model. The core formula system and extraction process are as follows:

[0054] Basic feature extraction model: from preprocessed images The three basic features extracted are texture, shape, and grayscale. The core calculation formulas for each feature are as follows:

[0055] Texture feature extraction model (based on Gray-Level Co-occurrence Matrix (GLCM)): First, The grayscale level is quantized to 16 levels, and the quantization formula is:

[0056] ;

[0057] in For quantized grayscale values; construct neighborhood distances Pixels, orientation 4 gray-level co-occurrence matrices , , Matrix element probability formula:

[0058] ;

[0059] in for Gray value in direction and The number of pixel pairs, The total number of pixel pairs in this direction; the average gray-level co-occurrence matrix is ​​obtained by averaging the matrices in the four directions. ,based on The four core texture feature parameters are calculated using the following formula:

[0060] Contrast : ;

[0061] energy : ;

[0062] entropy : ;

[0063] Correlation : ;

[0064] in (avoid (When logarithms are not meaningful). , The grayscale mean is... , The grayscale standard deviation is used; the four texture feature parameters are combined to form a texture feature set. ;

[0065] Morphological feature extraction model: First, the Otsu automatic thresholding method is used to extract morphological features. Threshold segmentation is performed to obtain candidate defect regions. , Otsu threshold To traverse gray levels Inter-class variance Maximum value, splitting formula:

[0066] ;

[0067] in The image is a segmented binary image, with the white area 255 representing candidate defect regions. ;right Morphological operations (erosion followed by dilation) are performed to remove small noise regions, based on the processed... The three core morphological feature parameters are calculated using the following formula:

[0068] area : ;

[0069] Circularity : ;

[0070] Aspect Ratio : ;

[0071] in Defect area Total number of pixels; The perimeter of the defect region is calculated using the 8-neighborhood chain code method. ; Let be the length of the longer side of the smallest bounding rectangle of the defect region. For the shorter side length; the three morphological feature parameters are combined to form a morphological feature set. ;

[0072] Gray-scale feature extraction model: targeting defect candidate regions The three core grayscale feature parameters are calculated using the following formula:

[0073] Gray mean : ;

[0074] Gray variance : ;

[0075] grayscale skewness : ;

[0076] The definitions of each parameter are the same as before; the three gray-level feature parameters are combined to form a gray-level feature set. ;

[0077] Feature Iterative Optimization Model: Based on three basic feature sets, a feature similarity matrix is ​​constructed. Redundant features are iteratively filtered out and effective features are strengthened to generate a fused feature vector. The core formula system and steps are as follows:

[0078] First iteration (redundant feature filtering): Construct a 10×10 cross-similarity matrix (Texture features 4 + Shape features 3 + Grayscale features 3), Matrix element cosine similarity formula:

[0079] ;

[0080] in (100 sets of sample features of different defect types were selected for similarity calculation) For the first The first group of samples eigenvalues For the first The first group of samples Each feature value; for each feature Take the maximum similarity between it and the other 9 features. Set a similarity threshold (The feature similarity threshold) The correlation distribution is determined by analyzing the features. Specifically, an initial feature set of at least 200 samples covering all defect types is extracted. The cosine similarity between each pair of features is calculated, and a distribution histogram is plotted. Typically, this distribution exhibits two peaks: the first peak represents irrelevant features (low similarity), and the second peak represents highly correlated (potentially redundant) features (high similarity). A value near the trough between two peaks should be selected as a preferred embodiment. Based on the analysis of the samples, this trough is located between 0.65 and 0.75. This invention selects 0.7 as the implementation method. At this threshold, redundant features can be effectively removed while retaining valid information. Features (non-redundant features), remove The features (redundant features) are used to obtain the feature set after the first optimization. ;

[0081] Second iteration (feature effectiveness optimization): Constructing a standard defect feature set (Obtained by taking the average value of features from 1000 sets of various defect samples), calculate the feature set after the first optimization. The matching degree, formula:

[0082] ;

[0083] in for Feature dimensions, for The 1 eigenvalue, for The 1 eigenvalue, Set matching threshold (The feature matching threshold) The accuracy is determined by balancing the false positive rate and the false negative rate. Specifically, on a representative test set, the system's recognition accuracy under different Match thresholds is calculated, and performance curves are plotted. A preferred embodiment should be a value selected near the plateau or inflection point of the performance curve. Experiments show that when... Within the range of 0.75 to 0.85, the overall system performance (F1 score) remains at a high level of over 95% (this invention selects 0.8 as the implementation method). Based on image quality parameters Adjust the feature extraction neighborhood range, and adjust the coefficient formula:

[0084] ;

[0085] in For floor operations, The standard deviation of the noise level is set to the ideal noise level; the GLCM neighborhood distance for texture feature extraction is adjusted to... The neighborhood range for grayscale feature extraction is adjusted to Pixels; based on the adjusted neighborhood range, basic features are re-extracted, the feature set is updated, and the matching degree is recalculated. ;like If the iteration stops, then stop.

[0086] The fusion feature generation model concatenates the three feature sets after final iteration and optimization in the order of "texture-morphology-grayscale". Before concatenation, each feature is normalized in the [0,1] interval. The normalization formula is as follows:

[0087] ;

[0088] in These are the original eigenvalues. This is the minimum value of this feature among 1000 samples. The maximum value is obtained; after concatenation, the fused feature vector is obtained. ;

[0089] The defect discrimination module is used to input the fused feature vector dataset output by the multi-dimensional feature extraction module into the feature feedback dynamic threshold calculation model and the comprehensive defect discrimination model, and output a defect discrimination result dataset. The fused feature vector dataset is standardized vector data integrating texture, shape, and grayscale features. The defect discrimination result dataset includes five categories of discrimination results: no defects, hole defects, wrinkle defects, impurity defects, and suspected defects, along with corresponding core parameters (noise standard deviation, feature matching degree, and dynamic threshold). The core formula system and discrimination process are as follows:

[0090] Benchmark Feature Library Construction: Benchmark feature libraries were constructed for different casing materials (collagen casing, cellulose casing). The specific steps are as follows:

[0091] S1 Sample Collection: 500 sets of defect-free samples, 300 sets of pore defect samples, 300 sets of wrinkle defect samples, and 300 sets of impurity defect samples are collected for each material. The sample collection conditions are consistent with the actual detection conditions, specifically, sample image collection and processing are carried out under the same image acquisition module hardware parameters (including camera, light source, platform speed) and the same image preprocessing process.

[0092] S2 Feature Extraction: For each group of sample images, perform standardized preprocessing and iterative feature optimization in sequence to extract the fused feature vector;

[0093] S3 benchmark calculation: The mean value of the fused feature vectors of similar samples is taken to obtain the defect-free benchmark features. Compared with the three types of defect benchmark characteristics (holes) (Folds) (Impurities), forming a benchmark feature library; among which, the standard defect feature set , The baseline feature library is obtained by taking the average value of the fused feature vectors of the above 1000 groups of various defect samples; the baseline feature library needs to be stored in the solid-state drive of the industrial control computer, supporting read and write speeds ≥100MB / s;

[0094] Feature-feedback dynamic threshold calculation model: This model calculates the dynamic threshold by combining sausage casing material characteristics, image quality parameters, and feature matching degree. The core formula system is as follows:

[0095] Basic threshold calculation: Introducing the casing material coefficient (The material coefficient α is used to compensate for the differences in the basic optical properties of different casing materials. Its value is inversely proportional to the average reflectivity of the material; that is, the lower the reflectivity of the material, the smaller the α value should be to enhance the sensitivity of defect signals. As a preferred embodiment, taking cellulose casing with high reflectivity as the benchmark (assuming α = 0.92 for cellulose casing), for collagen casing with a reflectivity of approximately 92%, the coefficient α can be set to 0.83 to 0.87 accordingly. In this invention, 0.85 is used.) Calculate the defect-free baseline features Minimum value of the three types of defect benchmark characteristics (Comparison based on feature vector magnitude), basic threshold formula:

[0096] ;

[0097] in The L2 norm (vector magnitude) is calculated using the following formula:

[0098] ;

[0099] in For the feature vector dimension, for The 1 eigenvalue, for The One eigenvalue;

[0100] Threshold calibration: Combined with the final noise standard deviation output by the image preprocessing module. Iterative matching degree with the features output by the feature extraction module The basic threshold is calibrated a second time, and the final dynamic threshold formula is:

[0101] ;

[0102] in For the ideal noise standard deviation, Image quality correction factor. This is a feature validity correction factor; the calibration process enables feedback adjustment of the threshold by the results of the preceding model, so that the threshold dynamically adapts to the current image quality and feature validity.

[0103] Comprehensive Defect Discrimination Model: The final defect discrimination result is jointly determined by feature distance, image quality parameters, and feature matching degree. The core discrimination formula and logic are as follows:

[0104] First verification: Calculate the fused feature vector of the sample to be detected. With defect-free benchmark features Euclidean distance:

[0105] ;

[0106] in The fused feature vector of the sample to be detected is the first... eigenvalues; if and If it is determined to be defect-free; but A second verification is required; if It proceeds directly to the second level of verification;

[0107] Second verification: Calculate the fused feature vector of the sample to be detected. Euclidean distances from the three types of defect baseline features:

[0108] ;

[0109] Take the minimum distance The corresponding defect type is the candidate defect type; the judgment is based on the feature matching degree:

[0110] ;

[0111] like If the defect is found to be valid, it is classified as a defect of the corresponding type; if it is not valid, it is classified as a suspected defect and requires manual re-inspection.

[0112] The result output module is used to input the defect discrimination result dataset output by the defect discrimination module to the standardized report generation unit and the control signal output unit, and output a standardized inspection report and equipment control signals. The defect discrimination result dataset includes core information such as discrimination result type, defect location, and defect level. The standardized inspection report is structured data in XML format, and the control signal is a 24VDC switching signal. Specific implementation details are as follows:

[0113] Inspection report generation: Stored in XML format, containing the following fields: inspection batch (format: YYYYMMDDXX, e.g., 2026010501), inspection time (accurate to milliseconds, format: YYYY-MM-DDHH:MM:SS.ms), casing material (collagen / cellulose), inspection length (unit: m, calculated as conveyor speed × inspection time), number of defects, and individual defect information (including defect pixel coordinates). Actual location (Defect type, defect level); where the actual location of the defect is calculated through pixel coordinate mapping, and the mapping formula is: In the formula The pixel coordinates are the center of the defect region. Image pixel resolution (unit: μm / pixel). The actual location of the defect (unit: m); the defect level is based on the defect area. Classification: Level 1 Pixels, secondary Pixels, Level 3 Pixel;

[0114] Control signal output: PLC (Programmable Logic Controller) is used to output switch signals. The signal voltage is 24VDC and the signal duration is 100ms. When unqualified casings (including defective or suspected defective casings) are detected, a rejection signal is output to the pneumatic sorting device. The response time of the sorting device is ≤50ms and the sorting accuracy is ±5mm.

[0115] Data Upload: The test report is uploaded to the production management system via Ethernet. The communication protocol is TCP / IP, the data transmission rate is ≥10Mbps, and the upload delay is ≤1s.

[0116] The present invention will be further described in detail below with reference to specific embodiments:

[0117] Example 1: Defect detection in collagen casing

[0118] Image Acquisition: After system startup, the conveyor platform speed is initially set to 2 m / s (v=2 m / s), and the line scan camera resolution is set to 2 μm / pixel (d=2 μm / pixel). Based on the matching relationship between camera frame rate, conveyor speed, and pixel resolution, the system automatically calculates that the camera frame rate should be set to 1000 fps (f=1000 fps). Subsequently, the ring light source is started with an initial illumination intensity of 800 lux. The illumination feedback adjustment unit monitors and maintains the uniformity of illumination on the sausage casing surface in real time, ensuring that the illumination fluctuation is ≤±5%. Under these conditions, the line scan camera acquires a raw image I0 with a resolution of 4096×2048, and the acquired data is stored in the high-speed image buffer unit in real time.

[0119] Image preprocessing: After the raw image dataset is fed into the image preprocessing module, it is first processed by an adaptive illumination-noise co-correction mathematical model. The system first calculates the original image... gray mean with standard deviation Subsequently, based on preset standard illumination target parameters... The initial compensation coefficients are obtained using the initial compensation coefficient calculation formula in the adaptive illumination-noise collaborative correction mathematical model. The initial coefficient is approximately 0.95. After adjusting the original image pixel-by-pixel using this initial coefficient to obtain a preliminary illumination-equalized image, the system further calculates the noise standard deviation of this image. Based on this noise parameter, an ideal noise standard deviation is introduced. The final compensation coefficient is obtained through the final compensation coefficient calculation formula in the model. The value is approximately 0.152. After further adjustment of the original image, the illumination-noise co-optimized image is obtained. Based on this, the system calculates... noise standard deviation Based on the window size calculation logic of the dynamic window mid-range filtering model, the filtering window size is determined to be 21×21. ,right Median filtering is performed to obtain the denoised image. Finally, the system calculates... minimum gray value With the maximum gray value The calculation formula of the gray-level normalization model is used to... The gray values ​​are linearly mapped to the [0,255] interval to obtain a standardized preprocessed image dataset, which will be used for subsequent feature extraction.

[0120] Feature Extraction: After the standardized preprocessed image dataset is input into the multi-dimensional feature extraction module, the system first quantizes the gray levels of the standardized preprocessed image to 16 levels. Then, it constructs a gray-level co-occurrence matrix with a neighborhood distance of 1 pixel and four directions (0°, 45°, 90°, 135°). Based on this matrix, the basic texture feature set is calculated. (Including four parameters: contrast, energy, entropy, and correlation). Simultaneously, the system uses the Otsu automatic thresholding method to obtain the segmentation threshold. Thresholding segmentation is performed on the standardized preprocessed image, and small noise regions are removed by morphological opening operation to obtain defect candidate regions. Then, the set of basic morphological features is calculated. (Including three parameters: area, roundness, and aspect ratio). For candidate defect regions. The system further calculates the grayscale basic feature set. (Including three parameters: grayscale mean, variance, and skewness). Next, the system constructs a 10×10 cross-similarity matrix, and calculates that the maximum similarity of each feature is less than a preset threshold. Therefore, all basic features are retained, resulting in the feature set after the first optimization. Subsequently, the system invokes the standard defect feature set for collagen casings. (The mean value of the fused feature vectors from 1000 sets of collagen casing defect samples is obtained, specifically [120, 0.03, 3.3, 0.75, 190, 0.68, 0.45, 82, 11, -0.25]). The matching degree calculation formula in the mathematical model is optimized using multi-dimensional features iteratively to obtain the current optimized feature set and... The matching degree is approximately 0.88, which is greater than or equal to the preset threshold. Therefore, the iterative optimization was stopped. Finally, the system normalized the optimized three feature sets within the [0,1] interval and directly concatenated them in the order of "texture-morphology-grayscale" to generate a fused feature vector dataset. This dataset will be passed to the defect detection module.

[0121] Defect Identification: After the fused feature vector dataset enters the defect identification module, the system first calls the baseline feature library of collagen casings (including baseline features for no defects and three types of defects), including material coefficients. Defect-free benchmark features The three types of defect baseline characteristics are as follows:

[0122] Hole ;

[0123] folds ;

[0124] impurities The system calculates the minimum modulus feature among the three types of defect baseline features as follows: The basic threshold is obtained by using the basic threshold calculation formula of the feature feedback dynamic threshold discrimination model. The noise standard deviation is combined with the output of the image preprocessing module. The matching degree output by the feature extraction module is 0.88. Using the final dynamic threshold calculation formula of the model, the final threshold is obtained. After entering the comprehensive judgment process, in the first verification stage, the system calculates the fused feature vector of the sample to be detected and the defect-free baseline features. Euclidean distance This value is greater than the final threshold. Therefore, it proceeds to the second verification stage. In the second verification stage, the system calculates the Euclidean distance between the fused feature vector of the sample to be detected and the baseline features of the three types of defects, respectively. , , minimum distance This corresponds to the hole defect. Further verification is needed. Therefore, the system determines that the sample to be tested has a hole defect.

[0125] Output Results: After defect identification, the output module automatically generates a standardized inspection report. The report records the batch number as 2026010501, the casing material as collagen, and the inspection length calculated based on the conveyor speed and inspection time. For identified hole defects, the system calculates the actual location of the defect using a mapping formula between pixel coordinates and actual position. (Corresponding pixel coordinates) Based on the defect area, the defect level was determined to be Level 2. Simultaneously, the system outputs a 24VDC switch control signal to the pneumatic sorting device, with a signal duration of 100ms, triggering the rejection of non-conforming casings. Finally, the inspection report is uploaded to the production management system via TCP / IP protocol, with a data transmission rate ≥10Mbps and an upload latency ≤1s.

[0126] The foregoing describes exemplary embodiments of this application. It should be understood that the above exemplary embodiments are not restrictive but illustrative, and the scope of protection of this application is not limited thereto. It should be understood that those skilled in the art can make modifications and variations to the embodiments of this application without departing from the spirit and scope of this application, and such modifications and variations should be within the scope of protection of this application.

Claims

1. A sausage casing surface defect identification system based on image recognition, characterized in that, It includes an image acquisition module, an image preprocessing module, a multi-dimensional feature extraction module, a defect discrimination module, and a result output module, which are connected in sequence. The image acquisition module is used to acquire raw image datasets of the sausage casing surface and output them to the image preprocessing module; The image preprocessing module is used to perform illumination equalization and noise suppression on the original image dataset and output a standardized preprocessed image dataset. The multi-dimensional feature extraction module is used to extract texture, morphology and grayscale features from the standardized preprocessed image dataset, and generate a fused feature vector dataset after iterative optimization. The defect discrimination module is used to determine the type of surface defect of sausage casing based on the fused feature vector dataset, combined with a preset benchmark feature library and dynamic threshold, and output the discrimination result dataset; the result output module is used to generate a standardized inspection report and equipment control signals based on the discrimination result dataset.

2. The image recognition-based sausage casing surface defect identification system according to claim 1, characterized in that, The image acquisition module includes a line scan camera, a ring-shaped adjustable LED light source, a servo-controlled uniform speed transmission platform, and a high-speed image buffer unit. The line scan camera is arranged vertically to the transmission platform, and its frame rate is matched with the transmission platform speed and image pixel resolution. The ring-shaped adjustable LED light source is equipped with a light sensor and a driving module to achieve closed-loop adjustment of the uniformity of light on the surface of the sausage casing. The high-speed image cache unit is used to store the raw image data acquired by the line scan camera in real time.

3. The image recognition-based sausage casing surface defect identification system according to claim 1, characterized in that, The image preprocessing module includes an adaptive illumination-noise co-correction mathematical model and a dynamic window value filtering model; The adaptive illumination-noise co-correction mathematical model calculates the initial illumination compensation coefficient and combines it with noise feedback correction to output an illumination-noise co-optimized image. The dynamic window median filtering model dynamically adjusts the size of the filtering window based on the noise standard deviation of the collaboratively optimized image. After median filtering, the image is then normalized to obtain the standardized preprocessed image dataset.

4. The image recognition-based sausage casing surface defect identification system according to claim 1, characterized in that, The multi-dimensional feature extraction module includes a basic feature extraction model and a feature iterative optimization model; The basic feature extraction model is used to extract texture features based on the gray-level co-occurrence matrix, morphological features based on image segmentation and morphological operations, and gray-level features based on defect candidate regions from the preprocessed image, respectively. The feature iterative optimization model filters redundant features by constructing a feature similarity matrix and optimizes feature effectiveness based on the matching degree with the standard defect feature set, ultimately generating a normalized fusion feature vector dataset.

5. The image recognition-based sausage casing surface defect identification system according to claim 1, characterized in that, The defect discrimination module includes a feature feedback-type dynamic threshold calculation model and a comprehensive defect discrimination model; The feature feedback-type dynamic threshold calculation model combines the casing material coefficient, image noise standard deviation, and feature matching degree to calculate the dynamic discrimination threshold; The comprehensive defect discrimination model calculates the Euclidean distance between the fused feature vector of the sample to be detected and the baseline features of no defects and various defects in the baseline feature library, and performs multiple verifications based on the dynamic discrimination threshold and feature matching degree to output the final defect discrimination result.

6. The image recognition-based sausage casing surface defect identification system according to claim 1, characterized in that, The result output module includes a standardized report generation unit and a control signal output unit; The standardized report generation unit is used to generate an XML-formatted inspection report that includes the inspection batch, time, material, defect location, type, and grade. The control signal output unit is used to output a switching control signal to the actuator when a defect or suspected defect is identified.