Patent Description:
Energy conservation and emission reduction are crucial to the sustainable development of the automotive industry. Electric vehicles, with their advantages in energy conservation and emission reduction, have become an important part of sustainable development of the automobile industry. For electric vehicles, battery technology is an important factor in connection with their development.

In some cases, a rechargeable battery (a battery that can be charged after being discharged to activate active materials for continuous use, also known as secondary battery) includes a battery box and a plurality of batteries connected in series and/or in parallel in the battery box. The battery cell is the smallest unit for providing energy in a battery. An electrode assembly is a key component in which electrochemical reactions take place in the battery cell and mainly includes an anode electrode plate, a cathode electrode plate, and a separator that separates the anode electrode plate from the cathode electrode plate.

How a yield of cell production is improved is an urgent technical problem to be resolved in the art.

<NPL>, proposes a weakly supervised learning strategy that only uses image-level annotations to obtain a method that is capable of segmenting cracks on electroluminescence (EL) images of solar cells. A modified ResNet-<NUM> is used to derive a segmentation from network activation maps. Defect classification is used as a surrogate task to train the network. To this end, normalized Lp normalization is applied to aggregate the activation maps into single scores for classification.

The claimed subject-matter is defined by the appended claims. The embodiments of the present disclosure are not to be regarded as necessarily defining claimed subject-matter unless they fall within the scope of the appended claims. Embodiments not falling within the terms of the claims are to be understood as background art or examples useful for understanding the claimed subj ect-matter.

This application is intended to resolve at least one of the technical problems in the prior art. An objective of this application is to provide a method and apparatus for training a cell defect detection model, a method and apparatus for cell defect detection, an electronic device, a computer-readable storage medium, and a computer program product, to improve a yield of cell production.

According to a first aspect of the invention, a method according to claim <NUM> is provided.

The defect classification model is first trained for the first-preset-category defects, and then the feature vector output by an intermediate layer of the defect classification model obtained through training is migrated to the backbone model. This not only makes a feature extracted by the defect classification model for the first-preset-category defects more accurate, facilitating subsequent classification of the backbone model, but also facilitates full use of existing model resources to avoid repeated training of new models. In this way, accuracy of the defect detection model in detecting cell defects, especially the first-preset-category defects, is improved. In addition, a speed for training the defect detection model is improved and training costs are reduced.

In some embodiments, the plurality of first-preset-category defects include at least one group of first-preset-category defects, each group of first-preset-category defects includes a plurality of first-preset-category defects, and similarities between image features of the first-preset-category defects in each group of first-preset-category defects are not less than a preset threshold. In the foregoing description, the defect classification model is pre-trained for similar first-preset-category defects. This enables the defect classification model to learn features of similar defects to improve accuracy of extracting the features of similar defects. In addition, the defect classification model needs only to precisely classify the first-preset-category defects and thus processes a small amount of information, thereby making training and calculation of the defect classification model faster.

In some embodiments, a similarity between an image feature of the second-preset-category defect and an image feature of any one of the plurality of first-preset-category defects is less than the preset threshold. In the foregoing description, the entire defect detection model is adjusted based on a sample image having a second-preset-category defect that is different from the first-preset-category defects so that the defect detection model can well identify the first-preset-category defects and the second-preset-category defect.

In some embodiments, the using a plurality of first sample images to train a defect classification model that includes an output layer so that a defect classification model obtained through training is capable of predicting a plurality of first-preset-category defects of a cell includes: for each of the plurality of first sample images, inputting the first sample image to the defect classification model that includes the output layer to obtain a predicted defect classification result of the first sample image; and adjusting parameters of the defect classification model based on the first-preset-category defect and the predicted defect classification result of the first sample image. In the foregoing description, a simple method is used to train the defect classification model for the first-preset-category defects to improve accuracy and efficiency of the defect classification model obtained through training.

In some embodiments, the plurality of first sample images include a plurality of groups of first sample images, the at least one group of first-preset-category defects includes a plurality of groups of first-preset-category defects, and a cell defect category in each group of first sample images pertains to a group of first-preset-category defects in one-to-one correspondence with the group of first sample images. The using a plurality of first sample images to train a defect classification model that includes an output layer so that a defect classification model obtained through training is capable of predicting a plurality of first-preset-category defects of a cell includes: for each group of first sample images, using the group of first sample images to train a corresponding defect classification submodel so that a defect classification submodel obtained through training is capable of predicting a group of first-preset-category defects corresponding to the group of first sample images; and determining parameters of the defect classification model based on parameters of a defect classification submodel obtained through training respectively using each of the plurality of groups of first sample images. In the foregoing description, corresponding defect classification submodels are trained for the plurality groups of first-preset-category defects. This can enable the defect classification submodels to fully learn features of the corresponding group of first-preset-category defects to improve accuracy of extracting features. In addition, the defect classification submodels need only to precisely classify the corresponding group of first-preset-category defects and thus process a small amount of information, thereby making training and calculation of the defect classification model faster.

In some embodiments, the for each group of first sample images, using the group of first sample images to train a corresponding defect classification submodel so that a defect classification submodel obtained through training is capable of predicting a group of first-preset-category defects corresponding to the group of first sample image includes: for each first sample image in the group of first sample images, inputting the first sample image to the defect classification model to obtain a predicted defect classification result of the first sample image; and adjusting parameters of the defect classification submodel based on the first-preset-category defect and the predicted defect classification result of the first sample image. In this way, efficiency and accuracy of extracting features of the first-preset-category defects by the defect classification submodel can be improved.

