Vision model-based lithium hexafluorophosphate impurity identification system

By combining image normalization processing and multi-scale residual generation network with grain boundary constraint discrimination, the problem of unstable identification of lithium hexafluorophosphate impurities in the prior art is solved, and accurate identification of weak color difference impurities and local texture destruction areas is achieved.

CN122636636APending Publication Date: 2026-08-25HUNAN ZHONGLAN NEW MATERIAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611141806.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing visual models struggle to distinguish between normal grain texture fluctuations and genuine impurity anomalies when identifying impurities in lithium hexafluorophosphate, leading to unstable identification, especially prone to misjudgment in cases of low contrast, small or weak color difference impurities.

Method used

An image normalization processing chain, a clean grain background reconstruction model, a multi-scale residual generation network, and a grain boundary constraint discrimination network are used to filter out impurity candidate regions by generating residual features and grain boundary continuity relationships.

Benefits of technology

It effectively separates normal grain texture from real impurity anomalies, improving the stability and accuracy of impurity identification and reducing misjudgments, especially in the identification of weak color difference impurities and areas with local texture damage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122636636A_ABST
    Figure CN122636636A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of image recognition and computer vision data processing, and particularly discloses a lithium hexafluorophosphate impurity recognition system based on a visual model. The system comprises an image normalization processing chain, a clean grain background reconstruction model, a multi-scale residual generation network, a grain boundary constraint discrimination network and an impurity region output layer. The system performs chroma normalization, local block division and particle texture zoning on the lithium hexafluorophosphate powder or crystal image, learns the normal visual distribution of clean grains and generates a background reconstruction map, forms residual features of particle scales, grain scales and local agglomeration scales according to the original image and the background reconstruction map, and filters impurity candidate regions in combination with the continuous relationship of grain boundaries, and outputs the impurity position and confidence. The system can separate normal grain texture fluctuations, boundary shadows and real impurity residuals, reduce misjudgment and missed judgment in weak color difference and small impurity recognition, and improve the stability of impurity region positioning and confidence determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image recognition and computer vision data processing technology, specifically a lithium hexafluorophosphate impurity identification system based on a visual model. Background Technology

[0002] Lithium hexafluorophosphate (LiPF6), a crucial raw material for lithium-ion battery electrolytes, has stringent requirements regarding impurity content and surface cleanliness. Current visual inspection methods typically involve placing sampled LiPF6 powder or crystals within a fixed imaging area, acquiring surface images using image acquisition equipment, and then performing grayscale conversion, filtering, edge enhancement, threshold segmentation, and connected component analysis using image processing programs. For foreign particles that are darker in color, have more complete outlines, or are larger in size, conventional methods can filter them using features such as grayscale difference, area, roundness, and edge strength, marking areas exceeding a preset range as impurity candidate regions. Some methods further employ convolutional visual models to classify candidate regions, training a classifier using labeled impurity image samples to teach the model the differences in color, texture, and morphology between impurity regions and normal grain regions.

[0003] In relatively recent existing technologies, lithium hexafluorophosphate impurity identification typically employs whole-image classification, object detection, or semantic segmentation models. These approaches generally involve first normalizing the image, then inputting it into a visual model to extract multi-layer features, with the detection head outputting impurity boxes, segmentation masks, or category confidence scores. To accommodate small targets in powder images, existing methods introduce multi-scale feature pyramids, attention mechanisms, or local cropping strategies, enabling the model to identify point-like or sheet-like impurities within a smaller receptive field. The identification results of these methods depend on the similarity between the appearance of impurities in the training samples and the image to be tested, as well as the consistency of the normal grain background across different samples. When the edge shadows, particle overlap, local reflections, or texture roughness of normal grains change, the local features extracted by the model can easily become similar to impurity features, leading to unstable candidate region boundaries.

[0004] The main technical problem with existing technologies is that conventional visual models directly learn impurity discrimination features from the entire image or candidate image patches of lithium hexafluorophosphate, without establishing an interpretable representation of the normal grain visual background, nor introducing the continuity of grain boundaries into the residual discrimination process. This leads to the overlap of normal grain texture fluctuations and real impurity anomalies in the feature space. For low-contrast, miniaturized, or weakly chromatic aberration impurities, impurity regions exhibit similar grayscale and texture characteristics to grain shadows, intergranular gaps, crystal boundaries, and locally overlapping areas, making it difficult to distinguish the source of anomalies by simply relying on object detection, segmentation, or classification networks. Consequently, in weakly anomalous scenarios, the model easily identifies normal boundary residuals as impurities and also easily classifies real impurities covered by grain textures as normal regions, affecting the stability of lithium hexafluorophosphate impurity region localization and confidence determination. Summary of the Invention

[0005] The purpose of this invention is to provide a visual model-based lithium hexafluorophosphate impurity identification system, which can solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0007] A visual model-based lithium hexafluorophosphate impurity identification system includes an image normalization processing chain, a clean grain background reconstruction model, a multi-scale residual generation network, a grain boundary constraint discrimination network, and an impurity region output layer.

[0008] The image normalization processing chain performs chromaticity normalization, local block division, and particle texture partitioning on lithium hexafluorophosphate powder or crystal images.

[0009] The clean grain background reconstruction model learns the normal grain visual distribution in the clean area and generates a background reconstruction map.

[0010] The multi-scale residual generation network generates residual features based on the original image and the reconstructed background image;

[0011] The grain boundary constraint discrimination network determines impurity candidate regions based on residual features and the continuity relationship of grain boundaries. The impurity region output layer outputs the impurity location and confidence level.

[0012] Preferably, the image normalization processing chain includes a local illumination correction subchain, a grain texture preservation subchain, and a local block index subchain;

