EMA 发布《附录 22:人工智能》(Annex 22)——“解读”制药行业迎来 AI 监管新时代

2025-07-16 09:17:00
gmpfan
转贴 1069

欧盟药品管理局(EMA)首次在《良好生产规范》(GMP)中专设“AI 附录”——Annex 22:Artificial Intelligence(人工智能),明确了 AI 在制药生产中的合规边界,为行业提供“红绿灯式”监管指引。

附录 22 的适用范围

适用系统:凡是在药物及活性物质生产中,利用 AI/ML 模型进行数据预测或分类,且对患者安全、产品质量或数据完整性有直接影响的关键系统,都需遵守本附录

  • 支持类型

    • 静态模型:上线后不再学习;

    • 确定性模型:同输入、同输出

  • 明令禁止

动态(不断学习)模型、生成式AI、大型语言模型(LLM)不得用于关键GMP流程

若用于非关键流程,必须有“人机共治”(Human-in-the-loop),且由具资质人员全程监管

1. Scope (范围)

This annex applies to all types of computerised systems used in the manufacturing of medicinal products and active substances, where Artificial Intelligence models are used in critical applications with direct impact on patient safety, product quality or data integrity, e.g. to predict or classify data. The document provides additional guidance to Annex 11 for computerised systems in which AI models are embedded.

• 解读:本附件适用于所有用于药品和活性物质生产的计算机化系统,特别是当这些系统在关键应用中使用人工智能模型时。这些关键应用需对患者安全、产品质量或数据完整性产生直接影响,例如用于预测或分类数据。它是对《附件11》关于嵌入AI模型的计算机化系统的额外指导。

• 示例

 一个AI模型用于预测药品生产过程中某个批次是否可能存在质量问题。 一个AI模型用于分类成品药物,将其区分为“合格”或“不合格”产品。这些应用因直接影响药品质量和患者安全,因此受本附件管辖。

The document applies to machine learning (AI/ML) models which have obtained their functionality through training with data, rather than being explicitly programmed. Models may consist of several individual models, each automating specific process steps in GMP.

• 解读:本文件适用于通过数据训练获得功能,而非通过明确编程实现的机器学习(AI/ML)模型。一个完整的模型可能由多个子模型组成,每个子模型自动化GMP(良好生产规范)中的特定工艺步骤。

• 示例:一个AI系统通过分析大量历史生产数据来学习识别缺陷产品,而不是通过编写硬编码的规则来识别。这个系统可能包含一个子模型用于图像识别,另一个子模型用于数据分析。

The document applies to static models, i.e. models that do not adapt their performance during use by incorporating new data. The use of dynamic models which continuously and automatically learn and adapt performance during use, is not covered by this document, and should not be used in critical GMP applications.

• 解读:本文件适用于静态模型,即在实际使用中不通过吸收新数据来改变其性能的模型。动态模型(即在使用过程中持续自动学习并调整性能的模型)不属于本文件管辖范围,且不应用于关键的GMP应用

• 示例

    ◦ 静态模型:一个AI模型在部署前经过训练和验证,其参数在运行中保持固定,不会根据新输入的数据自动调整其判断逻辑

    ◦ 动态模型(不适用):一个AI模型在生产线上实时运行,并根据每次新处理的产品数据自动微调其识别精度。这种模型不被允许用于关键GMP应用。

The document applies to models with a deterministic output which, when given identical inputs, provide identical outputs. Models with a probabilistic output which, when given identical inputs, might not provide identical outputs are not covered by this document and should not be used in critical GMP applications.

• 解读:本文件适用于确定性输出的模型,即相同输入总是产生相同输出的模型。具有概率性输出的模型(即相同输入可能产生不同输出的模型)不属于本文件管辖范围,且不应用于关键的GMP应用

• 示例

    ◦ 确定性模型:一个AI模型用于根据特定参数计算化学反应的终点,每次给定相同参数,它都会给出完全相同的终点值’

 概率性模型(不适用):一个AI模型用于生成新的分子结构,即使输入相同,每次也可能生成不同的结构。这种模型不被允许用于关键GMP应用。

Following the above, the document does not apply to Generative AI and Large Language Models (LLM), and such models should not be used in critical GMP applications. If used in non-critical GMP applications, which do not have direct impact on patient safety, product quality or data integrity, personnel with adequate qualification and training should always be responsible for ensuring that the outputs from such models are suitable for the intended use, i.e. a human-in-the-loop (HITL) and the principles described in this document may be considered where applicable.

