Automatic evaluation method for fish liver fat deposition state

By constructing an image processing workflow based on organ segmentation and color moment features, the problem of automating the assessment of fat deposition in fish livers was solved, achieving stable and interpretable assessment results applicable to aquaculture and scientific research scenarios.

CN121981978APending Publication Date: 2026-05-05国信工船(青岛)海洋科技有限公司 +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
国信工船(青岛)海洋科技有限公司
Filing Date
2026-01-11
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Current technologies for assessing fat deposition in fish livers rely on manual observation, which is highly subjective, makes it difficult to achieve automatic organ-level segmentation, and results in unstable color feature extraction. The level of automation is insufficient, and these technologies cannot meet the standardization and batch testing needs of modern aquaculture.

Method used

By constructing an image processing workflow for organ segmentation, color feature extraction, and classification, an image segmentation model is used to segment the liver, spleen, and gonadal regions, convert them to the HSV color space to calculate color moment features, and a lightweight classification model is used to determine the fat deposition status.

Benefits of technology

It achieves an objective, stable, and quantifiable assessment of the fat deposition status in fish livers, improves the standardization and consistency of the assessment, reduces the cost of model training and deployment, and is suitable for widespread application in aquaculture and scientific research scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121981978A_ABST
    Figure CN121981978A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of fish detection, in particular to an automatic evaluation method for a fish liver fat deposition state based on image segmentation and color feature analysis, and the method comprises the following steps: obtaining an image; segmenting organs; feature extraction: extracting an organ image based on the segmentation mask of the organ region, converting the organ image into an HSV color space, calculating color moment features of each channel of H, S and V, the color moment at least including a first moment, a second moment and a third moment; and fat deposition determination: inputting the color moment characteristics into a classification model to obtain a fat deposition state evaluation result of the liver, and the method can automatically identify a target organ region in an anatomical image and perform objective and quantitative evaluation on the fat deposition state of the liver based on the color characteristics with clear physical significance. By constructing an image processing flow consisting of organ segmentation, color feature extraction and classification judgment, the method can realize efficient, standardized and interpretable automatic evaluation of the fish liver fat deposition state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fish detection technology, specifically to an automated assessment method for the state of fat deposition in fish livers based on image segmentation and color feature analysis. Background Technology

[0002] With the development of large-scale and refined aquaculture, the assessment of fish liver condition has become a core aspect of aquaculture management. As a vital organ for metabolism and detoxification in fish, the degree of fat deposition in the liver is closely related to feed nutrition levels, metabolic capacity, and overall health, serving as an important indicator of fish growth and disease risk. Traditional methods for assessing liver fat deposition primarily rely on manual dissection and visual inspection, using empirical ratings based on the color, luster, and texture of the liver and accessory organs. This method has significant limitations: the assessment process depends on human experience, leading to strong subjectivity; judgment standards differ among personnel; it is difficult to develop quantifiable indicators; and it is inefficient in large-scale sample processing, failing to meet the demands of modern aquaculture for standardized, automated, and batch testing.

[0003] In recent years, with the development of image processing and computer vision technologies, the use of image analysis methods for fish tissue state detection has gradually attracted attention. However, existing research mainly focuses on disease identification, surface damage detection, or overall physiological state analysis, and there are still significant shortcomings in the automatic assessment of fish visceral tissues. Specifically: (1) Limited organ-level image segmentation capability. Many traditional methods rely on manually labeled regions or simple segmentation algorithms based on thresholds and color differences, which make it difficult to accurately distinguish tissue regions with similar shapes and colors, such as the liver, spleen, and gonads. In anatomical scenes, organ boundaries are often blurred due to interference from factors such as blood, lighting, and occlusion, resulting in low segmentation accuracy of traditional methods.

[0004] (2) Lack of feature extraction methods for liver fat deposition. Existing image analysis methods mostly rely on deep convolutional features for end-to-end learning, but these features have poor interpretability, are sensitive to the amount of training data, and are difficult to directly establish a correspondence with the physiological characteristics of fat deposition degree; at the same time, deep learning models consume high computational resources and are not suitable for deployment in real production environments. For liver fat deposition, an indicator directly related to color changes, existing methods lack a stable, lightweight image feature extraction mechanism with clear physical meaning.

[0005] (3) The automated assessment system is not yet perfect. Some studies have attempted to use deep learning to assess liver fat status, but they often rely on end-to-end training and require a large amount of labeled data; at the same time, they lack a complete pipeline design for organ segmentation, color feature analysis and classification models, and cannot balance accuracy, interpretability and deployment cost.

[0006] In summary, current technologies lack a method for accurately segmenting fish organ regions in anatomical images and performing lightweight, interpretable, and automated assessment of liver fat deposition based on physiologically significant color features. Therefore, it is necessary to provide a novel technical solution that combines organ-level image segmentation with color moment feature extraction to achieve accurate, stable, and objective automated assessment of liver fat deposition in fish. Summary of the Invention

[0007] To address the problems of existing technologies in assessing fat deposition in fish livers, such as reliance on manual observation, high subjectivity, difficulty in achieving automated organ-level segmentation, unstable color feature extraction, and insufficient automation, this invention proposes a method that can automatically identify target organ regions in anatomical images and objectively and quantitatively assess the state of fat deposition in the liver based on color features with clear physical meaning. By constructing an image processing workflow consisting of organ segmentation, color feature extraction, and classification, this invention enables efficient, standardized, and interpretable automated assessment of the state of fat deposition in fish livers.

[0008] To achieve the above objectives, the present invention provides the following technical solution: An automated method for assessing the fat deposition status of fish livers includes the following steps: S1. Image Acquisition: Acquire anatomical images of fish; S2. Organ segmentation: Input the anatomical image into the image segmentation model to segment the liver, spleen and gonadal regions, and obtain the corresponding segmentation mask. S3. Feature extraction: Extract organ images based on the segmentation mask of the organ region, convert them to the HSV color space, and calculate the color moment features of each channel of H, S, and V. The color moments include at least the first-order moment, the second-order moment, and the third-order moment. S4. Fat deposition determination: Input the color moment features into the classification model, and perform fat deposition level determination based on the color moment features to obtain the fat deposition status assessment result of the liver.