In some embodiments, the for each group of first sample images, using the group of first sample images to train a corresponding defect classification submodel so that a defect classification submodel obtained through training is capable of predicting a group of first-preset-category defects corresponding to the group of first sample image further includes: in response to completion of training of the defect classification submodel, compressing the defect classification submodel to obtain a compressed defect classification submodel; and using the group of first sample images to train the compressed defect classification submodel so that a compressed defect classification submodel obtained through training is capable of predicting a group of first-preset-category defects corresponding to the group of first sample images. In the foregoing description, the defect classification submodel is compressed. This can change a structure of the defect classification submodel (such as a quantity of intermediate layers and parameters of the intermediate layers) and facilitate subsequent weighted calculation for each defect classification submodel without the need to select multiple defect classification submodels with a completely same structure for training.

In some embodiments, the for each group of first sample images, using the group of first sample images to train a corresponding defect classification submodel so that a defect classification submodel obtained through training is capable of predicting a group of first-preset-category defects corresponding to the group of first sample image further includes: obtaining a defect classification student model, where a quantity of a plurality of first intermediate layers of the defect classification student model is less than a quantity of a plurality of second intermediate layers of the defect classification submodel; dividing the plurality of second intermediate layers of the defect classification submodel into a plurality of second intermediate layer groups, where each second intermediate layer group includes at least one second intermediate layer sequentially connected, and the plurality of second intermediate layer groups are in one-to-one correspondence with the plurality of first intermediate layers; inputting a first sample image in the group of first sample images to the defect classification student model to obtain a sample feature vector output by each of the plurality of first intermediate layers of the defect classification student model; obtaining a sample feature vector output by each of the plurality of second intermediate layer groups of the defect classification submodel; adjusting parameters of the defect classification student model based on the sample feature vector output by each first intermediate layer and the sample feature vector output by each second intermediate layer group; and using an adjusted defect classification student model as the defect classification submodel. In the foregoing description, the defect classification submodel is compressed through knowledge distillation. This can change a structure of the defect classification submodel (such as a quantity of intermediate layers and parameters of the intermediate layers) and facilitate subsequent weighted calculation for each defect classification submodel without the need to select multiple defect classification submodels with a completely same structure for training.

In some embodiments, defect classification submodels obtained through training respectively using each of the plurality of groups of first sample images have the same quantity of intermediate layers. In the foregoing description, defect classification submodels with similar structures are trained. This facilitates subsequent weighted calculation for the defect classification submodels, thereby making training of the defect classification model faster.

In some embodiments, the determining parameters of the defect classification model based on parameters of a defect classification submodel obtained through training respectively using each of the plurality of groups of first sample images includes: performing weighted calculation on corresponding parameters of defect classification submodels trained using the groups of first sample images; and using parameters obtained through weighted calculation as the parameters of the defect classification model. In the foregoing description, the parameters of defect classification submodels are used as the parameters of the defect classification model after weighted calculation. In this way, the defect classification model can integrate advantages of the defect classification submodels, thereby improving the accuracy of extracting features of the first-preset-category defects by the defect classification model.

In some embodiments, the backbone model is obtained through training using a plurality of sample images including the plurality of first-preset-category defects and the second-preset-category defect. Therefore, the backbone model can be a pre-trained or existing model capable of classifying all defects, which reduces training of new models and avoids a waste of existing resources.

In some embodiments, the second-preset-category defect includes a plurality of sub-preset-category defects, and a similarity between image features of any two of the plurality of sub-preset-category defects is less than the preset threshold. After the defect classification model is trained, the defect detection model is adjusted using sample images having preset-category defects that are not similar to the used preset-category defects. This can increase a speed of training the defect detection model and reduce a calculation amount and costs while ensuring that the defect detection model can identify all defects.

In some embodiments, the plurality of first-preset-category defects and the second-preset-category defect are generated in a die-cutting process during cell production. Many types of defects occur in a cell die-cutting process and the defects have indistinguishable features. With the foregoing method, defects generated in the die-cutting process can be detected.

In some embodiments, the method further includes: in response to completion of training of the defect detection model, compressing the defect detection model to obtain a compressed defect detection model; and using the plurality of sample images including the plurality of first-preset-category defects and the second-preset-category defect to train the compressed defect detection model so that a compressed defect detection model obtained through training is capable of predicting the plurality of first-preset-category defects and the second-preset-category defect. The defect detection model obtained through training is compressed. This reduces a parameter storage amount and increases a calculation speed of the defect detection model.

An embodiment provides a cell defect detection method, including: obtaining an image for inspection; inputting the image for inspection to a defect detection model to obtain a predicted defect classification result output by the defect detection model, where the defect detection model is obtained through training by performing a method for training a cell defect detection model according to this application; and determining, based on the predicted defect classification result, whether a defect exists in the image for inspection. This can make a feature extracted by a defect classification model for a first-preset-category defect more accurate, facilitating subsequent classification of a backbone model, and improving accuracy of detecting cell defects, especially the first-preset-category defect.

According to a second aspect of the invention, an apparatus according to claim <NUM> is provided. The solution can have the same technical effects as the foregoing corresponding method.

According to a third aspect of the invention, a cell defect detection apparatus according to claim <NUM> is provided. The solution can have the same technical effects as the foregoing corresponding method.

According to a fourth aspect of the invention, a computer-readable storage medium according to claim <NUM> is provided.

According to a fifth aspect of the invention, a computer program product according to claim <NUM> is provided.

The foregoing description is merely an overview of the technical solution of this application. For a better understanding of the technical means in this application such that they can be implemented according to the content of the specification, and to make the above and other objectives, features and advantages of this application more obvious and easier to understand, the following describes specific embodiments of this application.

In the accompanying drawings, unless otherwise specified, the same reference signs in a plurality of drawings denote the same or similar components or elements. The accompanying drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some implementations disclosed in this application and should not be considered as a limitation on a scope of this application.

Reference numerals in the accompanying drawings described as follows:.