[0013] The local illumination correction subchain generates an illumination compensation map based on the low-frequency brightness component of the image. The grain texture preservation subchain retains the grain edge gradient and particle surface texture after illumination compensation. The local block index subchain establishes local block numbers according to the consistency of grain boundary density and texture direction, so that the clean grain background reconstruction model receives lithium hexafluorophosphate image blocks with spatial adjacency relationships.

[0014] Preferably, the clean grain background reconstruction model includes a masking image encoder, a grain visual distribution decoder, and a clean sample constraint branch;

[0015] The masking image encoder performs masking encoding on some texture regions in the local block, the grain visual distribution decoder generates normal grain predicted texture corresponding to the masked region, and the clean sample constraint branch updates the normal grain visual distribution parameters together based on the impurity-free labeled region, the low residual region and the adjacent grain consistent region.

[0016] Preferably, the multi-scale residual generation network includes a particle-scale residual channel, a grain-scale residual channel, and a locally aggregated scale residual channel;

[0017] The particle-scale residual channel extracts point-like color differences and fine-grained foreign matter residuals, the grain-scale residual channel extracts grain surface texture fracture residuals, and the local agglomeration-scale residual channel extracts abnormal agglomeration residuals across local blocks. The outputs of the three residual channels are mapped to the same residual coordinate system according to their spatial overlap positions to form a multi-scale residual feature map.

[0018] Preferably, the local block index subchain includes a boundary density calculation layer, a texture direction aggregation layer, and a neighborhood consistency marking layer;

[0019] The boundary density calculation layer generates a grain boundary density map based on the gradient magnitude and edge closure. The texture direction aggregation layer vectorizes the main texture direction within the same local block. The neighborhood consistency labeling layer generates a neighborhood relationship label based on the boundary density difference and texture direction angle between adjacent local blocks, and inputs the neighborhood relationship label into the grain boundary constraint discrimination network.

[0020] Preferably, the clean sample constraint branch includes a candidate clean area screening layer, a pseudo-anomaly exclusion layer, and a reconstruction loss allocation layer;

[0021] The candidate clean area screening layer selects training areas based on local residual stability. The pseudo-anomaly exclusion layer excludes local blocks located at grain overlap edges, grain gaps, and strong reflective positions. The reconstruction loss allocation layer assigns different loss weights to the main grain area, grain boundary area, and grain gap area, and feeds back the loss weights to the occlusion image encoder and the grain visual distribution decoder.

[0022] Preferably, the multi-scale residual generation network further includes a residual consistency fusion layer;

[0023] The residual consistency fusion layer resamples and aligns the spatial responses of the particle-scale residual channels, grain-scale residual channels, and locally aggregated scale residual channels, and generates scale consistency codes based on the continuous occurrence positions of the residual responses at different scales.

[0024] The scale consistency encoding and the residual amplitude of each scale are input together into the grain boundary constraint discrimination network.

[0025] Preferably, the grain boundary constraint discrimination network includes a residual boundary relationship encoding layer, a natural boundary residual classification layer, and a suspected impurity residual screening layer;

[0026] The residual boundary relationship encoding layer performs coordinate registration between the multi-scale residual feature map and the neighborhood relationship marker. The natural boundary residual classification layer identifies natural boundary residuals based on the boundary closure, the continuity of texture direction on both sides of the boundary, and the residual distribution pattern along the boundary. The suspected impurity residual screening layer retains local residual regions that are deviated from the grain boundary continuity relationship.

[0027] Preferably, the residual consistency fusion layer further includes a residual source decomposition layer and a scale conflict resolution layer;

[0028] The residual source decomposition layer generates source codes based on the correspondence between residuals and background reconstruction errors, local chromaticity deviations, and texture breakage responses. When the particle-scale residuals and grain-scale residuals overlap in position but have inconsistent texture directions, the scale conflict resolution layer marks and retains residual nodes dominated by abnormal sources based on source codes and neighborhood relationships, and inputs the residual nodes into the suspected impurity residual screening layer.

[0029] Preferably, the impurity region output layer includes a candidate region merging layer, a confidence generation layer, and an impurity hotspot mapping layer;

[0030] The candidate region merging layer merges local residual regions that are detached from the grain boundary continuity relationship and have scale consistency coding according to spatial adjacency. The confidence generation layer generates confidence based on the degree of non-reconstructability of the normal background of the merged region, the residual source coding, and the natural boundary residual exclusion result. The impurity hot zone mapping layer maps the confidence and local block number to the impurity location result.

[0031] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0032] 1. Through the collaborative processing of an image normalization processing chain, a clean grain background reconstruction model, a multi-scale residual generation network, and a grain boundary constraint discrimination network, normal grain textures in lithium hexafluorophosphate images can be first transformed into reconstructable background distributions. Then, residual features are formed using the difference between the original image and the reconstructed background image, allowing impurity identification to no longer directly rely on the overall image appearance similarity. For weak color difference impurities, point-like foreign objects, and areas with localized texture damage, portions that cannot be explained by background reconstruction are preserved in the residual features. For normal variations caused by grain boundaries, intergranular spaces, and localized reflections, the continuity of grain boundaries provides a basis for exclusion. The multi-scale residual generation network maps anomalous responses at the particle scale, grain scale, and localized agglomeration scale to the same coordinate system. The grain boundary constraint discrimination network then filters impurity candidate regions based on the relationship between residuals and boundary continuity, separating normal texture fluctuations from real impurity anomalies in the discrimination chain.

