A potato rotting block removing method and system based on image recognition

CN122842104APending Publication Date: 2026-09-29GANSU RES INST OF AGRI ENG TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611084133.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

该类正常愈伤区域在颜色和纹理上与早期干腐病斑具有较高相似性,现有图像识别方式如果仅依据异常区域自身的颜色值、纹理粗糙度或局部二值模式特征进行判断,容易将正常愈伤组织误判为腐烂病斑,导致大量合格马铃薯被错误剔除,造成原料浪费

Benefits of technology

[0019]本申请通过前景掩码限定马铃薯有效本体区域,避免背景干扰参与异常识别;通过颜色特征和纹理特征保持对褐变、粗糙等疑似腐烂区域的高敏感检出;进一步结合异常候选区域与周边健康皮层之间的局部关联特征,判断异常是否具有病理扩展特征,从而降低正常愈伤组织被误判为腐烂区域的概率;同时,依据病理腐烂概率生成区域风险标记和全薯状态标签,并控制分拣执行机构执行放行、剔除或复检分流,使图像识别结果能够直接转化为分级分拣动作,提高腐烂块剔除准确性和分拣稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122842104A_ABST
    Figure CN122842104A_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a potato rotting block removing method and system based on image recognition, and relates to the technical field of agricultural product image recognition and automatic sorting. The method comprises the following steps: acquiring a visible light image of a surface of a potato to be sorted, generating a potato body image, a foreground mask and position coordinates; determining an effective body area in the potato body image according to the foreground mask, and determining an abnormal candidate area according to color features and texture features in the effective body area; determining a peripheral healthy skin layer around the abnormal candidate area in combination with the foreground mask; extracting local correlation features between the abnormal candidate area and the peripheral healthy skin layer; generating a region risk label according to a pathological rotting probability, and generating a whole-potato state label according to each region risk label; and controlling a sorting execution mechanism to execute release, removal or re-inspection distribution according to the whole-potato state label and the position coordinates. The application improves the distinguishing ability of normal healing areas and pathological rotting areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of agricultural product image recognition and automated sorting technology, and in particular to a method and system for removing rotten potato chunks based on image recognition. Background Technology

[0002] In the automated sorting, washing, slicing, and packaging of potatoes, it is usually necessary to identify rotten patches, diseased spots, or suspected deterioration areas on the potato surface and remove substandard potatoes from the main conveyor belt. Current technologies often use industrial cameras to capture visible light images of the potato surface, then use color thresholding, texture recognition, or classification models to determine the presence of rotten areas, and transmit the results to a pneumatic rejection mechanism or diversion mechanism to execute the rejection action.

[0003] However, during actual harvesting and transportation, potato surfaces are easily damaged by mechanical scraping, abrasion, or impact. After room temperature callus treatment, light to medium brown corky tissue forms at the wound site, which typically appears as browning, roughness, or localized depressions in visible light images. These normal callus areas are highly similar in color and texture to early dry rot lesions. Existing image recognition methods, if relying solely on the color value, texture roughness, or local binary pattern features of the abnormal area, can easily misidentify normal callus tissue as rot lesions, leading to the incorrect rejection of a large number of qualified potatoes and resulting in raw material waste.

[0004] Therefore, how to further distinguish between normal callus areas and pathological rotten areas while maintaining high sensitivity in detecting rotten areas, and how to transform the identification results into executable control results such as release, rejection, or re-inspection and diversion, are technical problems that urgently need to be solved in the field of potato image recognition and sorting. Summary of the Invention

[0005] This application provides a method and system for removing rotten potato chunks based on image recognition, which improves the accuracy of removing rotten potato chunks and the stability of sorting.

[0006] This application provides the following solution:

[0007] According to a first aspect, a method for removing rotten potato chunks based on image recognition is provided, comprising: acquiring a visible light image of the surface of the potato to be sorted, and preprocessing the visible light image to generate a potato body image, a foreground mask, and position coordinates; determining an effective body region in the potato body image based on the foreground mask, and determining an abnormal candidate region within the effective body region based on color and texture features; expanding outward based on the boundary contour of the abnormal candidate region, and determining the surrounding healthy skin layer around the abnormal candidate region in conjunction with the foreground mask; extracting local correlation features between the abnormal candidate region and the surrounding healthy skin layer; determining the pathological rot probability of the abnormal candidate region based on the local correlation features; generating a region risk marker based on the pathological rot probability, and generating a whole potato status label based on each region risk marker; and controlling a sorting execution mechanism to perform release, rejection, or re-inspection and diversion based on the whole potato status label and position coordinates.

[0008] According to one achievable method in an embodiment of this application, the preprocessing of the visible light image to generate a potato body image, a foreground mask, and position coordinates includes: performing illumination compensation on the visible light image and converting the compensated visible light image to the HSV color space or CIELAB color space to obtain a converted image; performing foreground segmentation on the converted image based on the color difference between the conveyor belt background and the potato body to generate a foreground mask representing the effective projection range of the potato body; extracting the body region from the compensated visible light image based on the foreground mask to generate a potato body image; and calculating the minimum bounding rectangle and centroid coordinates corresponding to the potato body based on the foreground mask to generate the position coordinates.

[0009] According to one achievable method in an embodiment of this application, determining the abnormal candidate region based on color and texture features within the effective body area includes: extracting suspected color anomalies that conform to brown features within the effective body area; extracting texture roughness within the effective body area based on local binary mode or gray-level co-occurrence matrix, and determining suspected texture anomalies; fusing the suspected color anomalies and the suspected texture anomalies to generate an anomaly response map; performing connected component analysis on the anomaly response map, and filtering connected regions with an area smaller than a preset defect threshold to obtain the abnormal candidate region.

[0010] According to one achievable method in an embodiment of this application, the extraction of local correlation features between the abnormal candidate region and the surrounding healthy cortex includes: establishing a sampling line along the boundary contour normal direction of the abnormal candidate region that runs through the abnormal candidate region and the surrounding healthy cortex region, and generating a color transition gradient feature based on the color change rate from the abnormal candidate region to the surrounding healthy cortex region on the sampling line; generating a boundary morphology continuity feature based on the boundary contour curvature of the abnormal candidate region and the convergence degree of the boundary contour relative to the surrounding healthy cortex region; extracting the texture distribution of the abnormal candidate region and the surrounding healthy cortex region respectively, and generating a texture coarsening limitation feature based on the difference in texture distribution between the two and the decay rate of texture roughness from the abnormal candidate region to the surrounding reference cortex region; generating an internal non-uniform structure change feature based on the gray-level variance, local contrast, and dark core distribution state within the abnormal candidate region; and generating the local correlation feature based on the color transition gradient feature, boundary morphology continuity feature, texture coarsening limitation feature, and internal non-uniform structure change feature.

[0011] According to one achievable method in an embodiment of this application, determining the pathological decay probability of the abnormal candidate region based on the local correlation features includes: normalizing the local correlation features to generate feature data to be identified; obtaining a pre-constructed classification mapping model, which is trained based on the local correlation features corresponding to labeled stable callus region samples and labeled pathological decay region samples; inputting the feature data to be identified into the classification mapping model to obtain the discrimination output values ​​of the feature data to be identified corresponding to stable callus regions and pathological decay regions respectively; and generating the pathological decay probability of the abnormal candidate region based on the discrimination output value corresponding to the pathological decay region and the difference between the discrimination output values ​​corresponding to stable callus regions and pathological decay regions.