[0009] Preferably, the image segmentation step includes: identifying the liver, spleen, and gonad regions based on a convolutional network, attention mechanism, or cue-driven segmentation model to obtain corresponding region masks. The structure and weights of the segmentation model are not limited, and the segmentation models are all within the scope of semantic segmentation models known in the art.

[0010] Preferably, the segmented liver region mask is subjected to noise removal, hole filling and edge smoothing to obtain a clean liver region for subsequent color analysis.

[0011] Preferably, the liver region is converted from RGB space to HSV space, wherein the HSV space is used to enhance the ability to express color differences related to fat deposition.

[0012] Preferably, the color features include at least one of the following statistical moment features calculated based on the three channels H, S, and V: mean, first-order central tendency; variance or dispersion measure; skewness or color distribution skewness measure.

[0013] Preferably, the color features constitute a color statistical moment feature vector with at least 9 dimensions, and are used to reflect the color distribution regularity of the liver region.

[0014] Preferably, the determination of fat deposition status includes: inputting the color feature vector into a preset classification model, performing at least two-level or multi-level classification on the liver sample, and the classification result includes at least one of normal, mild, moderate or severe fat deposition.

[0015] Preferably, the classification model is an interpretable model, including but not limited to decision trees, logistic regression, K-nearest neighbors, or support vector machines.

[0016] Preferably, the classification model determines the level of liver fat deposition based on the threshold, interval division, or feature combination relationship of at least one statistical moment feature in the color feature vector.

[0017] Preferably, the image segmentation model is a cue-driven segmentation model, which generates a liver region mask based on user interaction points, boundary cues, or text cues.

[0018] This invention achieves an objective, stable, and quantifiable assessment of the fat deposition status in fish livers by constructing an automated assessment process consisting of organ segmentation, color feature extraction, and classification. It overcomes the problems of relying on human experience and poor assessment consistency in existing technologies, and provides a reliable technical path for the automated analysis of fat deposition in fish livers.

[0019] (i) Improving the stability and consistency of assessment by limiting the assessment subjects based on organ segmentation. This invention first performs organ-level segmentation of the liver region in the anatomical image during the evaluation process, ensuring that subsequent analysis is focused solely on the target organ and avoiding interference from background tissue, blood-stained areas, and other internal organs. By limiting the evaluation object to the liver region, it significantly reduces the uncertainty caused by manual delineation and subjective region selection, improving the standardization of the evaluation process and the consistency of results.

[0020] (ii) Improve the interpretability of evaluation results by extracting statistical features based on HSV color moments. This invention, after obtaining the liver region, converts it to the HSV color space and extracts statistical features of color moments, enabling the variation in liver color distribution to be quantitatively expressed through statistically significant parameters. Compared to black-box models that rely on depth features, this feature construction method has clear physical meaning, allowing color changes caused by fat deposition to be intuitively reflected, thereby enhancing the interpretability and analyzability of the evaluation results.

[0021] (iii) Classification based on low-dimensional statistical features reduces model complexity and training dependency. This invention uses low-dimensional feature vectors composed of color moments as classification input, enabling effective differentiation of liver fat deposition states without requiring large-scale training samples and high-performance computing resources. This approach significantly reduces model training and deployment costs, making the evaluation method more suitable for widespread application in aquaculture and scientific research scenarios with limited sample sizes and varied application environments.

[0022] (iv) The synergistic effect of organ segmentation and color moment features enhances the reliability of assessment results. This invention does not simply superimpose organ segmentation and color feature extraction. Instead, it first precisely segments the liver region and then extracts color moment features from the segmented region, ensuring that the color statistical results are based on a clean and stable target region. This collaborative processing method effectively avoids the interference of background noise on statistical features in traditional whole-image-based color analysis methods, improving the reliability and stability of fat deposition assessment results.

[0023] (v) Unexpected technical effects of organ-level segmentation and statistical color feature combination Existing technologies do not reveal the combination of organ-level segmentation and statistical features of color moments to achieve stable assessment of fat deposition in fish livers in the absence of large-scale training data. This invention combines precise organ segmentation with statistically stable color moment features, achieving consistent assessment results even with limited sample sizes and less stringent imaging conditions. It constructs an automated assessment system that is highly interpretable, computationally inefficient, and requires minimal training. The effects of this technology are not directly predictable by those skilled in the art based on existing techniques, thus exhibiting significant and unexpected technical benefits. Attached Figure Description

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

[0025] Figure 1 A flowchart illustrating an automated method for assessing the state of fat deposition in the liver of fish. Figure 2 This is a schematic diagram of organ segmentation; Figure 3 This is a schematic diagram of the image after the liver region has been extracted. Figure 4 A schematic diagram for generating color moment features; Figure 5 Schematic diagram of the classification module. Detailed Implementation

[0026] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the invention will be further described below with reference to the accompanying drawings and embodiments. Those skilled in the art should understand that the embodiments described are for illustrative purposes only and are not intended to limit the invention; various adjustments, substitutions, or equivalent transformations can be made to the technical solutions of this invention without departing from the spirit and substance of the invention, and all of these should fall within the protection scope of this invention. Specific embodiments of this invention include, but are not limited to, the structures and processes shown in the following embodiments. Different modules, parameters, algorithms, or segmentation models can be freely combined or replaced according to the application scenario.

[0027] Example 1: This embodiment provides a method for assessing the state of fat deposition in fish livers based on image processing and color feature analysis, corresponding to the basic process described in claim 1 of this invention. The method is applicable to conventional anatomical images, does not rely on specific imaging equipment or segmentation models, and can be deployed in various aquaculture or scientific research scenarios.

