A method and system for visual assessment of the working conditions of a cast copper mold for refining

By using visual evaluation methods and deep learning models, automated inspection of copper mold working conditions has been achieved, solving the problems of low efficiency, poor accuracy, and safety hazards associated with manual evaluation, and improving inspection accuracy and the level of intelligent production.

CN122134649APending Publication Date: 2026-06-02HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
Filing Date
2026-02-09
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In the electrolytic refining of copper, the detection of the working condition of the copper mold relies on manual assessment, which is inefficient, inaccurate and poses safety hazards. Especially in high-temperature and high-dust environments, it is difficult to achieve intelligent and automated operation.

Method used

A visual evaluation method is adopted, which uses image acquisition and deep learning models for automated detection. The state of the top rod is evaluated by combining sub-pixel edge extraction and geometric fitting. An improved target detection network architecture is used to identify defects in barium sulfate coatings. Multi-scale masks and temporal momentum memory are integrated to improve detection accuracy.

Benefits of technology

It enables automated, non-contact inspection of copper mold working conditions, improving inspection accuracy and efficiency, reducing safety risks, providing a basis for intelligent production control, and reducing manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122134649A_ABST
    Figure CN122134649A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electrolytic refining of copper, and particularly discloses a copper mold working condition visual evaluation method and system for refining casting. The copper mold working condition visual evaluation method for refining casting comprises the following steps: collecting state images of a copper mold during a barium sulfate treatment process; analyzing the state images to evaluate the working condition of the copper mold; and outputting decision information for guiding production based on the evaluation results. The present application realizes automatic and non-contact visual detection of the working condition of the copper mold, replaces the traditional operation mode relying on manual visual inspection, effectively avoids the safety and occupational health risks of personnel in a high-temperature and high-dust environment, improves the detection efficiency and consistency, and provides a reliable basis for intelligent control of the casting process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electrolytic copper refining technology, and in particular to a visual evaluation method and system for copper mold working conditions used in refining and casting. Background Technology

[0002] The raw material for electrolytically refined copper is the copper anode plate. To reduce energy consumption during the electrolytic refining process, the copper anode plate is required to have high precision and a good physical shape. Copper anode plates are usually cast by a disc casting machine, and the control of the casting process determines the precision and shape of the copper anode plate.

[0003] In the process of casting anode plates in a disc mold, barium sulfate primarily functions as a release agent. It is sprayed onto the copper mold during anode plate casting, forming a protective film that serves the dual purpose of protecting the mold and improving the physical specifications of the anode plate. Specifically, barium sulfate is mixed with water to form an emulsion, which is then sprayed onto the copper mold during anode plate casting. This helps the hot anode plate to solidify and be demolded, ensuring smooth forming and demolding. The use of barium sulfate is crucial for the disc casting process. It not only protects the mold and reduces mold wear but also improves the physical specifications of the anode plate.

[0004] To facilitate demolding of the cast anode plates, each copper mold cavity on the disc has a push rod hole at its bottom. A push rod is movable within this hole. After the anode plate is cast, a corresponding lifting component at the demolding station lifts the push rod to eject the anode plate from the copper mold cavity. Therefore, before casting, it is necessary to ensure that the top surface of the push rod is flush with the top surface of the copper mold cavity to avoid affecting the quality of the anode plate. After demolding, the push rod returns to its original position under its own weight. However, after prolonged use, the push rod may not fully return to its original position. Currently, the return of the push rod is mainly checked manually, and then manually tapped to return it. Additionally, after spraying barium sulfate, the coating condition also needs to be manually checked. If the coating quality on the copper mold surface is poor, manual intervention is required. However, this method involves personnel being close to the moving equipment, and the high ambient temperature and dust levels pose safety and occupational health hazards. The workload for on-site personnel is heavy and demanding, requiring a large number of workers and exhibiting low levels of automation. Summary of the Invention

[0005] Based on this, the purpose of this invention is to provide a visual evaluation method and system for copper mold working conditions in refining and casting, so as to realize the automatic detection of copper mold working conditions.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] This invention provides a visual evaluation method for the working conditions of copper molds used in refining and casting, which includes the following steps: Images of the copper mold during the barium sulfate treatment process were captured. The state images are analyzed to assess the working condition of the copper mold; Based on the results of the evaluation, decision-making information is output to guide production.