[0012] According to one achievable method in an embodiment of this application, the step of generating regional risk markers based on the pathological decay probability and generating whole-potato status labels based on each regional risk marker includes: setting a low-risk judgment threshold and a high-risk judgment threshold, wherein the low-risk judgment threshold is less than the high-risk judgment threshold; when the pathological decay probability is less than or equal to the low-risk judgment threshold, the corresponding abnormal candidate region is marked as a stable callus region; when the pathological decay probability is greater than or equal to the high-risk judgment threshold, the corresponding abnormal candidate region is marked as a pathological extension region; when the pathological decay probability is greater than the low-risk judgment threshold and less than the high-risk judgment threshold, the corresponding abnormal candidate region is marked as a feature mixing region.

[0013] When the same potato has at least one pathologically extended region, a high-risk rejection label is generated; when the same potato does not have a pathologically extended region but has at least one feature-mixed region, a medium-risk pending review label is generated; when the same potato does not have both a pathologically extended region and a feature-mixed region, a low-risk retention label is generated.

[0014] According to one achievable method in this application embodiment, the step of controlling the sorting execution mechanism to perform release, rejection, or re-inspection diversion based on the whole potato status label and position coordinates includes: calculating the delay time for the potatoes to be sorted to reach the sorting execution position based on the position coordinates and real-time displacement data of the conveyor belt; when the whole potato status label is a high-risk rejection object label, generating a rejection trigger signal based on the delay time and controlling the corresponding pneumatic valve to open, so that the potatoes to be sorted are blown away from the main conveyor belt by the airflow and enter the waste collection channel; when the whole potato status label is a low-risk retention object label, not generating a rejection trigger signal, so that the potatoes to be sorted enter the qualified product channel along the main conveyor belt; when the whole potato status label is a medium-risk object to be reviewed label, generating a re-inspection diversion trigger signal based on the delay time and controlling the diversion mechanism to guide the potatoes to be sorted into the re-inspection channel.

[0015] According to one achievable method in an embodiment of this application, after determining the surrounding healthy cortex around the abnormal candidate region, the method further includes: expanding outwards according to the boundary contour of the abnormal candidate region by a preset expansion width, and removing pixels outside the potato body in conjunction with the foreground mask to obtain an annular neighborhood for determining the surrounding healthy cortex; obtaining the set of region pixels corresponding to all abnormal candidate regions on the current potato surface; removing the set of region pixels corresponding to the current abnormal candidate region from the set of region pixels corresponding to all abnormal candidate regions to obtain a background abnormal interference region; determining whether there is spatial overlap between the annular neighborhood and the background abnormal interference region; when there is spatial overlap, removing overlapping pixels belonging to the background abnormal interference region from the annular neighborhood to generate a clean annular neighborhood; using the clean annular neighborhood as a healthy cortex sampling area, and performing color transition gradient features and texture coarsening limitation features extraction based on the healthy cortex sampling area.

[0016] According to one achievable method in an embodiment of this application, before using the pure annular neighborhood as a healthy cortical sampling area, the method further includes: counting the number of effective pixels in the pure annular neighborhood; determining whether the number of effective pixels is lower than a preset minimum statistical sample threshold; when the number of effective pixels is lower than the minimum statistical sample threshold, generating a neighborhood sampling insufficiency marker, and marking the color transition gradient feature and texture coarsening limitation feature of the corresponding abnormal candidate region as missing features; and reducing the classification confidence of the corresponding abnormal candidate region based on the neighborhood sampling insufficiency marker.

[0017] According to the second aspect, an image recognition-based potato rotten block removal system is provided, comprising: an image preprocessing module for acquiring a visible light image of the surface of the potato to be sorted, and preprocessing the visible light image to generate a potato body image, a foreground mask, and position coordinates; an abnormal candidate region determination module for determining an effective body region in the potato body image based on the foreground mask, and determining an abnormal candidate region within the effective body region based on color and texture features; a peripheral skin layer determination module for expanding outward based on the boundary contour of the abnormal candidate region, and determining the surrounding healthy skin layer around the abnormal candidate region in conjunction with the foreground mask; a local correlation feature extraction module for extracting local correlation features between the abnormal candidate region and the surrounding healthy skin layer; a rot probability determination module for determining the pathological rot probability of the abnormal candidate region based on the local correlation features; a risk marking module for generating regional risk marks based on the pathological rot probability, and generating whole potato status labels based on each regional risk mark; and a sorting control module for controlling a sorting execution mechanism to perform release, rejection, or re-inspection and diversion based on the whole potato status labels and position coordinates.

[0018] According to the specific embodiments provided in this application, the following technical effects are disclosed:

[0019] This application uses foreground masking to limit the effective potato body area, avoiding background interference in anomaly identification; it maintains high sensitivity for detecting suspected rotten areas such as browning and roughness through color and texture features; further, it combines the local correlation features between the abnormal candidate area and the surrounding healthy skin to determine whether the abnormality has pathological expansion characteristics, thereby reducing the probability of normal callus tissue being misjudged as rotten areas; at the same time, it generates regional risk markers and whole-potato status labels based on the probability of pathological rot, and controls the sorting execution mechanism to perform release, rejection, or re-inspection and diversion, so that the image recognition results can be directly converted into grading and sorting actions, improving the accuracy of rotten block rejection and sorting stability.

[0020] Of course, any product implementing this application does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

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

[0022] Figure 1A flowchart of an image recognition-based method for removing rotten potato chunks provided in an embodiment of this application;

[0023] Figure 2 A structural block diagram of the image recognition-based potato rotten block removal system provided in this application embodiment;

[0024] Figure 3 A schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0026] Figure 1 A flowchart illustrating the image recognition-based method for removing rotten potato chunks provided in this application embodiment. Figure 1 As shown, the method may include the following steps:

[0027] Step 101: Obtain a visible light image of the surface of the potatoes to be sorted, and preprocess the visible light image to generate a potato body image, a foreground mask, and position coordinates.

[0028] Step 102: Determine the effective body region in the potato body image based on the foreground mask, and determine the abnormal candidate region within the effective body region based on color features and texture features.

[0029] Step 103: Expand outward based on the boundary contour of the abnormal candidate region, and determine the surrounding healthy cortex around the abnormal candidate region in conjunction with the foreground mask.

[0030] Step 104: Extract the local correlation features between the abnormal candidate region and the surrounding healthy cortex.

[0031] Step 105: Determine the pathological decay probability of the abnormal candidate region based on the local correlation features.

[0032] Step 106: Generate regional risk markers based on the pathological decay probability, and generate whole potato status labels based on the risk markers of each region.

[0033] Step 107: Control the sorting mechanism to perform release, rejection, or re-inspection and diversion according to the whole potato status label and location coordinates.

[0034] As can be seen from the above process, this application limits the effective potato body area by using foreground masking to avoid background interference in anomaly identification; it maintains high sensitivity to detect suspected rotten areas such as browning and roughness through color and texture features; further, it combines the local correlation features between the abnormal candidate area and the surrounding healthy skin to determine whether the abnormality has pathological expansion characteristics, thereby reducing the probability of normal callus tissue being misjudged as rotten areas; at the same time, it generates regional risk markers and whole potato status labels based on the probability of pathological rot, and controls the sorting execution mechanism to perform release, rejection, or re-inspection and diversion, so that the image recognition results can be directly converted into grading and sorting actions, improving the accuracy of rotten block rejection and sorting stability.