[0028] I. Image Acquisition Fish were dissected and photographed using a standard RGB camera to obtain color images including the liver, spleen, gonads, and surrounding tissues. Adequate lighting was maintained during photography, but this method is robust to changes in lighting and does not require strict control of the shooting environment.

[0029] The acquired image can be represented as a three-channel matrix: II. Organ segmentation The RGB image is input into the image segmentation model to predict the regions of three types of targets: liver, spleen, and gonads. The model outputs the corresponding segmentation mask.

[0030] The segmentation result can be represented as: in, Liver region binary mask Spleen region mask Gonadal region mask This embodiment can use any segmentation model that supports semantic region recognition, such as models based on convolutional networks, attention mechanisms, or cue-driven mechanisms. The internal structure of the model is not limited. III. HSV color space conversion Convert the liver region image from RGB space to HSV space: get: H(x,y), S(x,y), V(x,y) The HSV color space is better able to reflect the regularity between changes in organ color and the degree of fat deposition compared to RGB.

[0031] IV. Calculation of color moment features (27 dimensions in total) Calculate the color moments for the H, S, and V channels respectively, including the first moment (mean), the second moment (variance), and the third moment (skewness).

[0032] Taking channel C as an example (C ∈ {H, S, V}), the following formula is only an illustrative representation, and the present invention does not limit the specific mathematical expression of the color moment: First moment (mean): Second moment (variance): Third moment (skewness): The three channels contain a total of 9 moment features × 3 organs = 27-dimensional feature vectors. This feature can stably reflect the color distribution, dispersion, and skewness of organs, and is significantly correlated with changes in fat deposition.

[0033] In practical applications, other equivalent color statistics or feature combinations can be used. This invention does not limit the specific calculation method of color moments.

[0034] V. Classification Model and Determination of Fat Deposition Level Input the above 27-dimensional feature vectors into the classification model to output the level of liver fat deposition status.

[0035] The classification model can be any lightweight model, such as: Logistic Regression Support Vector Machine Decision tree model (see Example 3 for details) KNN Or other interpretable classification models The number of classification levels can be adjusted according to actual needs. This invention does not limit the specific classification method. The model output can be: normal Mild fat deposition Moderate fat deposition Severe fat deposition This embodiment does not limit the number of classification categories. Depending on the actual application, it can also be designed as a two-level or five-level classification.

[0036] Example 2: This embodiment further presents a preferred organ region segmentation scheme based on Embodiment 1. This scheme employs an image segmentation model with cue-driven capabilities, obtaining more accurate masks for the liver, spleen, and gonadal regions by inputting cue information such as foreground points, background points, or bounding boxes. This model is suitable for liver identification under different shooting angles, lighting variations, and complex tissue overlap conditions, significantly improving segmentation accuracy.

[0037] I. Generation of Prompt Messages Preliminary structural analysis is performed on the input fish anatomical images, and prompts can be automatically generated based on the anatomical layout of the images, including: Several foreground points for the liver prediction region; Background points near organizational boundaries; Alternatively, a rectangular prompt box can be generated for possible organ regions.

[0038] Cue points can be obtained based on color, location statistics, or heuristics. For example, based on the statistical regularity that the liver often appears on the left side of the abdominal cavity, foreground points can be automatically generated in this area; or background points can be generated in edge areas with prominent color changes to suppress missegmentation.

[0039] The above-described method for generating prompts is merely an example. Prompts can also be obtained through other heuristic methods or automatic prompting models, and this invention does not limit this.

[0040] The prompt message can be represented as: II. Prompt-driven segmentation model execution Anatomical images and cue information are input into a cue-driven segmentation model, which accurately locates the target organ region based on the cue points. The model outputs a mask set containing the liver, spleen, and gonads. include: :Suggests enhanced liver mask Spleen mask Gonadal mask This model can enhance the recognition of weakly textured areas by providing prompts, making organ boundaries clearer and avoiding confusion with background fat, blood clots, and other tissues.

[0041] III. Fine Extraction of Organ Regions Finally, the pixel matrix of organs such as the liver is extracted from the original image using the processed mask: This image serves as the data source for subsequent HSV conversion, color moment calculation, and classification model input.

[0042] IV. Subsequent Feature Extraction and Classification After obtaining the organ region, the subsequent steps are the same as in Example 1, including: HSV conversion; Calculate the 27-dimensional color moment features; The features are input into the classification model to obtain the fat deposition level.

[0043] Example 3: This embodiment, based on the method framework of Embodiment 1, further presents an interpretable fat deposition classification scheme using a CART (Classification and Regression Tree) decision tree model. This scheme can achieve transparent judgment of fat deposition levels through explicit color moment thresholds and decision paths, and features low computational cost, easy deployment, and strong interpretability.

[0044] I. Feature Input The organ region was obtained using Example 1 or Example 2, and the 27-dimensional color moment feature vector of the three HSV channels was calculated: in, μ represents the mean. σ represents the standard deviation. s represents skewness.

[0045] This vector serves as the input to the CART classifier.

[0046] II. Construction of CART Decision Tree Model Based on the known fat deposition level labels of the sample images, a CART decision tree model is constructed using the training set. The model uses the Gini coefficient as the metric for node splitting, and its form is as follows: in Let K be the proportion of samples in class k, and K be the number of classes.

[0047] During training, the optimal split point is found by traversing different split thresholds of the color moment features, thereby constructing a multi-layer decision structure.

[0048] III. Examples of Typical Judgment Rules The trained decision tree can produce decision paths in the following form: like Lower, and Within a smaller range, it is considered a normal liver; like Increased, shifted towards the yellow spectrum, and A higher level may indicate mild fat deposition; like A significant increase indicates enhanced brightness dispersion, which is then classified as moderate fat deposition. like Reduced, overall lighter in color, and A significant increase indicates severe fat deposition.