[0008] This invention enables automated, non-contact visual inspection of copper mold working conditions, replacing the traditional operation mode that relies on manual visual inspection. It effectively avoids the safety and occupational health risks of personnel in high-temperature and high-dust environments, improves inspection efficiency and consistency, and provides a reliable basis for intelligent control of the casting process.

[0009] As a further improvement to the above-described solution of the present invention, the acquisition step includes: acquiring a first state image for evaluating the state of the push rod before spraying barium sulfate; and acquiring a second state image for evaluating the quality of the barium sulfate coating after spraying barium sulfate. The operating conditions include the state of the copper mold ejector pin and the state of the barium sulfate coating on the surface of the copper mold. The evaluation includes analyzing the first state image to evaluate the ejector pin state and analyzing the second state image to evaluate the quality of the barium sulfate coating on the surface of the copper mold.

[0010] By acquiring images in stages, specific assessments are conducted on the condition of the push rod and the quality of the coating, making the inspection task more targeted, improving the accuracy and reliability of the inspection, and providing accurate input for subsequent different processing decisions (such as push rod adjustment and coating repair).

[0011] As a further improvement of the above-mentioned solution of the present invention, the step of analyzing the first state image to evaluate the state of the push rod is to extract the geometric deformation features of the corresponding push rod area in the first state image and determine whether the push rod is completely retracted into the push rod hole in combination with the preset reset reference parameters. The step of analyzing the second state image to evaluate the state of the barium sulfate coating on the surface of the copper mold is achieved by inputting the second state image into a trained defect detection model, which is a deep learning model based on an improved target detection network architecture.

[0012] This invention combines the advantages of traditional image processing and deep learning technology. It can accurately determine the physical position and orientation of the push rod through geometric features, and can also sensitively identify complex defects on the coating surface through a deep learning model, thus achieving a comprehensive and accurate assessment of multi-dimensional working conditions.

[0013] As a further improvement to the above-described solution of the present invention, the step of analyzing the first state image to evaluate the state of the push rod includes: (1) Subpixel-level edge extraction: The Canny operator is used to perform edge detection on the region of interest of the first state image, and the outer edge contour set of the mold hole is extracted respectively. and the inner edge contour set of the push rod end face ; (2) Geometric fitting and coordinate acquisition: The least squares ellipse fitting algorithm is used to fit the outer edge contour set respectively. and inner edge contour set By performing fitting, the fitting center coordinates of the mold hole are obtained. Fitting center coordinates with the top surface of the push rod and the major axis of the ellipse fitted to the top surface of the top rod. a With short axis b ; (3) Protrusion evaluation based on concentricity deviation: Calculate the Euclidean distance D between the center of the ejector pin top surface and the center of the mold hole, as the concentricity deviation index:

[0014] When D is greater than the preset relocation tolerance threshold T d At that time, it was determined that the push rod had axial extension due to failure to return to its original position; (4) Inclination assessment based on shape distortion: Calculate the eccentricity factor R of the fitted ellipse on the end face of the ejector pin to assess the degree of inclination of the ejector pin relative to the surface of the copper mold.

[0015] Compare the calculated R with the reference value under the standard facing condition. R ref Compare them, if the absolute value of the difference is... Exceeding the preset angle threshold T a If so, it is determined that the push rod has an abnormal tilt angle and is not in the correct return position.

[0016] By employing sub-pixel edge extraction and ellipse fitting algorithms, the positioning accuracy of the ejector pin edge and its center position is significantly improved. Through dual evaluation of concentricity deviation and shape distortion, the axial extension and tilting state of the ejector pin can be comprehensively judged, avoiding quality defects and adhesion problems between the anode plate and the copper mold, and effectively preventing anode plate quality defects caused by ejector pin failure to reset.

[0017] As a further improvement to the above-mentioned solution of the present invention, the dataset used to train the defect detection model includes labeled images of copper mold coating defects synthesized by an image generation model, wherein the image generation model is a diffusion model based on LoRA technology with lightweight fine-tuning.

[0018] As a further improvement to the above-described solution of the present invention, the improved target detection network architecture integrates the following modules: A learnable prototype clustering enhancement module is used to sharpen feature boundaries between different categories of defects; A multi-scale mask-guided dynamic sparse attention module is used to suppress background noise and focus on defect areas; A defect-aware contrast enhancement mechanism based on temporal momentum memory is used to improve the ability to identify rare defects.