[0033] 2. Further technical improvements include local illumination correction, grain texture preservation, and local block indexing, which retain the boundary gradients and spatial adjacency relationships of lithium hexafluorophosphate grains during the input stage, providing a consistent data foundation for subsequent background reconstruction and boundary discrimination. The clean sample constraint branch reduces interference from overlapping grain edges, grain gaps, and highly reflective locations on the learning of the normal grain visual distribution through candidate clean region screening, pseudo-anomaly elimination, and partition loss allocation. The residual consistency fusion layer, residual source decomposition layer, and scale conflict resolution layer differentiate and spatially align residuals at different scales, enabling the impurity region output layer to generate confidence scores by combining the degree of non-reconstructability of the normal background, residual source encoding, and natural boundary residual elimination results when merging candidate regions. This ensures that the output impurity location corresponds to the local block number, reducing recognition bias caused by isolated noise and edge pseudo-residuals. Attached Figure Description

[0034] Figure 1 The overall processing flowchart of the vision model-based lithium hexafluorophosphate impurity identification system is shown below.

[0035] Figure 2 Flowchart for generating image normalization processing chain and local block index;

[0036] Figure 3 Flowchart of collaborative processing between clean grain background reconstruction model and multi-scale residual generation network;

[0037] Figure 4 The flowchart for the output of the grain boundary constraint discrimination network and impurity regions is shown. Detailed Implementation

[0038] In one embodiment, reference Figure 1A visual model-based lithium hexafluorophosphate impurity identification system includes an image normalization processing chain, a clean grain background reconstruction model, a multi-scale residual generation network, a grain boundary constraint discrimination network, and an impurity region output layer. The image normalization processing chain performs chromaticity normalization, local block segmentation, and particle texture partitioning on lithium hexafluorophosphate powder or crystal images. The clean grain background reconstruction model learns the normal grain visual distribution based on clean areas and generates a background reconstruction map. The multi-scale residual generation network generates residual features based on the original image and the background reconstruction map. The grain boundary constraint discrimination network determines impurity candidate regions based on the residual features and the continuity relationship between grain boundaries. The impurity region output layer... The output includes the location and confidence level of impurities. In this embodiment, the image of lithium hexafluorophosphate powder or crystal is an externally input two-dimensional material appearance image. The image normalization processing chain does not change the grain edge relationship in the image, but compresses the chromaticity shift and local brightness fluctuation between different images to a unified characterization range. The clean grain background reconstruction model forms a reconstructable distribution of normal grains with the clean area as a reference. The multi-scale residual generation network converts local changes that cannot be explained by the normal grain distribution into residual responses. The grain boundary constraint discrimination network then jointly judges the residual response and the grain boundary continuity relationship. The impurity region output layer forms the output result based on the spatial location and discrimination confidence level of the candidate region.

[0039] Specifically, after linking the lithium hexafluorophosphate image to the image normalization process, the input image is represented as an image tensor composed of pixel position, chromaticity component, luminance component, and local gradient. Chromaticity normalization uses clean candidate regions within the same image to establish a reference chromaticity center, avoiding the cumulative offset between batch images caused by directly using a fixed chromaticity benchmark. Local block partitioning is not a simple equidistant slice, but rather a local block index is established by combining grain edge density and texture direction continuity, so that spatial adjacency is preserved between adjacent local blocks. Grain texture partitioning forms region labels according to the grain body, grain boundary, and grain gap. The region labels are input into the clean grain background reconstruction model along with the local blocks, enabling the background reconstruction process to distinguish normal grain texture, normal grain boundary, and suspected abnormal positions. During operation, the difference between the background reconstruction image and the original image forms a residual. The residual is then cross-validated with the grain boundary continuity relationship to remove the residuals caused by normal grain shadows, grain overlap, and local reflections from the impurity candidate regions.

[0040] ;

[0041] in, Indicates the first The original image tensor of each local block, This represents the local block tensor after chroma normalization and texture preservation. Indicates the relationship with the first Each local block belongs to a set of local blocks within the same clean reference partition. This represents the chromaticity mean vector of the local block set. This represents the discrete chromaticity vector of the local block set. This represents a stable constant to prevent the denominator from being zero. Indicates the first The gradient tensor of a local block, Indicates the texture preservation coefficient; when When the value is 0, the processing only performs chromaticity normalization, and the grain boundary gradient is not included in subsequent calculations; when... When a positive value is taken, the grain edges and grain surface texture are preserved together with the normalization result, so that the subsequent grain boundary constraint discrimination network can obtain the boundary basis corresponding to the residual position.

[0042] In one embodiment, the clean grain background reconstruction model includes an encoding part that implicitly represents local blocks and a decoding part that generates a normal grain visual distribution. The encoding part maps the normalized local blocks into feature vectors containing the grain body texture, grain edge gradient, and intergranular state. The decoding part recovers the normal grain image under the condition that the local area is occluded. The occlusion does not randomly destroy all features, but sets occlusion positions in the grain body region, grain boundary region, and intergranular region respectively, so that the model learns the fine texture, boundary transition, and dark part representation of the normal grain surface respectively. The clean region is not limited to artificially pre-labeled impurity-free regions, but also includes training regions jointly selected by low residual regions, neighborhood texture consistent regions, and boundary continuation regions. During model training, if a local block can be stably recovered after multiple occlusions, the local block enters the update set of the normal grain visual distribution. If a local block has color difference points, texture destruction, or non-boundary residuals that do not appear stably with changes in the occlusion method, the local block is not used to update the normal grain visual distribution.

[0043] ;

[0044] in, This represents element-wise multiplication, i.e., the Hadamard product. Indicates the first Local blocks at scale The residual characteristics below, Indicates the original image at scale The local block representation below, This indicates that the clean grain background reconstruction model is at the scale The background reconstruction image generated below, This represents the region weight mask corresponding to the grain bulk, grain boundary, and intergranular space; when When a higher weight is applied to the main grain region and a lower weight is applied to the natural boundary region, the residuals generated by tiny impurities on the grain surface are preserved, while the residuals generated by the shadows of the natural boundary are suppressed.