• 解读:基于上述规定,本文件不适用于生成式AI和大型语言模型(LLM),且这些模型不应用于关键的GMP应用。如果它们用于对患者安全、产品质量或数据完整性没有直接影响的非关键GMP应用,则必须由具备资质和培训的人员负责确保其输出适用于预期用途,即需要人工介入(human-in-the-loop, HITL),并且可以考虑适用本文件中描述的原则。

• 示例

  不适用关键GMP应用:一个LLM用于自动生成药品的批次放行报告。这属于关键应用,因此不允许使用。

   可用于非关键GMP应用(需HITL):一个LLM用于自动生成内部培训文档草稿,这不直接影响患者安全或产品质量。在这种情况下,文档草稿必须由具备资质的员工审核和批准,以确保其准确性,这意味着需要“人工介入”。

------------------------------------------------------------------------

2. Principles (原则)

2.1. Personnel. In order to adequately understand the intended use and the associated risks of the application of an AI model in a GMP environment, there should be close cooperation between all relevant parties during algorithm selection, and model training, validation, testing and operation. This includes but may not be limited to process subject matter experts (SMEs), QA, data scientists, IT, and consultants. All personnel should have adequate qualifications, defined responsibilities and appropriate level of access.

• 解读:为了充分理解AI模型在GMP环境中应用的预期用途和相关风险,在算法选择、模型训练、验证、测试和操作过程中,所有相关方都应紧密合作。这包括但不限于工艺主题专家(SME)、质量保证(QA)、数据科学家、IT人员和顾问。所有人员都应具备足够的资质、明确的职责和适当的访问权限

• 示例:开发一个用于质量控制的AI模型时,制药工艺工程师(SME)需要与数据科学家协作定义数据特征,QA人员审核验证计划,IT人员负责系统部署,确保各环节的专业性与协同性。

2.2. Documentation. Documentation for activities described in this section should be available and reviewed by the regulated user irrespective of whether a model is trained, validated and tested in-house or whether it is provided by a supplier or service provider.

• 解读:本节所述活动的所有文档都应可查阅,并由受监管的用户进行审查,无论模型是内部训练、验证和测试,还是由供应商或服务提供商提供

• 示例:无论是公司内部开发还是外包的AI质量检测系统,其训练过程、验证报告、测试结果等所有相关文档都必须由公司质量部门审核和存档。

2.3. Quality Risk Management Activities described in this document should be implemented based on the risk to patient safety, product quality and data integrity.

• 解读:本文件所述的所有活动都应基于对患者安全、产品质量和数据完整性的风险进行管理和实施。

• 示例:在决定AI模型测试的严谨程度时,需要评估其可能对患者健康造成的潜在风险。例如,用于关键诊断的AI模型需要比用于预测设备维护的AI模型更高程度的验证和风险控制

------------------------------------------------------------------------

3. Intended Use (预期用途)

3.1. Intended use. The intended use of a model and the specific tasks it is designed to assist or automate should be described in detail based on an in-depth knowledge of the process the model is integrated in. This should include a comprehensive characterisation of the data the model is intended to use as input and all common and rare variations; i.e. the input sample space. Any limitations and possible erroneous and biased inputs should be identified. A process subject matter expert (SME) should be responsible for the adequacy of the description, and it should be documented and approved before the start of acceptance testing.

• 解读:模型的预期用途及其旨在辅助或自动化的具体任务,应基于对模型所集成工艺的深入了解进行详细描述。这应包括对模型预期使用的输入数据及其所有常见和罕见变异进行全面表征,即定义输入样本空间。应识别任何限制以及可能的错误和有偏差的输入工艺主题专家(SME)应负责描述的充分性,且该描述应在开始验收测试前记录和批准

• 示例

  一个AI模型用于识别药片外观缺陷。其预期用途应详细描述为“自动检测药片表面裂纹、崩边、异色点等缺陷”。

   输入样本空间应明确包括各种药片的尺寸、颜色、批次差异,以及在生产过程中可能出现的各种缺陷类型(常见和罕见)。

   还需识别模型可能无法识别的缺陷类型(例如,极小的内部缺陷),或可能因光照变化等引起的误判(限制和错误输入)。

  这些描述必须由SME确认并记录批准,然后才能进行验收测试。