[0019] As a further improvement to the above-mentioned solution of the present invention, the implementation process of the learnable prototype clustering enhancement module is as follows: Input feature map Perform dimensional rearrangement to flatten it into a two-dimensional matrix; Through mapping function Project pixel features onto In a potential prototype space, the probability matrix of each pixel belonging to each prototype is calculated by setting the temperature coefficient using the Softmax function with a temperature coefficient. :

[0020] Through function For the initial prototype Perform transformation and execute Norm normalization yields the normalized prototypical basis. :

[0021] Using probability matrix For normalized prototypes Weighted reconstructed features are then connected to the original features via residual connections. The feature maps are fused and the output boundaries are sharpened. : .

[0022] By using image generation models to synthesize defect images with precise annotations, the problem of scarce and difficult-to-collect defect samples in industrial fields is greatly alleviated. The LoRA lightweight fine-tuning technology only requires updating a small number of parameters, which greatly reduces the consumption of computing resources while ensuring the quality of generation, and provides efficient and low-cost data support for continuous model training and iteration.

[0023] As a further improvement to the above-mentioned scheme of the present invention, the multi-scale mask-guided dynamic sparse attention module is implemented through a multi-scale perception and dynamic threshold truncation strategy: multi-scale perception is performed on the feature map to adaptively capture defect features of different sizes; a dynamic threshold is set based on the feature response value to generate a binary sparse mask; the sparse mask forces the network to focus only on defect regions with high response, suppresses background noise interference, and reduces the computational complexity of the self-attention mechanism.

[0024] As a further improvement to the above-mentioned solution of the present invention, the implementation process of the defect-aware contrast enhancement mechanism based on the temporal momentum memory is as follows: Construct a temporal momentum memory library to store historical defect features; An exponential moving average strategy is used to update historical defect features in the memory. Let the features extracted from the current input image be... The corresponding historical feature prototype in the memory bank is The momentum update formula is:

[0025] Construct a contrastive loss function that uses the momentum update version of the current feature as a positive sample. The rest in the memory bank Each feature is used as a negative sample. The optimization objective is to maximize and Similarity, minimization and The similarity is calculated using the following loss function formula:

[0026] The contrastive loss is weighted and fused with the original YOLOv12 loss to serve as the total loss function for model training.

[0027] This invention provides a method for evaluating the barium sulfate coating state on copper mold surfaces. Through the synergistic effect of a data generation pipeline and three innovative modules, it achieves accurate and efficient detection of coating defects. It addresses the problem of scarce defect samples; LoRA lightweight fine-tuning only updates UNet parameters, significantly reducing computational consumption. A controllable label generation mechanism ensures accurate matching between images and annotations, continuously providing high-quality data for model training and subsequent hardware iterations in the workshop. The improved target detection module clarifies category boundaries through explicit clustering, solving the feature confusion problem and effectively improving detection accuracy. The introduction of a multi-scale scheme effectively handles defects of different sizes, while using YOLOv12s as a baseline model is suitable for industrial deployment. The contrast enhancement mechanism of the temporal momentum memory achieves a recall rate of 62.9% for rare defects such as contaminants, overcoming the drawback of traditional methods that overemphasize high-frequency samples and perform poorly on low-frequency defects.

[0028] As a further improvement to the above-mentioned solution of the present invention, the decision information includes at least one of the following: a judgment conclusion on whether the copper mold is qualified or unqualified; information on the location and type of defects that require coating repair; and control instructions to trigger audible and visual alarms or automatic repair operations.

[0029] As a further improvement to the above-mentioned solution of the present invention, when acquiring the status image, a vision acquisition unit equipped with an active defogging device is used, wherein the active defogging device includes at least one of a fan, a hot air generator, or a protective cover with airflow.

[0030] This invention also provides a visual evaluation system for the working condition of copper molds used in refining and casting, for implementing the aforementioned visual evaluation method for the working condition of copper molds used in refining and casting, the system comprising: The image acquisition module is used to acquire images of the copper mold during the barium sulfate treatment process. The data processing and analysis module is used to run the trained defect detection model and analyze the state image to evaluate the working condition of the copper mold. The intelligent decision-making and output module is used to generate and output decision-making information to guide production based on the analysis results.