The following describes in detail the embodiments of technical solutions in this application with reference to the accompanying drawings. The following embodiments are merely used to describe technical solutions in this application more explicitly, and therefore they are merely used as examples and do not constitute a limitation to the protection scope of this application.

Unless otherwise defined, all technical and scientific terms used herein shall have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used herein are merely intended to describe the specific embodiments but not intended to constitute any limitation on this application. The terms "include", "comprise", and "having" and any other variations thereof in the specification, the claims and the foregoing brief description of drawings of this application are intended to cover a non-exclusive inclusion.

In descriptions of embodiments of this application, the terms "first", "second" and the like are merely intended to distinguish between different objects, and shall not be understood as any indication or implication of relative importance or any implicit indication of the number, specific sequence or primary-secondary relationship of the technical features indicated. In the descriptions of this application, "a plurality of" means at least two unless otherwise specifically stated.

In this specification, reference to "embodiment" means that specific features, structures or characteristics described with reference to the embodiment may be incorporated in at least one embodiment of this application. The word "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment or an independent or alternative embodiment that is exclusive of other embodiments. Persons skilled in the art explicitly and implicitly understand that the embodiments described herein may combine with another embodiment.

In the descriptions of embodiments of this application, the term "and/or" in this application describes only an association relationship for describing associated objects and represents that three relationships may exist. For example, A and/or B may represent the following three cases: A alone, both A and B, and B alone. In addition, a character "/" in this specification generally indicates an "or" relationship between contextually associated objects.

In the description of the embodiments of this application, the term "a plurality of" means more than two (inclusive). Similarly, "a plurality of groups" means more than two (inclusive) groups, and "a plurality of pieces" means more than two (inclusive) pieces.

In the description of the embodiments of this application, the orientations or positional relationships indicated by the technical terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "perpendicular", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", " radial", "circumferential", and the like are based on the orientations or positional relationships as shown in the accompanying drawings. These terms are merely for ease and brevity of description of the embodiments of this application rather than indicating or implying that the apparatuses or components mentioned must have specific orientations or must be constructed or manipulated according to specific orientations, and therefore shall not be construed as any limitations on embodiments of this application.

In the description of the embodiments of this application, unless otherwise specified and defined explicitly, the terms "mount", "connect", "join", and "fasten" should be understood in their general senses. For example, they may refer to a fixed connection, a detachable connection, or an integral connection, may refer to a mechanical connection or electrical connection, any may refer to a direct connection, an indirect connection via an intermediate medium, or an interaction between two elements. Persons of ordinary skill in the art can understand specific meanings of these terms in this application as appropriate to specific situations.

Currently, from a perspective of market development, application of electric vehicle batteries is becoming more and more extensive. Traction batteries have been widely used in energy storage power supply systems such as hydroelectric power plants, thermal power plants, wind power plants, and solar power plants, and many other fields including electric transportation tools such as electric bicycles, electric motorcycles, and electric vehicles, military equipment, and aerospace. With continuous expansion of application fields of traction batteries, market demands for the traction batteries are also expanding.

However, during production of a battery, various defects may be caused in various processes of the battery. For example, in a cell die-cutting process, almost <NUM> different defects may be caused, such as wrinkle defects, spot defects, and bump defects. Among these defects, there may be one or more pairs of defects with similar features.

The applicants have noted that in some cases, all sample images are simply input to a defect detection model for training. Accuracy of a defect detection model obtained through training using this method depends heavily on quality of the sample images input (such as a resolution and a signal-to-noise ratio).

The applicants have found through research that the accuracy of the defect detection model obtained through training using this method is not high. For some defects, especially defects with similar features or non-prominent features (such defects account for a small percentage), incorrect detection or missed detection is prone to occur. How a yield of cell production is improved has become an urgent technical problem to be resolved in the art.

Based on the above technical problems found, through in-depth research, the inventors provide a method and apparatus for training a cell defect detection model, a method and apparatus for cell defect detection, an electronic device, a computer-readable storage medium, and a computer program product, to improve a yield of cell production.

The solutions in embodiments of this application are applied in various cell production processes, for example, in a cell die-cutting process. The computer vision and deep learning technologies are used in the solutions in embodiments of this application. In an implementation solution of this application, a defect classification model is first trained for first-preset-category defects, and then a feature vector output by an intermediate layer of the defect classification model obtained through training is migrated to a backbone model. This not only makes a feature extracted by the defect classification model for the first-preset-category defects more accurate, facilitating subsequent classification of the backbone model, but also facilitates full use of existing model resources to avoid repeated training of new models. In this way, accuracy of the defect detection model in detecting cell defects, especially the first-preset-category defects, is improved. In addition, a speed for training the defect detection model is improved and training costs are reduced.

The solutions in embodiments of this application are applied in various production processes of electrode assemblies in various traction batteries or energy storage batteries, for example, in a cell die-cutting process.

For ease of description, an electric apparatus of an embodiment of the application being a vehicle <NUM> is used as an example for description.

Referring to <FIG> is a schematic structural diagram of a vehicle <NUM> according to some embodiments of this application. The vehicle <NUM> may be a fossil fuel vehicle, a natural-gas vehicle, or a new energy vehicle, where the new energy vehicle may be a battery electric vehicle, a hybrid electric vehicle, a range-extended vehicle, or the like. The vehicle <NUM> is provided with a battery <NUM> inside, where the battery <NUM> may be disposed at the bottom, front, or rear of the vehicle <NUM>. The battery <NUM> may be configured to supply power to the vehicle <NUM>. For example, the battery <NUM> may be used as an operational power source for the vehicle <NUM>. The vehicle <NUM> may further include a controller <NUM> and a motor <NUM>, where the controller <NUM> is configured to control the battery <NUM> to supply power to the motor <NUM>, for example, to satisfy power needs of start, navigation, and driving of the vehicle <NUM>.

