An image recognition-based meat appearance quality evaluation system
Patent Information
- Application Number
- CN202611514110.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]提供一种能够针对性分离多光谱图层特征并有效补偿局部色偏的肉食品外观质量评估方案,同时建立脂肪纹理网络与肌肉纤维走向网络之间的拓扑量度,以拓扑相似度直接表征外观质量,克服人工评估主观性强和现有图像方法对色偏敏感、纹理表征不全面的缺陷
通过光谱分离模块采用多个窄带滤波卷积核对初始外观图像进行卷积,获得不同光谱响应的单特征光谱图层,使得肉食品表面在不同波长下的反射特性被独立分解。差异筛选模块计算各单特征光谱图层与基准模板图层在灰度直方图上的动态时间弯曲距离,筛选出特征差异超过第一波动阈值的目标特征光谱图层。该筛选机制仅对发生显著偏移的光谱图层进行后续校正,避免对全图层的无差别处理引入新的计算误差。将筛选出的目标特征光谱图层映射至三维颜色空间生成点云,并在该空间内以区域生长方式分割为多个颜色分区点云块,计算每个点云块中心点与基准点云块中心点之间的色偏矢量。该矢量精确描述了不同颜色分区在空间中的非均匀偏移方向和幅度。将色偏矢量作为扰动项转换为反向色偏平移矩阵,对目标特征光谱图层的原始像素坐标矩阵执行反向仿射变换,通过坐标偏移补偿实现逐分区的色偏校正,生成校正后特征图层。该校正方式从颜色空间几何关系出发,对各个局部颜色分区进行独立平移,能够消除因光源色温不均造成的复杂空间异构色偏,避免全局白平衡方法在处理局部色差时产生的纹理错位和灰度阶损失。校正后特征图层与未被筛选的剩余单特征光谱图层按差异化权重进行逐像素融合,对校正图层赋予更高的第一融合权重值,对剩余图层分配较低的第二融合权重值,从而在保留原生光谱特征信息的同时强化校正区域的颜色还原度,生成无偏色的标准评估图像。
Smart Images