3.2. Subgroups. Where applicable, the input sample space should be divided into subgroups based on relevant characteristics. Subgroups may be defined by characteristics like the decision output (e.g. ‘accept’ or ‘reject’), process specific baseline characteristics (e.g. geographical site or equipment), specific characteristics in material or product, and characteristics specific to the task being automated (e.g. types and severity of defects).

• 解读:在适用的情况下,输入样本空间应根据相关特征划分为子组。子组可根据决策输出(例如“接受”或“拒绝”)、工艺特定基线特征(例如地理位置或设备)、物料或产品的特定特征,以及自动化任务的特定特征(例如缺陷类型和严重程度)来定义。

• 示例

  一个用于药物质量控制的AI模型,其输入数据可以根据药物类型(如片剂、胶囊)、生产批次生产设备缺陷类型(如颜色不均、尺寸偏差、杂质)等划分为不同的子组。

 模型对“接受”或“拒绝”的判断,也可能根据不同的子组有不同的表现或标准。

3.3. Human-in-the-loop. Where a model is used to give an input to a decision made by a human operator (human-in-the-loop), and where the effort to test such model has been diminished, the description of the intended use should include the responsibility of the operator. In this case, the training and consistent performance of the operator should be monitored like any other manual process.

• 解读:当模型作为人工操作员决策的输入(即“人工介入”),并且模型的测试工作因此有所减少时,预期用途的描述应包含操作员的责任。在这种情况下,操作员的培训和持续表现应像任何其他手动过程一样受到监控。

• 示例

  一个AI模型根据图像识别结果,推荐操作员某批次产品可能存在缺陷,最终由操作员决定是否“放行”或“拒绝”。由于AI只是提供建议,测试工作可能相对简化。

  在这种情况下,文件的预期用途说明中,必须明确操作员对最终决策的责任。同时,需要定期评估操作员的培训情况,并监控他们是否始终能正确地基于AI的建议做出判断。

------------------------------------------------------------------------

4. Acceptance Criteria (验收标准)

4.1. Test metrics. Suitable, case dependent test metrics, should be defined to measure the performance of the model according to the intended use. As an example, suitable test metrics for a model used to classify products (e.g. ‘accept’ or ‘reject’) may include, but may not be limited to, a confusion matrix, sensitivity, specificity, accuracy, precision and/or F1 score.

• 解读:应根据预期用途定义合适且依赖具体情况的测试指标,以衡量模型的性能。例如,用于产品分类(如“接受”或“拒绝”)的模型的适用测试指标可以包括但不限于混淆矩阵、敏感性、特异性、准确性、精确度和/或F1分数

• 示例:一个AI模型用于识别不合格药品,测试指标需要清晰定义。除了总体准确率,还需要关注:

 敏感性(Recall):能正确识别出所有不合格品的比例(避免漏报)。

 特异性(Specificity):能正确识别出所有合格品的比例(避免误报)。

 混淆矩阵:表格形式展示真阳性、真阴性、假阳性和假阴性的数量。

4.2. Acceptance criteria. Acceptance criteria for the defined test metrics should be established by which the performance of the model should be considered acceptable for the intended use. The acceptance criteria may differ for specific subgroups within the intended use. A process subject matter expert (SME) should be responsible for the definition of the acceptance criteria, which should be documented and approved before the start of acceptance testing.

• 解读:应为定义的测试指标建立验收标准,以此判断模型的性能是否符合预期用途。验收标准对于预期用途中的特定子组可能有所不同工艺主题专家(SME)应负责定义验收标准,且该标准应在开始验收测试前记录和批准

• 示例

   对于识别药片外观缺陷的AI模型,验收标准可能设定为“总准确率不低于98%,对裂纹缺陷的敏感性不低于95%”。

    如果药片有不同颜色,对红色药片的识别准确率可能允许略低于白色药片,因为红色药片的光学检测难度更高。这些子组差异化的标准需由SME定义。这些标准必须在验收测试开始前,由SME签字批准,并有完整记录。

4.3. No decrease. The acceptance criteria of a model, should be at least as high as the performance of the process it replaces. This implies, that the performance should be known for the process which is to be replaced by a model (see Annex 11 2.7).

• 解读:模型的验收标准应至少与其所替代工艺的性能一样高。这意味着,必须已知被模型替代的现有工艺的性能。