[0035] The following describes in detail each step of the above process and the effects that can be further produced, with reference to the embodiments.

[0036] Step 101 specifically involves: acquiring a visible light image of the surface of the potatoes to be sorted, and preprocessing the visible light image to generate a potato body image, a foreground mask, and position coordinates.

[0037] Visible light images of the surface of potatoes to be sorted can be acquired by industrial cameras positioned above or to the side of the sorting conveyor belt. Since the potatoes move continuously on the conveyor belt, and the actual production environment may experience fluctuations in light intensity, surface reflection, and shadows, the visible light images are first compensated for to ensure consistent brightness and color across different acquisition times. Subsequently, the compensated visible light images are converted to the HSV or CIELAB color space to relatively separate brightness and color information, improving the stability of subsequent foreground segmentation and color feature extraction.

[0038] After obtaining the transformed image, foreground segmentation is performed based on the color difference between the conveyor belt background and the potato itself. For example, the conveyor belt typically uses a dark, blue, or green background that contrasts significantly with the potato skin color. Therefore, color thresholding, adaptive thresholding, or region segmentation methods can be used to distinguish the pixels corresponding to the potato itself from the background pixels, generating a foreground mask. The foreground mask characterizes the effective projection range of the potato itself in the image. It can be a binary mask, where pixels belonging to the potato itself are marked as valid pixels, and pixels belonging to the conveyor belt background or invalid regions are marked as invalid pixels.

[0039] Furthermore, the system extracts the potato body region from the compensated visible light image based on the foreground mask, retaining only the potato body pixels corresponding to the foreground mask while removing the conveyor belt background, edge shadows, and other irrelevant areas, thus generating a potato body image. This potato body image serves as the basic input for subsequent anomaly candidate region identification, preventing background color, conveyor belt texture, or stray light spots from being mistakenly identified as potato surface anomalies, thereby improving the accuracy of subsequent color and texture feature extraction.

[0040] Simultaneously, the system calculates the minimum bounding rectangle and centroid coordinates of the potato body in the image based on the foreground mask, and uses these as the position coordinates. The minimum bounding rectangle represents the area currently occupied by the potato in the image, and the centroid coordinates represent the center position of the potato. These position coordinates not only identify the current position of the detected potato, but can also be combined with conveyor belt speed or encoder displacement data to calculate the delay time required for the potato to move from the image acquisition position to the rejection mechanism or diversion mechanism, thus providing a positional basis for the accurate triggering of subsequent sorting execution mechanisms.

[0041] Step 102 specifically involves: determining the effective body region in the potato body image based on the foreground mask, and determining anomaly candidate regions within the effective body region based on color and texture features.

[0042] The foreground mask is used to limit the effective range of the potato itself in the image. After generating the potato image, the system does not directly perform anomaly detection on the entire image. Instead, it first determines the effective potato region based on the foreground mask and performs color and texture feature analysis only within this region. This eliminates interference from the conveyor belt background, image edge shadows, stray reflections, and non-potato areas, ensuring that the subsequent anomaly candidate regions all originate from the potato surface itself.

[0043] Within the effective ontological area, the system first extracts suspected color anomalies based on color features. Since early rotten areas and corky areas after callus formation on the potato surface typically exhibit light brown, medium brown, or locally dark brown hues, the system can set corresponding color ranges in the HSV or CIELAB color space, marking pixels that meet the brown characteristic criteria as suspected color anomalies. The purpose of this process is to prioritize the discovery of suspicious areas exhibiting browning, rather than directly determining at this stage whether they necessarily constitute rot.

[0044] Simultaneously, the system extracts texture features within the effective body area to identify regions with rough surfaces, enhanced graininess, or abnormal local tissue structures. Specifically, local binary mode or gray-level co-occurrence matrix can be used to calculate the texture roughness within a local window. When the texture roughness of a pixel or local area exceeds a preset condition, it is identified as a suspected texture anomaly. Since necrotic lesions and callus tissue may both have a certain degree of rough texture, suspected texture anomalies are mainly used to improve the completeness of anomaly detection and avoid missing some early lesions due to relying solely on color features.

[0045] Subsequently, the system fuses suspected color and texture anomalies to generate an anomaly response map. The fusion method can be intersection fusion, union fusion, or weighted fusion. For example, when a region exhibits both browning and texture coarsening, it can be assigned a higher anomaly response value; when a region only meets the criteria for color anomaly or only texture anomaly, it can be retained as a low-intensity anomaly response based on set weights. Through this anomaly response map, the system can uniformly express apparent anomaly information from both color and texture dimensions, providing a foundation for subsequent region-level analysis.

[0046] Finally, the system performs connected component analysis on the abnormal response map, merging spatially adjacent or continuously distributed abnormal response pixels into independent connected regions. Connected regions with an area smaller than a preset defect threshold are generally considered noise points, minor blemishes, or local interference without substantial analytical significance, and are therefore filtered out. The connected regions retained after filtering are the candidate abnormal regions. These candidate abnormal regions are not directly equivalent to rotten areas, but rather indicate suspicious color or texture characteristics, requiring further assessment of their pathological rot probability in subsequent steps, combined with local correlation features of the surrounding healthy skin.

[0047] Step 103 specifically involves: expanding outward based on the boundary contour of the abnormal candidate region, and determining the surrounding healthy cortex around the abnormal candidate region in conjunction with the foreground mask.

[0048] After identifying candidate regions for anomalies, the system does not only analyze the color and texture of the candidate region itself, but also further acquires information about the surrounding skin layer to determine whether the abnormality is confined to the local wound or whether it has a tendency to spread outwards. Specifically, the system first extracts the boundary contour of the candidate region, which represents the boundary between the candidate region and the surrounding potato skin. Then, based on this boundary contour, it expands outwards by a preset pixel width to form the outer neighborhood surrounding the candidate region.

[0049] Since the anomaly candidate region may be located near the edge of the potato body, simply expanding outward along the boundary contour may result in the expanded region exceeding the potato body's range and falling into the conveyor belt background or invalid image area. Therefore, the system needs to combine a foreground mask to limit the expanded region. Specifically, the system matches the expanded outer neighborhood range with the effective projection range of the potato body represented by the foreground mask, retaining only pixels that belong to both the outer neighborhood range and the effective projection range of the potato body, and excluding pixels within the anomaly candidate region itself, thereby obtaining the surrounding healthy cortex around the anomaly candidate region.

[0050] In this application, the surrounding healthy cortex serves as a reference region outside the abnormal candidate region, reflecting the transitional relationship between the abnormal region and the normal epidermis. For example, if the abnormal candidate region is stable callus tissue, its browning and rough texture are usually concentrated mainly within the wound area, and the color and texture of the surrounding healthy cortex will quickly return to the normal epidermal state. If the abnormal candidate region is a pathological decay area, its color changes and texture coarsening may penetrate or diffuse into the surrounding cortex, blurring the boundary between the abnormal region and the surrounding cortex. By identifying the surrounding healthy cortex, the system can extract local correlation features such as color transition gradient, boundary convergence degree, and texture decay rate in subsequent steps, thereby providing a data basis for distinguishing between normal callus and pathological decay.

[0051] Furthermore, by combining foreground masks to determine the surrounding healthy skin layer, it is possible to avoid non-potato areas such as background pixels, conveyor belt textures, and image edge shadows from participating in feature calculations. Without this restriction, the system might mistake the color difference between the conveyor belt background and the abnormal candidate area as a true transition feature of the potato skin, thus affecting the judgment of the probability of pathological decay.