[0031] Compared with the prior art, the present invention has the following beneficial effects: This invention enables automated, non-contact visual inspection of copper mold working conditions, replacing the traditional operation mode that relies on manual visual inspection. It effectively avoids the safety and occupational health risks of personnel in high-temperature and high-dust environments, improves inspection efficiency and consistency, and provides a reliable basis for intelligent control of the casting process. Attached Figure Description

[0032] Figure 1 A flowchart of a visual evaluation method for copper mold working conditions in refining casting provided by the present invention; Figure 2 This is an overall flowchart of the method for applying barium sulfate coating to the surface of a copper mold in an embodiment of the present invention; Figure 3 This is a structural diagram of the learnable prototype clustering enhancement module in an embodiment of the present invention; Figure 4 This is a structural diagram of the dynamic sparse attention module guided by multi-scale masking in an embodiment of the present invention; Figure 5 This is a training curve of mAP50 on a self-built dataset in an embodiment of the present invention. Detailed Implementation

[0033] To facilitate understanding of the present invention, a more comprehensive description will be given below with reference to specific embodiments. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of the present invention.

[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.

[0035] This invention aims to address the problems of low efficiency, poor accuracy, and harsh environment associated with manual assessment of the barium sulfate coating quality of copper molds in the disc casting process of the copper refining workshop. The implementation of this invention relies on a visual assessment system deployed around the casting disc. The core of this system lies in acquiring online images of the copper mold status through visual acquisition units placed at key workstations. This images are then automatically analyzed using a defect detection model integrating advanced algorithms, ultimately achieving intelligent assessment and decision output of the working conditions. This guides or directly triggers repair, alarm, and other operations, improving the anode plate pass rate and the level of production automation.

[0036] Combination Figure 1 The visual evaluation method for copper mold working conditions for refining and casting provided in this embodiment includes the following steps: S1. Collect images of the state of the copper mold during the barium sulfate treatment process.

[0037] In this embodiment, the acquisition step includes at least: acquiring a first state image for evaluating the state of the push rod before spraying barium sulfate, and acquiring a second state image for evaluating the state of the barium sulfate coating after spraying barium sulfate.

[0038] In this embodiment, a vision acquisition unit is deployed to acquire images of the copper mold's condition. To comprehensively evaluate the working condition of the copper mold, industrial cameras are deployed at two key workstations. These two industrial cameras are defined as Industrial Camera 1 and Industrial Camera 2, respectively. Detection workstation 1 and Detection workstation 2 are sequentially arranged along the rotation direction of the disc, and are located upstream and downstream of the copper mold casting workstation, respectively. Industrial Camera 1 is used to acquire images of the copper mold ejector pin at Detection workstation 1 (i.e., a first state image used to evaluate the ejector pin's condition), and Industrial Camera 2 is used to acquire images of the copper mold surface coating at Detection workstation 2 (i.e., a second state image used to evaluate the quality of the barium sulfate coating).

[0039] When the disc pauses, industrial camera one images the copper mold at one inspection station, acquiring a first-state image for subsequent analysis to determine if the top surface of the ejector pin is flush with the bottom surface of the copper mold cavity. Simultaneously, industrial camera two images the surface of the copper mold at inspection station two (focusing on areas such as around the ejector pin holes, casting points, and ear surfaces), acquiring a second-state image with a resolution of 1920×1080 pixels to assess coating uniformity and integrity and detect defects.

[0040] To address the challenge of foggy spraying environments, all cameras are equipped with active defogging devices, which can employ two solutions: Option 1 (External Airflow): Install a miniature vortex tube or nozzle next to the camera lens, connect it to a clean compressed air source in the workshop, and form a continuous air curtain to disperse the fog and dust in front of the lens.

[0041] Option 2 (Internal Circulation Protective Housing): A sealed, transparent protective housing is installed on the camera. The housing integrates a miniature fan and a semiconductor heating element, creating a gentle, internally circulating hot airflow to prevent fogging on the inner glass and ensure a consistently clear view.

[0042] S2. Analyze the state images of the copper mold to evaluate its working condition.

[0043] In this embodiment, the working condition of the copper mold includes the state of the copper mold ejector pin and the state of the barium sulfate coating on the surface of the copper mold. The evaluation includes analyzing the first state image to evaluate the ejector pin state and analyzing the second state image to evaluate the state of the barium sulfate coating on the surface of the copper mold.