[0049] The above rules are automatically generated based on training samples and are for illustrative purposes only. This invention does not limit specific thresholds, number of splits, or tree depth; hyperparameters can be adjusted according to specific circumstances.

[0050] IV. Categorized Output The CART model ultimately outputs the liver fat deposition level, which can be set as follows: normal Mild moderate Severe This embodiment does not limit the number of classification categories, and can also be set to a binary or multi-level classification format depending on the production application. The classification model in this embodiment is simple, lightweight, and interpretable, making it suitable for deployment in aquaculture sites.

[0051] Example 4: like Figure 1 As shown, this embodiment uses large yellow croaker as an example to illustrate the complete process of an automated assessment method for the fat deposition status of fish livers. This process includes steps such as sample acquisition and image capture, organ region segmentation, feature extraction, and fat deposition status determination. This embodiment describes one application of the fish liver fat deposition status assessment method of this invention in a practical engineering environment, aiming to explain the overall technical process and feasibility of the method. This embodiment is only an application example and does not constitute a limitation on the scope of protection of this invention, including the following steps: S1: Fish sample acquisition and image data collection: Fish sample acquisition and image data collection. This step corresponds to the "image acquisition" step described in the claims. Its purpose is to acquire anatomical images containing target organs such as the fish liver, and to standardize and manage the image data to provide basic data input for subsequent organ segmentation, color feature extraction, and fat deposition status assessment. It should be noted that the description of the sample processing flow, acquisition environment, and equipment parameters in this step is merely an exemplary implementation method used to illustrate the feasibility of the method of the present invention and does not constitute a limitation on the scope of protection of the present invention. The specific operation is as follows: Fish individuals are anesthetized and dissected. After cleaning and removing impurities, the dissected fish structures are placed unobstructed and equidistantly on a white background. Images are captured by a camera, and the image data is stored in a standard format. The sample number, collection time, collection personnel, and basic information tags of the fish are recorded through file naming or metadata. All data is archived and saved for subsequent model training and diagnostic testing.

[0052] Specifically, standardized fish sample acquisition is fundamental to ensuring the accuracy of subsequent testing. This step strictly adheres to aquaculture sampling specifications and operational standards, establishing a unified process from sample selection, harvesting and anesthesia to processing. In the sample selection stage, referring to the national standard "Aquatic Sampling Methods" (GB / T 30891-2014), the sampling quantity is determined based on the scale of the aquaculture area to be tested. Stratified random sampling is used, dividing the fish into tiers according to different aquaculture tanks. Samples are randomly selected from each tier to ensure that the samples cover areas with different stocking densities and different feeding batches, avoiding model bias caused by sample uniformity. Using ophthalmic scissors, the fish's abdomen is dissected to the pectoral fin, and the right abdomen is laterally dissected to the gill cover. The live liver is removed using hooked forceps. A scalpel is used to cut the sample 1-1.5 cm inward from the tip of the liver lobules. After rapid immersion in PBS buffer for 5-10 seconds, the sample is stored in 2% paraformaldehyde solution. The aforementioned histopathological processing and microscopic observation procedures are only used for sample labeling, result comparison, or model validation, and are not necessary steps in the automated evaluation method of this invention. The evaluation process of this invention does not depend on the execution of these steps. Subsequently, following the HE staining method for tissue sections, dehydration, clearing, paraffin infiltration, embedding, sectioning, dewaxing, and staining steps were performed sequentially to obtain tissue sections. Observation and photography were conducted using an optical microscope, and the liver condition was strictly assessed according to histopathological requirements. A data information database was integrated using Excel spreadsheets to facilitate subsequent model training and data traceability. Complete metadata was recorded for each sample, including sample number, origin, body surface information, body length, weight, rearing cycle, feed type, feeding frequency, rearing conditions, collection time, and collection personnel.

[0053] Image data acquisition: In terms of shooting environment setup, this invention uses a flicker-free LED light source, strictly controls the color temperature within the range of 2700-3000K, and keeps the light intensity stable at 400-500 lux. This parameter combination can not only realistically restore the color attributes of the organs themselves, but also avoid color distortion caused by strong light reflection or weak light shadows, laying the foundation for accurate extraction of color features. The background board is made of clean, matte, watermark-free, opaque white material. The matte surface can eliminate reflection interference, and the pure white tone can maximize the contrast between the organs and the background, effectively reducing background noise during post-segmentation. At the same time, the background board surface is required to be free of stains and scratches to ensure the uniformity of the shooting scene.

[0054] After dissecting the fish to be examined, place it with its left side facing up, remove the gill cover to expose the gills, which helps to determine the overall condition of the fish. Then, lay the liver, digestive tract, and spleen flat on a white background, ensuring that each organ is spaced appropriately and does not obstruct the others, avoiding organ overlap that could affect segmentation accuracy. Finally, wipe the surface of the organs with sterile saline to remove blood, fat, and other foreign matter, ensuring that the organ outlines are clear, the surface is clean, and there are no impurities that could affect image quality.

[0055] The acquisition equipment used was Orbbec's new generation binocular 3D camera, which features a high-definition binocular structure and active light depth measurement capabilities. Its RGB channel outputs high-resolution images, while the depth channel simultaneously acquires spatial depth information, effectively distinguishing adjacent, adherent organs and tissues, thus solving the problem of traditional 2D cameras struggling to identify the spatial relationships of organs. The camera was fixed in place using a vertical lifting bracket. The bracket height was adjusted to ensure that the camera's viewfinder and the two vertical edges of the background completely overlapped, allowing for complete imaging of all laid-out organs. This ensured a constant viewing angle and distance for each shot, avoiding hand-held shaking or depth-of-field changes, and eliminating image blurring at its source. Before shooting, the camera's software was used for focus calibration to optimize image sharpness, ensuring that details such as texture and color on the organ surface were clearly discernible. During shooting, uniform and stable lighting conditions were maintained. A ring lighting design was used to reduce shadows and reflections on the organ surface, further reducing the risk of color distortion. Simultaneously, standardized file naming rules were used to record core tags such as sample number, collection time, collector, and basic fish information, ensuring traceability for each image.