[0052] Step 104 specifically involves extracting the local correlation features between the abnormal candidate region and the surrounding healthy cortex.

[0053] Local correlation features are used to characterize the relative changes between abnormal candidate regions and their surrounding healthy dermis. This step focuses not solely on whether the abnormal candidate region itself is brown or rough, but rather on further analyzing the color transition, boundary morphology changes, texture diffusion, and internal structural state between the abnormal candidate region and the surrounding normal epidermis. In this way, the deep differences between normal callus tissue and pathological necrotic areas can be revealed in the image.

[0054] The system first establishes a sampling line along the normal direction of the boundary contour of the candidate abnormal region. This sampling line passes through the boundary of the candidate abnormal region and extends into the surrounding healthy cortical area. The system sequentially extracts color values ​​along this sampling line and calculates the speed and magnitude of color value change from the candidate abnormal region to the surrounding healthy cortical area, thereby generating color transition gradient features. If the color change is completed rapidly near the boundary, it usually indicates that the abnormal region has a relatively clear local boundary, more consistent with the appearance of a stable callus area; if the color change extends continuously to the outer cortex and the process is relatively slow, it indicates that the abnormal color may have a tendency to penetrate or spread outwards, more closely resembling the appearance of a pathological necrotic area.

[0055] After obtaining the surrounding healthy cortical region of the abnormal candidate region, the method further includes: obtaining the set of region pixels corresponding to all abnormal candidate regions on the current potato surface; removing the set of region pixels corresponding to the current abnormal candidate region from the set of region pixels corresponding to all abnormal candidate regions to obtain the background abnormal interference region; determining whether there is spatial overlap between the annular neighborhood and the background abnormal interference region; when there is spatial overlap, removing overlapping pixels belonging to the background abnormal interference region from the annular neighborhood to generate a clean annular neighborhood; using the clean annular neighborhood as the healthy cortical sampling area, and performing color transition gradient feature and texture coarsening limitation feature extraction based on the healthy cortical sampling area.

[0056] A ring-shaped neighborhood refers to a local sampling region formed around the current anomaly candidate region. It provides an outer reference for subsequent extraction of color transition and texture attenuation features between the anomaly candidate region and the surrounding healthy skin layer. Specifically, the system expands the region outwards according to a preset expansion width, using the boundary contour of the current anomaly candidate region as a reference, to obtain an outer expansion region surrounding the current anomaly candidate region. Then, it combines this with a foreground mask to remove background pixels falling outside the potato body and excludes pixels from the current anomaly candidate region itself, thus forming a ring-shaped neighborhood. This ring-shaped neighborhood can characterize the potato skin region within a certain range around the current anomaly candidate region, allowing the system to analyze whether color recovers quickly, whether texture roughness attenuates significantly, and whether the anomaly boundary converges clearly along the direction from the anomaly region outwards into the skin layer. By setting a ring-shaped neighborhood, the system no longer relies solely on the color and texture within the anomaly candidate region but introduces the surrounding skin layer as a reference, which is beneficial for distinguishing between stable callus manifestations confined within the wound and pathological decay manifestations spreading outwards.

[0057] The system first obtains the set of pixels corresponding to all candidate anomalies on the potato surface. This set of pixels can be obtained from the connected component analysis of the aforementioned anomaly response map, representing the pixel locations of all pixels on the potato surface identified as candidate anomalies. Subsequently, the system removes the set of pixels corresponding to the currently being processed anomaly candidate from the set of pixels corresponding to all candidate anomalies; the remaining portion is the background anomaly interference region. This background anomaly interference region is used to represent other candidate anomalies besides the current candidate anomaly region and should not itself be used as a source of healthy cortical sampling for the current candidate anomaly region.

[0058] After identifying the background abnormal interference region, the system determines whether there is spatial overlap between the annular neighborhood and the background abnormal interference region. If there is no spatial overlap, it means that the current annular neighborhood is not contaminated by other abnormal candidate regions and can be directly used as a healthy cortical sampling area. If there is spatial overlap, it means that the current annular neighborhood contains pixels from other abnormal candidate regions. The system needs to remove these overlapping pixels belonging to the background abnormal interference region from the annular neighborhood to generate a clean annular neighborhood. This clean annular neighborhood retains pixels located outside the current abnormal candidate region that are not occupied by other abnormal regions, and better reflects the true transition relationship between the current abnormal candidate region and the surrounding relatively normal cortex.

[0059] After generating a pure annular neighborhood, the system uses it as a healthy cortical sampling area and extracts color transition gradient features and texture coarsening limitation features based on this healthy cortical sampling area. In other words, when calculating the rate of color change outward from the anomalous candidate region, the outer sampling points come from the purified healthy cortical sampling area; when calculating whether texture roughness decays outward, the outer texture also comes from this pure annular neighborhood. This process avoids misjudging persistent browning and persistent roughness caused by adjacent anomalous regions as pathological spread, thereby reducing the probability of stable callus areas being incorrectly labeled as decayed areas in dense anomalous scenes.

[0060] Preferably, before using the clean annular neighborhood as the healthy cortical sampling area, the method further includes: counting the number of effective pixels in the clean annular neighborhood; determining whether the number of effective pixels is lower than a preset minimum statistical sample threshold; when the number of effective pixels is lower than the minimum statistical sample threshold, generating a neighborhood sampling insufficiency marker, and marking the color transition gradient feature and texture coarsening limitation feature of the corresponding abnormal candidate region as missing features; reducing the classification confidence of the corresponding abnormal candidate region based on the neighborhood sampling insufficiency marker, and guiding the corresponding abnormal candidate region to the medium-risk branch to be reviewed.

[0061] In this embodiment, although the pure annular neighborhood has eliminated interfering pixels caused by other abnormal candidate regions, the number of remaining effective pixels may be too small in some cases. For example, if the current abnormal candidate region is located near the edge of a potato, or if multiple adjacent abnormal regions are distributed around the current abnormal candidate region, the number of pixels available for sampling in the pure annular neighborhood may be significantly reduced after foreground masking and background abnormal interference region elimination. If color transition gradient features and texture coarsening limitation features are still extracted based on this small number of pixels, it is easy to cause unstable statistical results, thereby affecting the judgment of the probability of pathological decay.

[0062] Therefore, before using the clean annular neighborhood as the healthy cortical sampling area, the system first counts the number of valid pixels within the clean annular neighborhood. The number of valid pixels refers to the number of pixels within the clean annular neighborhood that still belong to the potato body and have not been identified as other abnormal candidate regions. The system compares this number of valid pixels with a preset minimum statistical sample threshold. The minimum statistical sample threshold can be preset based on camera resolution, the number of sampling lines, the width of the annular neighborhood, and the minimum sample size required for feature calculation, and is used to determine whether the current clean annular neighborhood has a reliable statistical basis.

[0063] When the number of valid pixels is not lower than the minimum statistical sample threshold, it indicates that the clean annular neighborhood still has enough outer reference pixels to participate in the extraction of color transition gradient features and texture coarsening limitation features as a healthy cortical sampling area. When the number of valid pixels is lower than the minimum statistical sample threshold, it indicates that there is a lack of sufficiently reliable outer cortical reference information around the current abnormal candidate region. If the above features are forcibly extracted in this case, bias may occur due to insufficient sample size. Therefore, the system generates a neighborhood sampling insufficiency marker and marks the color transition gradient features and texture coarsening limitation features of the corresponding abnormal candidate region as missing features.

