Algorithm testing method, device, electronic device and storage medium
By deploying the first visual test algorithm in the production environment and the second visual test algorithm in the grayscale environment, and comparing the results of the two to determine the target algorithm, the problem of low AB test efficiency of the CV algorithm is solved and higher accuracy is achieved. sex and efficiency.
Patent Information
- Application Number
- CN202410949333.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-16
AI Technical Summary
The AB test efficiency of the existing CV algorithm is low, prone to problems such as data overfitting and false positives, and there is a lack of effective improvement methods.
By deploying the first visual test algorithm in the production environment, using the preset reflow strategy to obtain visual reflow data, and deploying the second visual test algorithm in the grayscale environment for inference, the results of the two are compared to determine the target with higher accuracy. Algorithms reduce manual intervention and improve test accuracy and efficiency.
It effectively improves the accuracy and efficiency of the AB test of the CV algorithm, reduces misjudgments, avoids overfitting and false positives, and provides a more accurate and reliable online CV algorithm AB test solution.
Smart Images

Figure CN118485896B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer algorithms, and in particular to an algorithm testing method, device, electronic device and storage medium. Background Art
[0002] CV algorithm (Computer Vision Algorithm): The algorithm usually processes images or videos and analyzes various attributes in them, such as shape, color, texture, motion, and objects, to achieve tasks such as recognition, tracking, and measurement.
[0003] The accuracy and reliability of the CV algorithm are key factors in determining its success in practical applications. AB testing plays a key role in ensuring the effectiveness of the algorithm. AB testing is a statistical method that uses real data to compare and test two or more algorithms to determine which one is the most effective. However, in traditional AB testing, since it only relies on real-time testing and feedback, it brings some potential risks, such as data overfitting, false positives, etc., making the CV algorithm less efficient.
[0004] With regard to the problem that the efficiency of the CV algorithm in the related technology needs to be improved, no effective solution has been proposed yet. Summary of the invention
[0005] In this embodiment, an algorithm testing method, device, electronic device and storage medium are provided to solve the problem that the efficiency of the CV algorithm in the related art needs to be improved.
[0006] In a first aspect, an algorithm testing method is provided in this embodiment, the method comprising:
[0007] Invoke a first visual test algorithm in a first environment, and obtain visual reflow data of the first visual test algorithm according to a preset reflow strategy; determine a first visual algorithm result according to the visual reflow data;
[0008] Invoking a second visual test algorithm in a second environment, and determining a second visual algorithm result according to the visual reflow data; the second visual test algorithm is determined according to the first visual test algorithm; the first environment and the second environment have different construction strategies;
[0009] A target algorithm is determined according to the first visual algorithm result and the second visual algorithm result.
[0010] In some embodiments, obtaining visual reflow data of the first visual testing algorithm according to a preset reflow strategy includes:
[0011] In response to the visual algorithm test requirement, the preset reflow strategy is determined according to the visual algorithm test requirement; the reflow strategy includes a visual algorithm call time interval and a visual algorithm data source;
[0012] Determine visual reflow data of the first visual test algorithm in the visual algorithm data source according to the visual algorithm call time interval.
[0013] In some embodiments, obtaining visual reflow data of the first visual testing algorithm includes:
[0014] Obtaining online visual algorithm data of the first visual test algorithm;
[0015] Determine the visual algorithm input parameters and the visual algorithm reasoning results according to the online visual algorithm data and the preset reflow strategy;
[0016] The visual reflow data is determined according to the visual algorithm input parameters and the visual algorithm reasoning results.
[0017] In some embodiments, the second visual testing algorithm and the first visual testing algorithm have consistent algorithm logic.
[0018] In some embodiments, determining a target algorithm according to the first visual algorithm result and the second visual algorithm result includes:
[0019] Comparing the first visual algorithm result and the second visual algorithm result, and generating difference result data according to data having differences between the first visual algorithm result and the second visual algorithm result;
[0020] Determine a visual judgment result according to the difference result data; and determine a target algorithm according to the visual judgment result.
[0021] In some embodiments, the method further comprises:
[0022] Determining the visual reflow data according to the preset reflow strategy;
[0023] Sampling the visual reflow data to obtain visual reflow sampling data;
[0024] Determine whether to update the target algorithm according to the visual reflow sampling data.
[0025] In some embodiments, determining a target algorithm according to the visual judgment result includes:
[0026] Preset a first algorithm evaluation index and a second visual algorithm evaluation index;
[0027] Determine a first visual evaluation result of the first visual test algorithm according to the first visual algorithm evaluation index; determine a second visual evaluation result of the second visual test algorithm according to the second visual algorithm evaluation index;
[0028] The target algorithm is determined according to the first visual analysis result and the second visual analysis result.
[0029] In a second aspect, an algorithm testing device is provided in this embodiment, the device comprising: a backflow data acquisition module, an algorithm result acquisition module and a target algorithm determination module;
[0030] The reflow data acquisition module is used to call the first visual test algorithm in the first environment, and obtain the visual reflow data of the first visual test algorithm according to the preset reflow strategy; determine the first visual algorithm result according to the visual reflow data;
[0031] The algorithm result acquisition module is used to call a second visual test algorithm in a second environment and determine a second visual algorithm result according to the visual reflow data; the second visual test algorithm is determined according to the first visual test algorithm; the deployment strategies of the first environment and the second environment are different;
[0032] The target algorithm determination module is used to determine the target algorithm according to the first visual algorithm result and the second visual algorithm result.
[0033] In a third aspect, an electronic device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the algorithm testing method described in the first aspect when executing the computer program.
[0034] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the algorithm testing method described in the first aspect is implemented.
[0035] Compared with the related art, an algorithm testing method, device, electronic device and storage medium provided in this embodiment deploys a first visual test algorithm to a first environment (production environment) and obtains visual reflow data through a predetermined timed reflow mechanism. Determine the first visual algorithm result of algorithmic reasoning based on the visual reflow data; deploy a second visual test algorithm in a second environment (grayscale environment), and perform algorithmic reasoning on the visual reflow data to obtain the second visual algorithm result. Compare the first visual result with the second visual result, and determine the algorithm with higher accuracy as the target algorithm. By obtaining visual reflow data and comparing the prediction results of the first visual test algorithm and the second visual test algorithm, the efficiency of the CV algorithm is further improved.
[0036] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0038] Figure 1 It is a hardware structure block diagram of a terminal of the algorithm testing method provided in an embodiment of the present application;
[0039] Figure 2 is a flow chart of the algorithm testing method provided in an embodiment of the present application;
[0040] Figure 3 It is a flowchart of the algorithm test provided in this specific embodiment;
[0041] Figure 4 is a schematic diagram of online algorithm reflow data provided by this specific embodiment;
[0042] Figure 5 This is a flow chart of the algorithm reasoning result analysis provided in this specific embodiment;
[0043] Figure 6 is a schematic diagram of the manual analysis process provided in this specific embodiment;
[0044] Figure 7 It is a preferred structural block diagram of the algorithm testing device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0046] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0047] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 is a hardware structure block diagram of a terminal of the algorithm testing method provided in the embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0048] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the algorithm testing method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0049] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0050] CV algorithm (Computer Vision Algorithm): The algorithm usually processes images or videos and analyzes various attributes such as shape, color, texture, motion and objects, so as to achieve tasks such as recognition, tracking and measurement. AB Testing (A / B Testing): It is mainly used to compare the effects of two (or more) different versions of solutions to find out which solution is better. The common method of AB testing algorithms is to compare the running results of the online CV algorithm with the pre-set standards, that is, "shadow testing". However, this method usually relies on a lot of manual participation, and the time and economic costs are high. In addition, because human judgment may be affected by factors such as knowledge and experience, sometimes inaccurate results may be given for the performance of a specific algorithm.
[0051] Therefore, in order to solve the above problems, reduce misjudgments in AB testing, and improve the online testing efficiency of CV algorithms, this application proposes an algorithm testing method, which improves the accuracy and efficiency of AB testing of CV algorithms through automated judgment, effectively reduces manual intervention, and improves the accuracy and efficiency of testing; at the same time, it avoids problems such as overfitting and false alarms, aiming to provide a more accurate and reliable online CV algorithm AB testing solution.
[0052] In this embodiment, an algorithm testing method is provided. Figure 2 is a flow chart of the algorithm testing method provided in the embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0053] Step S210, calling a first visual test algorithm in a first environment, and obtaining visual reflow data of the first visual test algorithm according to a preset reflow strategy; and determining a first visual algorithm result according to the visual reflow data.
[0054] In one possible embodiment, the first environment includes the environment in which the algorithm is actually operated, specifically the production environment for algorithm testing, and the second environment includes the environment for algorithm testing before actual operation, specifically the grayscale environment for algorithm testing. The production environment refers to the environment in which the algorithm is actually operated, using real production data; the grayscale environment is a transitional environment between the pre-release environment and the production environment, mainly used for small-scale testing of new functions, and a rollback strategy is applied in the grayscale environment. Specifically, when a problem occurs with a function, the grayscale server of the algorithm corresponding to the function is rolled back without affecting other servers in the production environment.
[0055] The processor deploys the first visual test algorithm to the first environment, and calls the first visual test algorithm in the first environment according to the preset reflow strategy, thereby obtaining and saving the visual reflow data inferred by the first visual test algorithm, and then determining the first visual algorithm result in the first environment. Among them, the preset reflow strategy includes determining the scope of the visual algorithm device according to the actual test requirements, screening the algorithm flow data to be cloned, configuring the cloning interval and the reflow rules, etc., which are not specifically limited here. Furthermore, the visual reflow data includes the input parameters and algorithm reasoning results of the online first visual test algorithm in the first environment.
[0056] Step S220, calling a second visual test algorithm in a second environment, and determining a second visual algorithm result based on visual reflow data; the second visual test algorithm is determined based on the first visual test algorithm; the construction strategies of the first environment and the second environment are different.
[0057] The processor deploys the second visual test algorithm to the second environment. Furthermore, the algorithm traffic of the second visual test algorithm is cloned from the online algorithm traffic of the first visual test algorithm. The second environment is an isolated environment. The second visual test algorithm is called in the second environment, and the second visual algorithm result is obtained based on the visual reflow data. Furthermore, the second visual test algorithm is determined based on the first visual test algorithm, which can be understood as follows: the second visual test algorithm is set to a visual test algorithm of the same type as the first visual test algorithm.
[0058] In some of the embodiments, the algorithm logic of the second visual testing algorithm is consistent with that of the first visual testing algorithm; however, due to different building strategies for different environments, the building strategies for different algorithms are also different.
[0059] Step S230, determining a target algorithm according to the first vision algorithm result and the second vision algorithm result.
[0060] Among them, the processor compares the first visual algorithm result and the second visual algorithm result obtained in the first environment and the second environment respectively to obtain a reasoning comparison result. Furthermore, the preset analysis and judgment strategy further verifies the reasoning comparison result to determine whether the reasoning comparison result is verified, and then determines whether the accuracy of the second visual test algorithm meets the requirements for online service deployment. Exemplarily, the method for verifying the reasoning comparison result can be to verify it through the accuracy index, precision index and recall rate index of the preset algorithm, and can also be through manual analysis and judgment to further screen out the visual algorithms that have passed the verification.
[0061] Through the above steps, by obtaining the visual reflow data of the first visual test algorithm under the first environment, using the visual reflow data to test other algorithms of the same type, i.e., the second visual test algorithm, to obtain the second visual test result, and then obtain the reasoning comparison result between the first visual test algorithm and the second visual test algorithm; thereafter, combined with the preset analysis and judgment strategy, the reasoning comparison result is analyzed by indicators, which is conducive to improving the accuracy and efficiency of CV algorithm testing.
[0062] In some of the embodiments, step S210 of obtaining visual reflow data of a first visual testing algorithm according to a preset reflow strategy includes steps S211 to S212.
[0063] Step S211, in response to the visual algorithm test requirement, determining a preset reflow strategy according to the visual algorithm test requirement; the reflow strategy includes a visual algorithm call time interval and a visual algorithm data source.
[0064] Among them, the reflux strategy includes the visual algorithm call time interval and the visual algorithm data source. Furthermore, the strategy of the visual algorithm data source also includes selecting which algorithm equipment’s camera device data is used as the data source, selecting a specific time range, and which databases the reflux data is stored in, etc., which are not specifically limited here.
[0065] Step S212, determining the visual reflow data of the first visual test algorithm in the visual algorithm data source according to the visual algorithm calling time interval.
[0066] The processor determines the visual reflow data in the first visual test algorithm according to the reflow strategy, that is, according to the reflow strategy, obtains and saves the input parameters and the results of the algorithm reasoning for the first visual test algorithm.
[0067] Through the above steps, by pre-configuring the reflow strategy and determining more algorithm-test-specific visual reflow data according to the reflow strategy, it is helpful to increase the accuracy and efficiency of the algorithm reasoning of the second visual testing algorithm.
[0068] In some of the embodiments, obtaining visual reflow data of a first visual testing algorithm in step S210 includes steps S213 to S214.
[0069] Step S213, obtaining online visual algorithm data of the first visual test algorithm.
[0070] Step S214, determining the visual algorithm input parameters and the visual algorithm reasoning results according to the online visual algorithm data and the preset reflow strategy; determining the visual reflow data according to the visual algorithm input parameters and the visual algorithm reasoning results.
[0071] Among them, the online visual algorithm data of the first visual test algorithm includes: visual algorithm input parameters and visual algorithm reasoning results obtained from the data source within a certain time interval according to a preset reflow strategy.
[0072] Determining visual reflow data through a preset reflow strategy and the online visual algorithm data of the first visual test algorithm is helpful in screening out algorithm test data for visual algorithm testing needs, thereby improving the accuracy and efficiency of subsequent algorithm testing.
[0073] In some embodiments, step S230 includes steps S231 to S232.
[0074] Step S231 , comparing the first visual algorithm result and the second visual algorithm result, and generating difference result data according to the data having differences between the first visual algorithm result and the second visual algorithm result.
[0075] After obtaining the first visual algorithm result and the second visual algorithm result respectively, the difference between the data corresponding to different attributes is determined respectively, thereby generating difference result data. Furthermore, the difference result data may be numerical data, image mask, sequence data, etc., and may specifically include image classification results, object detection results, image segmentation results, target tracking results, posture and depth estimation results, etc., which are not specifically limited here.
[0076] Step S232, determining a visual judgment result according to the difference result data; and determining a target algorithm according to the visual judgment result.
[0077] Among them, determining the target algorithm according to the visual judgment result includes: presetting a first visual algorithm evaluation index and a second visual algorithm evaluation index; determining a first visual judgment result of a first visual test algorithm according to the first visual algorithm evaluation index; determining a second visual judgment result of a second visual test algorithm according to the second visual algorithm evaluation index; and determining the target algorithm according to the first visual judgment result and the second visual judgment result.
[0078] Furthermore, after obtaining the difference result data, an evaluation task is created according to the corresponding data attributes in the difference result data, and a first visual algorithm evaluation indicator and a second visual algorithm evaluation indicator are preset according to the evaluation task. Exemplarily, the algorithm evaluation indicators include evaluation indicators of a first visual test algorithm in a first environment and evaluation indicators of a second visual test algorithm in a second environment. Thereafter, the difference result data are evaluated respectively according to the first visual algorithm evaluation indicator and the second visual algorithm evaluation indicator, and then a visual judgment result is obtained. The above method for further judging the difference result data is conducive to further improving the accuracy of the algorithm test.
[0079] Exemplarily, the evaluation task may also be a manual judgment task, which manually judges the difference data and outputs the results of whether the first visual test algorithm and the inference result of the first visual test algorithm are correct.
[0080] In some of the embodiments, the algorithm testing method further includes: determining visual reflow data according to a preset reflow strategy; sampling the visual reflow data to obtain visual reflow sampling data; and determining whether to update the target algorithm according to the visual reflow sampling data.
[0081] Among them, whether to update the target algorithm is determined based on the visual reflow sampling data, which is helpful to ensure the quality control of the algorithm running online in the production environment.
[0082] The present embodiment is described and illustrated by means of specific examples below.
[0083] This application obtains difference result data by establishing an online CV algorithm reasoning data reflow strategy and an algorithm reasoning effect comparison strategy; then, the evaluation indicators of the algorithm are output according to the evaluation task, and the accuracy and stability of the algorithm for visual algorithm testing in a grayscale environment are determined based on the evaluation indicators. Figure 3 Schematic diagram of the algorithm test flow provided in this specific embodiment. Figure 3, the algorithm testing environment is divided into a production environment and a grayscale environment, wherein the production environment is the first environment in the aforementioned embodiment, and the grayscale environment is the second environment in the aforementioned embodiment; in the production environment, the processor calls the online algorithm in the service bus / gateway and performs algorithm service V1.0, that is, deploys the first visual test algorithm to the production environment, and obtains the first visual test result in the aforementioned embodiment; in the grayscale environment, the processor calls the algorithm to be tested in the service bus / gateway and performs algorithm service V2.0, that is, deploys the second visual test algorithm to the production environment, and clones the traffic of the first visual test algorithm in the production environment to obtain the second visual test result in the aforementioned embodiment. Afterwards, the first visual test result and the second visual test result are grayscale verified, that is, the reasoning result is determined according to the first visual test result and the second visual test result. The reasoning result here is the visual judgment result in the aforementioned embodiment, and then an evaluation task is created, specifically a manual judgment task is created here, and the reasoning result is manually judged to be accurate, that is, whether it is verified; when it is judged that the second visual test algorithm is verified, the second visual test algorithm is deployed online for algorithm service.
[0084] Furthermore, in the grayscale verification phase, the environment needs to be isolated to verify the effect of the algorithm, thereby ensuring the stability of the algorithm service. Specifically, the second visual test algorithm is verified in a grayscale isolation environment based on real online traffic to verify the algorithm stability; at the same time, through traffic cloning, the same visual data is tested between the two algorithms, and the test results are compared to analyze the algorithm effect of the second visual test algorithm.
[0085] In one embodiment, the method for cloning and reflowing the data of the online algorithm, that is, the data of the first visual test algorithm, is as follows: Figure 4 As shown, Figure 4 Schematic diagram of online algorithm reflux data provided by this specific embodiment. Figure 4 , obtain the online CV algorithm data of the online algorithm, obtain the input parameters of the online data, and at the same time infer the online algorithm to obtain the online inference result; collect the input parameters and the inference result to obtain the reflux data.
[0086] Specifically, when the online algorithm model is deployed to the production environment, the input parameters of the algorithm reasoning are obtained and saved through the preset reflux strategy, and the results of the algorithm reasoning are recorded. Subsequently, the returned data is used to test the performance of other similar algorithms to decide whether to upgrade the currently running algorithm. This process ensures that the algorithms running online are effectively quality controlled. Among them, the preset reflux strategy includes: determining the device range: screening out a batch of CV devices and determining the data source; determining the cloned algorithm: screening the cloned algorithm; reflux rule configuration: configuring the traffic cloning interval, time and reflux rules; initiating data reflux tasks: retaining the frame extraction data of the CV device, calling the input parameters and reasoning results of the algorithm reasoning, etc.
[0087] Among them, the reflux rules include: selecting data from certain cameras and algorithms as data sources, setting a certain time period: for example, from what time to what time and from what day to what day; regularly synchronizing the cycle of reflux data, the cycle can be: every hour, every day, every week, etc.; also includes: in which databases the reflux data is stored, optionally, it can be stored in mysql, tidb and file storage, etc., without specific limitation here.
[0088] After determining the reflux data, it is necessary to compare and analyze the effect of the algorithm reasoning. Figure 5 This is a flowchart of the algorithm reasoning result analysis provided by this specific embodiment. Figure 5 , obtain the input parameters of the online algorithm in the reflow data, and input the online algorithm input parameters into the grayscale algorithm in the grayscale environment to obtain the grayscale algorithm reasoning result, where the grayscale algorithm is the second visual test algorithm in the aforementioned embodiment. At the same time, obtain the online algorithm reasoning result in the reflow data, and compare the grayscale algorithm reasoning result with the online algorithm reasoning result to obtain the diff result; wherein the diff result is the difference result data mentioned in the aforementioned embodiment. Exemplarily, the diff result includes: data results of addition, deletion, unmodified and modified in the grayscale algorithm reasoning result and the online algorithm reasoning result, which are not specifically limited here.
[0089] Deploy the new algorithm in the grayscale environment and use the cloned data of the current online algorithm for inference. Then compare the prediction results of the online algorithm and the grayscale environment algorithm. Save the difference data generated by the above comparison behavior as diff result data, and then make judgments based on the diff results.
[0090] Furthermore, in one embodiment, the accuracy of the diff result can be judged by setting an evaluation index according to the diff result, and the result can also be judged by manual reasoning. Figure 6 Schematic diagram of the manual judgment process provided by this specific embodiment. Figure 6, the processor uses the generated diff result data to create a manual judgment task. This task will generate algorithm evaluation indicators in the actual operating environment (online environment) and the pre-production environment (grayscale environment), and then judge the diff results. The judgment indicators include online algorithm evaluation indicators and grayscale algorithm evaluation indicators. These two indicators are then compared and analyzed to determine which environment has the best algorithm performance. If the algorithm in the grayscale environment performs better than the algorithm in the online environment, the grayscale algorithm will be deployed and applied later, that is, the new algorithm verified by the grayscale will be deployed online to improve the online algorithm effect and ensure the quality of the algorithm online. Among them, manual judgment is specifically: manually judge the difference data, and output the correct or incorrect results of the online algorithm and the grayscale algorithm reasoning results respectively.
[0091] Exemplarily, the indicator results include the accuracy index, precision index, recall rate index and F1 score index of the online algorithm and the grayscale algorithm generated according to the analysis results, which are not specifically limited here.
[0092] This application further improves the accuracy and efficiency of deploying online algorithms through methods such as online algorithm data reflow, generating diff results, and conducting effect analysis, thereby improving the efficiency and accuracy of CV algorithm testing.
[0093] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a group of computer executable instructions.
[0094] In this embodiment, an algorithm testing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit" and the like used below can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceivable.
[0095] Figure 7 is a preferred structural block diagram of the algorithm testing device provided in the embodiment of the present application, such as Figure 7 As shown, the device includes a reflux data acquisition module 10 , an algorithm result acquisition module 20 and a target algorithm determination module 30 .
[0096] The reflow data acquisition module 10 is used to call the first visual test algorithm in the first environment, and obtain the visual reflow data of the first visual test algorithm according to the preset reflow strategy; and determine the first visual algorithm result according to the visual reflow data.
[0097] The algorithm result acquisition module 20 is used to call the second visual test algorithm in the second environment and determine the second visual algorithm result according to the visual reflow data; the second visual test algorithm is determined according to the first visual test algorithm; the deployment strategies of the first environment and the second environment are different.
[0098] The target algorithm determination module 30 is used to determine the target algorithm according to the first vision algorithm result and the second vision algorithm result.
[0099] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0100] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0101] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0102] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0103] S1, calling a first visual test algorithm in a first environment, and obtaining visual reflow data of the first visual test algorithm according to a preset reflow strategy; and determining a result of the first visual algorithm according to the visual reflow data.
[0104] S2, calling the second visual test algorithm in the second environment, and determining the second visual algorithm result according to the visual reflow data; the second visual test algorithm is determined according to the first visual test algorithm; the construction strategies of the first environment and the second environment are different.
[0105] S3, determining a target algorithm according to the first visual algorithm result and the second visual algorithm result.
[0106] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0107] In addition, in combination with the algorithm testing method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the algorithm testing method. The storage medium stores a computer program, and when the computer program is executed by a processor, any one of the algorithm testing methods in the above embodiments is implemented.
[0108] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0109] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0110] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0111] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. An algorithm testing method, characterized in that: The method comprises: Invoke a first visual test algorithm in a first environment, and obtain visual reflow data of the first visual test algorithm according to a preset reflow strategy; determine a first visual algorithm result according to the visual reflow data; The obtaining of the visual reflow data of the first visual test algorithm comprises: obtaining online visual algorithm data of the first visual test algorithm; determining visual algorithm input parameters and visual algorithm reasoning results according to the online visual algorithm data and a preset reflow strategy; determining the visual reflow data according to the visual algorithm input parameters and the visual algorithm reasoning results; Invoke a second visual test algorithm in a second environment, and determine a second visual algorithm result according to the visual reflow data; the second visual test algorithm is determined according to the first visual test algorithm; the first environment and the second environment have different construction strategies; the second visual test algorithm and the first visual test algorithm have consistent algorithm logic; Determining a target algorithm according to the first visual algorithm result and the second visual algorithm result; Determining a target algorithm according to the first visual algorithm result and the second visual algorithm result includes: Comparing the first visual algorithm result and the second visual algorithm result, and generating difference result data according to data having differences between the first visual algorithm result and the second visual algorithm result; Determine a visual judgment result according to the difference result data; and determine a target algorithm according to the visual judgment result.
2. The algorithm testing method according to claim 1, characterized in that: The step of obtaining visual reflow data of the first visual testing algorithm according to a preset reflow strategy includes: In response to the visual algorithm test requirement, the preset reflow strategy is determined according to the visual algorithm test requirement; the reflow strategy includes a visual algorithm call time interval and a visual algorithm data source; Determine visual reflow data of the first visual test algorithm in the visual algorithm data source according to the visual algorithm call time interval.
3. The algorithm testing method according to claim 2, characterized in that: The method further comprises: Determining the visual reflow data according to the preset reflow strategy; Sampling the visual reflow data to obtain visual reflow sampling data; Determine whether to update the target algorithm according to the visual reflow sampling data.
4. The algorithm testing method according to claim 1, characterized in that: The step of determining a target algorithm according to the visual judgment result comprises: Preset a first visual algorithm evaluation index and a second visual algorithm evaluation index; Determine a first visual evaluation result of the first visual test algorithm according to the first visual algorithm evaluation index; determine a second visual evaluation result of the second visual test algorithm according to the second visual algorithm evaluation index; The target algorithm is determined according to the first visual analysis result and the second visual analysis result.
5. An algorithm testing device, characterized in that: The device comprises: a backflow data acquisition module, an algorithm result acquisition module and a target algorithm determination module; The reflow data acquisition module is used to call a first visual test algorithm in a first environment, and obtain visual reflow data of the first visual test algorithm according to a preset reflow strategy; determine a first visual algorithm result according to the visual reflow data; the acquisition of the visual reflow data of the first visual test algorithm includes: obtaining online visual algorithm data of the first visual test algorithm; determining visual algorithm input parameters and visual algorithm reasoning results according to the online visual algorithm data and a preset reflow strategy; determining the visual reflow data according to the visual algorithm input parameters and visual algorithm reasoning results; the algorithm result acquisition module is used to call a second visual test algorithm in a second environment, and determine a second visual algorithm result according to the visual reflow data; the second visual test algorithm is determined according to the first visual test algorithm; the deployment strategies of the first environment and the second environment are different; the algorithm logic of the second visual test algorithm is consistent with that of the first visual test algorithm; The target algorithm determination module is used to determine the target algorithm based on the first visual algorithm result and the second visual algorithm result; the determination of the target algorithm based on the first visual algorithm result and the second visual algorithm result includes: comparing the first visual algorithm result with the second visual algorithm result, and generating difference result data based on the data of the difference between the first visual algorithm result and the second visual algorithm result; determining the visual judgment result based on the difference result data; and determining the target algorithm based on the visual judgment result.
6. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the algorithm testing method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the algorithm testing method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Vision algorithm model test method and system, electronic equipment and storage medium
CN115185797A
Interface testing method and device, storage medium and computer equipment
CN117472759A