[0045] In one embodiment, a multi-scale residual generation network establishes residual channels at the particle scale, grain scale, and local agglomeration scale for the same lithium hexafluorophosphate image. The particle scale residual channel responds locally to point-like color differences, small foreign objects, and pinhole-like dark spots. The grain scale residual channel responds to surface texture breaks, patchy color shifts, and discontinuous textures within individual grains. The local agglomeration scale residual channel responds to anomalous aggregations, patchy darkening, or atypical powder accumulations across multiple local blocks. The outputs of the three scale channels are not directly added together. Instead, they are first mapped to the same residual coordinate system according to the local block index and image coordinates, and then the persistence of the response at the same location at different scales is encoded. When the same location shows an isolated response only at a single scale, the location is retained as a residual node to be verified. When the same location has a spatial overlap relationship in two or more scales and the residual source is consistent, the location is marked as a scale-consistent residual node. The subsequent grain boundary constraint discrimination network determines whether to form an impurity candidate region based on the continuity relationship between the scale-consistent residual node and the grain boundary.

[0046] In one embodiment, the grain boundary constraint discrimination network jointly encodes residual features and grain boundary continuity. The grain boundary continuity is composed of the boundary closure degree of the local block, the angle between the main texture directions of adjacent local blocks, the residual extension shape along the boundary, and the consistency of texture transition on both sides of the boundary. After receiving the multi-scale residual feature map, the network projects each residual node onto the grain boundary map. If the residual node is linearly distributed along the natural grain boundary and the texture direction on both sides of the boundary remains continuous, it is classified as a natural boundary residual. If the residual node is located in the main grain region or deviates from the boundary continuation line, and the residual source encoding shows color deviation, texture breakage, or local foreign object morphology, it is retained as a suspected impurity residual. If the residual node is in the intergranular space and the dark part morphology of the neighboring local block is continuous, it does not enter the impurity candidate region. This forms a continuous discrimination link from unreconstructable background and scale consistency to boundary relationship exclusion. The output result is transformed from the impurity region output layer into localizable region coordinates and confidence.

[0047] In a preferred embodiment, reference Figure 2The image normalization processing chain includes a local illumination correction subchain, a grain texture preservation subchain, and a local block index subchain. The local illumination correction subchain generates an illumination compensation map based on the low-frequency brightness component of the image. The grain texture preservation subchain preserves the grain edge gradient and particle surface texture after illumination compensation. The local block index subchain establishes local block numbers according to the grain boundary density and texture direction consistency, enabling the clean grain background reconstruction model to receive lithium hexafluorophosphate image blocks with spatial adjacency relationships. Specifically, the local illumination correction subchain decomposes the input image into low-frequency brightness components and high-frequency texture components. The low-frequency brightness components are used to estimate the local illumination compensation map, and the high-frequency texture components are used to preserve the true edges of the grain surface. The grain texture preservation subchain simultaneously maintains the relative relationship between gradient direction and gradient magnitude when the compensation map is applied to the original image, preventing normal grain boundaries from being smoothed out after illumination correction. The local block index subchain stores the image block number and neighborhood relationship together, enabling the background reconstruction model to call the texture direction information of adjacent local blocks when restoring occluded areas.

[0048] Further, the local block index subchain includes a boundary density calculation layer, a texture direction aggregation layer, and a neighborhood consistency labeling layer; the boundary density calculation layer generates a grain boundary density map based on gradient magnitude and edge closure; the texture direction aggregation layer vectorizes the main texture direction within the same local block; the neighborhood consistency labeling layer generates a neighborhood relationship label based on the boundary density difference and texture direction angle between adjacent local blocks, and inputs the neighborhood relationship label into the grain boundary constraint discrimination network; in this embodiment, the boundary density calculation layer first connects the gradient points within each local block. The analysis process obtains closed or semi-closed curves formed by grain boundaries, and then forms the boundary density based on the correspondence between the length of the closed curve and the area of ​​the local block. The texture direction aggregation layer takes the gradient direction vector as input and performs a weighted summation of the direction distribution within the same local block to obtain the main texture direction. The neighborhood consistency labeling layer compares the boundary density difference between adjacent local blocks with the angle between the main texture direction. If both the difference and the angle are within the normal grain continuation range, the local block relationship is marked as a continuation relationship. If the residual crosses the continuation relationship but is not distributed along the boundary, the relationship label is passed to the suspected impurity residual screening layer.

[0049] ;

[0050] in, Indicates the first The local block and the first Neighborhood difference between adjacent local blocks and These represent the grain boundary densities of the two local blocks, respectively. This indicates the angle between the main texture directions of two local blocks. This indicates a direction consistency operation. and These represent the weights of boundary density difference and texture direction difference, respectively; when When the value is 0, the main texture directions of the two local blocks are consistent, and the second item is set to 0; when When taking the corresponding right angle value, the second term takes a higher value, indicating that the texture continuity of adjacent local blocks is weak. The grain boundary constraint discrimination network reduces the reliability of the natural boundary continuity judgment accordingly.