[0064] The system lowers the classification confidence of corresponding abnormal candidate regions based on insufficient neighborhood sampling. In subsequent classification mapping, the system no longer considers the discrimination result of this abnormal candidate region as a highly reliable result with complete feature support, but rather as lacking sufficient surrounding reference cortical evidence. To avoid directly classifying the abnormal candidate region as a stable callus area or pathological extension area when evidence is insufficient, the system guides the corresponding abnormal candidate region to a medium-risk branch awaiting review, allowing the potato containing it to enter the re-examination process or trigger further testing.

[0065] The system generates boundary morphological continuity features based on the boundary contour curvature of the abnormal candidate region and the degree of convergence of this boundary contour relative to the surrounding healthy cortical region. Boundary contour curvature reflects the bending changes of the abnormal region's boundary, while the degree of contour convergence reflects whether the boundary forms a relatively complete and clear closed morphology. For stable callus tissue formed after mechanical injury, its boundary is usually relatively clear, with a relatively continuous contour morphology; for pathological decay areas, its boundary may appear blurred, fragmented, jagged, or irregularly diffused. Therefore, boundary morphological continuity features can provide morphological evidence for determining the source of the abnormality.

[0066] The system extracts the texture distribution of the abnormal candidate region and the surrounding healthy cortical region separately, and calculates the difference in texture distribution between the two. Simultaneously, the system analyzes the decay rate of texture roughness along the direction from the abnormal candidate region to the surrounding healthy cortical region, generating a texture coarsening limitation feature. If the texture roughness is mainly concentrated within the abnormal candidate region and decreases rapidly after entering the surrounding healthy cortical region, it indicates that the roughness feature has strong limitation, more consistent with the appearance of callus and corky tissue. If the surrounding healthy cortical region still maintains high roughness, or if the rough texture extends continuously outward from the abnormal region, it indicates that the abnormal change may have broken through the local boundary, posing a risk of pathological expansion.

[0067] The system also generates internal non-uniform structural variation characteristics based on the gray-level variance, local contrast, and dark core distribution within the abnormal candidate region. Gray-level variance and local contrast reflect whether the changes in light and dark within the region are drastic, while the distribution of the dark core reflects whether there are necrotic centers or localized dark patches within the abnormal region. Typically, stable callus tissue is relatively uniform, with inconspicuous dark cores; while pathological decay areas may exhibit localized necrotic centers, abrupt gray-level changes, or unevenly spreading patches.

[0068] Finally, the system combines color transition gradient features, boundary morphology continuity features, texture coarsening limitation features, and internal non-uniform structural change features to generate local correlation features. These local correlation features simultaneously contain external transition information between the abnormal region and the surrounding healthy cortex, as well as structural change information within the abnormal region. This provides a more complete and reliable feature basis for subsequent calculations of pathological decay probability, thereby reducing false rejections caused by judging solely based on color or rough texture.

[0069] Step 105 specifically involves determining the pathological decay probability of the abnormal candidate region based on the local correlation features.

[0070] After obtaining the local correlation features corresponding to the abnormal candidate regions, the system needs to further transform these features into pathological decay probabilities that can be used for risk assessment. Since features such as color transition gradients, boundary morphology continuity, texture coarsening limitations, and internal non-uniform structural changes may have different numerical ranges and dimensions, directly inputting them into the model for calculation might lead to a situation where a feature with a larger numerical value has an excessively strong influence on the discrimination result. Therefore, the system first normalizes the local correlation features to ensure that different types of features are within a relatively uniform numerical range, generating feature data to be identified, thereby improving the stability and comparability of subsequent classification mappings.

[0071] The classification mapping model is a pre-built recognition model, and its training samples include labeled stable callus region samples and labeled pathological rot region samples. Stable callus region samples can be derived from potato surface areas that have undergone normal callus treatment and have been manually confirmed to be free of rot. Pathological rot region samples can be derived from potato surface areas that have been confirmed to have rotten lesions through manual quality inspection, pathological testing, or re-inspection devices. For these samples, the system extracts local association features in the same manner as online recognition and uses these known-category local association features to train the classification mapping model, enabling the model to learn the differences between stable callus regions and pathological rot regions in terms of color transition, boundary morphology, texture diffusion, and internal structure.

[0072] During the actual sorting process, the system inputs the feature data to be identified corresponding to the current abnormal candidate region into the classification mapping model. Based on the discrimination rules formed during the training phase, the classification mapping model outputs the discrimination values ​​for the feature data to be identified, corresponding to stable callus regions and pathological decay regions, respectively. A higher discrimination output value corresponding to a stable callus region indicates that the current abnormal candidate region is closer to the characteristics of normal callus tissue; a higher discrimination output value corresponding to a pathological decay region indicates that the current abnormal candidate region is closer to the characteristics of decay lesions.

[0073] Furthermore, the system generates the pathological decay probability of abnormal candidate regions based on the discrimination output value corresponding to the pathological decay region and the difference between the two discrimination output values ​​of the stable callus region and the pathological decay region. In other words, the system considers not only the proximity of the current region to the pathological decay region but also its relative difference to the stable callus region. A higher pathological decay probability is generated when the discrimination output value of the pathological decay region is significantly higher than that of the stable callus region; a lower pathological decay probability is generated when the difference between the two is small or the discrimination output value of the stable callus region is higher.

[0074] Through the above processing, the system can transform complex local correlation features into continuous pathological decay probability values. These probability values ​​differ from the apparent anomaly scores obtained solely based on color or texture in traditional image recognition; they comprehensively reflect whether the candidate anomaly region possesses pathological decay characteristics such as color expansion, blurred boundaries, texture spread, and internal necrosis. Therefore, this step provides a quantitative basis for subsequent regional risk labeling and whole-potato status label generation, thereby reducing the possibility of misclassifying stable callus areas as decay areas.

[0075] Step 106 specifically involves generating regional risk markers based on the pathological decay probability, and generating whole-potato status labels based on the risk markers of each region.

[0076] After obtaining the pathological decay probability of abnormal candidate regions, the system needs to convert the continuous probability values ​​into risk labels that can be directly executed by subsequent sorting mechanisms. To this end, the system pre-sets low-risk and high-risk judgment thresholds, with the low-risk threshold being lower than the high-risk threshold. The low-risk threshold is used to distinguish abnormal candidate regions that clearly resemble stable callus appearance, while the high-risk threshold is used to distinguish abnormal candidate regions that clearly resemble pathological decay appearance. The interval between the two is used to accommodate intermediate state regions where the characteristic features are not clearly defined.

[0077] Specifically, when the pathological decay probability of a certain abnormal candidate area is less than or equal to the low-risk judgment threshold, it indicates that although the area exhibits abnormalities in color or texture, its local correlation characteristics are closer to stable callus tissue. For example, the color change is concentrated, the boundary is relatively clear, and the coarsening of the texture does not spread significantly outward. Therefore, the system marks this abnormal candidate area as a stable callus area. This marking indicates that the area should not be directly used as a basis for decay removal, thereby avoiding the mistaken removal of normal callus potatoes.

[0078] When the probability of pathological decay in an abnormal candidate region is greater than or equal to the high-risk threshold, it indicates that the region has strong pathological decay characteristics, such as an outward trend in color transition, irregular boundary morphology, coarsening texture extending to the surrounding cortex, or the presence of a distinct dark core. Therefore, the system marks this abnormal candidate region as a pathologically extended region. This marking indicates that the corresponding region has a high risk of decay and needs to be used as an important basis for subsequent removal and control.