[0056] S2: Organ segmentation like Figure 2 As shown, in this embodiment, target organs such as the liver, spleen, and gonads in fish anatomical images are automatically segmented to obtain corresponding organ region masks, thereby providing basic input for subsequent color feature extraction and fat deposition state determination based on organ regions. This step corresponds to the "organ segmentation" step described in the claims, and its core purpose is to achieve automatic identification and localization of target organ regions.

[0057] It should be noted that this invention does not limit the specific model type, network structure, or implementation method used for organ segmentation. Any segmentation model or algorithm capable of automatically segmenting the target organ region and outputting an organ mask can be used to implement the organ segmentation steps of this invention. The following content is only an exemplary implementation of the organ segmentation process to illustrate the feasibility of the method in practical applications, and does not constitute a limitation on the scope of protection of this invention. In this embodiment, for example, a prompt-driven segmentation model (such as SAM) can be used to segment the liver region: the image is segmented using an encoder-decoder paradigm architecture of SAM, a visual Transformer pre-trained by a mask autoencoder is used and minimized to handle high-resolution input, and the model is guided to clarify the segmentation boundary by marking the core region and the target region. The segmentation process includes steps such as model loading, prompt input, mask generation, post-processing and result output.

[0058] Specifically, the segmentation model used is SAM (Segment Anything Model). Its core goal is to achieve "segmentability of everything" through a cue-based segmentation paradigm, supporting zero-shot transfer to various downstream segmentation tasks. Inspired by fundamental models in NLP, it breaks through the limitations of traditional segmentation models that are trained specifically for particular tasks, transforming the segmentation task into a "response to cues"—users provide cues in any form, such as points, boxes, text, or masks, and the model outputs at least one "valid mask," producing a reasonable result even if the cues are ambiguous. Simultaneously, SAM balances efficiency and generalization ability by separating computationally intensive and lightweight interactive cues. The image encoder runs only once, and the cue response time in a browser CPU environment is approximately 50ms, meeting real-time interaction requirements. SAM's architecture adopts an "encoder-decoder" paradigm, with its core consisting of an image encoder, a cue encoder, and a lightweight mask decoder.

[0059] In this embodiment, the segmentation model can be implemented based on a visual transformation structure, such as the ViT architecture, but is not limited to it: the image encoder can be any network capable of outputting image embeddings with dimensions C×H×W. For scalability and utilization of high-quality pre-trained models, we employ a Visual Transformer (ViT) pre-trained with a masked autoencoder and minimize it to handle high-resolution inputs. Specifically, we use the ViT-H16 model, which includes a 14×14 window attention mechanism and four equally spaced global attention blocks, and its output is the embedding of the input image after a 16x downsampling. Since our goal is to process each cue in real time, a higher number of floating-point operations by the image encoder is acceptable, as this operation only needs to be performed once per image, rather than repeatedly for each cue. We uniformly adjust the resolution of the input images to 1024×1024, specifically by scaling the image and padding the shorter sides, resulting in an image embedding dimension of 64×64. To reduce the channel dimension, we first use a 1×1 convolution to reduce the number of channels to 256, and then further process it with a 3×3 convolution that also outputs 256 channels. Normalization is performed after each convolution layer.

[0060] The cue encoder maps sparse cues such as points, boxes, and text into 256-dimensional vector embeddings. The embedding for a point cue is the sum of the positional encoding of that point and one of the learned embeddings representing either the "foreground point" or the "background point." Box cues consist of a pair of embeddings: the sum of the positional encoding of the top-left vertex and its corresponding learned embedding, and the sum of the positional encoding of the bottom-right vertex and its corresponding learned embedding. Free text cues are processed using a CLIP model text encoder. Dense cues, such as masks, have a spatial correspondence with the image. We first reduce their input resolution to 1 / 4 of the input image's resolution, then pass them through two 2×2 convolutional layers with a stride of 2, outputting 4 and 16 channels respectively. The resolution is further reduced to 1 / 4 of the original, and finally, a 1×1 convolution maps the channel dimension to 256. Each layer is separated by a GELU activation function and layer normalization. The mask embedding and image embedding are then element-wise added. If no mask cue exists, a learned embedding representing "no mask" is added to each position in the image embedding.

[0061] A lightweight mask decoder efficiently maps image embeddings and a set of cue embeddings to an output mask. Before using the decoder, we first insert a learned output lexical embedding into the cue embedding set. This embedding will be used in the output stage of the decoder, acting similarly to the lexical embedding in the ViT model. Each decoder layer performs the following four steps: self-attention on lexical embeddings; cross-attention from lexical to image embedding using lexical as query and image embedding as key and value; updating each lexical using a pointwise multilayer perceptron; and cross-attention from image embedding to lexical using image embedding as query and lexical as key and value. The last step updates the image embedding using cue information. During the cross-attention operation, the image embedding is treated as a set of 64² 256-dimensional vectors. Each self-attention, cross-attention module, and multilayer perceptron includes residual connections and layer normalization. The next decoder layer receives the updated lexical and image embeddings from the previous layer. The entire decoder consists of two layers. After the decoder completes its operation, we upsample the updated image embedding by a factor of 4 using two transposed convolutional layers. Subsequently, the tokens perform attention operations on the image embedding again. We then input the updated output token embedding into a small 3-layer multilayer perceptron, whose output vector dimension matches the channel dimension of the upsampled image embedding. Finally, the prediction mask is obtained by spatially multiplying the upsampled image embedding with the output vector.