In some embodiments of this application, the battery <NUM> can be used as not only the operational power source for the vehicle <NUM> but also a driving power source for the vehicle <NUM>, replacing or partially replacing fossil fuel or natural gas to provide driving traction for the vehicle <NUM>.

Referring to <FIG> is an exploded view of a battery <NUM> according to some embodiments of this application. The battery <NUM> may include a box <NUM> and battery cells <NUM>, where the battery cells <NUM> is accommodated in the box <NUM>. The box <NUM> is configured to provide an accommodation space for the battery cells <NUM>. In some embodiments, the box <NUM> may include a first portion <NUM> and a second portion <NUM>. The first portion <NUM> and the second portion <NUM> fit together so that the first portion <NUM> and the second portion <NUM> jointly define a space for accommodating the battery cells <NUM>.

The battery cell <NUM> may be a secondary battery or a primary battery, and may be a lithium-sulfur battery, a sodium-ion battery, or a magnesium-ion battery, without being limited thereto. The battery cell <NUM> may be cylindrical, flat, cuboid, or of other shapes.

Referring to <FIG> is a schematic structural exploded view of a battery cell <NUM> according to some embodiments of this application. The battery cell <NUM> refers to a smallest unit constituting a battery. As shown in <FIG>, the battery cell <NUM> includes an end cover <NUM>, a housing <NUM>, an electrode assembly <NUM> (also referred to as a cell hereinafter), and other functional components.

The end cover <NUM> refers to a component that covers an opening of the housing <NUM> to isolate an internal environment of the battery cell <NUM> from an external environment. A shape of the end cover <NUM> is not limited and may be adapted to a shape of the housing <NUM> to fit the housing <NUM>. The housing <NUM> is an assembly configured to form an internal environment of the battery cells <NUM> together with the end cover <NUM>, where the formed internal environment may be configured to accommodate the electrode assembly <NUM>, an electrolyte, and other components.

The electrode assembly <NUM> is a component in the battery cell <NUM> in which electrochemical reactions occur. The housing <NUM> may include one or more electrode assemblies <NUM>. The electrode assembly <NUM> is mainly formed by winding or laminating a positive-electrode plate and a negative-electrode plate, and a separator is generally provided between the positive-electrode plate and the negative-electrode plate.

As shown in <FIG>, a method <NUM> for training a cell (which is an electrode assembly <NUM> as shown in <FIG>) defect detection model according to the invention includes the following steps S401 to S406.

In step S401, a plurality of first sample images are obtained, where the plurality of first sample images include sample images corresponding to a plurality of first-preset-category defects of a cell.

In step S402, the plurality of first sample images are used to train a defect classification model that includes an output layer so that a defect classification model obtained through training is capable of predicting the plurality of first-preset-category defects of the cell.

In step S403, a second sample image is obtained, where the second sample image includes a second-preset-category defect of the cell.

In step S404, the second sample image is input to the defect classification model with at least an output layer removed to obtain a sample feature vector of the second sample image.

In step S405, the sample feature vector of the second sample image is input to a backbone model to obtain a predicted defect classification result of the second sample image.

In step S406, parameters of the backbone model and the defect classification model with at least an output layer removed are adjusted based on the second-preset-category defect and the predicted defect classification result of the second sample image.

The first and second sample images can be collected using an industrial camera in a specific process (for example, a die-cutting process) during cell production. The industrial camera may be a CCD industrial camera or a CMOS industrial camera. For another example, the industrial camera may be a line scan camera or an area scan camera.

The plurality of first-preset-category defects may be a plurality of preset-category defects with similar forms and features, for example, wrinkle defects and spot defects. <FIG> shows a wrinkle defect <NUM> in a sample image <NUM> and a spot defect <NUM> in a sample image <NUM>. It should be understood that the plurality of first-preset-category defects may also be a plurality of preset-category defects that need defect features to be accurately extracted and that have other characteristics. This is not limited in this application.

The second-preset-category defect may be a preset-category defect different from the first-preset-category defect, for example, a preset-category defect with a feature not similar as that of the first-preset-category defect. In addition, features of various sub-preset-category defects in the second-preset-category defect may be not similar with each other and distinguishable. This is not limited in this application.

The defect classification model may be a deep learning model, for example, ResNet18, ResNet50, and DNN, or a traditional machine learning model. This is not limited in this application. The defect classification model may include an input layer, a plurality of intermediate layers, and an output layer. The input layer is used for inputting sample images, the plurality of intermediate layers are used for extracting a feature vector from a sample image, and the output layer is used for outputting a classification result based on the extracted feature vector. Parameters of the defect classification model are configuration variables in a model, such as a weight and an offset in a neural network model.

The backbone model may be a Softmax function or the like and is used for classification based on the feature vector input. The predicted defect classification result output by the backbone model may include a defect confidence corresponding to each sample image, for example, a probability value ranging from <NUM> to <NUM>. The parameters of the backbone model may be various parameters of a function.

As shown in <FIG>, the defect detection model includes a defect classification model M1 with at least an output layer removed and a backbone model S1, to migrate a feature vector output by an intermediate layer of the defect classification model to the backbone model, improving accuracy and speed of classifying the first-preset-category defects by the backbone model.

The defect classification model including an output layer is a complete defect classification model and the defect classification model with at least an output layer removed is a defect classification model with an output layer removed or a defect classification model with an output layer and the last (two, three, or the like) intermediate layer removed.

The training method <NUM> may be executed on a server or client device. The server may include one or more general-purpose computers, dedicated server computers (for example, PC (personal computer) servers, UNIX servers, and midrange servers), blade servers, mainframe computers, server clusters, or any other suitable arrangements and/or combinations. In some implementations, the server may be a server of a distributed system, a server combined with a block chain, a cloud server, an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. The client device may include various types of computer devices, for example, portable hand-held devices, general-purpose computers (such as personal computers and laptop computers), or workstation computers.