[0044] The step of analyzing the first-state image to evaluate the push rod state involves extracting the geometric deformation features of the corresponding push rod region in the first-state image and determining, in conjunction with preset reset reference parameters, whether the push rod has completely retracted into the push rod hole. Specifically, this includes: (1) Subpixel-level edge extraction: The Canny operator is used to perform edge detection on the region of interest of the first state image, and the outer edge contour set of the mold hole is extracted respectively. and the inner edge contour set of the push rod end face ; (2) Geometric fitting and coordinate acquisition: The least squares ellipse fitting algorithm is used to fit the outer edge contour set respectively. and inner edge contour set By performing fitting, the fitting center coordinates of the mold hole are obtained. Fitting center coordinates with the top surface of the push rod and the major axis of the ellipse fitted to the top surface of the top rod. a With short axis b ; (3) Protrusion evaluation based on concentricity deviation: Calculate the Euclidean distance D between the center of the ejector pin top surface and the center of the mold hole, as the concentricity deviation index:

[0045] When D is greater than the preset relocation tolerance threshold T d At that time, it was determined that the push rod had axial extension due to failure to return to its original position; (4) Inclination assessment based on shape distortion: Calculate the eccentricity factor R of the fitted ellipse on the end face of the ejector pin to assess the degree of inclination of the ejector pin relative to the surface of the copper mold.

[0046] Compare the calculated R with the reference value under the standard facing condition. R ref Compare them, if the absolute value of the difference is... Exceeding the preset angle threshold T a If so, it is determined that the push rod has an abnormal tilt angle and is not in the correct return position.

[0047] In this embodiment, the step of analyzing the second-state image to evaluate the state of the barium sulfate coating is achieved by inputting the second-state image into a trained defect detection model. The defect detection model is a deep learning model based on an improved target detection network architecture.

[0048] Combination Figure 2 The analysis of the second-state image based on an improved deep learning model to evaluate the state of the barium sulfate coating mainly includes the following steps: S21. Construct a LoRA-based pipeline for generating tag-controlled defect data. A diffusion model was selected as the basic generative model. Based on LoRA technology, only the attention layer parameters of the basic generative model were fine-tuned to construct a lightweight adaptive model. The fine-tuning process used a small number of real copper mold barium sulfate coating defect samples as supervised data, enabling the model to learn the texture, morphology, and scene features of the coating defects. Specifically: Model fine-tuning: Stable Diffusion v1.5 was selected as the base image generation model. The fine-tuning process used 995 real copper mold barium sulfate coating defect samples as supervised data. Based on Standard LoRA technology, only the parameters of the model's attention layer (to_k, to_q, to_v modules) were lightly adjusted. The samples covered three types of defects: cracks, pores, and contaminants. During training, the maximum image resolution was set to 512×512 pixels, and data augmentation strategies such as horizontal flipping were enabled to improve the model's generalization ability to defect features. The low-rank matrix has a dimension r=64, LoRA_alpha=32, the optimizer is AdamW8bit, the Unet network has a learning rate of 0.0001, the learning rate scheduling strategy is cosine annealing, and the learning rate warm-up ratio is 10%. It uses bf16 mixed precision training with xformers memory optimization enabled, the batch size is set to 1, the gradient accumulation step is 1, the noise offset value is set to 0.05, and the total number of training iterations is 10. While ensuring the fitting effect of defect features, it achieves lightweight model adaptation, reduces computing power consumption and fine-tuning cycle.

[0049] Controllable label generation: Taking the multi-scale visual features of the copper mold image output by the LoRA fine-tuned diffusion model and the text embedding of the text prompt encoded by CLIP as input, the visual feature channels are first compressed by lightweight convolution to reduce the amount of computation. Then, deformable attention is used to focus on the defect region of the copper mold, and cross-modal attention combined with text embedding enhances the discriminativeness of defect features. Next, based on the text embedding, the visual feature query vector with the highest similarity to the defect target category is selected from the enhanced features. Finally, after the features are aligned by the cross-modal encoder, the classification and regression branches output defect category labels and bounding box coordinates that are strictly aligned with the text prompt.

[0050] A prompt word library was built for three types of defects: cracks, holes, and contaminants. The pixel-level bounding box constraints were mapped to the YOLO normalized annotation format to ensure accurate matching between the generated image and the label.

[0051] Using this method, this embodiment automatically generated 3,000 high-quality, accurately labeled synthetic defect images.