[0062] Deploying the Segment Anything Model in a local computing environment is specifically designed for the accurate and automatic segmentation of core organ regions such as the liver, spleen, and gonads in fish anatomical images. Its technology is deeply integrated with customized interactive tools.

[0063] This invention utilizes Python and the Grado framework to repackage SAM (Segmentation Angiography), developing a dedicated interactive segmentation interface. This interface integrates image processing, interactive prompts, and result saving through a modular design, allowing users to easily complete segmentation operations without requiring specialized algorithmic knowledge. After launching the system, users can quickly master the operation process through the built-in collapsible "User Manual" module. This module clearly annotates annotation techniques for fish livers, spleens, and gonads, lowering the operational threshold. Clicking the "Upload Image" button supports uploading fish anatomical images in JPG, PNG, and other formats. After uploading, the image is automatically displayed in the core segmentation area on the left, and the system simultaneously updates the status information bar on the right with "Image loaded successfully" and basic information such as image size. To achieve precise organ segmentation guidance, this invention supports a dual guidance method using foreground and background points, adapting to the complex morphology of fish organs and their tendency to adhere to surrounding tissues: When the user selects the "foreground point" mode and clicks on the core areas of the liver, spleen, and gonads, the system marks them with red dots; when the user selects the "background point" mode and clicks on the surrounding abdominal tissue, fat, or background areas, the system marks them with blue dots. This bidirectional guidance helps the model clearly define the segmentation boundaries. If the user's input of guidance points is inaccurate, all marked points can be cleared with a single click using the "Clear Click Points" button on the interface, allowing for re-marking and ensuring targeted and accurate segmentation.

[0064] Meanwhile, to meet the needs of multi-organ segmentation in fish, the system has designed three flexible region preservation strategies: when "Save All Results" is selected, the system will automatically identify all target organs in the image and generate independent segmentation masks and visualization results for the liver, spleen, and gonads respectively; when "Save Only Segmented Regions" is selected, the system will only retain the specific organ region pointed to by the prompt point and provide two formats: transparent background and white background, to reduce irrelevant data interference during later feature extraction; when "Save Only Masks" is selected, the system will only output binary organ mask images to meet the needs of pure quantitative analysis.

[0065] The right-hand status information bar of the interactive system displays real-time data categorized into "Image Status - Labeling Information - Segmentation Result - Save Information": the image status bar displays upload status, image resolution, etc.; the labeling information bar records the coordinates and number of foreground / background points; the segmentation result bar displays the segmentation confidence score output by the model, such as "Segmentation complete, score: 0.92"; and the save information bar provides real-time feedback on the file save path, file name, and save status. After the user completes the labeling of the prompted points, the system automatically calls the locally deployed SAM model for inference, ultimately obtaining a complete and continuous organ segmentation result.

[0066] This invention pioneered the application of SAM (Segmentation Aspect Ratio) to fish anatomical image analysis, enabling automatic region identification and mask generation for key organs such as the liver, spleen, and gonads without manual annotation. Compared to traditional methods relying on experience and visual judgment for organ localization, this invention provides segmentation results with higher accuracy and consistency. Even under complex backgrounds, blurred organ boundaries, or insignificant color differences, SAM maintains reliable segmentation performance, significantly enhancing automated processing capabilities. This automation completely eliminates manual operation from the evaluation process, improving detection efficiency and providing a precise input foundation for subsequent color feature extraction and evaluation metric calculation.

[0067] The classification model has a simple structure and possesses interpretability and deployability. In the feature classification stage, this invention uses extracted color moment features for binary classification. The classification model has advantages such as simple structure, clear logic, and high inference efficiency. Both training and prediction processes do not require high computing resources, making it suitable for general computing devices. It can be deployed and run on ordinary computers or portable field devices, without relying on the cloud. The tree structure node partitioning rules in this invention are clear, intuitively demonstrating the contribution of each feature dimension in the classification process, facilitating user understanding of the judgment criteria, and possessing good interpretability. Compared to black-box models such as deep neural networks, decision trees can maintain low latency during model deployment, which is beneficial for rapid evaluation in actual aquaculture environments and reduces hardware costs.

[0068] The above method enables automatic segmentation of organ regions, providing a regional basis for subsequent feature extraction and fat deposition status determination. It should be understood that the above segmentation model and its implementation are merely examples, and the organ segmentation steps of this invention are not limited to these.

[0069] S3: Organ Feature Extraction like Figure 3 As shown, this step corresponds to the "feature extraction" step described in the claims. Its purpose is to: based on the obtained target organ region segmentation mask, perform statistical feature quantification on the color information of the organ region to construct a set of feature parameters for determining the fat deposition state.

[0070] It should be noted that the color space conversion method, statistical feature type and calculation method in this embodiment are only an exemplary implementation to illustrate the feasibility of the method of the present invention, and do not constitute a limitation on the scope of protection of the present invention; other equivalent color spaces or statistical feature forms may be used without departing from the scope of the claims.

[0071] The segmented original RGB image is converted to the HSV color space. For each image mask region, the values ​​of its hue, saturation, and luminance channels are extracted pixel by pixel, and its first, second, and third moments are calculated respectively. That is, each part obtains nine feature parameters. The first moment is used to describe the average level of color, the second moment is used to describe the dispersion of color distribution, and the third moment is used to describe the skewness of color distribution.

[0072] like Figure 4 As shown, organ feature extraction is performed. After accurately segmenting the liver, spleen, and gonads of fish, feature extraction becomes a crucial step in connecting image data with evaluation and analysis. This invention uses an automated and standardized process to quantify and analyze the color features of target organs, aiming to extract high-dimensional feature vectors from images. This process is based on a custom-developed Python batch processing algorithm, deeply integrating the perceptual advantages of the HSV color space with the quantification capabilities of statistical features. This preserves the meaning of color information while achieving the computability of feature parameters, providing high-quality input for subsequent classification models.