[0051] In a preferred embodiment, reference Figure 3 The clean grain background reconstruction model includes a masking image encoder, a grain visual distribution decoder, and a clean sample constraint branch. The masking image encoder performs masking encoding on some texture regions in local blocks. The grain visual distribution decoder generates normal grain prediction textures corresponding to the masked regions. The clean sample constraint branch updates the normal grain visual distribution parameters based on impurity-free labeled regions, low residual regions, and adjacent grain consistent regions. In this embodiment, the masking image encoder does not treat the masked regions as missing noise, but forms a contextual representation based on the grain boundaries, texture direction, and chromaticity distribution around the masked position. The grain visual distribution decoder generates a background reconstruction map based on the contextual representation and outputs grain body prediction, boundary transition prediction, and grain gap prediction during the decoding process. The clean sample constraint branch records the source of the training regions. When the impurity-free labeled regions and low residual regions coincide in space, the regions are preferentially included in the normal grain visual distribution update set. When adjacent grain consistent regions conflict with boundary closure relationships, the regions are not used for updating.

[0052] Preferably, the clean sample constraint branch includes a candidate clean region screening layer, a pseudo-anomaly exclusion layer, and a reconstruction loss allocation layer. The candidate clean region screening layer selects training regions based on local residual stability. The pseudo-anomaly exclusion layer excludes local blocks located at grain overlap edges, grain gaps, and highly reflective positions. The reconstruction loss allocation layer assigns different loss weights to the main grain region, grain boundary region, and grain gap region, and feeds back the loss weights to the occlusion image encoder and the grain visual distribution decoder. In this embodiment, the local residual stability is determined by the same local block under various occlusion conditions. The reconstruction difference fluctuation under different occlusion methods is determined. If the local block residuals migrate significantly with the change of occlusion position, it indicates that the residuals are more due to reconstruction uncertainty. If the local block residuals appear stably in the same position under different occlusion methods, they enter the pseudo-anomaly exclusion layer. The pseudo-anomaly exclusion layer uses the linear continuity features of the overlapping edges of grains, the neighborhood dark continuity features of the intergranular gaps, and the brightness saturation features of the strong reflective positions to exclude them. The reconstruction loss allocation layer assigns weights according to the region labels, so that the main grain region bears the main texture learning constraints, the grain boundary region bears the boundary transition constraints, and the intergranular gap region bears the dark continuity constraints.

[0053] ;

[0054] in, This represents the reconstruction loss of the clean grain background reconstruction model. This represents the set of local blocks that participated in the training. , , They represent the first Original representation of the grain body, grain boundaries, and intergranular spaces in a local block. , , These represent the reconstructed representations of the corresponding regions. , , These represent the reconstruction loss weights for the three types of regions. When the pseudo-anomaly exclusion layer determines that a local block is located in a highly reflective area, the corresponding region weight is set to a low value to prevent the reconstruction error caused by brightness saturation from entering the normal grain texture learning. If the local block belongs to the main grain and has no stable residual, then... A higher value is chosen so that the main grain texture constrains the background distribution.

[0055] In one embodiment, the multi-scale residual generation network includes a particle-scale residual channel, a grain-scale residual channel, and a local clustering-scale residual channel. The particle-scale residual channel extracts point-like color differences and fine-grained foreign object residuals, the grain-scale residual channel extracts grain surface texture fracture residuals, and the local clustering-scale residual channel extracts anomalous clustering residuals across local blocks. The outputs of the three residual channels are mapped to the same residual coordinate system according to their spatial overlap positions to form a multi-scale residual feature map. In this embodiment, the particle-scale residual channel uses local difference responses with smaller neighborhoods to represent point-like anomalies, the grain-scale residual channel uses texture difference responses covering the entire grain body to represent grain surface anomalies, and the local clustering-scale residual channel uses regional consistency responses across local blocks to represent continuous anomalies. The responses formed at the same residual location in different scale channels are uniformly mapped to the original image coordinates. During mapping, the coordinates are determined by the local block number and the position within the block to avoid erroneous merging of anomalous locations at different scales.

[0056] Furthermore, the multi-scale residual generation network also includes a residual consistency fusion layer. This layer resamples and aligns the spatial responses of the particle-scale residual channel, the grain-scale residual channel, and the locally clustered scale residual channel, and generates a scale consistency code based on the continuous occurrence position of the residual response at different scales. The scale consistency code and the residual amplitude of each scale are input into the grain boundary constraint discrimination network. In this embodiment, the resampling alignment uses the original image coordinates as a common reference to convert the residual responses at each scale into a residual map of a uniform size, and then locally aggregates the responses near the same coordinates. The scale consistency code includes the number of scales in which the residuals occur, the positional offset between scales, and the strength relationship of the scale responses. When there are point-like residuals at the particle scale but no corresponding responses at the grain scale and the locally clustered scale, the code records an isolated particle response. When responses appear at all three scales in the same main grain region, the code records a continuous abnormal response. The grain boundary constraint discrimination network performs difference processing on the relationship between the residuals and the boundary accordingly.

[0057] In a preferred embodiment, the residual consistency fusion layer further includes a residual source decomposition layer and a scale conflict resolution layer. The residual source decomposition layer generates a source code based on the correspondence between the residual and background reconstruction error, local chromaticity deviation, and texture breakage response. When the particle-scale residual and grain-scale residual overlap in position but have inconsistent texture directions, the scale conflict resolution layer marks and retains residual nodes dominated by abnormal sources based on the source code and neighborhood relationship, and inputs the residual nodes into the suspected impurity residual screening layer. In this embodiment, the residual source decomposition layer represents each residual node as a result of multiple repetitions. The source vector is constructed from error components, chromaticity deviation components, texture breakage components, and boundary adjacency components. If the residual mainly comes from background reconstruction error and chromaticity deviation and texture breakage exist simultaneously, the source encoding is biased towards abnormal sources. If the residual mainly extends along the natural boundary and the texture direction is continuous, the source encoding is biased towards boundary sources. When the scale conflict resolution layer gives inconsistent judgments at different scales, it calls the neighborhood relationship label. If the adjacent local blocks maintain texture continuity while the residual nodes deviate from the continuity direction, the nodes with abnormal sources are retained. If the residual nodes are distributed along the continuity boundary, it is transferred to the natural boundary residual classification layer.