[0052] LoRA lightweight fine-tuning only updates the attention layer parameters, accounting for 1%-5% of the total parameters, significantly reducing computational power consumption; the controllable label generation mechanism ensures accurate matching between images and annotations, which can continuously provide high-quality data for model training and subsequent hardware iterations in the workshop, solving the problem of scarce defective samples.

[0053] S22. Construct an improved YOLOv12 defect detection model Using the lightweight YOLOv12s as the baseline network, three innovative modules are integrated to address the characteristics of copper mold coating defects: (1) Learnable prototype clustering enhancement module Figure 3 The structure diagram of the learnable prototype clustering enhancement module is shown below. The implementation process of the learnable prototype clustering enhancement module is as follows: Input feature map Perform dimensional rearrangement and flatten it into a two-dimensional matrix to achieve global operations in the pixel-level feature space; Through mapping function Project pixel features onto In a potential prototype space, through a temperature coefficient ( The Softmax function sets a temperature coefficient and calculates the probability matrix of each pixel belonging to each prototype. The formula for assigning visual features to semantic clustering is as follows:

[0054] Through function For the initial prototype Perform transformation and execute Norm normalization yields the normalized prototypical basis. The formula is:

[0055] Using probability matrix For normalized prototypes Weighted reconstructed features are then connected to the original features via residual connections. The feature maps are fused and the output boundaries are sharpened. To resolve the issue of confusion regarding the characteristics of different types of defects, the formula is as follows: .

[0056] (2) Multi-scale mask-guided dynamic sparse attention module Figure 4 The diagram shows the structure of the multi-scale mask-guided dynamic sparse attention module. The multi-scale mask-guided dynamic sparse attention module is implemented through a multi-scale perception and dynamic threshold truncation strategy: multi-scale perception is performed using 3×3 and 5×5 convolutions for defects of different sizes, a dynamic threshold is set, and a binary sparse mask is generated; attention calculation is retained only in the high-response region of the mask, which reduces the computational complexity of the self-attention mechanism, while suppressing background noise and enhancing defect feature extraction.

[0057] (3) Defect-aware contrast enhancement mechanism based on temporal momentum memory The implementation process of the defect-aware contrast enhancement mechanism based on temporal momentum memory is as follows: Construct a temporal momentum memory to store historical defect features and set momentum coefficients. Temperature coefficient ; The historical defect features in the memory are updated using the EMA (Exponential Moving Average) strategy. Let the features extracted from the current input image be... The corresponding historical feature prototype in the memory bank is The momentum update formula is:

[0058] Construct a contrastive loss function that uses the momentum update version of the current feature as a positive sample. The rest in the memory bank Each feature is used as a negative sample. The optimization objective is to maximize and Similarity, minimization and The similarity is calculated using the following loss function formula:

[0059] The contrastive loss and the original YOLOv12 loss are fused with a weight of 0.3:0.7 to serve as the total loss function for model training, thereby improving the feature discrimination ability of rare defects.

[0060] The improved target detection module clarifies category boundaries through explicit clustering, resolving feature confusion and effectively improving detection accuracy. The introduction of a multi-scale scheme effectively handles defects of varying sizes, while the use of YOLOv12s as the baseline model makes it suitable for industrial deployment. The contrast enhancement mechanism based on the temporal momentum memory achieves a recall rate of 62.9% for rare defects such as contaminants, addressing the shortcomings of traditional methods that overemphasize high-frequency samples and perform poorly on low-frequency defects.

[0061] S23. Model Training and Optimization The 3000 images generated in step S21 are divided into a training set, a validation set, and a test set in an 8:1:1 ratio, with 2400 images in the training set, 300 images in the validation set, and 300 images in the test set. Data augmentation strategies such as random flipping, translation, and scaling are employed. Training parameters are set as follows: learning rate = 1e-3, batch size = 64, and number of iterations = 720. Training is stopped and the optimal model is saved when there is no improvement in the validation set after 300 iterations. Figure 5 The image shows the mAP50 training curve on a self-built dataset. On the copper mold coating defect dataset, the mAP50 reaches 0.857, with an accuracy of 90.2% and a detection speed of 30 frames / second, which is suitable for the real-time quality inspection needs of industry.

[0062] S24. Real-time Defect Detection The second state image is acquired at a resolution of 1920×1080 using an industrial camera, scaled down to 640×640 and input into the optimal model; the model outputs the defect category and bounding box coordinates, and the coordinates are mapped back to the original image size for visualization.

[0063] The detection speed meets the real-time detection needs of high-speed production in the workshop, with a detection speed of 30 frames / second, a crack defect recall rate of 67%, a hole defect recall rate of 99%, and a contaminant defect recall rate of 62.9%.

[0064] S3. Based on the evaluation results of step S2, output decision-making information to guide production.

[0065] If the ejector pin malfunctions, the decision information is to strike the ejector pin. Workers can manually strike the ejector pin according to the decision information, or an automatic striking mechanism can be installed at the testing station. Specifically, the automatic striking mechanism may include a mounting frame, a rotating rod, a striking hammer, and a cylinder. The mounting frame is installed on the ground at one testing station. One end of the rotating rod is rotatably mounted on the mounting frame, and the other end extends above the disc. The striking hammer is vertically mounted on the end of the rotating rod away from the mounting frame. The cylinder body is mounted on the mounting frame, and its piston rod end is connected to the rotating rod. When the piston rod of the cylinder extends or retracts, the rotating rod rotates under the drive of the piston rod, thereby driving the striking hammer to strike the ejector pin. Triggering the cylinder actuates the rotating rod, causing it to rotate and drive the striking hammer to strike the ejector pin.

[0066] If any coating defect is detected, the coating is deemed unqualified. Decision information includes: a) Highlight the location and type of defects on the HMI interface; b) Trigger the audible and visual alarm; c) Generate a log containing the copper mold ID, defect details, and timestamp.