[0073] Background removal is a crucial preprocessing step to ensure the accuracy of feature extraction. Segmented images may retain a pure white background, such as a solid-color tabletop during shooting; if not removed, this will interfere with the authenticity of color features. The algorithm achieves background purification in three steps: First, the image is read using `cv2.imread`, converting OpenCV's default BGR format to RGB format; then, a background mask is generated. When the pixel values ​​of all three RGB channels are 255, it is considered a pure white background, and the corresponding mask value is set to 0; the mask values ​​for other organ regions are set to 255; finally, through `cv2.bitwise_and`, only organ pixels with a mask value of 255 are retained, generating a clean organ image without background interference. This step completely eliminates the influence of environmental factors on feature extraction, ensuring that subsequent analysis focuses only on the color attributes of the organ itself.

[0074] Scientific color space conversion is a core strategy for improving feature discrimination. Considering the strong correlation between the three channels of the RGB space and its susceptibility to feature distortion due to lighting fluctuations and reflective areas, the algorithm uses the cv2.cvtColor function to convert the purified organ image from BGR format to HSV space. The HSV space decomposes color into three independent channels: the H channel directly represents the color type; the S channel reflects the color purity; and the V channel represents the light reflection intensity.

[0075] The quantification of color moments is a core step in feature extraction. It comprehensively characterizes the statistical properties of organ color through the first-order moment mean, second-order moment variance, and third-order moment skewness. The first moment reflects the overall color level, and its calculation formula is as follows: ;in, This represents the value of the i-th pixel in the color channel, and N represents the total number of valid pixels in that channel. The mean of this channel; the second moment reflects the dispersion of the color distribution, and is calculated using the following formula: The third moment reflects the symmetry of the distribution, and its calculation formula is: Each organ's three channels generated three features, resulting in a total of 27-dimensional feature vectors extracted from the three organ types, fully covering color change information. Color distribution was plotted as a normalized histogram using matplotlib, with the H, S, and V channels distinguished by red, green, and blue curves, respectively. These features provided highly discriminative input for subsequent classification models, laying a data foundation for the automated assessment of fat deposition in fish livers.

[0076] S4: Determination of Fat Deposition Status: like Figure 5 As shown, in this embodiment, the color feature parameters extracted in step S3 are used as input to determine and analyze the fat deposition status of fish livers. This step corresponds to the "fat deposition determination" step described in the claims, and its core lies in achieving automated classification and judgment based on feature parameters. It should be noted that the following description of the classification model structure, algorithm form, and parameter settings are merely exemplary implementation methods and do not constitute a limitation on the scope of protection of this invention.

[0077] This invention, based on the high-discriminative features extracted previously, constructs a classification model using the CART algorithm. The core objective is to achieve accurate and interpretable discrimination of fat deposition in fish livers. The algorithm recursively splits the feature space, dividing samples into subsets with the most homogeneous categories possible, ultimately forming interpretable "if-then" decision rules. The feature dimension is fixed at 27 color moment parameters, covering the mean, variance, and skewness of the H, S, and V channels for three organ types. To maximize the use of sample data, this invention employs leave-one-out cross-validation, where only one sample is used as the test set each time, and the rest are used as the training set. The final classification accuracy is obtained by averaging all samples.

[0078] This invention selects the CART algorithm as the core classification model. Its core advantage lies in constructing a strict binary tree structure based on "Gini impurity," which avoids bias towards features with multiple values ​​and improves the interpretability of the model through simple splitting logic. The algorithm essentially divides the sample space into several sub-regions through recursive binary splitting, making the sample categories in each sub-region as homogeneous as possible. Its construction logic revolves around core indicators such as Gini impurity and total impurity after splitting. Gini impurity is a fundamental indicator for measuring the purity of a sample set, used to describe the degree of mixing of sample categories in a node. For a dataset D containing samples with and without liver fat deposition, its calculation formula is: ,in Let Gini represent the proportion of samples of class k in a node. A smaller Gini value indicates higher purity of the sample set. In feature selection, CART determines the classification value of a feature by calculating the "total impurity after splitting." For a given feature A, assuming its splitting threshold is t, the sample set D can be divided into two child nodes that satisfy the threshold. and those that do not meet the threshold The total impurity after splitting is: ,in, , These represent the sample sizes of the two child nodes, respectively. The total sample size of the parent node. The algorithm iterates through all possible thresholds for all features, selecting the feature and threshold combination that minimizes the total impurity after splitting as the splitting rule for the current node. The lower the total impurity, the more concentrated the categories of the child nodes after splitting, and the better the classification effect. The specific process is as follows: Initialize the root node with all training samples as the root node and calculate the "impurity" of the current node; For all possible values ​​of each feature, calculate the total impurity of the two child nodes after splitting, and select the feature and threshold with the "lowest total impurity" as the splitting rule; Repeat the above for the two child nodes after splitting until the stopping condition is met, such as all child node samples being of the same category, reaching the maximum depth, etc.; Each leaf node corresponds to a category, and the category with the highest proportion in that node is used as the prediction result.