[0058] ;

[0059] in, Indicates position The scale consistency coding value, This represents the set of scales consisting of the particle scale, grain scale, and local aggregation scale. Indicates position In scale The residual response intensity under the following conditions Indicates position In scale The value is set to 1 if a sustained response exists and 0 if no sustained response exists; when the same location is only selected at the particle scale... hour, The response at a single scale determines the outcome; further analysis requires combining the source encoding. When the same location is measured at all three scales... And when the response positions overlap, This reflects the continued existence of cross-scale residuals, and the candidate region merging layer obtains a more stable spatial basis.

[0060] In one embodiment, reference Figure 4 The grain boundary constraint discrimination network includes a residual boundary relationship encoding layer, a natural boundary residual classification layer, and a suspected impurity residual screening layer. The residual boundary relationship encoding layer performs coordinate registration between the multi-scale residual feature map and the neighborhood relationship marker. The natural boundary residual classification layer identifies natural boundary residuals based on the boundary closure, the continuity of texture directions on both sides of the boundary, and the residual distribution pattern along the boundary. The suspected impurity residual screening layer retains local residual regions that are detached from the grain boundary continuity relationship. In this embodiment, the coordinate registration uses the local block number as the basic index to map the residual node position, local block boundary density, main texture direction, and neighborhood consistency marker to the same discrimination map. The natural boundary residual classification layer determines whether the residual is distributed in a continuous band along the grain edge and whether there is a traceable continuity in the texture direction on both sides of the boundary. The suspected impurity residual screening layer performs regional connectivity on nodes that are not classified as natural boundary residuals. When connecting, the source encoding in the same region is required to have similar components, and the region is required to maintain a distinguishable positional relationship with the grain boundary continuity line.

[0061] Preferably, the impurity region output layer includes a candidate region merging layer, a confidence generation layer, and an impurity hotspot mapping layer. The candidate region merging layer merges local residual regions that are detached from the grain boundary continuity relationship and have scale consistency coding according to spatial adjacency. The confidence generation layer generates a confidence score based on the degree of non-reconstructability of the normal background of the merged region, the residual source coding, and the natural boundary residual exclusion result. The impurity hotspot mapping layer maps the confidence score and local block number to the impurity location result. In this embodiment, the candidate region merging layer is based on the local block adjacency graph, merging adjacent residual nodes with consistent source coding into candidate regions, and removing nodes excluded by the natural boundary residual classification layer from the merge set. The confidence generation layer does not use a single residual amplitude as a criterion, but instead inputs the background reconstruction difference, source coding, and boundary exclusion result into the confidence function. The impurity hotspot mapping layer generates a location result based on the local block number, intra-block coordinates, and merged region boundary, so that the output region can correspond to the specific grain position in the original lithium hexafluorophosphate image.

[0062] ;

[0063] in, It is the Sigmoid activation function. Indicates the first Confidence level of each merged candidate region This indicates the degree to which the normal background of the candidate region cannot be reconstructed. Indicates the anomaly source coding strength of the candidate region. This represents the scale consistency encoding aggregation value of the candidate region. This indicates the intensity at which the candidate region is interpreted by natural boundaries. , , , This represents the weight of the corresponding input quantity; when the candidate region is at the natural grain boundary and When a higher value is taken, the result within the parentheses is reduced, and the confidence level decreases accordingly; when the candidate region simultaneously has a higher confidence level... , and and When a low value is taken, the confidence level remains high, and the impurity hotspot mapping layer writes the candidate region into the output position result.

[0064] In this embodiment, the training data consists of images of lithium hexafluorophosphate powder or crystals, clean area annotations, impurity area annotations, and local block adjacency information. Clean area annotations are used to initialize the normal grain visual distribution, and impurity area annotations are used to verify candidate regions after multi-scale residuals and boundary constraints. Local block adjacency information is automatically generated by the image normalization processing chain. The training process does not directly input the entire image into the classifier to output the impurity category. Instead, it forms a decomposable training chain in the order of image normalization, clean background reconstruction, residual generation, boundary constraints, and region output. For local blocks without impurity annotations but with low residual stability and consistent neighborhood texture, the clean sample constraint branch treats them as auxiliary clean areas. For local blocks with impurity annotations, the reconstruction model still generates a background image according to the normal grain distribution. The residual generation network then aligns the annotation area with the background reconstruction difference, so that the model learns the uninterpretable part of the normal background, rather than binding the appearance of impurities to the background of a certain batch of images.

[0065] In a preferred embodiment, when the model inference process receives a single or multiple consecutive lithium hexafluorophosphate images, each image independently establishes a clean reference partition and a local block index to avoid the direct input of chromaticity differences between different images into the residual discrimination. The local block tensor output by the image normalization processing chain is input into the clean grain background reconstruction model to generate a background reconstruction map consistent with the coordinates of the original image. The multi-scale residual generation network calculates the residual response at three scales and maps the residual response back to a unified coordinate. The grain boundary constraint discrimination network identifies natural boundary residuals and suspected impurity residuals based on neighborhood relationship labels. The impurity region output layer merges, generates confidence scores, and maps hot zones for suspected impurity residuals to obtain a result containing impurity location, region boundary, and confidence score. If there are large-area normal grain boundary changes in the same image, the boundary constraint discrimination network prioritizes the exclusion using boundary closure and texture direction continuity. If there are local point-like dark spots in the same image, the residual source decomposition layer combines chromaticity deviation and particle scale continuous response to retain them.