• 示例:如果AI模型将取代人工目视检查药片缺陷,那么AI模型的缺陷识别准确率必须至少达到甚至超过熟练人工目视检查的准确率。这意味着在引入AI前,必须对人工目视检查的性能有一个清晰的量化评估。

------------------------------------------------------------------------

5. Test Data (测试数据)

5.1. Selection. Test data should be representative of and expand the full sample space of the intended use. It should be stratified, include all subgroups, and reflect the limitations, complexity and all common and rare variations within the intended use of the model. The criteria and rationale for selection of test data should be documented.

• 解读:测试数据应代表并涵盖预期用途的完整样本空间。它应进行分层,包括所有子组,并反映模型预期用途中的限制、复杂性以及所有常见和罕见变异。测试数据选择的标准和理由应被记录。

• 示例:如果AI模型用于识别药品包装上的印刷错误:

测试数据需要包含所有不同字体、字号、颜色、背景的正确和错误印刷样本。

需要包含常见错误类型(如错别字、漏印)和罕见错误类型(如墨水污染、轻微模糊)的样本。

数据还应反映实际生产中可能遇到的各种复杂情况(如光线变化、包装材料反光)以及模型的已知限制。

5.2. Sufficient in size. The test dataset, and any of its subgroups, should be sufficient in size to calculate the test metrics with adequate statistical confidence.

• 解读:测试数据集及其任何子组的大小应足够大,以便能够以足够的统计置信度计算测试指标。

• 示例:不能只用少数几个样本来测试AI模型识别某种罕见缺陷的能力,而需要足够多的这种缺陷样本才能得出有统计意义的结论。

5.3. Labelling. The labelling of test data should be verified following a process that ensures a very high degree of correctness. This may include independent verification by multiple experts, validated equipment or laboratory tests.

• 解读:测试数据的标签应通过一个确保极高正确性的过程进行验证。这可能包括由多位独立专家进行验证、使用经过验证的设备或进行实验室测试

• 示例:如果图片被标记为“合格药片”,必须有多名经验丰富的QA人员独立确认该药片确实合格,或者通过实验室分析确认其质量符合标准,以确保标签的准确性。

5.4. Pre-processing. Any pre-processing of the test data, e.g. transformation, normalisation, or standardisation, should be pre-specified and a rationale should be provided, that it represents intended use conditions.

• 解读:测试数据的任何预处理,例如转换、归一化或标准化,都应预先指定,并提供理由证明其代表预期用途条件。

• 示例:如果AI模型处理的图片在输入前都需要进行图像灰度化和尺寸统一化,那么这些预处理步骤必须在测试计划中明确说明,并解释为什么这些处理与实际操作中的数据处理方式一致。

5.5. Exclusion. Any cleaning or exclusion of test data should be documented and fully justified.

• 解读:任何对测试数据的清洗或排除都应被记录并充分证明其合理性

• 示例:如果由于测试数据中存在损坏或不完整的样本而将其排除,则必须详细记录排除的原因、排除的样本以及决策依据。

5.6. Data generation. Generation of test data or labels, e.g. by means of generative AI, is not recommended and any use hereof should be fully justified.

• 解读:不建议通过生成式AI等方式生成测试数据或标签,任何此类使用都应充分证明其合理性

• 示例:不应使用生成式AI来生成虚拟的药片缺陷图像作为测试数据,因为其真实性存疑。如果特殊情况必须使用,则需要提供非常强的理由和验证过程。

------------------------------------------------------------------------

6. Test Data Independency (测试数据独立性)

6.1. Independence. Effective measures consisting of technical and/or procedural controls should be implemented to ensure the independency of test data, i.e. that data which will be used to test a model, is not used during development, training or validation of the model. This may be by capturing test data only after completion of training and validation, or by splitting test data from a complete pool of data before training has started.

• 解读:应实施由技术和/或程序控制组成的有效措施,以确保测试数据的独立性。这意味着用于测试模型的数据不应在模型的开发、训练或验证过程中使用。这可以通过在训练和验证完成后才捕获测试数据,或者在训练开始前从完整数据池中分割出测试数据来实现。

• 示例

   方法一:先用一批数据训练和验证AI模型,待模型稳定后,再从生产线上采集一批全新的数据作为最终测试数据。

   方法二:在项目开始时,从所有可用数据中预先划出20%隔离保管,确保开发和训练团队无法接触到这部分数据。