[0079] When the probability of pathological decay in a certain abnormal candidate region is greater than the low-risk threshold but less than the high-risk threshold, it indicates that the region cannot be clearly classified as a stable callus region, nor can it be directly identified as a pathological extension region. It may belong to an intermediate state of early changes, unclear boundaries, or mixed features. Therefore, the system marks it as a region with mixed features.

[0080] After completing the risk labeling of individual abnormal candidate areas, the system further generates whole-potato status labels from the perspective of the whole potato. Since sorting agencies typically release, reject, or divert potatoes on an individual basis, it is necessary to aggregate the labels of multiple areas on the surface of the same potato into an executable label. Specifically, when the same potato has at least one pathologically extended area, it indicates that the potato has a clear risk of decay, and the system generates a high-risk rejection label; when the same potato does not have a pathologically extended area but has at least one characteristic mixed area, it indicates that the potato has an uncertain risk, and the system generates a medium-risk object label for review; when the same potato has neither a pathologically extended area nor a characteristic mixed area, it indicates that its abnormal manifestations are all stable callus or no obvious abnormalities were detected, and the system generates a low-risk retention label.

[0081] Through the above processing, the system converts regional-level pathological decay probabilities into whole-potato-level sorting control tags, achieving a seamless connection between image recognition results and sorting execution results. This method ensures that potatoes with clear decay risks are promptly removed, while retaining potatoes with normal callus, and introducing potatoes with unclear characteristics into the re-inspection channel, thereby reducing the risk of false rejection and missed rejection, and improving the accuracy and stability of automated sorting.

[0082] Step 107 specifically involves controlling the sorting mechanism to perform release, rejection, or re-inspection and diversion based on the whole potato status label and location coordinates.

[0083] After generating a whole-potato status label, the system needs to convert this label into a control action that the sorting mechanism can execute at a precise time. Because potatoes move continuously on the conveyor belt, there is usually a certain distance between the image acquisition position and the rejection or diversion mechanism. Therefore, the mechanism cannot be triggered immediately after identification; instead, a delay time needs to be calculated based on the potato's current position and the conveyor belt's movement. Specifically, the system determines the spatial position of the potato to be sorted at the moment of image acquisition based on the position coordinates obtained during image preprocessing, and combines this with real-time conveyor belt displacement data or conveyor belt speed to calculate the time required for the potato to travel from the image acquisition position to the sorting execution position, thus obtaining the delay time.

[0084] When the whole potato status label is marked as a high-risk rejection object, it indicates that there is at least one abnormal candidate area on the surface of the potato that is identified as a pathological expansion area, posing a clear risk of decay. At this time, the system generates a rejection trigger signal based on the aforementioned delay time, matching the rejection action with the moment the potato arrives at the rejection position. After the delay time is reached, the system controls the corresponding pneumatic valve to open, releasing a directional airflow to blow the potato to be sorted off the main conveyor belt and into the waste collection channel. This delayed trigger control avoids premature or delayed airflow release, preventing the rejection object from shifting, thereby improving rejection accuracy.

[0085] When the whole potato status label is set to "low-risk retention," it indicates that the potato does not have any pathological extension areas or mixed characteristic areas, or that its abnormal candidate areas mainly exhibit stable callus characteristics. In this case, the system does not generate a rejection trigger signal or trigger the diversion mechanism, allowing the potatoes to continue moving along the main conveyor belt and entering the qualified product channel. This processing method avoids rejecting normal callus potatoes as rotten potatoes, thereby reducing the loss of qualified raw materials.

[0086] When the whole potato status label is "medium-risk, pending review object," it indicates that although the potato has not been definitively identified as rotten, it possesses at least one area of ​​mixed characteristics, and its pathological rot probability falls between the low-risk and high-risk thresholds. For such uncertain objects, the system does not directly remove the waste. Instead, it generates a re-inspection diversion trigger signal based on the delay time and controls the diversion mechanism to move when the potato reaches the diversion position, guiding it into the re-inspection channel. The re-inspection channel can be configured with a manual review station, secondary image acquisition equipment, or a higher-precision detection device for further confirmation of the potato.

[0087] Through the aforementioned control method, the system combines the whole-potato status label obtained from image recognition with the real-time position control of the conveyor belt, achieving accurate connection between the recognition results and the physical sorting action. High-risk items are promptly removed, low-risk items are allowed to pass normally, and medium-risk items enter the re-inspection channel. This ensures the removal of rotten potatoes while avoiding the direct and accidental removal of normal callus potatoes, thus improving the accuracy, continuity, and controllability of the automated sorting process.

[0088] According to another embodiment, an image recognition-based system for removing rotten potato chunks is provided. Figure 2 A schematic block diagram of an image recognition-based potato rotten chunk removal system according to one embodiment is shown. Figure 2 As shown, the system includes:

[0089] The image preprocessing module 201 is used to acquire a visible light image of the surface of the potato to be sorted, and to preprocess the visible light image to generate a potato body image, a foreground mask, and position coordinates.

[0090] The abnormal candidate region determination module 202 is used to determine the effective body region in the potato body image according to the foreground mask, and to determine the abnormal candidate region within the effective body region according to color features and texture features.

[0091] The peripheral cortex determination module 203 is used to expand outward based on the boundary contour of the abnormal candidate region and determine the peripheral healthy cortex surrounding the abnormal candidate region in conjunction with the foreground mask.

[0092] The local correlation feature extraction module 204 is used to extract the local correlation features between the abnormal candidate region and the surrounding healthy cortex.

[0093] The decay probability determination module 205 is used to determine the pathological decay probability of the abnormal candidate region based on the local correlation features.

[0094] The risk labeling module 206 is used to generate regional risk labels based on the pathological decay probability, and to generate whole potato status labels based on the risk labels of each region.

[0095] The sorting control module 207 is used to control the sorting execution mechanism to perform release, rejection or re-inspection and diversion according to the whole potato status label and location coordinates.

[0096] As one possible implementation, the image preprocessing module 201, when preprocessing the visible light image to generate a potato body image, a foreground mask, and position coordinates, can be configured to: perform illumination compensation on the visible light image and convert the compensated visible light image to the HSV color space or CIELAB color space to obtain a converted image; perform foreground segmentation on the converted image based on the color difference between the conveyor belt background and the potato body to generate a foreground mask representing the effective projection range of the potato body; extract the body region from the compensated visible light image based on the foreground mask to generate the potato body image; and calculate the minimum bounding rectangle and centroid coordinates corresponding to the potato body based on the foreground mask to generate the position coordinates.

[0097] As one possible implementation, when the anomaly candidate region determination module 202 determines anomaly candidate regions based on color and texture features within the effective body region, it can be configured to: extract suspected color anomalies that conform to brown features within the effective body region; extract texture roughness within the effective body region based on local binary mode or gray-level co-occurrence matrix, and determine suspected texture anomalies; fuse the suspected color anomalies and the suspected texture anomalies to generate an anomaly response map; perform connected component analysis on the anomaly response map, and filter connected regions with areas smaller than a preset defect threshold to obtain anomaly candidate regions.