[0067] Based on the test results, workers can manually recoat the copper mold coating using tools dipped in barium sulfate powder to fill defective areas. Alternatively, a robotic arm can be installed at the second testing station for automated recoating. For example, a robotic arm with an applicator at its end can be installed; a dry powder mixing tank containing barium sulfate powder, kept uniform by a stirrer, can draw powder from the mixing tank and pump it out via a delivery pipe; the end of the delivery pipe is fixed to the robotic arm and connected to the applicator, thus delivering the barium sulfate powder to the applicator; a servo valve on the delivery pipe controls the flow of the barium sulfate powder. The applicator is block-shaped or brush-shaped, made of a porous, absorbent elastic material, such as high-porosity, wear-resistant, and weakly acid- and alkali-resistant polyurethane (PU) sponge, or high-temperature resistant foamed silicone rubber; this material has numerous interconnected micropores that can absorb and retain the barium sulfate powder for recoating. If no coating defects are detected, the system outputs the instruction "Mold qualified, casting can proceed" and allows the copper mold to flow into the next process.

[0068] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0069] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A visual evaluation method for the working condition of copper molds used in refining and casting, characterized in that, It includes the following steps: Images of the copper mold during the barium sulfate treatment process were captured. The state images are analyzed to assess the working condition of the copper mold; Based on the results of the evaluation, decision-making information is output to guide production.

2. The visual evaluation method for copper mold working conditions for refining and casting according to claim 1, characterized in that, The acquisition steps include: acquiring a first state image for evaluating the condition of the push rod before spraying barium sulfate; and acquiring a second state image for evaluating the quality of the barium sulfate coating after spraying barium sulfate. The operating conditions include the state of the copper mold ejector pin and the state of the barium sulfate coating on the surface of the copper mold. The evaluation includes analyzing the first state image to evaluate the ejector pin state and analyzing the second state image to evaluate the state of the barium sulfate coating on the surface of the copper mold.

3. The visual evaluation method for copper mold working conditions for refining and casting according to claim 2, characterized in that, The step of analyzing the first state image to evaluate the state of the push rod is to extract the geometric deformation features of the corresponding push rod area in the first state image and determine whether the push rod has completely retracted into the push rod hole in combination with the preset reset reference parameters. The step of analyzing the second state image to evaluate the state of the barium sulfate coating on the surface of the copper mold is achieved by inputting the second state image into a trained defect detection model, which is a deep learning model based on an improved target detection network architecture.