6.2. Data split. If test data is split from a complete pool of data before training of the model, it is essential that employees involved in the development and training of the model have never had access to the test data. The test data should be protected by access control and audit trail functionality logging accesses and changes to these. There should be no copies of test data outside this repository.

• 解读:如果在模型训练前从完整数据池中分割出测试数据,关键在于参与模型开发和训练的员工从未接触过这些测试数据。测试数据应通过访问控制和记录访问及更改的审计追踪功能进行保护。该存储库之外不应存在测试数据的任何副本。

• 示例:如果测试数据预先分离,那么训练模型的团队成员不应有权限访问存储这些测试数据的服务器或文件夹。任何对测试数据的访问和修改都应被系统自动记录(审计追踪),并且不能在其他地方保留测试数据的副本。

6.3. Identification. It should be recorded which data has been used for testing, when and how many times.

• 解读:应记录哪些数据被用于测试,以及测试的时间和次数。

• 示例:系统应有日志显示,某个测试批次的特定图片或样本集在何时、被哪个测试过程使用了多少次。

6.4. Physical objects. When test data originates from physical objects, it should be ensured, that the objects used for the final test of the model have not previously been used to train or validate the model, unless features are independent.

• 解读:当测试数据来源于物理对象时,应确保用于模型最终测试的这些物理对象以前未曾用于模型的训练或验证,除非其特征是独立的。

• 示例:如果AI模型通过图像识别来检测药瓶的缺陷,那么用于最终验收测试的药瓶不应是之前用于训练或验证模型所用的药瓶,除非可以证明这些药瓶的缺陷特征在不同药瓶之间是完全独立的,互不影响。

6.5. Staff independency. Effective procedural and/or technical controls should be implemented to prevent staff members who have had access to test data from being involved in training and validation of the same model. In organisations where it is impossible to maintain this independency, a staff member who might have had access to test data for a model, should only have access to training and validation of the same model when working together (in pair) with a colleague who has not had this access (4-eyes principle).

• 解读:应实施有效的程序和/或技术控制,以防止接触过测试数据的员工参与同一模型的训练和验证。在无法维持这种独立性的组织中,可能接触过模型测试数据的员工,只有在与未接触过测试数据的同事一起工作(两人一组)四眼原则)。

• 示例

   理想情况:A团队负责收集和准备测试数据,B团队负责模型的训练和验证,A团队成员不参与B团队的工作。

   无法独立时:如果A团队的一名成员因工作需要接触了测试数据,那么在进行模型训练或验证时,他必须与B团队中一位从未接触过测试数据的同事共同操作和审核,以确保公正性。

------------------------------------------------------------------------

7. Test Execution (测试执行)

7.1. Fit for intended use. The test should ensure that a model is fit for intended use and is ‘generalising well’, i.e. that the model has a satisfactory performance with new data from the intended use. This includes detecting possible over-or underfitting of the model to the training data.

• 解读:测试应确保模型符合预期用途并“泛化良好”,即模型在使用来自预期用途的新数据时表现令人满意。这包括检测模型对训练数据可能存在的过拟合或欠拟合

• 示例

   泛化良好:一个AI模型在训练时表现出色,但在实际生产中处理从未见过的产品图片时,依然能准确识别缺陷。

   过拟合:模型在训练数据上表现完美,但在新数据上表现糟糕,因为它过度学习了训练数据的特定“噪音”而不是普遍规律。

   欠拟合:模型甚至在训练数据上都表现不佳,因为它没有充分学习到数据中的模式。

7.2. Test plan. Before the test is initiated, a test plan should be prepared and approved. It should contain a summary of the intended use, the pre-defined metrics and acceptance criteria, a reference to the test data, a test script including a description of all steps necessary to conduct the test, and a description of how to calculate the test metrics. A process subject matter expert (SME) should be involved in developing the plan.

• 解读:在测试开始前,应准备并批准测试计划。它应包含预期用途摘要、预定义的指标和验收标准、测试数据引用、包含执行测试所需所有步骤描述的测试脚本,以及如何计算测试指标的描述工艺主题专家(SME)应参与制定该计划

• 示例:在测试一个AI视觉检测系统前,需要制定详细的测试计划,包括:系统将检测何种缺陷(预期用途),合格标准是什么(验收标准),使用哪些特定批次的产品作为测试样本(测试数据引用),以及详细的测试步骤(如将样本放置在哪个位置、如何启动系统、如何记录结果),并说明如何计算准确率、敏感性等指标。这些内容都需要SME的参与和批准。