[0098] As one possible implementation, the local correlation feature extraction module 204, when extracting the local correlation features between the abnormal candidate region and the surrounding healthy cortex, can be configured to: establish a sampling line along the boundary contour normal direction of the abnormal candidate region that runs through the abnormal candidate region and the surrounding healthy cortex region, and generate a color transition gradient feature based on the color change rate from the abnormal candidate region to the surrounding healthy cortex region on the sampling line; generate a boundary morphology continuity feature based on the boundary contour curvature of the abnormal candidate region and the convergence degree of the boundary contour relative to the surrounding healthy cortex region; extract the texture distribution of the abnormal candidate region and the surrounding healthy cortex region respectively, and generate a texture coarsening limitation feature based on the difference in texture distribution between the two and the decay rate of texture roughness from the abnormal candidate region to the surrounding reference cortex region; generate an internal non-uniform structure change feature based on the gray-level variance, local contrast, and dark core distribution state inside the abnormal candidate region; and generate the local correlation feature based on the color transition gradient feature, boundary morphology continuity feature, texture coarsening limitation feature, and internal non-uniform structure change feature.

[0099] As one possible implementation, the decay probability determination module 205, when determining the pathological decay probability of the abnormal candidate region based on the local correlation features, can be configured to: normalize the local correlation features to generate feature data to be identified; obtain a pre-constructed classification mapping model, which is trained based on the local correlation features corresponding to labeled stable callus region samples and labeled pathological decay region samples; input the feature data to be identified into the classification mapping model to obtain the discrimination output values ​​of the feature data to be identified corresponding to stable callus regions and pathological decay regions respectively; and generate the pathological decay probability of the abnormal candidate region based on the discrimination output value corresponding to the pathological decay region and the difference between the discrimination output values ​​corresponding to stable callus regions and pathological decay regions.

[0100] As one possible implementation, when the risk labeling module 206 generates regional risk labels based on the pathological decay probability and generates whole-potato status labels based on each regional risk label, it can be configured to: set a low-risk judgment threshold and a high-risk judgment threshold, wherein the low-risk judgment threshold is less than the high-risk judgment threshold; when the pathological decay probability is less than or equal to the low-risk judgment threshold, the corresponding abnormal candidate region is marked as a stable callus region; when the pathological decay probability is greater than or equal to the high-risk judgment threshold, the corresponding abnormal candidate region is marked as a pathological expansion region; when the pathological decay probability is greater than the low-risk judgment threshold and less than the high-risk judgment threshold, the corresponding abnormal candidate region is marked as a feature-mixed region; when the same potato has at least one pathological expansion region, a high-risk rejection object label is generated; when the same potato does not have a pathological expansion region but has at least one feature-mixed region, a medium-risk pending review object label is generated; when the same potato does not have both a pathological expansion region and a feature-mixed region, a low-risk retention object label is generated.

[0101] As one possible implementation, the sorting control module 207, when controlling the sorting execution mechanism to perform release, rejection, or re-inspection diversion based on the whole potato status label and position coordinates, can be configured as follows: Based on the position coordinates and real-time conveyor belt displacement data, calculate the delay time for the potatoes to be sorted to reach the sorting execution position; when the whole potato status label is a high-risk rejection label, generate a rejection trigger signal based on the delay time and control the corresponding pneumatic valve to open, causing the potatoes to be sorted to be blown away from the main conveyor belt by airflow and enter the waste collection channel; when the whole potato status label is a low-risk retention label, do not generate a rejection trigger signal, allowing the potatoes to be sorted to enter the qualified product channel along the main conveyor belt; when the whole potato status label is a medium-risk re-inspection label, generate a re-inspection diversion trigger signal based on the delay time and control the diversion mechanism to guide the potatoes to be sorted into the re-inspection channel.

[0102] As one possible implementation, after determining the surrounding healthy cortex around the abnormal candidate region, the local correlation feature extraction module 204 can be configured to: expand outwards according to the boundary contour of the abnormal candidate region by a preset expansion width, and remove pixels outside the potato body in conjunction with the foreground mask to obtain an annular neighborhood for determining the surrounding healthy cortex; obtain the set of region pixels corresponding to all abnormal candidate regions on the current potato surface; remove the set of region pixels corresponding to the current abnormal candidate region from the set of region pixels corresponding to all abnormal candidate regions to obtain the background abnormal interference region; determine whether there is spatial overlap between the annular neighborhood and the background abnormal interference region; when there is spatial overlap, remove the overlapping pixels belonging to the background abnormal interference region from the annular neighborhood to generate a clean annular neighborhood; use the clean annular neighborhood as the healthy cortex sampling area, and perform color transition gradient feature and texture coarsening limitation feature extraction based on the healthy cortex sampling area.

[0103] As one possible implementation, before using the clean annular neighborhood as a healthy cortical sampling area, the local correlation feature extraction module 204 can be configured to: count the number of effective pixels in the clean annular neighborhood; determine whether the number of effective pixels is lower than a preset minimum statistical sample threshold; when the number of effective pixels is lower than the minimum statistical sample threshold, generate a neighborhood sampling insufficiency marker, and mark the color transition gradient feature and texture coarsening limitation feature of the corresponding abnormal candidate region as missing features; reduce the classification confidence of the corresponding abnormal candidate region based on the neighborhood sampling insufficiency marker.

[0104] in, Figure 3 The architecture of an electronic device is illustrated, which may include a processor 310, a video display adapter 311, a disk drive 312, an input / output interface 313, a network interface 314, and a memory 320. The processor 310, video display adapter 311, disk drive 312, input / output interface 313, network interface 314, and memory 320 can communicate with each other via a communication bus 330.

[0105] The processor 310 can be implemented using a general-purpose CPU, microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits to execute relevant programs in order to implement the technical solution provided in this application.

[0106] The memory 320 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 320 can store the operating system 321 for controlling the operation of the electronic device 300, and the basic input / output system (BIOS) 322 for controlling the low-level operations of the electronic device 300. Additionally, it can store a web browser 323, a data storage management system 324, and an image recognition-based potato rotten block removal system 325, etc. The aforementioned image recognition-based potato rotten block removal system 325 can be the application program that specifically implements the aforementioned steps in this embodiment. In summary, when implementing the technical solution provided in this application through software or firmware, the relevant program code is stored in the memory 320 and executed by the processor 310.

[0107] Input / output interface 313 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.

[0108] Network interface 314 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0109] Bus 330 includes a pathway for transmitting information between various components of the device, such as processor 310, video display adapter 311, disk drive 312, input / output interface 313, network interface 314, and memory 320.

[0110] It should be noted that although the above-described device only shows the processor 310, video display adapter 311, disk drive 312, input / output interface 313, network interface 314, memory 320, bus 330, etc., in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.

[0111] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for removing rotten potato chunks based on image recognition, characterized in that, include: A visible light image of the surface of the potato to be sorted is acquired, and the visible light image is preprocessed to generate a potato body image, a foreground mask, and position coordinates. The effective body region in the potato body image is determined based on the foreground mask, and anomaly candidate regions are determined within the effective body region based on color and texture features. Expand outward based on the boundary contour of the abnormal candidate region, and determine the surrounding healthy cortex around the abnormal candidate region in conjunction with the foreground mask; Extract the local correlation features between the abnormal candidate regions and the surrounding healthy cortex; The pathological decay probability of the abnormal candidate region is determined based on the local correlation features. Based on the pathological decay probability, regional risk markers are generated, and based on the risk markers of each region, whole potato status labels are generated. The sorting mechanism is controlled to perform release, rejection, or re-inspection and diversion based on the whole potato status label and location coordinates.