The foregoing embodiment not only makes a feature extracted by the defect classification model for the first-preset-category defects more accurate, facilitating subsequent classification of the backbone model, but also facilitates full use of existing model resources to avoid repeated training of new models. In this way, accuracy of the defect detection model in detecting defects, especially the first-preset-category defects, is improved. In addition, a speed for training the defect detection model is improved and training costs are reduced.

In some embodiments of this application, the plurality of first-preset-category defects include at least one group of first-preset-category defects, each group of first-preset-category defects includes a plurality of first-preset-category defects, and similarities between image features of the first-preset-category defects in each group of first-preset-category defects are not less than a preset threshold.

In other words, the plurality of first-preset-category defects in each of the at least one group of first-preset-category defects may be a plurality of preset-category defects with similar forms and features, for example, wrinkle defects and spot defects. <FIG> shows a wrinkle defect <NUM> in a sample image <NUM> and a spot defect <NUM> in a sample image <NUM>. The preset threshold may be determined based on experience or a specification requirement in a battery production process.

In the foregoing description, the defect classification model is pre-trained for similar first-preset-category defects. This enables the defect classification model to learn features of similar defects to improve accuracy of extracting the features of similar defects. In addition, the defect classification model needs only to precisely classify the first-preset-category defects and thus processes a small amount of information, thereby making training and calculation of the defect classification model faster.

In some embodiments of this application, a similarity between an image feature of the second-preset-category defect and an image feature of any one of the plurality of first-preset-category defects is less than the preset threshold.

In other words, the second-preset-category defect may be a preset-category defect different from the first-preset-category defect, for example, a preset-category defect with a feature not similar as that of the first-preset-category defect.

In the foregoing description, the entire defect detection model is adjusted based on the second-preset-category defect that is different from the first-preset-category defects so that the defect detection model can well identify the first-preset-category defects and the second-preset-category defect.

In some embodiments of this application, step S402 in which a plurality of first sample images are used to train a defect classification model that includes an output layer so that a defect classification model obtained through training is capable of predicting a plurality of first-preset-category defects of a cell includes: for each of the plurality of first sample images, inputting the first sample image to the defect classification model that includes the output layer to obtain a predicted defect classification result of the first sample image; and adjusting parameters of the defect classification model based on the first-preset-category defect and the predicted defect classification result of the first sample image.

In other words, a defect classification model may be pre-trained for the plurality of first-preset-category defects so that the defect classification model can classify the first-preset-category defects. In addition, if the at least one group of first-preset-category defects includes only group of first-preset-category defects (a plurality first-preset-category defects are similar), a defect classification model is pre-trained for the plurality of similar first-preset-category defects so that the defect classification model can well distinguish the group of similar defects.

In some examples, parameters of the defect classification model can be continuously adjusted using a gradient descent method based on the first-preset-category defects and the predicted defect classification result to minimize a loss function of the defect classification model.

In the foregoing description, a simple method is used to train the defect classification model for the first-preset-category defects to improve accuracy and efficiency of the defect classification model obtained through training.

In some embodiments of this application, the plurality of first sample images include a plurality of groups of first sample images, the at least one group of first-preset-category defects includes a plurality of groups of first-preset-category defects, and a cell defect category in each group of first sample images pertains to a group of first-preset-category defects in one-to-one correspondence with the group of first sample images. Step <NUM> in which a plurality of first sample images are used to train a defect classification model that includes an output layer so that a defect classification model obtained through training is capable of predicting a plurality of first-preset-category defects of a cell may include: for each group of first sample images, using the group of first sample images to train a corresponding defect classification submodel so that a defect classification submodel obtained through training is capable of predicting a group of first-preset-category defects corresponding to the group of first sample images; and determining parameters of the defect classification model based on parameters of a defect classification submodel obtained through training respectively using each of the plurality of groups of first sample images.

In other words, when the at least one group of first-preset-category defects includes a plurality of groups of first-preset-category defects (for example, a plurality of groups of similar defects), a defect classification submodel can be pre-trained for each of the plurality of groups of first-preset-category defects. The defect classification submodel may have a structure the same as (for example, with the same quantity of intermediate layers and parameters of corresponding intermediate layers corresponding to each other) or different from that of the defect classification model.

Parameters of the defect classification model are configuration variables in a model, such as a weight and an offset in a neural network model. Parameters of the defect classification submodel specifically refer to parameters (that is, weight and offset) of the intermediate layers of the defect classification submodel. Similarly, the parameters of the defect classification model refer to parameters (that is, weight and offset) of the intermediate layers of the defect classification model. The defect detection model includes only the defect classification model with an output layer removed. Therefore, the parameters of the intermediate layers of the defect classification model need only to be determined.

As shown in <FIG>, a plurality of groups of first sample images include a group of first sample images G1 and another group of first sample images G2. The group of first sample images G1 includes a group of first-preset-category defects Q1 and Q2, and the another group of first sample images G2 includes a group of first-preset-category defects Q3 and Q4. The group of first sample images G1 is used as an example. The group of first sample images G1 is used to train a corresponding defect classification submodel M11 including an output layer S11 so that a defect classification submodel M11 obtained through training is capable of predicting the group of first-preset-category defects Q1 and Q2. Similarly, the group of first sample images G2 is used to train a defect classification submodel M21 including an output layer S21. Then, parameters of a defect classification model M1 (p1, p2,. , and pn) are determined based on parameters of the defect classification models M11 and M21 (p11, p12,. , and p1n; p21, p22,. , and p2n). In this way, a new defect classification model with at least an output layer removed can be constructed based on parameters of plurality of pre-trained defect classification submodels.