7.3. Deviation. Any deviation from the test plan, failure to meet acceptance criteria, or omission to use all test data should be documented, investigated, and fully justified.

• 解读:任何偏离测试计划、未能达到验收标准或未能使用所有测试数据的情况,都应被记录、调查并充分证明其合理性

• 示例:如果在测试过程中发现AI模型未能达到预设的98%准确率,或者因为某种原因未能测试所有预设的样本,这些情况必须详细记录,并进行根本原因分析,说明为何偏离以及如何纠正或接受这种偏离。

7.4. Test documentation. All test documentation should be retained along with the description of the intended use, the characterisation of test data, the actual test data, and where relevant, physical test objects. In addition, documentation for access control to test data and related audit trail records, should be retained similarly to other GMP documentation.

• 解读:所有测试文档都应与预期用途描述、测试数据特征、实际测试数据以及(如果相关)物理测试对象一并保留。此外,测试数据访问控制的文档和相关的审计追踪记录也应像其他GMP文档一样保留。

• 示例:测试完成后,不仅要保存测试报告,还要保存当初的预期用途文件、测试用到的原始图片或数据文件、测试时使用的实际物理样本(如药片),以及谁在何时访问或修改了测试数据的记录。

------------------------------------------------------------------------

8. Explainability (可解释性)

8.1. Feature attribution. During testing of models used in critical GMP applications, systems should capture and record the features in the test data that have contributed to a particular classification or decision (e.g. rejection). Where applicable, techniques like feature attribution (e.g. SHAP values or LIME) or visual tools like heat maps should be used to highlight key factors contributing to the outcome.

• 解读:在关键GMP应用中使用的模型测试期间,系统应捕获并记录测试数据中导致特定分类或决策(例如,拒绝)的特征。在适用情况下,应使用**特征归因技术(例如SHAP值或LIME)可视化工具(例如热图)**来突出导致结果的关键因素。

• 示例

   一个AI模型将一批药片分类为“不合格”。系统应能显示是哪些特定的特征(例如,图片中某一区域的异常颜色、形状或纹理)导致了这个“不合格”的判断。

   可以使用SHAP值来量化每个特征对模型决策的贡献,或者使用热图来直观地在图像上标记出模型“关注”的区域。

8.2. Feature justification. In order to ensure that a model is making decisions based on relevant and appropriate features and based on risk, a review of these features should be part of the process for approval of test results.

• 解读:为了确保模型是基于相关和适当的特征以及基于风险做出决策,对这些特征的审查应作为测试结果批准过程的一部分

• 示例:AI模型判断一个产品不合格,因为它检测到某个特征。除了识别出这个特征,还需要人工专家验证这个特征确实是导致不合格的原因,而不是模型学习到了不相关或错误的关联。例如,如果模型仅仅因为背景光线的微小变化就判断产品不合格,那么这个特征归因就是不合理的。

------------------------------------------------------------------------

9. Confidence (置信度)

9.1. Confidence score. When testing a model used to predict or classify data, the system should, where applicable, log the confidence score of the model for each prediction or classification outcome.

• 解读:在测试用于预测或分类数据的模型时,系统在适用情况下应记录模型对每个预测或分类结果的置信度分数

• 示例:一个AI模型判断一个产品为“合格”,并给出“99.5%”的置信度。另一个产品被判断为“合格”,但置信度只有“60%”。这些置信度分数都应该被系统记录下来。

9.2. Threshold. Models used to predict or classify data should have an appropriate threshold setting to ensure predictions or classifications are made only when suitable. If the confidence score is very low, it should be considered whether the model should flag the outcome as ‘undecided’, rather than making potentially unreliable predictions or classifications.

• 解读:用于预测或分类数据的模型应设置适当的阈值,以确保仅在合适时才进行预测或分类。如果置信度分数非常低,则应考虑模型是否应将结果标记为“未定”,而不是做出可能不可靠的预测或分类。

• 示例

   可以设定一个阈值,例如,只有当AI模型对结果的置信度超过85%时,才将其分类为“合格”或“不合格”。

   如果模型的置信度介于50%到85%之间,则系统应将其标记为“未定”,需要人工介入进行复核,而不是强行给出一个可能不准确的分类。

------------------------------------------------------------------------

10. Operation (操作)