2. The method according to claim 1, characterized in that, The preprocessing of the visible light image to generate a potato body image, a foreground mask, and position coordinates includes: The visible light image is subjected to illumination compensation, and the compensated visible light image is converted to the HSV color space or CIELAB color space to obtain the converted image. Based on the color difference between the conveyor belt background and the potato body, the converted image is segmented foreground to generate a foreground mask that characterizes the effective projection range of the potato body. Based on the foreground mask, the body region of the compensated visible light image is extracted to generate a potato body image; The minimum bounding rectangle and centroid coordinates corresponding to the potato body are calculated based on the foreground mask, and the position coordinates are generated.

3. The method according to claim 1, characterized in that, The step of determining anomaly candidate regions based on color and texture features within the effective body area includes: Extract suspected anomalies that match the brown color characteristics within the effective body area; Texture roughness is extracted within the effective body region based on local binary mode or gray-level co-occurrence matrix, and suspected texture anomalies are identified. The suspected color anomalies and the suspected texture anomalies are fused together to generate an anomaly response map; Connectivity analysis is performed on the abnormal response graph, and connected regions with areas smaller than a preset defect threshold are filtered out to obtain abnormal candidate regions.

4. The method according to claim 1, characterized in that, The extraction of local association features between the abnormal candidate region and the surrounding healthy cortex includes: A sampling line is established along the boundary contour normal direction of the abnormal candidate region, penetrating the abnormal candidate region and the surrounding healthy cortical region. Based on the color change rate from the abnormal candidate region to the surrounding healthy cortical region on the sampling line, a color transition gradient feature is generated. Based on the boundary contour curvature of the abnormal candidate region and the degree of convergence of the boundary contour relative to the surrounding healthy cortical region, a boundary morphology continuity feature is generated. The texture distribution of the abnormal candidate region and the surrounding healthy cortical region are extracted respectively. Based on the difference in texture distribution between the two and the decay rate of texture roughness from the abnormal candidate region to the surrounding reference cortical region, a texture coarsening limitation feature is generated. Based on the gray-level variance, local contrast, and dark core distribution state within the abnormal candidate region, internal non-uniform structural variation characteristics are generated. The local correlation features are generated based on the color transition gradient features, boundary morphology continuity features, texture coarsening limitation features, and internal non-uniform structure variation features.

5. The method according to claim 4, characterized in that, The step of determining the pathological decay probability of the abnormal candidate region based on the local correlation features includes: The local correlation features are normalized to generate feature data to be identified; A pre-constructed classification mapping model is obtained, which is trained based on the local association features corresponding to labeled stable callus region samples and labeled pathological decay region samples. The feature data to be identified is input into the classification mapping model to obtain the discrimination output values ​​of the feature data to be identified corresponding to the stable callus area and the pathological decay area, respectively; The pathological decay probability of the abnormal candidate region is generated based on the discrimination output value corresponding to the pathological decay region and the difference between the discrimination output values ​​corresponding to the stable callus region and the pathological decay region.

6. The method according to claim 1, characterized in that, The process of generating regional risk markers based on the pathological rot probability, and generating whole-potato status labels based on each regional risk marker, includes: Set a low-risk determination threshold and a high-risk determination threshold, wherein the low-risk determination threshold is less than the high-risk determination threshold; When the probability of pathological decay is less than or equal to the low-risk determination threshold, the corresponding abnormal candidate area is marked as a stable callus area. When the probability of pathological decay is greater than or equal to the high-risk determination threshold, the corresponding abnormal candidate region is marked as a pathological extension region. When the probability of pathological decay is greater than the low-risk determination threshold and less than the high-risk determination threshold, the corresponding abnormal candidate region is marked as a feature mixing region. When at least one pathologically extended area exists in the same potato, a high-risk removal label is generated; When the same potato does not have a pathologically extended area but has at least one area with mixed characteristics, a medium-risk object label for review is generated. When there are no pathological extension areas and feature mixing areas in the same potato, a low-risk retention object label is generated.

7. The method according to claim 6, characterized in that, The step of controlling the sorting mechanism to perform release, rejection, or re-inspection and diversion based on the whole potato status label and location coordinates includes: Based on the location coordinates and real-time displacement data of the conveyor belt, calculate the delay time for the potatoes to be sorted to reach the sorting execution position; When the whole potato status label is a high-risk rejection label, a rejection trigger signal is generated according to the delay time, and the corresponding pneumatic valve is controlled to open, so that the potatoes to be sorted are blown away from the main conveyor belt by the airflow and enter the waste collection channel. When the whole potato status label is a low-risk retention label, no rejection trigger signal is generated, and the potatoes to be sorted enter the qualified product channel along the main conveyor belt. When the whole potato status label is a medium-risk object to be reviewed, a re-inspection diversion trigger signal is generated according to the delay time, and the diversion mechanism is controlled to guide the potatoes to be sorted into the re-inspection channel.

8. The method according to claim 4, characterized in that, After determining the surrounding healthy cortex around the abnormal candidate region, the method further includes: Based on the boundary contour of the abnormal candidate region, expand outward by a preset expansion width, and combine with the foreground mask to remove pixels outside the potato body to obtain a ring-shaped neighborhood for determining the surrounding healthy skin layer; Obtain the set of pixels corresponding to all candidate abnormal regions on the current potato surface; Remove the set of pixels corresponding to the current abnormal candidate region from the set of pixels corresponding to all abnormal candidate regions to obtain the background abnormal interference region. Determine whether there is spatial overlap between the annular neighborhood and the background abnormal interference region; When spatial overlap exists, overlapping pixels belonging to the background abnormal interference region are removed from the annular neighborhood to generate a clean annular neighborhood. The pure annular neighborhood is used as the healthy cortical sampling area, and color transition gradient features and texture coarsening limitation features are extracted based on the healthy cortical sampling area.

9. The method according to claim 8, characterized in that, Before using the pure annular neighborhood as a healthy cortical sampling area, the method further includes: Count the number of valid pixels in the pure annular neighborhood; Determine whether the number of effective pixels is lower than a preset minimum statistical sample threshold; When the number of effective pixels is lower than the minimum statistical sample threshold, a neighborhood sampling insufficiency marker is generated, and the color transition gradient feature and texture coarsening limitation feature of the corresponding abnormal candidate region are marked as missing features. The classification confidence of the corresponding abnormal candidate region is reduced based on the insufficient sampling of the neighborhood.

10. A potato rotten block removal system based on image recognition, characterized in that, include: The image preprocessing module is used to acquire a visible light image of the surface of the potatoes to be sorted, and to preprocess the visible light image to generate a potato body image, a foreground mask, and position coordinates. An abnormal candidate region determination module is used to determine the effective body region in the potato body image based on the foreground mask, and to determine the abnormal candidate region within the effective body region based on color features and texture features. The peripheral cortex determination module is used to expand outward based on the boundary contour of the abnormal candidate region and determine the peripheral healthy cortex surrounding the abnormal candidate region in combination with the foreground mask; The local correlation feature extraction module is used to extract the local correlation features between the abnormal candidate region and the surrounding healthy cortex; The decay probability determination module is used to determine the pathological decay probability of the abnormal candidate region based on the local correlation features. The risk labeling module is used to generate regional risk labels based on the pathological decay probability, and to generate whole potato status labels based on the risk labels of each region. The sorting control module is used to control the sorting execution mechanism to perform release, rejection, or re-inspection and diversion based on the whole potato status label and location coordinates.