Disclosure of Invention
The invention aims to provide a method and equipment for detecting screen appearance defects.
According to an aspect of the present invention, there is provided a screen appearance flaw detection method, including:
acquiring an appearance image of the electronic equipment;
extracting a screen appearance area image of the electronic equipment from an appearance image of the electronic equipment;
inputting the screen appearance area image into a model of combining the FPN network with the backbone network after training is finished;
receiving a defect detection result of a screen appearance area of the electronic device, which is output from a model of the FPN network combined with the backbone network, wherein the defect detection result comprises: the defect type of the screen of the electronic device, the position of the defect in the screen of the electronic device, and the confidence of the defect detection result.
Further, in the above method, extracting a screen appearance region image of the electronic device from the appearance image of the electronic device includes:
and extracting the screen appearance area image of the electronic equipment from the appearance image of the electronic equipment by adopting a Unet instance segmentation mode.
Further, in the above method, the front 2 layer of the backhaul network adopts res structure, and the back 2 layer of the network adopts an initiation structure.
Further, in the above method, after receiving the defect detection result of the screen appearance area of the electronic device from the model of the FPN network in combination with the backbone network, the method further includes:
identifying whether a confidence level of the flaw detection result is greater than a first preset threshold,
and if the current value is larger than the first preset threshold value, outputting result information including the defect type of the screen of the electronic equipment and the position of the defect in the screen of the electronic equipment.
Further, before inputting the screen appearance region image into the model combining the FPN network and the backbone network, the method further includes:
presetting a model of combining an FPN network with a backbone network and initial model parameters thereof;
inputting the screen appearance area image of the sample electronic equipment into a FPN network with current model parameters and combining with a backsbone network model to obtain a defect prediction result of the screen of the sample electronic equipment, wherein the defect prediction result comprises the following steps: the defect type of the screen of the sample electronic device, the position of the defect in the screen of the sample electronic device, and the confidence of the defect detection result;
calculating a difference between the flaw prediction result and a true flaw result of the sample electronic device based on a preset objective function, identifying whether the difference is greater than a second preset threshold,
if the difference value is larger than a second preset threshold value, a fourth step of executing from the second step again after updating the model parameters of the FPN network combined with the backbone network based on the difference value;
and if the difference is smaller than or equal to a second preset threshold, step five, taking the model of the FPN network combined with the backbone network with the current model parameters as the model of the FPN network combined with the backbone network after the training is finished.
According to another aspect of the present invention, there is also provided a screen appearance flaw detection apparatus including:
the device comprises a first device, a second device and a third device, wherein the first device is used for acquiring an appearance image of the electronic equipment;
second means for extracting a screen appearance region image of the electronic device from an appearance image of the electronic device;
the third device is used for inputting the screen appearance area image into a model of the FPN network combined with the backbone network after training is finished;
fourth means for receiving an output defect detection result of a screen appearance area of an electronic device from a model of the FPN network in combination with a backbone network, wherein the defect detection result includes: the defect type of the screen of the electronic device, the position of the defect in the screen of the electronic device, and the confidence of the defect detection result.
Further, in the foregoing device, the second means is configured to extract the screen appearance region image of the electronic device from the appearance image of the electronic device by using a Unet instance segmentation method.
Further, in the above device, the front 2 layer of the backhaul network adopts a res structure, and the rear 2 layer of the network adopts an initiation structure.
Further, in the foregoing apparatus, the fourth device is further configured to identify whether a confidence of the defect detection result is greater than a first preset threshold, and if the confidence is greater than the first preset threshold, output result information including a defect type of a screen of the electronic apparatus and a position of the defect in the screen of the electronic apparatus.
Further, the above apparatus further includes a fifth device, including:
a fifth device, configured to preset a model of the FPN network combined with the backbone network and initial model parameters thereof;
a fifth second device, configured to input the screen appearance area image of the sample electronic device into a model combining the FPN network with current model parameters and the backbone network, to obtain a defect prediction result of the screen of the sample electronic device, where the defect prediction result includes: the defect type of the screen of the sample electronic device, the position of the defect in the screen of the sample electronic device, and the confidence of the defect detection result;
a fifth third means for calculating a difference between the defect prediction result and a true defect result of the sample electronic device based on a preset objective function, and identifying whether the difference is greater than a second preset threshold, if the difference is greater than the second preset threshold, executing a fifth fourth means for restarting execution from the fifth second means after updating the model parameters of the FPN network in combination with the backbone network based on the difference;
and if the difference is smaller than or equal to a second preset threshold, executing a fifth device, and taking the model of the FPN network combined with the backbone network with the current model parameters as the model of the FPN network combined with the backbone network after the training is finished.
The present invention also provides a computing-based device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
step S1, acquiring an appearance image of the electronic equipment;
step S2, extracting the screen appearance area image of the electronic equipment from the appearance image of the electronic equipment;
step S3, inputting the screen appearance area image into a model of the FPN network combined with the backbone network after training is finished;
step S4, receiving a defect detection result of the screen appearance area of the electronic device from the model of the FPN network combined with the backbone network, where the defect detection result includes: the defect type of the screen of the electronic device, the position of the defect in the screen of the electronic device, and the confidence of the defect detection result.
The present invention also provides a computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions, when executed by a processor, cause the processor to:
step S1, acquiring an appearance image of the electronic equipment;
step S2, extracting the screen appearance area image of the electronic equipment from the appearance image of the electronic equipment;
step S3, inputting the screen appearance area image into a model of the FPN network combined with the backbone network after training is finished;
step S4, receiving a defect detection result of the screen appearance area of the electronic device from the model of the FPN network combined with the backbone network, where the defect detection result includes: the defect type of the screen of the electronic device, the position of the defect in the screen of the electronic device, and the confidence of the defect detection result.
Compared with the prior art, the method has the advantages that the appearance image of the electronic equipment is obtained; extracting a screen appearance area image of the electronic equipment from an appearance image of the electronic equipment; inputting the screen appearance area image into a model of combining the FPN network with the backbone network after training is finished; receiving a defect detection result of a screen appearance area of the electronic device, which is output from a model of the FPN network combined with the backbone network, wherein the defect detection result comprises: the defect type of the screen of the electronic equipment, the position of the defect in the screen of the electronic equipment and the confidence coefficient of the defect detection result can accurately identify the defect difference of the screen appearance of the second-hand electronic equipment such as a mobile phone.
Detailed Description
The present invention is described in further detail below with reference to the attached drawing figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
The invention provides a method for detecting screen appearance flaws, which comprises the following steps:
step S1, acquiring an appearance image of the electronic equipment;
step S2, extracting the screen appearance area image of the electronic equipment from the appearance image of the electronic equipment;
step S3, inputting the screen appearance area image into a model of the FPN network combined with the backbone network after training is finished;
step S4, receiving a defect detection result of the screen appearance area of the electronic device from the model of the FPN network combined with the backbone network, where the defect detection result includes: the defect type of the screen of the electronic device, the position of the defect in the screen of the electronic device, and the confidence of the defect detection result.
The model of the FPN network in combination with the backbone network can be as shown in fig. 3.
Here, the defect detection results of the screen appearance region of the electronic device, which are received and output from the model of the FPN network combined with the backbone network, as shown in fig. 2, each defect detection result includes cls, x1, y1, x2, y2, score, where cls is a defect type, x1, y1, x2, and y2 are 4 coordinates of a position where a defect is located in the screen appearance region image, and score is a confidence of the defect.
The invention mainly utilizes the improved characteristic pyramid (FPN) network and the deep learning model of the backbone network to accurately identify the defect difference of the screen appearance of the second-hand electronic equipment such as a mobile phone.
In an embodiment of the method for detecting the screen appearance flaws, in step S2, the method for extracting the screen appearance area image of the electronic device from the appearance image of the electronic device includes:
and extracting the screen appearance area image of the electronic equipment from the appearance image of the electronic equipment by adopting a Unet instance segmentation mode.
Here, the screen appearance region image can be obtained quickly and efficiently by the Unet instance division.
In an embodiment of the screen appearance flaw detection method, the front 2 layers of the backbone network adopt a res structure, and the rear 2 layers of the network adopt an acceptance structure.
In an embodiment of the method for detecting the defect of the screen appearance of the present invention, after the step S4, receiving the defect detection result of the screen appearance area of the electronic device from the model of the FPN network combined with the backbone network, the method further includes:
identifying whether a confidence level of the flaw detection result is greater than a first preset threshold,
and if the current value is larger than the first preset threshold value, outputting result information including the defect type of the screen of the electronic equipment and the position of the defect in the screen of the electronic equipment.
Here, the defect kinds of the screen may sequentially include a shallow scratch, a hard scratch, and a chipping kind, of which grades are sequentially increased.
In this embodiment, by identifying the confidence of the flaw detection result, a reliable result can be screened from the flaw detection result and output.
In an embodiment of the method for detecting the screen appearance flaws, before the step S3 of inputting the screen appearance region image into a model of FPN network combined with backbone network, the method further includes:
presetting a model of combining an FPN network with a backbone network and initial model parameters thereof;
inputting the screen appearance area image of the sample electronic equipment into a FPN network with current model parameters and combining with a backsbone network model to obtain a defect prediction result of the screen of the sample electronic equipment, wherein the defect prediction result comprises the following steps: the defect type of the screen of the sample electronic device, the position of the defect in the screen of the sample electronic device, and the confidence of the defect detection result;
calculating a difference between the flaw prediction result and a true flaw result of the sample electronic device based on a preset objective function, identifying whether the difference is greater than a second preset threshold,
if the difference value is larger than a second preset threshold value, a fourth step of executing from the second step again after updating the model parameters of the FPN network combined with the backbone network based on the difference value;
and if the difference is smaller than or equal to a second preset threshold, step five, taking the model of the FPN network combined with the backbone network with the current model parameters as the model of the FPN network combined with the backbone network after the training is finished.
And circularly training the model of the FPN network combined with the backbone network by identifying whether the difference value is greater than a second preset threshold, so as to obtain a reliable model.
The invention provides a screen appearance flaw detection device, comprising:
the device comprises a first device, a second device and a third device, wherein the first device is used for acquiring an appearance image of the electronic equipment;
second means for extracting a screen appearance region image of the electronic device from an appearance image of the electronic device;
the third device is used for inputting the screen appearance area image into a model of the FPN network combined with the backbone network after training is finished;
fourth means for receiving an output defect detection result of a screen appearance area of an electronic device from a model of the FPN network in combination with a backbone network, wherein the defect detection result includes: the defect type of the screen of the electronic device, the position of the defect in the screen of the electronic device, and the confidence of the defect detection result.
Here, the fault detection results of the screen appearance region of the electronic device, which are output from the model of the FPN network combined with the backbone network, each fault detection result includes cls, x1, y1, x2, y2, and score, where cls is a defect type, x1, y1, x2, and y2 are 4 coordinates of a position where a fault is located in the screen appearance region image, and score is a confidence of the fault.
The invention mainly utilizes the improved characteristic pyramid (FPN) network and the deep learning model of the backbone network to accurately identify the screen appearance difference of the second-hand electronic equipment such as a mobile phone.
In an embodiment of the method for detecting the screen appearance flaws, the second device is configured to extract a screen appearance area image of the electronic device from an appearance image of the electronic device in a manner of using a pnet instance segmentation.
Here, the screen appearance region image can be obtained quickly and efficiently by the Unet instance division.
In an embodiment of the screen appearance flaw detection method, the front 2 layers of the backbone network adopt a res structure, and the rear 2 layers of the network adopt an acceptance structure.
In an embodiment of the method for detecting the screen appearance defect, the fourth device is further configured to identify whether a confidence of the defect detection result is greater than a first preset threshold, and if the confidence is greater than the first preset threshold, output result information including a defect type of a screen of the electronic device and a position of the defect in the screen of the electronic device.
Here, the defect kinds of the screen may sequentially include a shallow scratch, a hard scratch, and a chipping kind, of which grades are sequentially increased.
In this embodiment, by identifying the confidence of the flaw detection result, a reliable result can be screened from the flaw detection result and output.
In an embodiment of the method for detecting the screen appearance defect of the present invention, the method further includes a fifth apparatus, including:
a fifth device, configured to preset a model of the FPN network combined with the backbone network and initial model parameters thereof;
a fifth second device, configured to input the screen appearance area image of the sample electronic device into a model combining the FPN network with current model parameters and the backbone network, to obtain a defect prediction result of the screen of the sample electronic device, where the defect prediction result includes: the defect type of the screen of the sample electronic device, the position of the defect in the screen of the sample electronic device, and the confidence of the defect detection result;
a fifth third means for calculating a difference between the defect prediction result and a true defect result of the sample electronic device based on a preset objective function, and identifying whether the difference is greater than a second preset threshold, if the difference is greater than the second preset threshold, executing a fifth fourth means for restarting execution from the fifth second means after updating the model parameters of the FPN network in combination with the backbone network based on the difference;
and if the difference is smaller than or equal to a second preset threshold, executing a fifth device, and taking the model of the FPN network combined with the backbone network with the current model parameters as the model of the FPN network combined with the backbone network after the training is finished.
And circularly training the model of the FPN network combined with the backbone network by identifying whether the difference value is greater than a second preset threshold, so as to obtain a reliable model.
The present invention also provides a computing-based device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
step S1, acquiring an appearance image of the electronic equipment;
step S2, extracting the screen appearance area image of the electronic equipment from the appearance image of the electronic equipment;
step S3, inputting the screen appearance area image into a model of the FPN network combined with the backbone network after training is finished;
step S4, receiving a defect detection result of the screen appearance area of the electronic device from the model of the FPN network combined with the backbone network, where the defect detection result includes: the defect type of the screen of the electronic device, the position of the defect in the screen of the electronic device, and the confidence of the defect detection result.
The present invention also provides a computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions, when executed by a processor, cause the processor to:
step S1, acquiring an appearance image of the electronic equipment;
step S2, extracting the screen appearance area image of the electronic equipment from the appearance image of the electronic equipment;
step S3, inputting the screen appearance area image into a model of the FPN network combined with the backbone network after training is finished;
step S4, receiving a defect detection result of the screen appearance area of the electronic device from the model of the FPN network combined with the backbone network, where the defect detection result includes: the defect type of the screen of the electronic device, the position of the defect in the screen of the electronic device, and the confidence of the defect detection result.
For details of embodiments of each device and storage medium of the present invention, reference may be made to corresponding parts of each method embodiment, and details are not described herein again.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
It should be noted that the present invention may be implemented in software and/or in a combination of software and hardware, for example, as an Application Specific Integrated Circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present invention may be executed by a processor to implement the steps or functions described above. Also, the software programs (including associated data structures) of the present invention can be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Further, some of the steps or functions of the present invention may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
In addition, some of the present invention can be applied as a computer program product, such as computer program instructions, which when executed by a computer, can invoke or provide the method and/or technical solution according to the present invention through the operation of the computer. Program instructions which invoke the methods of the present invention may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal-bearing medium and/or stored within a working memory of a computer device operating in accordance with the program instructions. An embodiment according to the invention herein comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or solution according to embodiments of the invention as described above.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.