10.1. Change control. A tested model, the system it is implemented in, and the whole process it is automating or assisting should be put under change control before it is deployed in operation. Any change to the model itself, the system, or the process in which it is used, including any change to physical objects the model is using as input, should be documented and evaluated to determine if the model needs to be retested. Any decision not to conduct such retest should be fully justified.

• 解读:经过测试的模型、其所实现的系统以及它自动化或辅助的整个过程,在投入运行前都应置于变更控制之下。对模型本身、系统或其所用过程的任何变更,包括对模型作为输入的物理对象的任何变更,都应记录和评估,以确定模型是否需要重新测试。任何决定不进行此类重新测试的情况都应充分证明其合理性

• 示例

  如果AI模型升级了算法版本。

  如果AI系统所运行的硬件环境发生了变化。

  如果AI识别的对象(如药片)的包装材料或尺寸发生了变化。

  所有这些变更都需要通过变更控制流程,评估是否需要对AI模型进行重新验证或重新测试。如果决定不重测,必须给出充分的理由并记录。

10.2. Configuration control. A tested model should be put under configuration control before being deployed in operation, and effective measures should be used to detect any unauthorised change.

• 解读:经过测试的模型在部署运行前应置于配置控制之下,并应采取有效措施检测任何未经授权的更改

• 示例:模型文件、参数设置等应被版本控制系统管理,并且只有授权人员才能修改,任何修改都应有审计记录,以防止未经批准的篡改。

10.3. System performance monitoring. The performance of a model as defined by its metrics should be regularly monitored to detect any changes in the computerised system (e.g. deterioration or change of a lighting condition).

• 解读:应定期监控模型的性能(由其指标定义),以检测计算机化系统中的任何变化(例如,照明条件的恶化或变化)。

• 示例:一个视觉检测AI系统,其缺陷识别准确率应该持续监测。如果发现其准确率突然下降,可能需要检查是否是摄像头磨损、光源强度变化或其他系统性问题导致的。

10.4. Input sample space monitoring. It should be regularly monitored whether the input data are still within the model sample space and intended use. Metrics should be defined for monitoring any drift in the input data.

• 解读:应定期监控输入数据是否仍在模型的样本空间和预期用途内。应定义指标以监控输入数据的任何漂移

• 示例:AI模型是针对特定形状和颜色的药片训练的。如果在生产中开始使用新型号的药片,其形状或颜色与训练数据大相径庭,那么这些新的输入数据就可能超出了模型的样本空间。需要有机制(例如定义新的药片颜色和形状的参数范围)来检测这种“漂移”,并进行相应处理。

10.5. Human review. When a model is used to give an input to a decision made by a human operator (human-in-the-loop), and where the effort to test such model has been diminished, records should be kept from this process. Depending on the criticality of the process and the level of testing of the model, this may imply a consistent review and/or test of every output from the model, according to a procedure.

• 解读:当模型作为人工操作员决策的输入(即“人工介入”),并且模型的测试工作因此有所减少时,应保留此过程的记录。根据过程的关键性和模型的测试水平,这可能意味着根据程序对模型的每个输出进行持续审查和/或测试

• 示例:如前所述,如果AI只是辅助决策,并且其测试力度有所减小,那么操作员每次采纳或不采纳AI的建议,都应有记录。对于高风险流程,可能需要操作员逐一审核AI模型的每个推荐结果。

------------------------------------------------------------------------

Glossary (术语表)

Artificial Intelligence – ‘AI system’ means a machine-based system that is designed to operate with varying levels of autonomy and that may exhibit adaptiveness after deployment, and that, for explicit or implicit objectives, infers, from the input it receives, how to generate outputs such as predictions, content, recommendations, or decisions that can influence physical or virtual environments;

• 解读:人工智能(AI)系统是一种基于机器的系统,其设计旨在以不同程度的自主性运行,并可能在部署后表现出适应性。它根据接收到的输入,为明确或隐含的目标推断如何生成预测、内容、建议或决策等输出,这些输出可以影响物理或虚拟环境。

• 示例:用于药品生产的AI系统,可以根据传感器数据预测设备故障,或者推荐最佳的生产参数设置。

Deep Learning – Approach to creating rich hierarchical representations through the training of neural networks with many hidden layers

• 解读:深度学习是一种通过训练具有多个隐藏层的神经网络来创建丰富分层表示的方法。