[0079] To avoid overfitting, this invention determines the optimal tree structure through hyperparameter optimization: the code traverses decision tree depths from 1 to 8, calculates the accuracy of the training and test sets at each depth through cross-validation, and finally selects the parameter with the highest average accuracy on the test set and the shallowest depth, ensuring moderate model complexity while avoiding noise from the training set. Simultaneously, addressing the potential imbalance between the two classes in real-world scenarios, the code dynamically adjusts class weights through parameters, giving higher weights to minority classes and prioritizing the reduction of impurity caused by high-weight classes during splitting, thereby improving the ability to identify diseased samples and reducing prediction bias caused by sample bias. Under the test sample conditions of this embodiment, the model achieved relatively stable judgment results, verifying the feasibility of the method. The final model prediction accuracy reached 93%, meeting the evaluation needs of large-scale aquaculture scenarios. Furthermore, the strong interpretability of the CART algorithm is a core advantage of this model; users can clearly understand the "basis for classifying samples," solving the "black box" problem of traditional deep learning models and facilitating trust and operation by aquaculture personnel. Unlike deep learning models that rely on iterative generation of results using tens of millions of parameters and lack interpretable judgment logic, CART decision trees are centered on explicit rules. Each non-leaf node corresponds to a quantifiable judgment criterion. For example, the root node rule of the comprehensive feature model is "liver channel H mean ≤ 30", the left child node further splits into rules such as "spleen S channel skewness ≤ -0.23", and the final leaf node directly outputs the conclusions "liver fat deposition exists" or "liver fat deposition does not exist". The features in these rules are not abstract model parameters, but quantitative indicators directly linked to fish evaluation characteristics, allowing the model's judgments to resonate with the actual observation experience of fish farmers. This verification mechanism not only enhances the farmers' trust in the model but also makes the model a tool to assist in experience-based judgment. If the model's judgment does not match actual observation, farmers can quickly locate the problem, such as glare from sample image capture causing distortion of V channel values, rather than passively accepting ambiguous results.

[0080] This invention focuses on the practical needs of aquaculture scenarios, designing a simplified and efficient end-to-end detection solution. The core objective is to enable aquaculture and testing personnel to quickly assess the presence of fat deposits in fish livers. Users do not need complex image processing or model operation skills; they only need to complete the assessment in three steps: sample processing, image input, and result viewing. There are no professional barriers to entry. The specific operating procedure closely matches the actual aquaculture environment: First, after anesthetizing, dissecting, and exposing the organs of the fish according to the aforementioned specifications, no additional complex processing is required. Users only need to use the Orbbec binocular 3D camera provided with the system to capture images of the dissected organs under standard shooting conditions. If users have already captured images, they can also directly use the "Upload Image" function on the system interface to select locally stored JPG, PNG, and other format files, supporting batch uploading and batch detection to meet the high-efficiency needs of large-scale aquaculture scenarios. After the image is input into the system, all subsequent processes are completed automatically by the system without manual intervention: First, the locally deployed SAM segmentation model quickly identifies the three core organs in the image: liver, spleen, and gonads. Through its pre-trained accurate segmentation capabilities, it automatically removes background and occluded tissues, extracting clean organ regions without requiring manual selection or annotation by the user. Second, the system calls the feature extraction module to convert the organ image from RGB space to HSV space, calculates the mean, variance, and skewness of the H, S, and V channels pixel by pixel, and automatically generates a 27-dimensional color moment feature vector. The entire process does not require the user to understand the calculation logic of color moments. Third, the feature vector is directly input into the fixed CART classification model. The model completes the classification judgment in milliseconds by matching and quantizing rules layer by layer, and finally outputs a clear classification result, allowing the user to intuitively understand the judgment basis.

Claims

1. An automated method for assessing the fat deposition status of fish livers, characterized in that, Includes the following steps: S1. Image Acquisition: Acquire anatomical images of fish; S2. Organ segmentation: Input the anatomical image into the image segmentation model to segment the liver, spleen and gonadal regions, and obtain the corresponding segmentation mask. S3. Feature extraction: Extract organ images based on the segmentation mask of the organ region, convert them to the HSV color space, and calculate the color moment features of each channel of H, S, and V. The color moments include at least the first-order moment, the second-order moment, and the third-order moment. S4. Fat deposition determination: Input the color moment features into the classification model, and perform fat deposition level determination based on the color moment features to obtain the fat deposition status assessment result of the liver.

2. The automated method for assessing the fat deposition status of fish livers according to claim 1, characterized in that, The image segmentation step includes: identifying the liver, spleen, and gonad regions based on a convolutional network, attention mechanism, or cue-driven segmentation model to obtain corresponding region masks. The structure and weights of the segmentation model are not limited, and the segmentation models are all within the scope of semantic segmentation models known in the art.

3. The automated method for assessing the fat deposition status of fish livers according to claim 2, characterized in that, The segmented liver region mask is subjected to noise removal, hole filling and edge smoothing to obtain a clean liver region for subsequent color analysis.

4. The automated method for assessing the fat deposition status of fish livers according to claim 1, characterized in that, The liver region was converted from RGB space to HSV space, where HSV space was used to enhance the ability to express color differences related to fat deposition.

5. The automated method for assessing the fat deposition status of fish livers according to claim 1, characterized in that, The color features include at least one of the following statistical moment features calculated based on the H, S, and V channels: Mean, first-order central tendency; Variance or measure of dispersion; Skewness or color distribution skewness is a measure of the degree of skewness.

6. The automated method for assessing the fat deposition status of fish livers according to claim 5, characterized in that, The color features constitute a color statistical moment feature vector with at least 9 dimensions, and are used to reflect the regularity of color distribution in the liver region.

7. The automated method for assessing the fat deposition status of fish livers according to claim 1, characterized in that, The determination of fat deposition status includes: based on the color feature vector input into a preset classification model, performing at least two-level or multi-level classification on the liver sample, and the classification result includes at least one of normal, mild, moderate or severe fat deposition.

8. The automated method for assessing the fat deposition status of fish livers according to claim 7, characterized in that, The classification model is an interpretable model, including but not limited to decision trees, logistic regression, K-nearest neighbors, or support vector machines.

9. The automated method for assessing the fat deposition status of fish livers according to claim 1, characterized in that, The classification model determines the level of liver fat deposition based on the threshold, interval division, or feature combination relationship of at least one statistical moment feature in the color feature vector.

10. The automated method for assessing the fat deposition status of fish livers according to claim 2, characterized in that, The image segmentation model is a cue-driven segmentation model, which generates a liver region mask based on user interaction points, boundary cues, or text cues.