[0066] Furthermore, the impurity candidate regions in the lithium hexafluorophosphate image undergo region consistency verification before output. The region consistency verification consists of the consistency of residual sources within the candidate region, the distance relationship between the candidate region and the adjacent grain boundary, and the overlap relationship of the candidate region in the multi-scale residual map. When the residual source encoding within the candidate region is mixed and highly attached to the grain boundary, the candidate region merging layer splits it into boundary residual segments and segments to be verified. When the residual source encoding within the candidate region is consistent and forms a clear interval with the surrounding normal grain background, the candidate region is output as a whole. In this embodiment, the local block number runs through the entire process of image normalization, background reconstruction, residual fusion, boundary discrimination, and output mapping. Any output impurity hotspot can be traced back to the original local block, background reconstruction residual, scale consistency encoding, and boundary exclusion results, which facilitates the location of the specific feature source causing the recognition difference in subsequent image review or model retraining.

[0067] In one embodiment, the system employs a combination of clean background distribution freezing and abnormal residual incremental correction during model updates. Parameters that have established a stable and normal grain visual distribution do not change directly with each new image. Local blocks identified by the candidate clean region screening layer in the new image are used only to update the statistical representation of the clean reference partition. Suspected impurity regions identified by the boundary constraint discrimination network in the new impurity image are used to update the residual source decomposition layer and the confidence generation layer. When the normal grain background in the new image experiences an overall chromatic shift, the image normalization processing chain absorbs this shift through the clean reference partition in the same image, and the clean grain background reconstruction model still outputs the predicted texture of normal grains. When the abnormal residuals in the new image exhibit a new morphology but still do not conform to the grain boundary continuity relationship, the multi-scale residual generation network and the residual source decomposition layer retain the abnormal residuals, and the confidence generation layer calculates and outputs the results based on the degree of non-reconstructability of the normal background, the coding strength of the abnormal source, and the boundary interpretation strength.

[0068] In a preferred embodiment, the system performs specialized processing on complex grain boundary regions, including overlapping boundaries formed by multiple grains in contact, regions where grain gaps are connected by dark lines, and bright band regions caused by reflections from the crystal surface. For overlapping boundaries, the residual boundary relationship encoding layer establishes a natural boundary interpretation based on the boundary closure degree and the continuity of texture directions on both sides of the boundary. Only when the residual deviates from the closed boundary and the source encoding is biased to anomalies does it enter the suspected impurity residual screening layer. For grain gaps, the pseudo-anomaly exclusion layer of the clean sample constraint branch uses the continuity of the dark area in the neighborhood as an exclusion condition to prevent grain gaps from being included in the normal grain main body learning. For bright band regions, the local illumination correction subchain first removes the overall brightness drift from the low-frequency brightness component, and the reconstruction loss allocation layer then reduces the influence of the strongly reflective region on the background distribution parameters, so that the bright band residual can be distinguished by the source encoding when entering the boundary constraint discrimination.

[0069] In this embodiment, the impurity location result is generated by the impurity hotspot mapping layer according to image coordinates, local block numbers, and the boundaries of merged candidate regions. The output retains the source link for each candidate region, which includes the input local block, background reconstruction image, residual scale response, scale consistency encoding, neighborhood relationship label, natural boundary residual exclusion result, and confidence level. For cases where the same candidate region spans multiple local blocks, the candidate region merging layer generates a unified region boundary based on the adjacency relationship of the local blocks and weights and merges the confidence levels of each local block within the region according to the residual source encoding. For cases where candidate regions partially overlap with natural boundary regions, the impurity hotspot mapping layer retains the portion that deviates from the grain boundary continuity relationship and removes the portion that can be explained by the natural boundary. The resulting output corresponds to the spatial location of the true local residual in the lithium hexafluorophosphate image, rather than simply outputting a classification judgment at the whole-image level.

[0070] In a preferred embodiment, the system can also access images of lithium hexafluorophosphate from different batches without altering the core structure of the visual model. Batch differences are absorbed only through the clean reference partition and local illumination correction sub-chain in the image normalization processing chain, without using the overall batch tone as a criterion for impurity discrimination. When there are changes in the normal grain size, grain stacking degree, or local brightness in the image, the local block index sub-chain recalculates the boundary density and texture direction. The clean grain background reconstruction model generates the corresponding background reconstruction map based on the updated local block relationship. The multi-scale residual generation network still uses the unexplainable differences between the original image and the background reconstruction map as input, and the grain boundary constraint discrimination network still excludes natural residuals based on boundary continuity relationships. This processing method keeps the core discrimination chain of the model between normal background reconstruction, residual source decomposition, and grain boundary constraints, without relying on a fixed image style.

[0071] In this embodiment, the components adopt a sequential and feedback-enabled processing relationship. The image normalization processing chain provides stable local block tensors and neighborhood relationships for the clean grain background reconstruction model. The clean grain background reconstruction model provides a normal grain background reconstruction map for the multi-scale residual generation network. The multi-scale residual generation network provides scaled residuals and source encoding for the grain boundary constraint discrimination network. The grain boundary constraint discrimination network provides suspected impurity residuals after natural boundary exclusion for the impurity region output layer. The low-confidence regions and boundary conflict regions generated by the impurity region output layer can be used as excluded samples or samples to be verified in the subsequent clean sample constraint branch. Thus, normal grain background learning, residual generation, boundary discrimination, and position output constitute a closed data processing flow. Each step is set around the core technical problem of the superposition of low-contrast small impurities and normal grain texture, without introducing processing objects unrelated to lithium hexafluorophosphate image impurity recognition.

Claims