Figure CN123015561A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to a meat product appearance quality assessment system based on image recognition. Background Technology
[0002] Appearance quality assessment of meat products is a crucial step in meat processing and quality control, directly impacting product grading and economic value. Current technologies generally rely on manual visual inspection or simple feature analysis methods based on ordinary color images. Manual visual inspection is affected by the inspector's subjective experience, visual fatigue, and lighting conditions, making consistency and repeatability difficult to guarantee. Evaluation methods based on ordinary images often employ global features such as overall color moments and gray-level co-occurrence matrices, failing to effectively separate subtle appearance differences across different spectral bands and lacking targeted characterization methods for the texture distribution characteristics of fat and muscle tissue. In actual production environments, due to fluctuations in the color temperature of lighting sources and differences in the response of image acquisition equipment, acquired meat product images generally exhibit color casts. Existing methods typically use global white balance or histogram equalization for correction, ignoring non-uniform color shifts across different spectral bands. This leads to color distortion or texture aliasing in localized areas of the corrected image, significantly reducing the reliability of quality criteria based on texture networks. Meanwhile, most existing texture analysis methods treat fat texture and muscle fiber as independent features for separate evaluation, and then derive a comprehensive score through artificially set weights. This fails to reflect the inherent constraints of the spatial arrangement between the fat texture network and the muscle fiber orientation network, resulting in insufficient consistency between the quality score and the actual sensory experience. Therefore, how to accurately correct local color casts in meat product images and quantify the spatial topological relationship between the two tissue networks (fat and muscle) is a technical problem that urgently needs to be solved in the automatic evaluation of meat product appearance quality. Summary of the Invention
[0003] This paper proposes a meat product appearance quality assessment scheme that can selectively separate multispectral layer features and effectively compensate for local color shifts. At the same time, it establishes a topological measure between the fat texture network and the muscle fiber orientation network, and directly represents the appearance quality with topological similarity. This overcomes the shortcomings of strong subjectivity in manual assessment and the sensitivity of existing image methods to color shifts and incomplete texture representation.
[0004] The objective of this invention can be achieved through the following technical solutions: This invention provides a meat product appearance quality assessment system based on image recognition. The system includes a spectral separation module, a difference screening module, a color shift correction module, a weighted fusion module, and a quality scoring module. The spectral separation module acquires an initial appearance image of the meat product sample to be evaluated, performs multispectral feature separation on the initial appearance image, and generates multiple single-feature spectral layers, thereby decomposing the comprehensive appearance information into independent layers under different spectral features for targeted analysis. The difference screening module selects target feature spectral layers from the multiple single-feature spectral layers that have a feature difference value exceeding a first fluctuation threshold from a preset benchmark meat product template layer, and maps the target feature spectral layers to a three-dimensional color space to generate a target color space point cloud. Through threshold screening, local areas where color or texture deviates from the normal range can be automatically identified, providing accurate targets for subsequent correction. The color shift correction module divides the target color space point cloud into multiple color partition point cloud blocks, calculates the color shift vector between the center point of each color partition point cloud block and the center point of the corresponding benchmark point cloud block of the preset benchmark meat product template layer in the three-dimensional color space; by calculating the color shift vector using partitioning, the deviation direction and degree of different color regions can be finely characterized. The weighted fusion module uses the color shift vector as a perturbation term to perform an inverse affine transformation on the target feature spectral layer, generating a corrected feature layer. This corrected feature layer is then weighted and fused with the remaining single-feature spectral layers that were not filtered out, resulting in a standard evaluation image. By performing inverse correction and focused weighted fusion on the abnormal feature layers, the interference of color shift on the evaluation is effectively reduced while preserving the original spectral details of normal areas. The quality scoring module extracts the fat texture network and muscle fiber orientation network from the standard evaluation image, calculates the topological similarity between the fat texture network and the muscle fiber orientation network, and uses this topological similarity as the meat product appearance quality score, ensuring that the scoring results objectively reflect the symmetry and regularity of the distribution and interweaving of fat and muscle fibers.
[0005] As a preferred embodiment of the present invention, when the spectral separation module performs multispectral feature separation on the initial appearance image, it uses multiple preset narrowband filter convolution kernels to perform convolution operations on the initial appearance image to obtain multiple filter response maps; it performs non-maximum suppression on each filter response map to extract the peak response position in each filter response map; and it uses each peak response position as the center to crop a fixed-size local response region in the corresponding filter response map, and uses the local response region as the single-feature spectral layer. Through non-maximum suppression and local region cropping, the local texture unit with the strongest spectral feature response can be accurately extracted, reducing background noise interference.
[0006] As a preferred embodiment of the present invention, the difference screening module calculates the global grayscale histogram of each single-feature spectral layer when screening target feature spectral layers, and simultaneously calculates the reference grayscale histogram of the reference spectral layer at the corresponding spectral position in the preset reference meat food template layer; it uses a dynamic time-bending distance algorithm to calculate the histogram distance between the global grayscale histogram and the reference grayscale histogram, and uses the histogram distance as the feature difference value; it compares the feature difference value with a first fluctuation threshold, and when the feature difference value is greater than the first fluctuation threshold, the corresponding single-feature spectral layer is marked as the target feature spectral layer. The dynamic time-bending distance algorithm can tolerate minor misalignments in grayscale distribution patterns, more accurately measure the true distribution differences between histograms, and improve the robustness of abnormal layer screening.
[0007] As a preferred embodiment of the present invention, when mapping the target feature spectral layer to a three-dimensional color space, the pixel coordinates and pixel grayscale values of each pixel in the target feature spectral layer are read. The horizontal coordinate of the pixel coordinates is used as the first dimension coordinate of the three-dimensional color space, the vertical coordinate of the pixel coordinates is used as the second dimension coordinate of the three-dimensional color space, and the pixel grayscale value is used as the third dimension coordinate of the three-dimensional color space. Coordinate mapping is performed on all pixels in the target feature spectral layer to generate multiple three-dimensional spatial coordinate points. The set of all three-dimensional spatial coordinate points is the target color space point cloud. In this way, the spectral grayscale and spatial position carried by the two-dimensional image are unified into a three-dimensional space, which facilitates color partitioning based on spatial distance.
[0008] As a preferred embodiment of the present invention, when dividing the target color space point cloud into multiple color partition point cloud blocks, the centroid coordinates of all three-dimensional spatial coordinate points in the target color space point cloud are calculated. Using the centroid coordinates as seed points, a region growing algorithm is used to traverse adjacent three-dimensional spatial coordinate points in the target color space point cloud. During the traversal, when the Euclidean distance between the current three-dimensional spatial coordinate point and the seed point is less than a preset distance threshold, the current three-dimensional spatial coordinate point is assigned to the current color partition point cloud block, and the current three-dimensional spatial coordinate point is used as a new seed point for further growth. When the traversal is complete, all three-dimensional spatial coordinate points assigned to the current color partition point cloud block are removed from the target color space point cloud, and the centroid calculation and region growing operations are repeated until the target color space point cloud is empty, thus obtaining the multiple color partition point cloud blocks. This segmentation strategy can adaptively group pixels with similar colors and spatial positions into the same partition, avoiding errors caused by manually setting the number of categories.
[0009] As a preferred embodiment of the present invention, when performing an inverse affine transformation on the target feature spectral layer using the color shift vector as a perturbation term, the original pixel coordinate matrix of the target feature spectral layer is constructed, and the color shift vector is converted into an inverse color shift translation matrix; the original pixel coordinate matrix and the inverse color shift translation matrix are subtracted to obtain the offset pixel coordinate matrix; each offset coordinate in the offset pixel coordinate matrix is mapped back to the original pixel position of the target feature spectral layer, and the pixel grayscale value corresponding to each offset coordinate is calculated using a bilinear interpolation algorithm to generate the corrected feature layer. The inverse affine transformation can offset the pixel value position shift caused by color shift, and bilinear interpolation ensures the grayscale continuity and smoothness of the corrected layer.
[0010] As a preferred embodiment of the present invention, when weighted fusing the corrected feature layer with the remaining unselected single-feature spectral layers, a first fusing weight value is assigned to the corrected feature layer, and a second fusing weight value is assigned to each unselected remaining single-feature spectral layer, wherein the first fusing weight value is greater than any of the second fusing weight values. At each pixel position of the corrected feature layer, the pixel grayscale value of the corrected feature layer is multiplied by the first fusing weight value to obtain a weighted corrected grayscale value. Simultaneously, at the same pixel position, the pixel grayscale value of each remaining single-feature spectral layer is multiplied by the corresponding second fusing weight value and summed to obtain a weighted remaining grayscale total value. The weighted corrected grayscale value is added to the weighted remaining grayscale total value to obtain a fused grayscale value. The fused grayscale values at all pixel positions are combined to form the standard evaluation image. Assigning higher weight to the corrected layer makes the fused standard evaluation image highlight the repaired abnormal areas and weaken the influence of uncorrected deviations, resulting in an evaluation basis that more accurately reflects the true appearance of the flesh.
[0011] As a preferred embodiment of the present invention, when extracting the fat texture network and muscle fiber orientation network from the standard evaluation image, a multi-directional Gabor filter bank is used to filter the standard evaluation image to obtain multiple directional filtering responses. The direction with the highest energy is extracted from the multiple directional filtering responses as the primary texture direction, and the direction perpendicular to the primary texture direction is extracted as the secondary texture direction. Connected regions in the standard evaluation image that extend continuously along the primary texture direction and have a gray value higher than a first gray value threshold are labeled as the fat texture network, and connected regions in the standard evaluation image that extend continuously along the secondary texture direction and have a gray value lower than a second gray value threshold are labeled as the muscle fiber orientation network. By utilizing the multi-directional selectivity and gray value threshold constraint of Gabor filtering, the two texture components of fat and muscle can be effectively separated. Preferably, the first gray value threshold and the second gray value threshold are dynamically calculated based on the gray value distribution of the standard evaluation image using the adaptive Otsu method, so that the segmentation threshold self-matches the global brightness characteristics of the image, improving the automation and accuracy of texture extraction.
[0012] As a preferred embodiment of the present invention, when calculating the topological similarity between the fat texture network and the muscle fiber orientation network, all connected regions in the fat texture network are extracted using a skeletonization method to obtain a fat texture skeleton map. Simultaneously, all connected regions in the muscle fiber orientation network are extracted using a skeletonization method to obtain a muscle fiber skeleton map. The orientation angle of each skeleton branch in the fat texture skeleton map is calculated to obtain a first angular distribution histogram. Simultaneously, the orientation angle of each skeleton branch in the muscle fiber skeleton map is calculated to obtain a second angular distribution histogram. The distribution distance between the first and second angular distribution histograms is calculated using the Bach distance algorithm, and the reciprocal of this distribution distance is used as the topological similarity. Skeletonization extraction and angular distribution histograms can capture the overall orientation pattern of the texture network. The reciprocal of the Bach distance is used as a similarity measure, resulting in a higher topological similarity, more uniform texture interweaving, and better appearance quality of the meat products.
[0013] As a preferred embodiment of the present invention, after using the topological similarity as the appearance quality score of meat products, the system further performs the following operations: acquiring the historical topological similarity of multiple historical meat product samples and the actual quality grade label corresponding to each historical meat product sample; forming a training dataset by combining the historical topological similarity of the multiple historical meat product samples and the actual quality grade label; training a support vector regression model using the training dataset to obtain a quality grade mapping model; inputting the topological similarity into the quality grade mapping model, outputting the corresponding predicted quality grade, and using the predicted quality grade as the final appearance quality evaluation result. By converting the similarity score into a quality grade with practical business meaning through the mapping model, the evaluation results become more intuitive and suitable for hierarchical management. Furthermore, the support vector regression model has good generalization ability under small sample conditions, ensuring the stability of the grade prediction.
[0014] The beneficial effects of this invention are: The initial appearance image is convolved using multiple narrowband filter convolution kernels by a spectral separation module to obtain single-feature spectral layers with different spectral responses, allowing the reflectance characteristics of the meat surface at different wavelengths to be independently decomposed. A difference filtering module calculates the dynamic temporal curvature distance between each single-feature spectral layer and the baseline template layer on the grayscale histogram, filtering out target feature spectral layers whose feature differences exceed a first fluctuation threshold. This filtering mechanism only performs subsequent correction on spectral layers with significant shifts, avoiding the introduction of new computational errors through indiscriminate processing of the entire layer. The filtered target feature spectral layers are mapped to a 3D color space to generate point clouds, and then divided into multiple color partition point cloud blocks within this space using a region growing method. The color shift vector between the center point of each point cloud block and the center point of the baseline point cloud block is calculated. This vector accurately describes the non-uniform shift direction and magnitude of different color partitions in space. The color shift vector is converted into an inverse color shift translation matrix as a perturbation term, and an inverse affine transformation is performed on the original pixel coordinate matrix of the target feature spectral layer. Color shift correction is achieved partition-by-part through coordinate shift compensation, generating a corrected feature layer. This correction method starts from the geometric relationship of color space and independently translates each local color zone. This eliminates complex spatial heterogeneous color shifts caused by uneven light source color temperature, avoiding texture misalignment and grayscale loss that occur when global white balance methods deal with local color differences. After correction, the feature layer is fused pixel-by-pixel with the remaining unfiltered single-feature spectral layers according to differential weights. A higher first fusion weight value is assigned to the correction layer, and a lower second fusion weight value is assigned to the remaining layers. This enhances the color reproduction of the correction area while preserving the original spectral feature information, generating a standard evaluation image without color cast.
[0015] On the standard evaluation image, a multi-directional Gabor filter bank is used to extract texture directions, determining the primary and secondary texture directions. High-grayscale connected regions along the primary texture direction are labeled as fat texture networks, and low-grayscale connected regions along the secondary texture directions are labeled as muscle fiber orientation networks. An adaptive Otsu method is used to dynamically set the first and second grayscale thresholds, allowing the definition of fat and muscle regions to adapt to the overall grayscale distribution of the image, avoiding the failure of fixed thresholds across different batches of samples. Skeletonization extraction is performed on the fat texture network and muscle fiber orientation network to obtain corresponding skeleton maps. The orientation angle of each skeleton branch is calculated, constructing a first and second angular distribution histogram. The distribution distance between the two angular distribution histograms is quantified using Bach distance, and the reciprocal of the distribution distance is used as the topological similarity. When the fat texture skeleton and the muscle fiber skeleton exhibit a regular intersecting or parallel relationship in direction, the angular distributions highly overlap, the Bach distance approaches zero, and the higher the topological similarity, the more uniform and orderly the marbling structure of the meat product, corresponding to a higher appearance quality grade. This topological metric starts from the distribution similarity of the geometric orientation of the network skeleton, directly reflecting the spatial arrangement characteristics of fat and muscle tissue. It provides a quality criterion independent of absolute color and single-class texture density, and has natural robustness to illumination and slight deformation. The high consistency between the output score and the sensory evaluation results is strongly guaranteed. Attached Figure Description
[0016] The invention will now be further described with reference to the accompanying drawings.
[0017] Figure 1 This is a schematic diagram of a meat product appearance quality assessment system based on image recognition. Figure 2 This is a flowchart of the point cloud generation and segmentation process for the color shift correction module; Figure 3 This is the flowchart of the inverse affine transformation of the weighted fusion module; Figure 4 This is a flowchart for evaluating the appearance quality of meat products based on the topological similarity between fat texture and muscle fiber. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] See Figure 1This invention provides a meat product appearance quality assessment system based on image recognition, including a spectral separation module, a difference screening module, a color shift correction module, a weighted fusion module, and a quality scoring module. The spectral separation module acquires the initial appearance image of the meat product sample to be evaluated, performs multispectral feature separation on the initial appearance image, and generates multiple single-feature spectral layers. The difference screening module selects target feature spectral layers from the multiple single-feature spectral layers whose feature difference value exceeds a first fluctuation threshold with a preset benchmark meat product template layer, maps the target feature spectral layers to a three-dimensional color space, and generates a target color space point cloud. The color shift correction module divides the target color space point cloud into multiple color partition point cloud blocks, calculates the color shift vector between the center point of each color partition point cloud block and the center point of the corresponding benchmark point cloud block of the preset benchmark meat product template layer in the three-dimensional color space. The weighted fusion module uses the color shift vector as a perturbation term to perform an inverse affine transformation on the target feature spectral layers, generating a corrected feature layer, and weightedly fuses the corrected feature layer with the remaining single-feature spectral layers that were not selected to obtain a standard evaluation image. The quality scoring module extracts the fat texture network and muscle fiber orientation network from the standard evaluation image, calculates the topological similarity between the fat texture network and the muscle fiber orientation network, and uses the topological similarity as the appearance quality score of meat products.
[0020] In practice, the spectral separation module uses multiple preset narrowband filter convolution kernels to perform convolution operations on the initial appearance images of the meat samples to be evaluated, obtaining multiple filtered response maps. The number and center wavelength of the multiple narrowband filter convolution kernels cover the visible to near-infrared bands. Each narrowband filter convolution kernel is 7×7 pixels in size, with a convolution stride of 1 pixel. The convolution operation maintains the size of the initial appearance image unchanged.
[0021] For each filtered response map, the spectral separation module performs non-maximum suppression (NMS) to extract the peak response locations. The NMS operation works as follows: For each pixel in the filtered response map, within a 3×3 pixel neighborhood centered on the current location, the response value at the current location is compared with the response values at all other locations in the neighborhood. If the response value at the current location is greater than or equal to the response values at all other locations in the neighborhood, the current location is retained as the peak response location; otherwise, the response value at the current location is set to zero. After this process, all locations with non-zero response values constitute the set of peak response locations in the filtered response map.
[0022] After obtaining the peak response locations, the spectral separation module uses each peak response location as the center to extract a fixed-size local response region from the corresponding filtered response map. This extracted local response region is then used as a single-feature spectral layer. The fixed size is preset to 64×64 pixels, based on the fact that the statistical average of the typical fat texture width and muscle fiber spacing in the meat sample being evaluated is approximately 30 to 50 pixels. A 64×64 pixel local response region is sufficient to completely cover the texture period while avoiding the introduction of excessive background interference. If a peak response location is close to the edge of the filtered response map, making it impossible to extract a complete 64×64 pixel region centered at that location, then that peak response location is discarded, and no corresponding single-feature spectral layer is generated.
[0023] In the above manner, multiple single-feature spectral layers are generated from the initial appearance image. Each single-feature spectral layer corresponds to the spectral response feature of a narrowband filter convolution kernel at a certain local peak.
[0024] In the difference screening module, target feature spectral layers whose feature difference values exceed a first fluctuation threshold from multiple single-feature spectral layers are selected. The preset benchmark meat template layer is generated and stored from pre-collected standard qualified meat samples through the same spectral separation process, and contains a benchmark spectral layer corresponding to the center wavelength of each narrowband filter convolution kernel.
[0025] For the filtering process, the difference filtering module calculates the global gray-level histogram for each single-feature spectral layer. The global gray-level histogram is constructed by counting the frequency of each gray level in the range of 0 to 255 for all pixels in the single-feature spectral layer, forming a one-dimensional sequence of length 256. The value of each element is grayscale. The number of pixels appearing in a single-feature spectral layer.
[0026] Simultaneously, the difference filtering module obtains the baseline spectral layer from the preset baseline meat product template layer, which has the same center wavelength as the narrowband filter convolution kernel corresponding to the current single-feature spectral layer, and calculates the baseline gray-level histogram of the baseline spectral layer. The construction method of the baseline gray-level histogram is the same as that of the global gray-level histogram. The frequency of each gray level in the baseline spectral layer is counted for all pixels in the gray-level range of 0 to 255, forming a one-dimensional sequence of length 256.
[0027] The difference filtering module uses the dynamic time-bending distance algorithm to calculate the histogram distance between the global gray-level histogram of a single-feature spectral layer and the reference gray-level histogram of the reference spectral layer, and uses this histogram distance as the feature difference value. In the implementation of the dynamic time-bending distance algorithm, the sequence of global gray-level histograms is represented as follows: ,in This indicates the gray level corresponding to the global grayscale histogram. The frequency value, The value range is from 1 to 256; the sequence of the baseline grayscale histogram is represented as... ,in This indicates the gray level corresponding to the reference gray level in the gray histogram. The frequency value, The value of is in the range of 1 to 256. Construct a cumulative distance matrix with 256 rows and 256 columns. The value of in the matrix is... Line number Column elements The following formula is used for recursive calculation:
[0028] in, This is the index of the global grayscale histogram sequence, with a value ranging from 2 to 256; The index of the baseline grayscale histogram sequence, with a value range of 2 to 256; Index in the global grayscale histogram sequence The corresponding frequency value; Index in the baseline grayscale histogram sequence The corresponding frequency value; The th in the cumulative distance matrix Line number The element values of the column; The th in the cumulative distance matrix Line number The element values of the column; The th in the cumulative distance matrix Line number The element values of the column; This represents taking the minimum value among three adjacent matrix elements. The initialization condition for the cumulative distance matrix is: ;for From 2 to 256, ;for From 2 to 256, After the recursive calculation is completed, take... The square root of the value is used as the histogram distance between the global grayscale histogram and the reference grayscale histogram, i.e., the feature difference value.
[0029] The difference screening module compares the calculated feature difference values with a first fluctuation threshold. The first fluctuation threshold is determined as follows: initial appearance images of a large number of pre-collected standard qualified meat product samples are obtained, the feature difference values of their corresponding single feature spectral layers are calculated, and the mean of all feature difference values is calculated. and standard deviation Set the first fluctuation threshold to When the feature difference value of a single feature spectral layer is greater than the first fluctuation threshold, it indicates that the color distribution of the single feature spectral layer deviates significantly from the standard reference, and the difference screening module marks the single feature spectral layer as the target feature spectral layer; when the feature difference value is less than or equal to the first fluctuation threshold, the single feature spectral layer is not marked as the target feature spectral layer and is reserved for subsequent weighted fusion.
[0030] In specific implementation, please refer to Figure 2 The color shift correction module acquires the target feature spectral layer output by the difference filtering module and performs a mapping operation from two-dimensional image space to three-dimensional color space on the target feature spectral layer to generate a target color space point cloud. The target feature spectral layer is a filtered local response region with known width and height pixel dimensions, and its width is denoted as... 1 pixel, height denoted as _ ... 1 pixel.
[0031] The color cast correction module reads the pixel coordinates and grayscale value of each pixel in the target feature spectral layer. The pixel coordinates are defined with the top-left corner of the target feature spectral layer as the origin, with the horizontal axis pointing to the right and the vertical axis pointing downwards. For pixels in the target feature spectral layer at position... Column, No. The pixel of the row, its x-coordinate is denoted as The ordinate of the pixel coordinates is labeled as ,in The value range is 1 to integers, The value range is 1 to An integer. The pixel grayscale value of this pixel is denoted as . , The value of is an integer ranging from 0 to 255.
[0032] The color shift correction module will adjust the x-coordinate of the pixel coordinates. As the first dimension of the coordinate system in the three-dimensional color space, the ordinate of the pixel coordinates As the second dimension of the three-dimensional color space, the pixel grayscale value As the third dimension of the three-dimensional color space, a three-dimensional spatial coordinate point is constructed, whose coordinates are represented as follows: The above coordinate mapping is performed on each pixel in the target feature spectral layer, generating a total of... The set of all three-dimensional spatial coordinate points constitutes the target color space point cloud. .
[0033] The color cast correction module obtains the point cloud of the target color space. Then, the target color space point cloud The point cloud is divided into multiple color partitions. During the segmentation process, the color shift correction module first calculates the target color space point cloud. The centroid coordinates of all three-dimensional spatial coordinate points. The centroid coordinates are calculated by statistically analyzing the target color space point cloud. The total number of coordinate points in three-dimensional space is denoted as Summing the first-dimensional coordinates of all three-dimensional spatial points, then dividing the sum by... Obtain the first-dimensional coordinates of the centroid Summing the second-dimensional coordinates of all three-dimensional coordinate points, then dividing the sum by... Obtain the second-dimensional coordinates of the centroid Summing the third-dimensional coordinates of all three-dimensional coordinate points, then dividing the sum by... Obtain the third-dimensional coordinates of the centroid The centroid coordinates are .
[0034] The color shift correction module uses centroid coordinates As seed points, a region growing algorithm is used to grow the point cloud in the target color space. The algorithm iterates through adjacent 3D spatial coordinate points. The adjacency relationship in the region growing algorithm is defined as follows: for any two 3D spatial coordinate points... and If the three-dimensional spatial coordinates point First dimension coordinates with three-dimensional spatial coordinates First dimension coordinates The absolute value of the difference does not exceed 1, and the second dimension coordinates and The absolute value of the difference does not exceed 1, and the third dimension coordinates and If the absolute value of the difference does not exceed 1, then the three-dimensional spatial coordinates of the point are... regarded as a three-dimensional spatial coordinate point The adjacent points.
[0035] During the traversal, the color shift correction module starts from the seed point and examines the target color space point cloud. The 3D spatial coordinates of the point cloud that have not yet been assigned to any color partition. For the currently examined 3D spatial coordinates, the color shift correction module calculates the Euclidean distance between the current 3D spatial coordinates and the seed point. The formula for calculating the Euclidean distance is:
[0036] in, This represents the Euclidean distance between the current 3D spatial coordinate point and the seed point; This represents the first-dimensional coordinate of the current three-dimensional spatial point; This represents the second-dimensional coordinate of the current three-dimensional spatial point; This represents the third-dimensional coordinate of the current three-dimensional spatial point; Represents the first-dimensional coordinates of the seed point; Represents the second-dimensional coordinates of the seed point; This represents the third-dimensional coordinate of the seed point.
[0037] When the calculated Euclidean distance When the distance is less than a preset threshold, the color shift correction module assigns the current 3D spatial coordinate point to the current color partition point cloud and uses it as a new seed point to continue growth. The preset distance threshold is set to 5.0, based on the following principle: in 3D color space, a change of 5 units in coordinate value can distinguish color gradations caused by the interface between local fat and muscle without over-segmenting pixels within the same fat region. If the Euclidean distance between the current 3D spatial coordinate point and the seed point is less than the threshold value, the color shift correction module will assign the current 3D spatial coordinate point to the current color partition point point cloud and use it as a new seed point to continue growth. If the distance is greater than or equal to the preset distance threshold, the current 3D spatial coordinate point will not be assigned to the current color partition point cloud.
[0038] After a growth cycle has traversed all adjacent 3D spatial coordinates that satisfy the distance condition using the current seed point, the color shift correction module selects 3D spatial coordinates that have not been used as seed points from the points already included in the current color partition point cloud block, and repeats the growth process as new seed points until no new 3D spatial coordinates meet the inclusion condition. At this point, the growth of the current color partition point cloud block is complete, and the color shift correction module removes all 3D spatial coordinates already included in the current color partition point cloud block from the target color space point cloud. Removed from the middle.
[0039] The color cast correction module corrects the remaining target color space point cloud after removal. Repeat the centroid calculation and region growing operations: recalculate the centroid coordinates of the remaining 3D space coordinates, start a new round of region growing with the new centroid coordinates as the seed point, obtain the next color partition point cloud patch, and transfer the 3D space coordinates contained in this color partition point cloud patch from the target color space point cloud. Remove from the target color space point cloud. Repeat the above process until the target color space point cloud is reached. It no longer contains any three-dimensional spatial coordinate points, i.e., the target color space point cloud. If left empty, multiple color partition point cloud blocks are ultimately obtained. Each color partition point cloud block corresponds to a pixel region in the target feature spectral layer that exhibits clustering characteristics in both spatial location and grayscale value.
[0040] In specific implementation, please refer to Figure 3The weighted fusion module obtains the color cast vector generated by the color cast correction module. Using the color cast vector as a perturbation term, it performs an inverse affine transformation on the target feature spectral layer to generate the corrected feature layer. The target feature spectral layer is a two-dimensional image with a defined pixel width and pixel height, and its pixel width is denoted as... Each pixel has a height denoted as . 1 pixel.
[0041] The weighted fusion module constructs the original pixel coordinate matrix of the target feature spectral layer. The original pixel coordinate matrix is a... OK A matrix of columns, where the column is located at the th column. Line number The elements of the column are a two-dimensional vector. ,in Indicating the first spectral layer of target features Line number The original x-coordinates of the column pixels, The value is ; Indicating the first spectral layer of target features Line number The original ordinates of the column pixels, The value is . The value range is 1 to integers, The value range is 1 to Integers.
[0042] The weighted fusion module converts the color cast vector into an inverse color cast translation matrix. The color cast vector is a vector containing three components, corresponding to the offsets in the first, second, and third dimensions of the three-dimensional color space. Let the color cast vector be denoted as... .in This refers to the color shift component in the first-dimensional coordinate direction of the three-dimensional color space. This refers to the color shift component in the second-dimensional coordinate direction of the three-dimensional color space. This refers to the color shift component in the third-dimensional coordinate direction of the three-dimensional color space. The weighted fusion module extracts the first two components from the color shift vector. and Inverting these two components yields the inverse color shift amount. The inverse color shift translation matrix is a matrix with the same size as the original pixel coordinate matrix. OK In the column matrix, the value of each element in the reverse color shift translation matrix is a two-dimensional vector. That is, the translation amount at all positions in the reverse color shift translation matrix remains constant.
[0043] The weighted fusion module performs a matrix subtraction operation between the original pixel coordinate matrix and the inverse color shift translation matrix to obtain the offset pixel coordinate matrix. The matrix subtraction operation is performed as follows: For From 1 to Each of the possible values, and From 1 to For each value of , the in the original pixel coordinate matrix Line number Two-dimensional vector of column elements The first in the inverse color shift translation matrix Line number Two-dimensional vector of column elements By subtracting each component, we obtain the pixel coordinate matrix after offset. Line number Column elements The calculation process is expressed as follows:
[0044] in, Represents the pixel coordinate matrix after offset. Line number The x-coordinate value of the column element; Represents the pixel coordinate matrix after offset. Line number The y-coordinate value of the column element; The first pixel in the original pixel coordinate matrix Line number The original x-coordinate of the column element; The first pixel in the original pixel coordinate matrix Line number The original y-coordinate of the column element; The color shift component is the first-dimensional coordinate direction of the color shift vector in the three-dimensional color space; This represents the color shift component of the color shift vector in the second dimension of the three-dimensional color space. The offset x-coordinate... The value is determined by the original x-coordinate. Add color cast component We obtain the offset ordinate. The value is determined by the original ordinate. Add color cast component get.
[0045] The weighted fusion module maps each offset coordinate in the offset pixel coordinate matrix back to the original pixel position in the target feature spectral layer. The original pixel position in the target feature spectral layer is defined as having an x-coordinate value of 1 to... The integer value of the ordinate is 1 to 1. All discrete grid points of integers. Because... and The result after superposition of color-shift components may be a non-integer coordinate. The coordinates will not usually fall exactly at integer intersections of the original pixel grid. Therefore, the weighted fusion module calculates the pixel grayscale value corresponding to each offset coordinate using a bilinear interpolation algorithm.
[0046] The specific implementation of the bilinear interpolation algorithm is as follows: for the offset coordinates Take its x-coordinate The integer part is The decimal part is Take its ordinate The integer part is The decimal part is Decimal part and The values of all values are in the range [0,1). Locate four adjacent original integer pixel positions in the target feature spectral layer: and Read the pixel grayscale values at these four locations respectively, and record them as follows: and When any adjacent integer pixel position exceeds the boundary of the target feature spectral layer, the pixel grayscale value at that position is set to 0. The weighted fusion module first performs linear interpolation on the grayscale value along the horizontal axis, and then performs linear interpolation on the grayscale value along the vertical axis to obtain the pixel grayscale value corresponding to the offset coordinate. The calculated pixel grayscale value is then filled into the corrected feature image. Line number The pixel position of the column. For all From 1 to , From 1 to For each set of values, the above interpolation calculation is performed to obtain the complete corrected feature layer. The size of the corrected feature layer is the same as the size of the target feature spectral layer. OK List.
[0047] In practice, the weighted fusion module acquires the corrected feature layer and the remaining unfiltered single-feature spectral layers output by the difference filtering module. It then performs a weighted fusion of the corrected feature layer and all remaining single-feature spectral layers to obtain the standard evaluation image. The number of remaining single-feature spectral layers is denoted as... , For integers greater than or equal to zero, when When the value is zero, the weighted fusion process only involves the corrected feature layer.
[0048] The weighted fusion module assigns a first fusion weight value to the corrected feature layer and a second fusion weight value to each remaining single-feature spectral layer that was not filtered out. The first fusion weight value is denoted as... , The value is set to 0.6, based on the following: After color shift correction, the color distribution of the corrected feature layer matches the preset benchmark meat template layer better than the remaining single-feature spectral layers. Giving the corrected feature layer a higher weight makes the fusion result closer to the standard appearance. Through weighted scanning experiments on multiple groups of samples with known quality levels, when… When the value is 0.6, the structural similarity between the fused image and the standard reference image reaches its highest value. The allocation method for the second fusion weight value is as follows: for the first... The remaining single-feature spectral layers, whose second fusion weight value is denoted as... ,in For the index of the remaining single-feature spectral layers, The value range is 1 to Integers. All second fusion weight values satisfy the normalization condition, i.e. Each second fusion weight value The allocation rule is: calculate the first... The feature difference values of the remaining single-feature spectral layers are calculated using the same dynamic time-bending distance algorithm as the difference filtering module. The total difference value is obtained by summing the feature difference values of all remaining single-feature spectral layers. ; will the first The second fusion weight value of the remaining single-feature spectral layers Set as the first The feature difference value of each remaining single-feature spectral layer divided by the total difference value Multiply the quotient by 0.4. When equal to zero, The value is 1.0.
[0049] The weighted blending module performs a weighted blending operation at each pixel location of the corrected feature layer. The pixel width of the corrected feature layer is denoted as... Each pixel has a height denoted as . For the corrected feature layer located at the pixel... Line number The pixel positions of the columns, where The value range is 1 to integers, The value range is 1 to The integer, the weighted fusion module reads the corrected feature layer at the pixel position. The pixel grayscale value at that location is denoted as The weighted fusion module combines pixel grayscale values. Multiply by the first fusion weight value The weighted corrected grayscale value is obtained and denoted as .
[0050] At the same pixel position At that point, the weighted fusion module reads the pixel grayscale value at that pixel location for each remaining single-feature spectral layer. For the first... The remaining single-feature spectral layer at pixel position The pixel grayscale value at that location is denoted as The weighted fusion module multiplies the pixel grayscale value of each remaining single-feature spectral layer by its corresponding second fusion weight value, and sums all products to obtain the weighted total remaining grayscale value. The calculation process is expressed as follows:
[0051] in, Indicates pixel position The weighted remaining gray value at the location; This represents the total number of remaining single-feature spectral layers; This is the index of the remaining single-feature spectral layer, with a value ranging from 1 to... Integers; For the first The second fusion weight value corresponding to each remaining single-feature spectral layer; For the first The remaining single-feature spectral layer at pixel position The pixel grayscale value at that location. When When equal to zero, The value is 0.
[0052] The weighted fusion module will weight and correct the grayscale values. With weighted residual gray total value Add them together to get the pixel position. The blended grayscale value at the location is denoted as Blending grayscale values The value may exceed the range of 0 to 255. The weighted fusion module performs a cropping operation on the fused grayscale value: if the fused grayscale value If the value is greater than 255, the grayscale value will be merged. Set to 255; if blending grayscale values If the value is less than 0, the grayscale values will be merged. Set to 0.
[0053] The weighted fusion module performs the above weighted fusion operation on all pixel positions in the corrected feature layer, traversing... From 1 to , From 1 to For each pixel location, the fused grayscale value at all pixel locations is obtained. These fused grayscale values are then arranged and combined according to their corresponding pixel locations to form a standard evaluation image. The pixel width of the standard evaluation image is [missing information]. pixels, pixel height is Each pixel is the same size as the corrected feature layer.
[0054] In specific implementation, please refer to Figure 4 The quality scoring module obtains the standard evaluation image output by the weighted fusion module, and extracts the fat texture network and muscle fiber orientation network from the standard evaluation image. The standard evaluation image is a single-channel grayscale image, and its pixel width is denoted as [missing information]. Each pixel has a height denoted as . 1 pixel.
[0055] The quality scoring module uses a multi-directional Gabor filter bank to filter the standard evaluation image. The multi-directional Gabor filter bank includes... Gabor filters in different directions, The value is 8, and it is evenly distributed in 8 directions. to Within the radius of curvature, the interval between adjacent directions Radius. The kernel size of each Gabor filter is set to 21×21 pixels, the sine wave wavelength to 8 pixels, the phase offset to 0 radians, the standard deviation of the Gaussian envelope to 5 pixels, and the ellipticity to 1.0. For each pixel location in the standard evaluation image, convolution operations are performed using the eight Gabor filters to obtain eight directional filter response maps, each with the same size as the standard evaluation image.
[0056] The quality scoring module extracts the direction with the highest energy from eight directional filter response maps as the main texture direction. For each directional filter response map, the energy value is calculated by summing the squares of the response values at all pixel positions in that direction. The total energy of the eight directions is compared, and the direction corresponding to the maximum total energy is selected as the main texture direction. The angle of the main texture direction is denoted as . Simultaneously, the direction perpendicular to the main texture direction is extracted as the secondary texture direction, and the angle of the secondary texture direction is... ,like Exceeding In radians, subtract it. radians to maintain to Within the range.
[0057] The quality scoring module determines a first grayscale threshold and a second grayscale threshold. These thresholds are dynamically calculated based on the grayscale distribution of the standard evaluation image using the adaptive Otsu method. The implementation process of the adaptive Otsu method involves: statistically analyzing the grayscale histogram of the standard evaluation image, with grayscale levels ranging from 0 to 255, and calculating the probability of each grayscale level occurring. , The grayscale level is an integer ranging from 0 to 255. Let's define a grayscale level... , An integer between 0 and 255, indicating that the grayscale value in the standard evaluation image is less than or equal to... The pixels are classified as Class 1, with gray values greater than [value missing]. The pixels in the first category are classified as second category. The proportion of pixels in the first category is calculated. and average gray level The proportion of the second type of pixels and average gray level and the overall average gray level of the entire image. For each Calculate the inter-class variance Traversal From 0 to 255, find the value that makes the inter-class variance... The largest The value will be at this time. The first grayscale threshold is used as the input image. The second grayscale threshold is calculated in the same way as the first, using the adaptive Otsu method, but the input image is a standard evaluation image smoothed by a 3×3 pixel mean filter to avoid underestimating the threshold due to subtle grayscale fluctuations within the muscle fiber region. The quality scoring module records the first grayscale threshold as... The second grayscale threshold is denoted as .
[0058] The quality scoring module selects images from the standard evaluation image that extend continuously along the main texture direction and have gray values higher than the first gray value threshold. The connected regions are labeled as a fat texture network. The specific labeling method is as follows: the standard evaluation image is binarized, and grayscale values higher than [a certain value] are labeled as fat texture networks. Pixels with a certain value are set as foreground pixels, and the rest are set as background pixels; connected component analysis is performed on the foreground pixels, using an 8-connected neighborhood definition; for each connected region, the extension direction of the connected region is calculated, which is determined by the principal axis direction of the connected region. The principal axis direction is obtained by performing principal component analysis on the coordinates of all pixels within the connected region; if the principal axis direction of the connected region coincides with the main texture direction... The included angle is less than If the radius is radian, the connected region is preserved and marked as part of the fat texture network; otherwise, the foreground pixels of the connected region are set as background pixels.
[0059] The quality scoring module selects images from the standard evaluation image that extend continuously along the subtexture direction and have gray values below the second gray threshold. Connected regions are labeled as muscle fiber orientation networks. The specific labeling method is as follows: the standard evaluation image is binarized, and grayscale values lower than [a certain value] are labeled as [a certain value]. Pixels with a certain value are set as foreground pixels, and the rest are set as background pixels; connected component analysis is performed on the foreground pixels, using an 8-connected neighborhood definition; for each connected region, the extension direction of the connected region is calculated, and if the principal axis direction of the connected region coincides with the secondary texture direction... The included angle is less than If the radius is radian, the connected region is preserved and marked as part of the muscle fiber orientation network; otherwise, the foreground pixels of the connected region are set as background pixels.
[0060] After obtaining the fat texture network and muscle fiber orientation network, the quality scoring module calculates the topological similarity between them. During the calculation, the module extracts the skeletonization of all connected regions in the fat texture network to obtain a fat texture skeleton map. The skeletonization extraction uses the Zhang-Suen thinning algorithm to iteratively erode the fat texture network until the line width formed by all foreground pixels is a single pixel, thus obtaining the fat texture skeleton map. Simultaneously, the quality scoring module extracts the skeletonization of all connected regions in the muscle fiber orientation network to obtain a muscle fiber skeleton map, using the same algorithm as the fat texture network.
[0061] The quality scoring module calculates the orientation angle of each skeleton branch in the fat texture skeleton map. A skeleton branch is defined as a continuous curve segment in the skeleton map that starts from an endpoint or intersection and travels along the skeleton path until it encounters another endpoint or intersection. The quality scoring module iterates through all skeleton pixels in the fat texture skeleton map, detecting endpoints and intersections. An endpoint is a pixel with one skeleton pixel in its 8-neighborhood, and an intersection is a pixel with more than two skeleton pixels in its 8-neighborhood. Starting from the starting point of each skeleton branch, the average tangential angle of each point on the branch is calculated as the orientation angle of that skeleton branch. The value range of the orientation angle is... to Radius. Adjust the direction and angle of all skeletal branches according to... The intervals in radians are statistically analyzed into an angular distribution histogram, with a total of 36 intervals, resulting in the first angular distribution histogram. The first angular distribution histogram is denoted as... The frequency of each interval is , The value is an integer from 1 to 36. The quality scoring module processes the muscle fiber skeleton diagram in the same way to obtain the second angular distribution histogram, and the first angular distribution histogram is denoted as the first angular distribution histogram. The frequency of each interval is Normalize the histogram for each angular distribution by dividing the frequency of each interval by the sum of the frequencies of all intervals in the histogram, so that each interval value of the histogram represents a probability.
[0062] The quality scoring module uses the Bach distance algorithm to calculate the distribution distance between the first-angle distribution histogram and the second-angle distribution histogram. The formula for calculating the Bach distance is:
[0063] in, This represents the distribution distance between the first angular distribution histogram and the second angular distribution histogram; This is the interval index of the angular distribution histogram, with values ranging from 1 to 36; The first angular distribution histogram is the... Normalized frequency values for each interval; For the second angular distribution histogram, the first... Normalized frequency values for each interval; Indicates to and Find the square root of the product of the two.
[0064] The quality scoring module will distribute distance The reciprocal of the product is used as the topological similarity, denoted as . When the distribution distance When the value approaches zero, it indicates that the two angular distributions highly overlap, and the topological similarity is... When the topological similarity approaches a maximum value, the topological similarity is... The cutoff value is set to 1000.
[0065] After using topological similarity as the appearance quality score for meat products, the system performs the following operations to output the final appearance quality assessment result. The quality scoring module obtains the historical topological similarity of multiple historical meat product samples and the corresponding actual quality level label for each historical meat product sample. The actual quality level label is manually assigned and divided into five levels: Level 1, Level 2, Level 3, Level 4, and Level 5, with corresponding numerical codes from 1 to 5. The historical topological similarity and actual quality level labels of multiple historical meat product samples are combined to form a training dataset, where each sample in the training dataset is a pair. , An index for historical meat product samples. For the first Historical topological similarity of historical meat product samples For the first The actual quality grade label value corresponding to each historical meat product sample.
[0066] The quality scoring module uses the training dataset to train the support vector regression model, obtaining a quality level mapping model. The core architecture of the support vector regression model is: using radial basis functions as the kernel function, the expression for which is: ,in For kernel function parameters, This represents the Euclidean distance between two historical topological similarities. The objective function of the support vector regression model includes a penalty coefficient. and insensitive loss interval width During training, a grid search method combined with 5-fold cross-validation was used to determine the optimal combination of hyperparameters for the support vector regression model. The search range was set as follows: penalty coefficient... exist Selected from, kernel function parameters exist Select from the middle, the width of the insensitive loss interval exist The selection process involves dividing the training dataset into five equal parts for each hyperparameter combination. Four parts are used as the training subset, and one part as the validation subset in rotation. The root mean square error (RMSE) on the validation subset is calculated, and the average of the five RMSEs is taken as the cross-validation error for that hyperparameter combination. The hyperparameter combination with the smallest cross-validation error is selected to configure the support vector regression model, which is then retrained on the entire training dataset to obtain the final quality level mapping model.
[0067] The quality scoring module will use the topological similarity of the current meat product sample to be evaluated. The input is fed into the quality grade mapping model, which outputs a continuous predicted value. This predicted value is rounded to the nearest integer and limited to the range of 1 to 5 to obtain the predicted quality grade. The predicted quality grade is then output as the final appearance quality assessment result.
[0068] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.
Claims
1. A meat product appearance quality assessment system based on image recognition, characterized in that, The system includes: The spectral separation module acquires the initial appearance image of the meat sample to be evaluated, performs multispectral feature separation on the initial appearance image, and generates multiple single-feature spectral layers. The difference filtering module filters out the target feature spectral layer from the multiple single feature spectral layers, whose feature difference value with the preset benchmark meat food template layer exceeds the first fluctuation threshold, and maps the target feature spectral layer to a three-dimensional color space to generate a target color space point cloud. The color shift correction module divides the target color space point cloud into multiple color partition point cloud blocks and calculates the color shift vector between the center point of each color partition point cloud block and the center point of the corresponding reference point cloud block of the preset reference meat template layer in the three-dimensional color space. The weighted fusion module uses the color shift vector as a perturbation term to perform an inverse affine transformation on the target feature spectral layer to generate a corrected feature layer. The corrected feature layer is then weighted and fused with the remaining single-feature spectral layers that were not selected to obtain a standard evaluation image. The quality scoring module extracts the fat texture network and muscle fiber orientation network from the standard evaluation image, calculates the topological similarity between the fat texture network and the muscle fiber orientation network, and uses the topological similarity as the appearance quality score of meat products.
2. The image recognition-based meat product appearance quality assessment system according to claim 1, characterized in that, Multispectral feature separation is performed on the initial appearance image to generate multiple single-feature spectral layers, including: The initial appearance image is convolved using multiple preset narrowband filter convolution kernels to obtain multiple filter response maps; Perform non-maximum suppression on each filtered response map to extract the peak response location in each filtered response map; Centered on each peak response location, a local response region of fixed size is extracted from the corresponding filtered response map, and the local response region is used as the single-feature spectral layer.
3. The image recognition-based meat product appearance quality assessment system according to claim 2, characterized in that, Selecting target feature spectral layers from the plurality of single-feature spectral layers whose feature difference value from the preset benchmark meat product template layer exceeds a first fluctuation threshold, including: Calculate the global grayscale histogram of each single-feature spectral layer, and simultaneously calculate the reference grayscale histogram of the reference spectral layer at the corresponding spectral position in the preset reference meat product template layer; The histogram distance between the global grayscale histogram and the reference grayscale histogram is calculated using a dynamic time bending distance algorithm, and the histogram distance is used as the feature difference value. The feature difference value is compared with the first fluctuation threshold. When the feature difference value is greater than the first fluctuation threshold, the corresponding single feature spectral layer is marked as the target feature spectral layer.
4. The image recognition-based meat product appearance quality assessment system according to claim 1, characterized in that, Mapping the target feature spectral layer onto a three-dimensional color space to generate a target color space point cloud includes: Read the pixel coordinates and pixel grayscale value of each pixel in the target feature spectrum layer, take the horizontal coordinate of the pixel coordinate as the first dimension coordinate of the three-dimensional color space, take the vertical coordinate of the pixel coordinate as the second dimension coordinate of the three-dimensional color space, and take the pixel grayscale value as the third dimension coordinate of the three-dimensional color space. Coordinate mapping is performed on all pixels in the target feature spectral layer to generate multiple three-dimensional spatial coordinate points, and the set of all three-dimensional spatial coordinate points is used as the target color space point cloud.
5. The image recognition-based meat product appearance quality assessment system according to claim 4, characterized in that, The target color space point cloud is divided into multiple color partition point cloud blocks, including: Calculate the centroid coordinates of all three-dimensional spatial coordinate points in the target color space point cloud, and use the centroid coordinates as seed points to traverse adjacent three-dimensional spatial coordinate points in the target color space point cloud using a region growing algorithm. During the traversal, when the Euclidean distance between the current 3D spatial coordinate point and the seed point is less than the preset distance threshold, the current 3D spatial coordinate point is assigned to the current color partition point cloud block, and the current 3D spatial coordinate point is used as a new seed point to continue growing. When the traversal is complete, all three-dimensional spatial coordinate points that have been assigned to the current color partition point cloud block are removed from the target color space point cloud, and the centroid calculation and region growth operations are repeated until the target color space point cloud is empty, thus obtaining the multiple color partition point cloud blocks.
6. The image recognition-based meat product appearance quality assessment system according to claim 1, characterized in that, Using the color shift vector as a perturbation term, an inverse affine transformation is performed on the target feature spectral layer to generate a corrected feature layer, including: Construct the original pixel coordinate matrix of the target feature spectral layer, and convert the color shift vector into an inverse color shift translation matrix; Perform a matrix subtraction operation between the original pixel coordinate matrix and the reverse color shift translation matrix to obtain the offset pixel coordinate matrix; Each offset coordinate in the offset pixel coordinate matrix is mapped back to the original pixel position of the target feature spectral layer, and the pixel gray value corresponding to each offset coordinate is calculated by a bilinear interpolation algorithm to generate the corrected feature layer.
7. The image recognition-based meat product appearance quality assessment system according to claim 1, characterized in that, The corrected feature layer is then weighted and fused with the remaining single-feature spectral layers that were not filtered out to obtain a standard evaluation image, including: A first fusion weight value is assigned to the corrected feature layer, and a second fusion weight value is assigned to each remaining single-feature spectral layer that was not filtered out, wherein the first fusion weight value is greater than any of the second fusion weight values; At each pixel position of the corrected feature layer, the pixel gray value of the corrected feature layer is multiplied by the first fusion weight value to obtain a weighted corrected gray value. At the same pixel position, the pixel gray value of each remaining single feature spectrum layer is multiplied by the corresponding second fusion weight value and summed to obtain a weighted remaining gray value. The weighted corrected gray value is added to the total weighted remaining gray value to obtain the fused gray value. The fused gray values at all pixel locations are combined to form the standard evaluation image.
8. The image recognition-based meat product appearance quality assessment system according to claim 1, characterized in that, Extracting the fat texture network and muscle fiber orientation network from the standard evaluation image, including: The standard evaluation image is filtered using a multi-directional Gabor filter bank to obtain multi-directional filter responses; The direction with the highest energy is extracted from the multiple directional filtering responses as the main texture direction, and the direction perpendicular to the main texture direction is extracted as the secondary texture direction. Connected regions in the standard evaluation image that extend continuously along the main texture direction and have a gray value higher than the first gray value threshold are labeled as the fat texture network, and connected regions in the standard evaluation image that extend continuously along the secondary texture direction and have a gray value lower than the second gray value threshold are labeled as the muscle fiber orientation network.
9. A meat product appearance quality assessment system based on image recognition according to claim 8, characterized in that, The first grayscale threshold and the second grayscale threshold are dynamically calculated based on the grayscale distribution of the standard evaluation image using the adaptive Otsu method.
10. A meat product appearance quality assessment system based on image recognition according to claim 8, characterized in that, Calculating the topological similarity between the fat texture network and the muscle fiber orientation network includes: All connected regions in the fat texture network are extracted using skeletal modeling to obtain a fat texture skeletal map. At the same time, all connected regions in the muscle fiber orientation network are extracted using skeletal modeling to obtain a muscle fiber skeletal map. The orientation angle of each skeletal branch of the fat texture skeleton map is calculated to obtain a first angle distribution histogram. At the same time, the orientation angle of each skeletal branch of the muscle fiber skeleton map is calculated to obtain a second angle distribution histogram. The distribution distance between the first angular distribution histogram and the second angular distribution histogram is calculated using the Bach distance algorithm, and the reciprocal of the distribution distance is used as the topological similarity.