• 示例:AI视觉检测系统中用于识别复杂图像特征(如微小划痕或污点)的核心算法,可能就是基于深度学习的。

Feature – A pattern in data that can be reduced to a simpler higher-level representation

• 解读:特征是数据中的一种模式,可以将其简化为更高级别的表示。

• 示例:在检测药片外观时,“颜色”、“形状”或“纹理”都是药片图片数据中的“特征”。

LIME – Local Interpretable Model-Agnostic Explanations; a technique that approximates any black box machine learning model with a local, interpretable model to explain each individual prediction.

• 解读:LIME(局部可解释模型无关解释)是一种技术,通过使用局部、可解释的模型来近似任何黑盒机器学习模型,以解释每个单独的预测。

• 示例:一个复杂的AI模型判断某批药品不合格,LIME可以生成一个简单的、可理解的解释,例如“因为它在某个特定区域的亮度异常高”,而无需理解整个复杂模型的内部运作。

Machine Learning – Machine learning refers to the computational process of optimising the parameters of a model from data, which is a mathematical construct generating an output based on input data. Machine learning approaches include, for instance, supervised, unsupervised and reinforcement learning, using a variety of methods including deep learning with neural networks.

• 解读:机器学习是指从数据中优化模型参数的计算过程。模型是一种数学构造,根据输入数据生成输出。机器学习方法包括例如监督学习、无监督学习和强化学习,使用多种方法,包括神经网络的深度学习。

• 示例:通过给AI系统输入大量的合格和不合格产品数据,让系统自己学习并调整其内部参数,从而能够识别新的产品是合格还是不合格,这就是机器学习的过程。

Model – Mathematical algorithms with parameters (weights) arranged in an architecture that allows learning of patterns (features) from training data

• 解读:模型是数学算法,其参数(权重)以某种架构排列,允许从训练数据中学习模式(特征)。

• 示例:一个AI视觉识别模型,其本质是一系列复杂的数学公式和其中的参数(权重),这些参数通过训练数据被调整,使其能够识别出图片中的特定“模式”或“特征”(如缺陷)。

Overfitting – Learning details from training data that cannot be generalised to new data

• 解读:过拟合是指从训练数据中学习到无法泛化到新数据的细节。

• 示例:AI模型在训练时记住了每一张缺陷图片中背景墙上的一个小斑点,并将其误认为是缺陷的标志。当遇到新图片时,即使没有缺陷但背景墙上有类似小斑点,模型也可能错误地将其识别为缺陷。

SHAP – Shapley Additive Explanations; an explainable AI (XAI) framework that can provide model-agnostic local explainability for tabular, image, and text datasets

• 解读:SHAP(Shapley加性解释)是一种可解释AI(XAI)框架,可以为表格、图像和文本数据集提供模型无关的局部可解释性。

• 示例:与LIME类似,SHAP可以帮助解释AI模型为什么对某个药品的图像做出了“合格”或“不合格”的判断,指出图像中哪些像素区域(特征)对这个决策贡献最大。

Static – Frozen model: A model where all parameters have been finally set, not allowing further adaption to new data.

• 解读:静态模型(Frozen model)是指所有参数都已最终设定,不允许进一步适应新数据的模型。

• 示例:一个AI模型在部署到生产线后,其内部的算法和参数就被“冻结”了,不会因为后续接收到的新产品数据而自动改变其识别规则。

Test dataset – The "hold-out" data that is used to estimate performance of the final ML model.

• 解读:测试数据集是用于估计最终机器学习模型性能的“保留”数据。

• 示例:在训练AI模型之后,会拿出一批从未参与训练和验证的数据,用这批数据来最终评估模型在实际应用中的表现,这批数据就是测试数据集。

Training dataset – The data used to train the ML model.

• 解读:训练数据集是用于训练机器学习模型的数据。

• 示例:为了让AI模型学会识别药片缺陷,我们向其输入大量已经被人工标记为“合格”或“不合格”的药片图片,这些图片组成了训练数据集

Validation dataset (in AI) – The dataset used during model development, to inform on how to optimally train the model from training data. size smaller than the training set

• 解读:验证数据集(在AI中)是在模型开发过程中使用的数据集,用于指导如何从训练数据中优化训练模型。其大小通常小于训练集。

• 示例:在AI模型训练过程中,会周期性地用一小部分验证数据集来评估模型当前的训练效果,并根据验证集上的表现来调整训练的策略或参数,以避免过拟合

博客分类