4. The visual evaluation method for copper mold working conditions for refining and casting according to claim 3, characterized in that, The steps of analyzing the first state image to evaluate the push rod state include: (1) Subpixel-level edge extraction: The Canny operator is used to perform edge detection on the region of interest of the first state image, and the outer edge contour set of the top rod hole is extracted respectively. and the inner edge contour set of the push rod end face ; (2) Geometric fitting and coordinate acquisition: The least squares ellipse fitting algorithm is used to fit the outer edge contour set respectively. and inner edge contour set By performing fitting, the fitted center coordinates of the top rod hole are obtained. Fitting center coordinates with the top surface of the push rod and the major axis of the ellipse fitted to the top surface of the top rod. a With short axis b ; (3) Protrusion assessment based on concentricity deviation: Calculate the Euclidean distance D between the center of the top surface of the push rod and the center of the push rod hole, as the concentricity deviation index: When D is greater than the preset relocation tolerance threshold T d At that time, it was determined that the push rod had axial extension due to failure to return to its original position; (4) Inclination assessment based on shape distortion: Calculate the eccentricity factor R of the fitted ellipse on the end face of the ejector pin to assess the degree of inclination of the ejector pin relative to the surface of the copper mold. Compare the calculated R with the reference value under the standard facing condition. R ref Compare them, if the absolute value of the difference is... Exceeding the preset angle threshold T a If so, it is determined that the push rod has an abnormal tilt angle and is not in the correct return position.

5. The visual evaluation method for copper mold working conditions for refining and casting according to claim 3, characterized in that, The dataset used to train the defect detection model includes labeled images of copper mold coating defects synthesized by an image generation model; the image generation model is a diffusion model based on LoRA technology with lightweight fine-tuning. And / or, the improved target detection network architecture integrates the following modules: A learnable prototype clustering enhancement module is used to sharpen feature boundaries between different categories of defects; A multi-scale mask-guided dynamic sparse attention module is used to suppress background noise and focus on defect areas; A defect-aware contrast enhancement mechanism based on temporal momentum memory is used to improve the ability to identify rare defects.

6. The visual evaluation method for copper mold conditions used in refining and casting according to claim 5, characterized in that, The implementation process of the learnable prototype clustering enhancement module is as follows: Input feature map Perform dimensional rearrangement to flatten it into a two-dimensional matrix; Through mapping function Project pixel features onto In a potential prototype space, the probability matrix of each pixel belonging to each prototype is calculated by setting the temperature coefficient using the Softmax function with a temperature coefficient. : Through function For the initial prototype Perform transformation and execute Norm normalization yields the normalized prototypical basis. : Using probability matrix For normalized prototypes Weighted reconstructed features are then connected to the original features via residual connections. The feature maps are fused and the output boundaries are sharpened. : 。 7. The visual evaluation method for copper mold working conditions for refining and casting according to claim 5, characterized in that, The multi-scale mask-guided dynamic sparse attention module is implemented through a multi-scale perception and dynamic threshold truncation strategy: it performs multi-scale perception on the feature map and adaptively captures defect features of different sizes. A binary sparse mask is generated by setting a dynamic threshold based on the feature response value. By using sparse masks, the network is forced to focus only on defective regions with high response, thus suppressing background noise interference and reducing the computational complexity of the self-attention mechanism.

8. The visual evaluation method for copper mold conditions used in refining and casting according to claim 5, characterized in that, The implementation process of the defect-aware contrast enhancement mechanism based on temporal momentum memory is as follows: Construct a temporal momentum memory library to store historical defect features; An exponential moving average strategy is used to update historical defect features in the memory. Let the features extracted from the current input image be... The corresponding historical feature prototype in the memory bank is The momentum update formula is: Construct a contrastive loss function that uses the momentum update version of the current feature as a positive sample. The rest in the memory bank Each feature is used as a negative sample. The optimization objective is to maximize and Similarity, minimization and The similarity is calculated using the following loss function formula: The contrastive loss is weighted and fused with the original YOLOv12 loss to serve as the total loss function for model training.

9. The visual evaluation method for copper mold conditions used in refining and casting according to claim 1 or 2, characterized in that, The decision information includes at least one of the following: the judgment of whether the copper mold is qualified or unqualified; the location and type of defects that require coating repair; and the control command to trigger an audible and visual alarm or automatic repair operation.

10. A visual evaluation system for the working condition of copper molds used in refining and casting, characterized in that, The system is used to implement the visual evaluation method for copper mold conditions in refining casting as described in any one of claims 1-9, the system comprising: The image acquisition module is used to acquire images of the copper mold during the barium sulfate treatment process. The data processing and analysis module is used to run the trained defect detection model and analyze the state image to evaluate the working condition of the copper mold. The intelligent decision-making and output module is used to generate and output decision-making information to guide production based on the analysis results.