In the foregoing description, corresponding defect classification submodels are trained for a plurality of groups of first-preset-category defects. This can enable the defect classification submodels to fully learn features of the corresponding group of first-preset-category defects to improve accuracy of extracting features. In addition, the defect classification submodels need only to precisely classify the corresponding group of first-preset-category defects and thus process a small amount of information, thereby making training and calculation of the defect classification model faster.

In some embodiments of this application, that for each group of first sample images, the group of first sample images is used to train a corresponding defect classification submodel so that a defect classification submodel obtained through training is capable of predicting a group of first-preset-category defects corresponding to the group of first sample image includes: for each first sample image in the group of first sample images, inputting the first sample image to the defect classification submodel to obtain a predicted defect classification result of the first sample image; and adjusting parameters of the defect classification submodel based on the first-preset-category defect and the predicted defect classification result of the first sample image.

In some examples, parameters of the defect classification submodel can be continuously adjusted using a gradient descent method based on the first-preset-category defects and the predicted defect classification result to minimize a loss function of the defect classification submodel.

In this way, efficiency and accuracy of extracting features of the first-preset-category defects by the defect classification submodel can be improved.

In some embodiments of this application, the for each group of first sample images, using the group of first sample images to train a corresponding defect classification submodel so that a defect classification submodel obtained through training is capable of predicting a group of first-preset-category defects corresponding to the group of first sample image further includes: in response to completion of training of the defect classification submodel, compressing the defect classification submodel to obtain a compressed defect classification submodel; and using the group of first sample images to train the compressed defect classification submodel so that a compressed defect classification submodel obtained through training is capable of predicting a group of first-preset-category defects corresponding to the group of first sample images.

When a plurality of defect classification submodels include defect classification submodels with different model structures, a defect classification submodel with a complicated model structure can be compressed by using a method such as pruning and quantizing so that the compressed defect classification submodel can have a structure the same as (for example, with the same quantity of intermediate layers and parameters of corresponding intermediate layers corresponding to each other) or similar with (for example, with the same quantity of intermediate layers) those of other defect classification submodels. In some examples, the defect classification submodel can be compressed by using an existing pruning or quantizing algorithm.

In the foregoing description, the defect classification submodel is compressed. This can change a structure of the defect classification submodel (such as a quantity of intermediate layers and parameters of the intermediate layers) and facilitate subsequent weighted calculation for the defect classification submodel without the need to select multiple defect classification submodels with a completely same structure for training.

In some embodiments of this application, the for each group of first sample images, using the group of first sample images to train a corresponding defect classification submodel so that a defect classification submodel obtained through training is capable of predicting a group of first-preset-category defects corresponding to the group of first sample image may further include: obtaining a defect classification student model, where a quantity of a plurality of first intermediate layers of the defect classification student model is less than a quantity of a plurality of second intermediate layers of the defect classification submodel; dividing the plurality of second intermediate layers of the defect classification submodel into a plurality of second intermediate layer groups, where each second intermediate layer group includes at least one second intermediate layer sequentially connected, and the plurality of second intermediate layer groups are in one-to-one correspondence with the plurality of first intermediate layers; inputting a first sample image in the group of first sample images to the defect classification student model to obtain a sample feature vector output by each of the plurality of first intermediate layers of the defect classification student model; obtaining a sample feature vector output by each of the plurality of second intermediate layer groups of the defect classification submodel; adjusting parameters of the defect classification student model based on the sample feature vector output by each first intermediate layer and the sample feature vector output by each second intermediate layer group; and using an adjusted defect classification student model as the defect classification submodel.

When a plurality of defect classification submodels include defect classification submodels with different model structures, a defect classification submodel with a complicated model structure can be compressed through knowledge distillation so that the compressed defect classification submodel can have a structure the same as or similar with those of other defect classification submodels. A model structure of the defect classification student model may be the same as structures of other defect classification submodels. In this case, intermediate layers of the trained defect classification submodel with a complicated model structure are grouped so that a plurality of intermediate layer groups of the defect classification submodel are in one-to-one correspondence with a plurality of intermediate layers of the defect classification student model. Alternatively, the model structure of the defect classification student model may be different from the structures of other defect classification submodels. In this case, the intermediate layers of the trained defect classification submodel with a complicated model structure and intermediate layers of the defect classification student model can be grouped at the same time so that a plurality of intermediate layer groups of the defect classification student model are in one-to-one correspondence with a plurality of intermediate layer groups of the defect classification submodel.

The adjusting parameters of the defect classification student model based on the sample feature vector output by each first intermediate layer and the sample feature vector output by each second intermediate layer group may include: calculating distillation loss based on the sample feature vector output by each first intermediate layer and the sample feature vector output by each second intermediate layer group, and adjusting the parameters of the defect classification student model based on the distillation loss calculated.

In the foregoing description, the defect classification submodel is compressed through knowledge distillation. This can change a structure of the defect classification submodel (such as a quantity of intermediate layers and parameters of the intermediate layers) and facilitate subsequent weighted calculation for each defect classification submodel without the need to select multiple defect classification submodels with a completely same structure for training.

In some embodiments of this application, defect classification submodels obtained through training respectively using each of the plurality of groups of first sample images have the same quantity of intermediate layers.

In other words, a plurality of defect classification submodels with similar model structures can be set up for the plurality of groups of first-preset-category defects.

In the foregoing description, defect classification submodels with similar model structures are trained. This facilitates subsequent weighted calculation for the defect classification submodels, thereby making training of the defect detection model faster.

In some embodiments of this application, the determining parameters of the defect classification model based on parameters of a defect classification submodel obtained through training respectively using each of the plurality of groups of first sample images may include: performing weighted calculation on corresponding parameters of defect classification submodels trained using the groups of first sample images; and using parameters obtained through weighted calculation as the parameters of the defect classification model.