1. A visual model-based lithium hexafluorophosphate impurity identification system, characterized in that, This includes an image normalization processing chain, a clean grain background reconstruction model, a multi-scale residual generation network, a grain boundary constraint discrimination network, and an impurity region output layer; The image normalization processing chain performs chromaticity normalization, local block division, and particle texture partitioning on lithium hexafluorophosphate powder or crystal images. The clean grain background reconstruction model learns the normal grain visual distribution in the clean area and generates a background reconstruction map. The multi-scale residual generation network generates residual features based on the original image and the reconstructed background image; The grain boundary constraint discrimination network determines impurity candidate regions based on residual features and the continuity relationship of grain boundaries. The impurity region output layer outputs the impurity location and confidence level.

2. The lithium hexafluorophosphate impurity identification system based on a visual model according to claim 1, characterized in that, The image normalization processing chain includes a local illumination correction subchain, a grain texture preservation subchain, and a local block indexing subchain; The local illumination correction subchain generates an illumination compensation map based on the low-frequency brightness component of the image. The grain texture preservation subchain retains the grain edge gradient and particle surface texture after illumination compensation. The local block index subchain establishes local block numbers according to the consistency of grain boundary density and texture direction, so that the clean grain background reconstruction model receives lithium hexafluorophosphate image blocks with spatial adjacency relationships.

3. The lithium hexafluorophosphate impurity identification system based on a visual model according to claim 1, characterized in that, The clean grain background reconstruction model includes a masking image encoder, a grain visual distribution decoder, and a clean sample constraint branch. The masking image encoder performs masking encoding on some texture regions in the local block, the grain visual distribution decoder generates normal grain predicted texture corresponding to the masked region, and the clean sample constraint branch updates the normal grain visual distribution parameters together based on the impurity-free labeled region, the low residual region and the adjacent grain consistent region.

4. The lithium hexafluorophosphate impurity identification system based on a visual model according to claim 2, characterized in that, The multi-scale residual generation network includes particle-scale residual channels, grain-scale residual channels, and locally aggregated scale residual channels; The particle-scale residual channel extracts point-like color differences and fine-grained foreign matter residuals, the grain-scale residual channel extracts grain surface texture fracture residuals, and the local agglomeration-scale residual channel extracts abnormal agglomeration residuals across local blocks. The outputs of the three residual channels are mapped to the same residual coordinate system according to their spatial overlap positions to form a multi-scale residual feature map.

5. The lithium hexafluorophosphate impurity identification system based on a visual model according to claim 4, characterized in that, The local block index subchain includes a boundary density calculation layer, a texture direction aggregation layer, and a neighborhood consistency marking layer; The boundary density calculation layer generates a grain boundary density map based on the gradient magnitude and edge closure. The texture direction aggregation layer vectorizes the main texture direction within the same local block. The neighborhood consistency labeling layer generates a neighborhood relationship label based on the boundary density difference and texture direction angle between adjacent local blocks, and inputs the neighborhood relationship label into the grain boundary constraint discrimination network.

6. The lithium hexafluorophosphate impurity identification system based on a visual model according to claim 3, characterized in that, The clean sample constraint branch includes a candidate clean area screening layer, a pseudo-anomaly exclusion layer, and a reconstruction loss allocation layer. The candidate clean area screening layer selects training areas based on local residual stability. The pseudo-anomaly exclusion layer excludes local blocks located at grain overlap edges, grain gaps, and strong reflective positions. The reconstruction loss allocation layer assigns different loss weights to the main grain area, grain boundary area, and grain gap area, and feeds back the loss weights to the occlusion image encoder and the grain visual distribution decoder.

7. The lithium hexafluorophosphate impurity identification system based on a visual model according to claim 5, characterized in that, The multi-scale residual generation network also includes a residual consistency fusion layer; The residual consistency fusion layer resamples and aligns the spatial responses of the particle-scale residual channels, grain-scale residual channels, and locally aggregated scale residual channels, and generates scale consistency codes based on the continuous occurrence positions of the residual responses at different scales. The scale consistency encoding and the residual amplitude of each scale are input together into the grain boundary constraint discrimination network.

8. The lithium hexafluorophosphate impurity identification system based on a visual model according to claim 7, characterized in that, The grain boundary constraint discrimination network includes a residual boundary relationship encoding layer, a natural boundary residual classification layer, and a suspected impurity residual screening layer. The residual boundary relationship encoding layer performs coordinate registration between the multi-scale residual feature map and the neighborhood relationship marker. The natural boundary residual classification layer identifies natural boundary residuals based on the boundary closure, the continuity of texture direction on both sides of the boundary, and the residual distribution pattern along the boundary. The suspected impurity residual screening layer retains local residual regions that are deviated from the grain boundary continuity relationship.

9. The lithium hexafluorophosphate impurity identification system based on a visual model according to claim 8, characterized in that, The residual consistency fusion layer also includes a residual source decomposition layer and a scale conflict resolution layer; The residual source decomposition layer generates source codes based on the correspondence between residuals and background reconstruction errors, local chromaticity deviations, and texture breakage responses. When the particle-scale residuals and grain-scale residuals overlap in position but have inconsistent texture directions, the scale conflict resolution layer marks and retains residual nodes dominated by abnormal sources based on source codes and neighborhood relationships, and inputs the residual nodes into the suspected impurity residual screening layer.

10. The lithium hexafluorophosphate impurity identification system based on a visual model according to claim 8, characterized in that, The impurity region output layer includes a candidate region merging layer, a confidence generation layer, and an impurity hotspot mapping layer. The candidate region merging layer merges local residual regions that are detached from the grain boundary continuity relationship and have scale consistency coding according to spatial adjacency. The confidence generation layer generates confidence based on the degree of non-reconstructability of the normal background of the merged region, the residual source coding, and the natural boundary residual exclusion result. The impurity hot zone mapping layer maps the confidence and local block number to the impurity location result.