An image analysis based expert system for assessing the quality of freeze-dried protein formulations

Development of freeze-dried protein formulations is a complex and time consuming task, complicated by the numerous excipients available, the choice of processing conditions and the number of quality attributes to evaluate. The aim of this study was to investigate the feasibility of developing an expert system, based on image analysis and fuzzy logic, for high throughput evaluation of the quality of the freeze-dried cake. Samples consisted of different concentrations of mannitol, sucrose and model protein. After freeze drying, images were acquired and analyzed to obtain measures for collapse and appearance of the cake. Based on fuzzy logic and the results from image analysis an expert system was constructed. The crisp inputs from image analysis were first fuzzified into linguistic descriptors of cake properties. A set of rules was constructed and the output defuzzified from visual cake evaluations to a score on a numeric scale. Finally the system was tested on samples with different properties. The system was found to preform satisfyingly showing the feasibility of constructing a more elaborate one with more inputs.


Introduction
Development of freeze-dried protein formulations is a growing area in the pharmaceutical field due to the increasing number of protein drugs being developed.Formulation development is, however, complicated by the intricate and time consuming freeze-drying process, the selection of the right combination of excipients, the often limited amount of protein available and the numerous quality attributes that need to be evaluated in the end product.[3] Quality of the freeze-dried cake is traditionally evaluated by visual inspection of the vials after freezedrying.This approach is subjective, time consuming and labor intensive if high numbers of formulations need to be evaluated.A high throughput evaluation system thus requires a way to analyze visual information objectively and fast; these requirements are fulfilled by image analysis.Development of an image analysis system for evaluating cake properties requires the simultaneous analysis of aspects such as collapse and transparency/glassiness.The image analysis system should thus be capable of evaluating a range of information to capture the same information as perceived by the human eye; such systems are often referred to as machine vision. 4Furthermore, the quality parameters must then be assessed in a similar way as a freeze-drying professional would, creating an expert system.
Experts systems are computational systems capable of taking decisions based on an elaborate rule system.When designing expert systems for evaluating properties like cake quality, one of the challenges is the lack of exact or sharply defined boundaries used when describing visual impressions linguistically.Systems without sharp boundaries are often referred to as fuzzy systems.The output obtained from image analysis is, however, numerical and thus sharply defined.In order to build a rule framework based on visual impression requires the use of fuzzy logic.Fuzzy logic has been previously applied in the pharmaceutical field, e.g. for controlling bed height during fluidization process and for modeling skin permeability.The combination of fuzzy logic and image analysis has also been reported for process control of wet granulation.[7][8][9]

Materials and methods
Samples contained mannitol and sucrose from Unikem (Copenhagen, Denmark) and the model protein bovine serum albumin (BSA), Sigma-Aldrich (St.Luis, USA).Formulations were prepared with different mannitol-to-sucrose ratios, different solid concentration and different protein content.100 µL of sample solution was filled into each well of a custom-fabricated well-plate sealed on one side.After freeze drying in an Epsilon 2-4 LSC freeze-dryer (Christ, Osterode, Germany), images were obtained and analyzed in Matlab® (MatWorks, Natick, Massachusetts).Different in-house routines were employed to get measures for cake collapse and the cake appearance with regard to the transparency/glassiness.Based on fuzzy logic a rule system was constructed in order to assess the cake quality of each sample.Fuzzy Logic toolbox in Matlab® (MathWorks, Natick, Massachusetts) was applied for developing the expert system.The Mamdanitype inference system consisted of the two inputs (collapse and appearance) and a set of five IF THEN -rules to generate an output of cake quality on a scale from 0 to 10.Both inputs and the output were transformed into Gaussian shaped membership functions.

Results and discussion
After freeze-drying and image analysis the data were compiled into a fuzzy inference system.The two outputs from image analysis were measures for the cake collapse and the appearance with regard to glassines of the sample, both in numeric values and thus crisp (non-fuzzy).These numeric values were used as inputs in the system and fuzzified into linguistic descriptions of the cake properties such as complete cake collapse, partial cake collapse, fluffy appearance etc. as shown in Figure 1.Based on the opinions of a skilled protein formulation specialist, the experience-based evaluation of the cake quality from the original images was transformed into a linguistic description of the cake quality.Membership function describes mathematically precisely how a vague linguistic expert opinion of e.g."Glassy" appearance of a freeze dried cake can be treated mathematically precisely from the input variable "Appearance", which is based on the exact numeric values derived from the grey scale values of the original image.

Figure 1 Fuzzification of the outputs from image analysis to linguistic description of the cake properties appearance with regard to glassines (bottom panel) and the degree of collapse, note that high output from the image analysis routine corresponds to minimal collapse (top panel). X-axis containing original image analysis values and y-axis membership function value.
In the same way, a fuzzy output is needed.In this study, the expert-based opinion of the cake quality, being acceptable, inadequate or defect was used as output.After fuzzifying the inputs and adding the output, a set of rules was written out summarizing the expert opinion of the visual appearance of the freeze-dried cakes (acceptable cake, inadequate cake and defect cake).By this means, the original image information can be transferred into mathematical expression and further, the knowledge of an experienced formulation specialist can be transferred into equations that can be handled mathematically in form of rules.The implemented rules are presented in Table 1.For the sake of simplicity all rules were given the same weight of 1.The last step in the model development was to defuzzify the output from the aggregated rule set in order to obtain crisp descriptions of the cake quality of each sample as shown in Figure 2. In this system the desired output was a score of the cake quality on a scale from 1 to 10, 0 being the lowest quality and 10 being the best physical appearance.

Figure 2 Defuzzification of linguistic descriptors of cake quality into a numeric value on a scale from 0 to 10
The performance of the final model was tested on a range of freeze-dried samples with different degrees of glassiness and cake collapse.Figure 3 shows how the model evaluates the performance of 4 samples with different characteristics.The outputs from the model were generally found to be in good agreement with visual evaluation of the samples indicating the validity of the model.

Conclusion
The development of an expert system for analyzing cake quality in freeze-dried samples shows the feasibility of constructing a more elaborate system with numerous inputs and a more elaborate fuzzy rule set.

Table 1
Rules implemented in model fuzzy logic system