A defect detection model shown in <FIG> is used as an example. Weighted calculation is performed on corresponding parameters (p11, p12,. , and p1n; p21, p22,. , and p2n) of defect classification submodels M11 and M21 that are obtained through training respectively using each of groups of first sample images G1 and G2, to determine parameters of a defect classification model M1 (p1, p2,. For example, p1=k11p11+k12p21, p2=k21p12+k22p22,. , pn=kn1p1n+kn2p2n. k11, k12, k21, k22,. , kn1, and kn2 are weights of the parameters, which can be manually set based on experience. Alternatively, simple averaging can be performed on the corresponding parameters of defect classification submodels trained using the groups of first sample images for use as parameters of the defect classification model.

In the foregoing description, the parameters of defect classification submodels are used as the parameters of the defect classification model after weighted calculation. In this way, the defect classification model can integrate advantages of the defect classification submodels, thereby improving the accuracy of extracting features of the first-preset-category defects by the defect classification model.

In some embodiments of this application, the backbone model is obtained through training using a plurality of sample images including the plurality of first-preset-category defects and the second-preset-category defect.

Therefore, the backbone model can be a pre-trained or existing model capable of classifying all defects, which can reduce training of new models and avoid a waste of existing resources.

In some embodiments of this application, the second-preset-category defect includes a plurality of sub-preset-category defects, and a similarity between image features of any two of the plurality of sub-preset-category defects is less than the preset threshold.

In other words, a plurality of sub-preset-category defects of the second-preset-category defect are not similar with each other. The defect detection model can easily extract features of defects that are not similar with each other (with prominent features). Therefore, after the defect classification model is trained, these dissimilar features can be used to adjust parameters of the defect detection model so that the defect detection model is capable of identifying all defects.

As shown in <FIG>, the second-preset-category defect includes a plurality of sub-preset-category defects Q5, Q6, and Q7. The plurality of sub-preset-category defects Q5, Q6, and Q7 are not similar with each other. In steps S404 to S406, a second sample image G3 including a plurality of sub-preset-category defects Q5, Q6, and Q7 is input to the defect detection model including a defect classification model M1 with at least an output layer removed and a backbone model S1, and parameters (p1, p2,. , and pn) of the defect classification model M1 with at least an output layer removed and parameters of the backbone model S1 are adjusted based on a predicted defect classification result output by the backbone model S1 and a second-preset-category defect.

After the defect classification model is trained, the defect detection model is adjusted using sample images having preset-category defects that are not similar to the used preset-category defects. This can increase a speed of training the defect detection model and reduce a calculation amount and costs while ensuring that the defect detection model can identify all defects.

In some embodiments of this application, the plurality of first-preset-category defects and the second-preset-category defect are generated in a die-cutting process during cell production.

Many types of defects occur in a cell die-cutting process and the defects have indistinguishable features. With the foregoing method, defects generated in the die-cutting process can be detected.

In some embodiments of this application, the method <NUM> further includes: in response to completion of training of the defect detection model, compressing the defect detection model to obtain a compressed defect detection model; and using the plurality of sample images including the plurality of first-preset-category defects and the second-preset-category defect to train the compressed defect detection model so that a compressed defect detection model obtained through training is capable of predicting the plurality of first-preset-category defects and the second-preset-category defect.

In other words, the trained defect detection model can be compressed by using a method such as pruning and quantizing. In some examples, the defect detection model can be compressed by using an existing pruning or quantizing algorithm. Alternatively, the trained defect detection model can be compressed through knowledge distillation.

In the foregoing description, the defect detection model obtained through training is compressed. This reduces a parameter storage amount and increases a calculation speed of the defect detection model.

As shown in <FIG>, some embodiments of this application provide a cell defect detection method <NUM>. The method may include: step S701: Obtain an image for inspection; step S702: Input the image for inspection to a defect detection model to obtain a predicted defect classification result output by the defect detection model, where the defect detection model is obtained through training by performing the foregoing method <NUM>; and step S703: Determine, based on the predicted defect classification result, whether a defect exists in the image for inspection.

A method for obtaining the image for inspection is the same as a method for obtaining a sample image in method <NUM>. Details are not described here.

The method <NUM> may be executed on a server or client device. The server includes one or more general-purpose computers, dedicated server computers (for example, PC (personal computer) servers, UNIX servers, and midrange servers), blade servers, mainframe computers, server clusters, or any other suitable arrangements and/or combinations. In some implementations, the server may be a server of a distributed system, a server combined with a block chain, a cloud server, an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. The client device may include various types of computer devices, for example, portable hand-held devices, general-purpose computers (such as personal computers and laptop computers), or workstation computers. Alternatively, the method <NUM> may be executed on an industrial computer equipped with a chip in a cell production line. The chip may be a system on chip (System on Chip, SoC) or the like.

This not only makes a feature extracted by the defect classification model for the first-preset-category defects more accurate, facilitating subsequent classification of the backbone model, but also facilitates full use of existing model resources to avoid repeated training of new models. In this way, accuracy and efficiency in detecting defects, especially the first-preset-category defects, are improved.

As shown in <FIG>, the invention provides an apparatus <NUM> for training a cell defect detection model. The defect detection model includes a backbone model and a defect classification model with at least an output layer removed. The apparatus <NUM> includes a first obtaining unit <NUM>, a training unit <NUM>, a second obtaining unit <NUM>, a feature extraction unit <NUM>, a defect detection unit <NUM>, and an adjustment unit <NUM>. The first obtaining unit <NUM> is configured to obtain a plurality of first sample images, and the plurality of first sample images include sample images corresponding to a plurality of first-preset-category defects of a cell, wherein the cell is an electrode assembly <NUM> included in a battery cell <NUM>. The training unit <NUM> is configured to use the plurality of first sample images to train a defect classification model that includes an output layer so that a defect classification model obtained through training is capable of predicting the plurality of first-preset-category defects of the cell. The second obtaining unit <NUM> is configured to obtain a second sample image, and the second sample image includes a second-preset-category defect of the cell. The feature extraction unit <NUM> is configured to input the second sample image to the defect classification model with at least an output layer removed to obtain a sample feature vector of the second sample image. The defect detection unit <NUM> is configured to input the sample feature vector of the second sample image to the backbone model to obtain a predicted defect classification result of the second sample image. The adjustment unit <NUM> is configured to adjust, based on the second-preset-category defect and the predicted defect classification result of the second sample image, parameters of the backbone model and the defect classification model with at least an output layer removed.

It should be understood that the modules of the apparatus <NUM> shown in <FIG> correspond to the steps of the method <NUM> described in <FIG>. Therefore, operations, features, and advantages described for the method <NUM> are also applicable to the apparatus <NUM> and its modules. For brevity, some operations, features, and advantages are not described herein again.

The invention not only makes a feature extracted by the defect classification model for the first-preset-category defects more accurate, facilitating subsequent classification of the backbone model, but also facilitates full use of existing model resources to avoid repeated training of new models. In this way, accuracy of the defect detection model in detecting defects, especially the first-preset-category defects, is improved. In addition, a speed for training the defect detection model is improved and training costs are reduced.

As shown in <FIG>, the invention provides a cell defect detection apparatus <NUM>, including: a third obtaining unit <NUM>, a detection unit <NUM>, and a determining unit <NUM>. The third obtaining unit <NUM> is configured to obtain an image for inspection. The detection unit <NUM> is configured to input the image for inspection to a defect detection model to obtain a predicted defect classification result output by the defect detection model, and the defect detection model is obtained through training by performing the method <NUM>. The determining unit <NUM> is configured to determine, based on the predicted defect classification result, whether a defect exists in the image for inspection.

This makes a feature extracted by the defect classification model for the first-preset-category defects more accurate, facilitating subsequent classification of the backbone model, and also facilitates full use of existing model resources to avoid repeated training of new models. In this way, accuracy and efficiency in detecting defects, especially the first-preset-category defects, are improved.

The invention provides a computer-readable storage medium storing computer instructions, where the computer instructions are configured to enable a computer to perform the training method <NUM> and/or the method <NUM>.

The invention provides a computer program product including a computer program, where when the computer program is executed by a processor, the training method <NUM> and/or the method <NUM> are/is implemented.

As shown in <FIG>, a training method <NUM> for a cell defect detection model according to some embodiments of this application includes the following steps S1001 to S1011.

In step S1001, a plurality of first sample images are obtained. The plurality of first sample images include sample images corresponding to a plurality of first-preset-category defects of a cell, and the plurality of first sample images include a plurality of groups of first sample images. At least one group of first-preset-category defects includes a plurality of groups of first-preset-category defects, and a cell defect category in each group of first sample images pertains to a group of first-preset-category defects in one-to-one correspondence with the group of first sample images.

In step S <NUM>, for each group of first sample images, the group of first sample images is used to train a corresponding defect classification submodel so that a defect classification submodel obtained through training is capable of predicting a group of first-preset-category defects corresponding to the group of first sample images.

In step S1003, weighted calculation is performed on corresponding parameters of defect classification submodels trained using the groups of first sample images.

In step S <NUM>, parameters obtained through weighted calculation are used as the parameters of the defect classification model.

In step S1005, a second sample image is obtained, where the second sample image includes a second-preset-category defect of the cell.

In step S <NUM>, the second sample image is input to the defect classification model with at least an output layer removed to obtain a sample feature vector of the second sample image.

In step S <NUM>, the sample feature vector of the second sample image is input to a backbone model to obtain a predicted defect classification result of the second sample image.

In step S1008, parameters of the backbone model and the defect classification model with at least an output layer removed are adjusted based on the second-preset-category defect and the predicted defect classification result of the second sample image.

The steps of the foregoing method <NUM> have the same features as the corresponding steps of the method <NUM>. For brevity, details are not described herein again.

The method <NUM> in this embodiment of this application not only makes a feature extracted by the defect classification model for the first-preset-category defects more accurate, facilitating subsequent classification of the backbone model, but also facilitates full use of existing model resources to avoid repeated training of new models. In this way, accuracy of the defect detection model in detecting defects, especially the first-preset-category defects, is improved. In addition, a speed for training the defect detection model is improved and training costs are reduced.

Claim 1:
A computer-implemented method (<NUM>) for training a cell defect detection model, wherein the defect detection model comprises a backbone model and a defect classification model with at least an output layer removed, and the method (<NUM>) comprises:
obtaining (S401) a plurality of first sample images, wherein the plurality of first sample images comprise sample images corresponding to a plurality of first-preset-category defects of a cell, and wherein the cell is an electrode assembly (<NUM>) included in a battery cell (<NUM>);
using (S402) the plurality of first sample images to train a defect classification model that comprises the output layer so that a defect classification model obtained through training is capable of predicting the plurality of first-preset-category defects of the cell;
obtaining (S403) a second sample image, wherein the second sample image comprises a second-preset-category defect of the cell;
inputting (S404) the second sample image to the defect classification model with at least an output layer removed to obtain a sample feature vector of the second sample image;
inputting (S405) the sample feature vector of the second sample image to the backbone model to obtain a predicted defect classification result of the second sample image; and
adjusting (S406), based on the second-preset-category defect and the predicted defect classification result of the second sample image, parameters of the backbone model and the defect classification model with at least an output layer removed.